1 2015-09-18 Alex Christensen <achristensen@webkit.org>
5 2015-09-18 Nan Wang <n_wang@apple.com>
7 AX: Implement ARIA 1.1 @aria-current on iOS
8 https://bugs.webkit.org/show_bug.cgi?id=149297
10 Reviewed by Chris Fleizach.
12 Added support for iOS to query for aria-current status.
13 Also, enabled aria-current.html test on iOS.
15 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
16 (-[WebAccessibilityObjectWrapper accessibilityInvalidStatus]):
17 (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]):
18 (-[WebAccessibilityObjectWrapper accessibilityMathRootIndexObject]):
20 2015-09-18 Alex Christensen <achristensen@webkit.org>
22 Fix Windows tests after switch to CMake.
24 * testing/js/WebCoreTestSupportPrefix.h:
25 Include cmakeconfig.h before wtf/Platform.h like we do in all the other precompiled headers
26 to have consistent features defined.
28 2015-09-18 Alexey Proskuryakov <ap@apple.com>
30 REGRESSION (r189526): Nightlies don't work on Mavericks
31 https://bugs.webkit.org/show_bug.cgi?id=149215
33 Reviewed by Daniel Bates.
35 * platform/sql/SQLiteDatabase.cpp:
36 (WebCore::SQLiteDatabase::SQLiteDatabase): Fixed the check to work when cross-compiling
37 for 10.9 with 10.10 SDK.
38 (WebCore::SQLiteDatabase::disableThreadingChecks): Removed an obsolete version check -
39 WebCore has an #error elsewhere making sure that the version is higher than that.
40 (WebCore::SQLiteDatabase::authorizerFunction): Ditto.
42 2015-09-18 Alex Christensen <achristensen@webkit.org>
44 CMake clean build fix after r189971.
49 2015-09-18 Antti Koivisto <antti@apple.com>
51 Support style isolation in shadow trees
52 https://bugs.webkit.org/show_bug.cgi?id=149353
54 Reviewed by Ryosuke Niwa.
56 Allow ShadowRoots to have their own StyleResolvers.
58 This patch just adds the mechanism, all shadow roots still use the document resolver.
60 * css/StyleResolver.h:
61 (WebCore::StyleResolverParentPusher::push):
62 (WebCore::StyleResolverParentPusher::~StyleResolverParentPusher):
64 (WebCore::Element::absoluteLinkURL):
65 (WebCore::Element::styleResolver):
67 Helper function for getting the right StyleResolver for the element.
69 (WebCore::Element::resolveStyle):
71 Helper function for resolving element style.
75 (WebCore::ShadowRoot::~ShadowRoot):
76 (WebCore::ShadowRoot::styleResolver):
77 (WebCore::ShadowRoot::cloneNode):
79 (WebCore::ShadowRoot::resetStyleInheritance):
80 * editing/EditingStyle.cpp:
81 (WebCore::styleFromMatchedRulesForElement):
82 * html/HTMLTitleElement.cpp:
83 (WebCore::HTMLTitleElement::computedTextWithDirection):
84 * html/canvas/CanvasRenderingContext2D.cpp:
85 (WebCore::CanvasRenderingContext2D::setFont):
86 * inspector/InspectorCSSAgent.cpp:
87 (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
88 * page/animation/KeyframeAnimation.cpp:
89 (WebCore::KeyframeAnimation::KeyframeAnimation):
90 * rendering/RenderElement.cpp:
91 (WebCore::RenderElement::getUncachedPseudoStyle):
92 (WebCore::RenderElement::containingBlockForFixedPosition):
93 * rendering/RenderNamedFlowFragment.cpp:
94 (WebCore::RenderNamedFlowFragment::checkRegionStyle):
95 (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
96 * style/StyleResolveTree.cpp:
97 (WebCore::Style::styleForElement):
99 (WebCore::SVGElement::customStyleForRenderer):
100 (WebCore::SVGElement::animatedSMILStyleProperties):
101 * svg/SVGElementRareData.h:
102 (WebCore::SVGElementRareData::overrideComputedStyle):
104 2015-09-18 Alex Christensen <achristensen@webkit.org>
106 [Win] Fix bindings tests after r189934.
108 Reviewed by Brent Fulgham.
110 * bindings/scripts/preprocessor.pm:
112 Bindings tests use /usr/bin/gcc from cygwin, which requires different flags.
113 If we're using gcc to preprocess, use it like we did before r189934.
115 2015-09-18 Eric Carlson <eric.carlson@apple.com>
117 [MediaStream] Finish implementing MediaDevices.enumerateDevices
118 https://bugs.webkit.org/show_bug.cgi?id=149322
119 <rdar://problem/22750866>
121 Reviewed by Brent Fulgham.
123 Test: fast/mediastream/MediaDevices-enumerateDevices.html
125 * CMakeLists.txt: Add MediaDevicesRequest.cpp
127 * Modules/mediastream/MediaDeviceInfo.h: Add MediaDeviceInfoVector typedef.
129 * Modules/mediastream/MediaDevices.cpp:
130 (WebCore::MediaDevices::enumerateDevices): Use MediaDevicesRequest.
131 * Modules/mediastream/MediaDevices.h: EnumerateDevicePromise -> EnumerateDevicesPromise.
132 * Modules/mediastream/MediaDevices.idl:
134 * Modules/mediastream/MediaDevicesRequest.cpp: Added.
135 (WebCore::MediaDevicesRequest::create):
136 (WebCore::MediaDevicesRequest::MediaDevicesRequest):
137 (WebCore::MediaDevicesRequest::~MediaDevicesRequest):
138 (WebCore::MediaDevicesRequest::securityOrigin):
139 (WebCore::MediaDevicesRequest::contextDestroyed):
140 (WebCore::MediaDevicesRequest::start):
141 (WebCore::MediaDevicesRequest::didCompleteRequest):
142 (WebCore::MediaDevicesRequest::requestOrigin):
143 * Modules/mediastream/MediaDevicesRequest.h: Added.
145 * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
146 (WebCore::MediaStreamTrackSourcesRequest::MediaStreamTrackSourcesRequest):
147 (WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
148 * Modules/mediastream/MediaStreamTrackSourcesRequest.h:
150 * Modules/mediastream/UserMediaRequest.cpp:
151 (WebCore::UserMediaRequest::enumerateDevices): Deleted.
152 * Modules/mediastream/UserMediaRequest.h:
154 * WebCore.xcodeproj/project.pbxproj: Add MediaDevicesRequest.cpp
156 * platform/mediastream/MediaDevicesPrivate.cpp: Removed.
157 * platform/mediastream/MediaDevicesPrivate.h: Removed.
159 * platform/mediastream/MediaStreamCreationClient.h:
160 * platform/mediastream/MediaStreamTrackSourcesRequestClient.h:
161 (WebCore::MediaStreamTrackSourcesRequestClient::~MediaStreamTrackSourcesRequestClient):
163 * platform/mediastream/mac/AVCaptureDeviceManager.h:
164 * platform/mediastream/mac/AVCaptureDeviceManager.mm:
165 (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Optionally take an
166 AVCaptureSession instead of always allocating one.
167 (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): Pass the AVCaptureSession
168 to verifyConstraintsForMediaType.
170 * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
171 (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources):
173 * platform/mock/MockRealtimeMediaSourceCenter.cpp:
174 (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources):
176 2015-09-18 Chris Dumez <cdumez@apple.com>
178 WebContent crash in WebCore::MemoryPressureHandler::releaseCriticalMemory() with GuardMalloc when preparing to suspend
179 https://bugs.webkit.org/show_bug.cgi?id=149350
181 Reviewed by Antti Koivisto.
183 in MemoryPressureHandler::releaseCriticalMemory(), iterate over a copy of
184 Document::allDocuments() instead of iterating over allDocuments() directly.
185 Also make sure the Documents are ref'd inside the copy.
187 This is needed because clearing the StyleResolver of a Document may cause
188 Documents to be unref'd and removed from the allDocument() HashSet.
190 No new tests, already covered by existing tests.
192 * platform/MemoryPressureHandler.cpp:
193 (WebCore::MemoryPressureHandler::releaseCriticalMemory):
195 2015-09-18 Brent Fulgham <bfulgham@apple.com>
197 [Win] Unreviewed build fix.
199 Non-cmake build does not include quotes in the file path, so a search
200 operation always failed.
202 * bindings/scripts/preprocessor.pm:
205 2015-09-18 Chris Dumez <cdumez@apple.com>
207 REGRESSION (r182449, Mavericks ONLY): Pages re-open empty after swiping back and scrolling on them
208 https://bugs.webkit.org/show_bug.cgi?id=149317
209 <rdar://problem/22521514>
211 Reviewed by Tim Horton.
213 Disable on Mavericks a PageCache optimization from r182449 which lets
214 into PageCache pages that only have certain types of pending loads
215 (images and XHR). This is because it has been determined via bisection
216 that this change is the one that introduced the bug on Mavericks.
218 * loader/DocumentLoader.cpp:
219 (WebCore::areAllLoadersPageCacheAcceptable):
221 2015-09-18 Brent Fulgham <bfulgham@apple.com>
223 [Win] Use tiled drawing for main background layer
224 https://bugs.webkit.org/show_bug.cgi?id=149347
225 <rdar://problem/22759632>
227 Reviewed by Alex Christensen.
229 Turn on tiled drawing for the root layer when using
230 accelerated compositing on Windows.
232 * page/Frame.h: Export the 'isMainFrame' method so that
233 it can be used by WebKit.dll.
234 * platform/graphics/ca/GraphicsLayerCA.cpp:
235 (WebCore::GraphicsLayerCA::getDebugBorderInfo): Use a full
236 pixel width on Windows, since it doesn't support High DPI (yet).
237 * platform/graphics/ca/win/PlatformCALayerWin.cpp:
238 (PlatformCALayerWin::create): Use nullptr.
239 (toCACFFilterType): Ditto.
240 (layerTreeHostForLayer): Ditto.
241 (PlatformCALayer::platformCALayer): Ditto.
242 (PlatformCALayerWin::PlatformCALayerWin): Use the correct contents scaling
243 factor for new layers.
244 (PlatformCALayerWin::animationForKey): Use nullptr.
245 * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
246 (WebTiledBackingLayerWin::displayCallback): Update assertion to
247 recognize LayerTypePageTiledBackingLayer as a valid layer to be used
248 in this display routine.
250 2015-09-18 Chris Dumez <cdumez@apple.com>
252 Drop support for Entity Node type
253 https://bugs.webkit.org/show_bug.cgi?id=149239
255 Reviewed by Darin Adler.
257 Drop support for Entity DOM type. This legacy type has been dropped in
259 - https://dom.spec.whatwg.org/#dom-core-changes
261 Chrome [1] and Firefox [2] already dropped it. There is currently no
262 way to construct an Entity Node in WebKit.
264 [1] https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/k3tZGP2EANc
265 [2] https://developer.mozilla.org/en-US/docs/Web/API/Entity
267 No new tests, already covered by existing W3C test.
269 * DerivedSources.cpp:
270 * WebCore.xcodeproj/project.pbxproj:
271 * bindings/gobject/WebKitDOMPrivate.cpp:
272 (WebKit::wrap): Deleted.
273 * bindings/js/JSNodeCustom.cpp:
274 (WebCore::createWrapperInline): Deleted.
275 * bindings/objc/DOM.mm:
278 (WebCore::Document::importNode): Deleted.
279 (WebCore::Document::adoptNode): Deleted.
280 (WebCore::Document::childTypeAllowed): Deleted.
281 (WebCore::Document::canAcceptChild): Deleted.
285 (WebCore::Node::isDefaultNamespace): Deleted.
286 (WebCore::Node::lookupPrefix): Deleted.
287 (WebCore::Node::lookupNamespaceURI): Deleted.
288 (WebCore::appendTextContent): Deleted.
289 (WebCore::Node::setTextContent): Deleted.
292 (WebCore::lengthOfContentsInNode): Deleted.
293 (WebCore::Range::processContentsBetweenOffsets): Deleted.
294 (WebCore::Range::insertNode): Deleted.
295 (WebCore::Range::checkNodeWOffset): Deleted.
296 (WebCore::Range::checkNodeBA): Deleted.
297 (WebCore::Range::selectNode): Deleted.
298 (WebCore::Range::selectNodeContents): Deleted.
299 (WebCore::Range::surroundContents): Deleted.
300 * editing/MarkupAccumulator.cpp:
301 (WebCore::MarkupAccumulator::appendStartMarkup): Deleted.
303 (WebCore::XPath::isValidContextNode): Deleted.
305 2015-09-17 Brian Burg <bburg@apple.com>
307 ASSERT(!m_frontendRouter->hasLocalFrontend()) when running Web Inspector tests
308 https://bugs.webkit.org/show_bug.cgi?id=149006
310 Reviewed by Joseph Pecoraro.
312 The patch fixes two defects:
314 (1) the stub inspector frontend is not closed reliably when a test times out
315 (2) frontend clients and channels are sometimes connected to the wrong controllers
317 When an inspector test times out, the test runner requests (via the inspected page's controller)
318 that the inspector close. But, the stub frontend works independently of InspectorClient,
319 so the inspected page's InspectorController cannot close the stub frontend. The assertion
320 failed because the stub frontend's channel was still connected to the inspected page's controller.
322 The fix is to route requests for the inspector window to close through the FrontendClient's
323 closeWindow() method rather than InspectorClient, so that the stub frontend can react.
324 The other code paths (i.e., through close() and closeLocalFrontend()) have been removed.
326 Now that the stub frontend eagerly closes its channel before the Page gets GC'd, several
327 methods invoked during test teardown must be reordered to avoid using dangling pointers.
329 The stub frontend in Internals has been rewritten to properly disconnect itself
330 from both the frontend and inspected page's inspector controllers.
332 While fixing this bug, I noticed that we are inconsistent about which inspector controller
333 (the inspected page's or the frontend page's) receives the FrontendClient and which takes
334 FrontendChannels. It is now the case for all configurations that the FrontendClient is
335 connected to the frontend page's inspector controller, and FrontendChannels are connected
336 to the inspected page's inspector controller. In the WK2 case, the Inspector Process
337 has an attached frontend client, and its inspected Web Process has frontend channels.
339 No new tests, covered by existing tests.
341 * inspector/InspectorClient.h:
342 * inspector/InspectorController.cpp:
343 (WebCore::InspectorController::~InspectorController):
344 (WebCore::InspectorController::inspectedPageDestroyed):
346 This method is called from Page::~Page, so we should disconnect all frontends now
347 before subframes are detached from the page, making InspectorController inaccessible.
349 (WebCore::InspectorController::disconnectFrontend):
351 The teardown branch was never being run before, because we never disconnected the
352 frontend's channel correctly. Some agents use the overlay during teardown, so notify
353 agents before releasing the overlay page.
355 (WebCore::InspectorController::disconnectAllFrontends):
357 The actions from close() are inlined and rearranged here, similar to disconnectFrontend.
358 We have to notify agents before removing InspectorClient as some agents make use of it.
360 (WebCore::InspectorController::close): Deleted.
361 (WebCore::InspectorController::show): This assertion is vacuously true now.
362 * inspector/InspectorFrontendClientLocal.cpp:
363 (WebCore::InspectorFrontendClientLocal::inspectedPage): Added. Used by stub frontend.
364 * inspector/InspectorFrontendClientLocal.h:
365 (WebCore::InspectorFrontendClientLocal::frontendPage): Added.
366 * loader/EmptyClients.h:
368 (WebCore::Page::~Page):
370 Notify inspector before detaching frames, otherwise it will not be possible to
371 cleanly disconnect the stub frontend's channel.
373 * testing/Internals.cpp:
375 Rewrite the stub frontend to better encapsulate its setup and teardown logic.
377 (WebCore::InspectorStubFrontend::frontendPage): Added.
378 (WebCore::InspectorStubFrontend::InspectorStubFrontend): Added.
379 (WebCore::InspectorStubFrontend::~InspectorStubFrontend): Added.
380 (WebCore::InspectorStubFrontend::closeWindow): Added.
381 (WebCore::InspectorStubFrontend::sendMessageToFrontend): Added.
382 (WebCore::Internals::openDummyInspectorFrontend):
383 (WebCore::Internals::closeDummyInspectorFrontend):
384 (WebCore::InspectorFrontendClientDummy::~InspectorFrontendClientDummy): Deleted.
385 (WebCore::InspectorFrontendClientDummy::InspectorFrontendClientDummy): Deleted.
386 (WebCore::InspectorFrontendChannelDummy::~InspectorFrontendChannelDummy): Deleted.
387 (WebCore::InspectorFrontendChannelDummy::InspectorFrontendChannelDummy): Deleted.
388 (WebCore::InspectorFrontendChannelDummy::sendMessageToFrontend): Deleted.
389 * testing/Internals.h:
391 2015-09-18 Chris Dumez <cdumez@apple.com>
393 classList.toggle(name, force) treats undefined `force` argument as false
394 https://bugs.webkit.org/show_bug.cgi?id=148582
395 <rdar://problem/22545600>
397 Reviewed by Ryosuke Niwa.
399 classList.toggle(name, force) treats undefined `force` argument as false.
400 However, according to the Web IDL specification, we should treat undefined
401 as if the value was missing for optional parameters that do not have a
403 https://heycam.github.io/webidl/#dfn-overload-resolution-algorithm (Step 14.4).
405 For optional parameters that have a default value, undefined should be
406 converted into the default value. This is supported as of r189957.
408 In this patch, we use custom bindings to provide a spec-compliant version
409 of DOMTokenList.toggle(). Unfortunately, adding such support in the
410 bindings generator would be a non-trivial task (I guess, we would have to
411 generalize using WTF::Optional<> type for all optional parameters in our
412 implementation. Also we cannot use the default value support added in
413 r189957 because the toggle() implementation needs to be able to
414 distinguish all 3 states for the 'force' parameter: true, false or
417 The new behavior matches the behavior of Firefox and the specification.
419 Test: fast/dom/Element/class-list-toggle.html
422 * WebCore.vcxproj/WebCore.vcxproj:
423 * WebCore.vcxproj/WebCore.vcxproj.filters:
424 * WebCore.xcodeproj/project.pbxproj:
425 * bindings/js/JSBindingsAllInOne.cpp:
426 * bindings/js/JSDOMTokenListCustom.cpp: Added.
427 (WebCore::JSDOMTokenList::toggle):
428 * html/DOMTokenList.h:
429 * html/DOMTokenList.idl:
431 2015-09-17 Joseph Pecoraro <pecoraro@apple.com>
433 Web Inspector: Remove unused canClearBrowserCookies / canClearBrowserCache protocol methods
434 https://bugs.webkit.org/show_bug.cgi?id=149307
436 Reviewed by Brian Burg.
438 * inspector/InspectorClient.h:
439 (WebCore::InspectorClient::canClearBrowserCache): Deleted.
440 (WebCore::InspectorClient::clearBrowserCache): Deleted.
441 (WebCore::InspectorClient::canClearBrowserCookies): Deleted.
442 (WebCore::InspectorClient::clearBrowserCookies): Deleted.
443 These were unimplemented by any ports.
445 * inspector/CommandLineAPIHost.cpp:
446 * inspector/InspectorController.cpp:
447 (WebCore::InspectorController::InspectorController):
448 * inspector/InspectorResourceAgent.cpp:
449 (WebCore::InspectorResourceAgent::InspectorResourceAgent):
450 (WebCore::InspectorResourceAgent::canClearBrowserCache): Deleted.
451 (WebCore::InspectorResourceAgent::clearBrowserCache): Deleted.
452 (WebCore::InspectorResourceAgent::canClearBrowserCookies): Deleted.
453 (WebCore::InspectorResourceAgent::clearBrowserCookies): Deleted.
454 * inspector/InspectorResourceAgent.h:
455 * inspector/InspectorTimelineAgent.cpp:
456 (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
457 * inspector/InspectorTimelineAgent.h:
458 * inspector/WorkerInspectorController.cpp:
459 (WebCore::WorkerInspectorController::WorkerInspectorController):
460 Remove uses of InspectorClient where it is no longer needed.
462 2015-09-16 Ryosuke Niwa <rniwa@webkit.org>
464 Update features.json for Shadow DOM and Web Components
465 https://bugs.webkit.org/show_bug.cgi?id=149249
467 Reviewed by Antti Koivisto.
469 Updated the status of Shadow DOM and made myself the point of contact for shadow DOM and web components.
473 2015-09-17 Chris Dumez <cdumez@apple.com>
475 [WebIDL] Add support for default parameter values
476 https://bugs.webkit.org/show_bug.cgi?id=149263
477 <rdar://problem/22545600>
479 Reviewed by Ryosuke Niwa.
481 Add support for default parameter values to our Web IDL parser and JS
482 bindings generator. This allows the bindings to convert undefined to
483 the parameter's default value for optional parameters:
484 https://heycam.github.io/webidl/#dfn-optional-argument-default-value
486 Previously, our bindings generator would just convert undefined to
487 0 / false / "undefined" for optional parameters, depending on the
490 This patch uses the new default parameter support to fix a bug in
491 document.createNodeIterator() / document.createTreeWalker()'s handling
492 of the whatToShow parameter:
493 https://dom.spec.whatwg.org/#document
495 WebKit currently was undefined to 0 in this case, even though it should
496 use the parameter's default value: OxFFFFFFFF.
498 I am planning to go through other optional parameters in a follow-up
499 patch and add default values where needed.
501 No new tests, already covered by existing layout tests and
502 added bindings tests coverage.
504 * bindings/scripts/CodeGeneratorJS.pm:
505 (GenerateParametersCheck):
506 * bindings/scripts/IDLParser.pm:
507 (parseOptionalOrRequiredArgument):
508 * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
509 (webkit_dom_test_obj_method_with_optional_arg_and_default_value):
510 (webkit_dom_test_obj_method_with_optional_string_and_default_value):
511 * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
512 * bindings/scripts/test/JS/JSTestObj.cpp:
513 (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
514 (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
515 * bindings/scripts/test/ObjC/DOMTestObj.h:
516 * bindings/scripts/test/ObjC/DOMTestObj.mm:
517 (-[DOMTestObj methodWithOptionalArgAndDefaultValue:]):
518 (-[DOMTestObj methodWithOptionalStringAndDefaultValue:]):
519 * bindings/scripts/test/TestObj.idl:
522 2015-09-17 Dean Jackson <dino@apple.com>
524 Multi-hop reference cycles not detected.
525 https://bugs.webkit.org/show_bug.cgi?id=149181
527 Reviewed by Jon Honeycutt.
529 SVG's cycle detection was not picking up a
530 case where an element was drawing a pattern, that
531 referenced another pattern, that referenced another
532 pattern, that referenced the original pattern.
534 The issue was that we were forgetting to check the
535 children of the renderer itself, rather than just
536 the children of the referenced renderers.
538 Found by running a test from Blink.
540 I also took the opportunity to clean up the debugging
541 code that logs cycle detection.
543 Test: svg/custom/pattern-3-step-cycle.html
545 * platform/Logging.h: Add a new SVG channel. I can't believe we
546 didn't already have one!
547 * rendering/svg/SVGResourcesCycleSolver.cpp:
548 (WebCore::SVGResourcesCycleSolver::resourceContainsCycles): Check the referenced
549 resources for cycles.
550 (WebCore::SVGResourcesCycleSolver::resolveCycles): Logging update.
552 2015-09-17 Dean Jackson <dino@apple.com>
554 Cyclic resources were not detected if the reference had deep containers
555 https://bugs.webkit.org/show_bug.cgi?id=149182
557 Reviewed by Jon Honeycutt.
559 During our examination of the SVG rendering tree looking for cycles,
560 if a resource pointed to something that had a nested structure, and
561 one of the parent nodes in that structure was a container object
562 without resources itself, we were not looking into the children.
564 Test: svg/custom/pattern-content-cycle-w-resourceless-container.html
566 * rendering/svg/SVGResourcesCycleSolver.cpp:
567 (WebCore::SVGResourcesCycleSolver::resourceContainsCycles): We should still
568 check all children resources, but not exit early if there are none. Instead
569 we should recurse into any children.
570 (WebCore::SVGResourcesCycleSolver::resolveCycles): Changes to some debug
571 code that no longer compiled (it's still off by default, but at least
574 2015-09-17 Myles C. Maxfield <mmaxfield@apple.com>
576 REGRESSION(r188871): 50% regression in page load time of Wikipedia home page
577 https://bugs.webkit.org/show_bug.cgi?id=149320
579 Reviewed by Daniel Bates.
581 This is due to <rdar://problem/22144016> about how language-specific
582 font fallback is an order of magnitude slower than regular non-language-
583 specific font-fallback. This performance problem has been fixed, but not
586 No new tests because there is no correctness change.
588 * platform/graphics/ios/FontCacheIOS.mm:
589 (WebCore::platformLookupFallbackFont):
591 2015-09-17 Ryosuke Niwa <rniwa@webkit.org>
593 Add HTMLSlotElement, Element.slot, and NonDocumentTypeChildNode.assignedSlot
594 https://bugs.webkit.org/show_bug.cgi?id=149241
596 Reviewed by Antti Koivisto.
598 Implement the slotting algorithm and related features: slot element, slot attribute, and assignedSlot
599 as specified by https://w3c.github.io/webcomponents/spec/shadow/#slotting-algorithm
600 as of 8bf56e8ea5521a7a911efd1cabeb2be0d5c3ca74.
602 The slotting algorithm is implemented by the newly introduced SlotAssignment class which is created on
603 demand by ShadowRoot when a HTMLSlotElement is inserted into the shadow root. SlotAssignment contains
604 a HashMap of a slot name to SlotInfo structure, which holds the number of slot elements of the said name,
605 the first element if it's known, and an ordered list of the assigned nodes.
607 When there is exactly one slot element of a given name, "element" returns the slot element in O(1).
608 When another slot of the same name is inserted into the same shadow tree, we increment "elementCount" and
609 set "element" to nullptr since we don't know which slot element comes first in the tree order without O(n)
610 tree traversal, which is lazily done in resolveAllSlotElements.
612 Observe that SlotInfo's "element" can be nullptr in two occasions: (1) when there is no slot element of
613 the given name (SlotAssignment::assignSlots may insert such an entry), and (2) when there are more than
614 one slot elements of the same name and we haven't run resolveAllSlotElements.
616 Resolving assigned nodes, on the other hand, is always O(n) unless all assignments are up to date, and
617 lazily computed by assignSlots. This is because inserting or removing a node doesn't tell us the relative
618 ordering of the node with respect to other nodes assigned to the same slot. For example, let's say we have
619 child nodes (A, B, C, D) and (A, D) are assigned to slot Alpha and (B, C) are assigned to slot Beta. If we
620 insert a new node E between nodes B and C and this node is assigned to slot Alpha, then we must create an
621 ordered list (A, E, D) for slot Alpha. Unfortunately, determining where to insert E in this list can cost
622 O(n) child traversal in the worst case.
624 Tests: fast/shadow-dom/HTMLSlotElement-interface.html
625 fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html
628 * DerivedSources.cpp:
629 * DerivedSources.make:
630 * WebCore.vcxproj/WebCore.vcxproj:
631 * WebCore.vcxproj/WebCore.vcxproj.filters:
632 * WebCore.xcodeproj/project.pbxproj:
634 (WebCore::Element::attributeChanged): Invalidate the slot assignments when slot attribute is changed.
635 (WebCore::Element::childrenChanged): Ditto for when a child node is inserted or removed. We can avoid it
636 when there is no default slot and only text nodes are removed or added in the future.
637 * dom/Element.idl: Added slot attribute on Element.
639 (WebCore::Node::assignedSlot): Added. Returns the assigned slot if the slot is in an open shadow tree.
641 * dom/NonDocumentTypeChildNode.idl: Added assignedSlot. Only expose in JS for now to avoid generating
642 the binding code for HTMLSlotElement in other languages.
643 * dom/ShadowRoot.cpp:
644 (WebCore::ShadowRoot::findAssignedSlot): Added. Forwards it to the implementation in SlotAssignment.
645 (WebCore::ShadowRoot::addSlotElementByName): Ditto.
646 (WebCore::ShadowRoot::removeSlotElementByName): Ditto.
647 (WebCore::ShadowRoot::invalidateSlotAssignments): Ditto.
648 (WebCore::ShadowRoot::assignedNodesForSlot): Ditto.
650 (WebCore::ShadowRoot): Added m_slotAssignments as a member.
651 * dom/SlotAssignment.cpp: Added.
652 (WebCore::treatNullAsEmpty): Added. See https://w3c.github.io/webcomponents/spec/shadow/#dfn-default-slot
653 (WebCore::SlotAssignment::findAssignedSlot): Find the slot element to which a given node is assigned.
654 Since there could be multiple slot elements of the same name (or lack thereof), call findFirstSlotElement
655 to find the first slot element.
656 (WebCore::SlotAssignment::addSlotElementByName): Added. Called when a new slot element is inserted into
657 the associated shadow tree. When a slot element's name is changed, removeSlotElementByName is called on
658 with the old name before addSlotElementByName is called with the new name.
659 (WebCore::SlotAssignment::removeSlotElementByName): Ditto for removal.
660 (WebCore::SlotAssignment::assignedNodesForSlot): Added. Finds the ordered list of assigned nodes for
661 a given slot element. When there are multiple slot elements of the same name, we return the list only if
662 SlotInfo::element matches the argument.
663 (WebCore::SlotAssignment::findFirstSlotElement): Added. Resolves SlotInfo::element if needed.
664 (WebCore::SlotAssignment::resolveAllSlotElements): Finds SlotInfo::element for all slots. We resolve all
665 slots simultaneously to avoid doing O(number of nodes) tree traversal for O(number of slots) to avoid
666 the worst case O(n^2) behavior when all nodes in the shadow tree are slot elements of the same name.
667 (WebCore::SlotAssignment::assignSlots): Added. Computes the slot assignments by traversing each child
668 of the shadow host and adding to the appropriate SlotInfo::assignedNodes, creating a new entry if needed.
669 * dom/SlotAssignment.h: Added.
670 (WebCore::SlotAssignment::SlotAssignment):
671 (WebCore::SlotAssignment::invalidate):
672 (WebCore::SlotAssignment::SlotInfo::SlotInfo):
673 (WebCore::SlotAssignment::SlotInfo::hasSlotElements):
674 (WebCore::SlotAssignment::SlotInfo::hasDuplicatedSlotElements):
675 (WebCore::SlotAssignment::SlotInfo::shouldResolveSlotElement):
676 * html/HTMLAttributeNames.in: Added slot attribute.
677 * html/HTMLSlotElement.cpp: Added.
678 (WebCore::HTMLSlotElement::create):
679 (WebCore::HTMLSlotElement::HTMLSlotElement):
680 (WebCore::HTMLSlotElement::insertedInto): Calls addSlotElementByName.
681 (WebCore::HTMLSlotElement::removedFrom): Calls removeSlotElementByName. Because the element had already
682 been removed from the shadow tree, we can't use containingShadowRoot() to find the ShadowRoot here.
683 (WebCore::HTMLSlotElement::attributeChanged): Calls removeSlotElementByName and addSlotElementByName.
684 (WebCore::HTMLSlotElement::getDistributedNodes): Returns an ordered list of the assigned nodes.
685 * html/HTMLSlotElement.h: Added.
686 * html/HTMLSlotElement.idl: Added.
687 * html/HTMLTagNames.in: Added slot element.
689 2015-09-17 Chris Dumez <cdumez@apple.com>
691 Regression(r189881): release assertion hit in toJS(ExecState*, JSDOMGlobalObject*, DocumentFragment*)
692 https://bugs.webkit.org/show_bug.cgi?id=149281
694 Reviewed by Ryosuke Niwa.
696 After r189881, we started generating a toJS() function for DocumentFragment
697 as an optimization. DocumentFragment has a subclass (ShadowRoot) but the
698 default toJS() implementation should have still been acceptable given that
699 the subclass is not web-exposed and therefore does not have a JS wrapper.
701 However, the ShadowRoot interface was introduced shortly after in r189841
702 and to toJS() implementation for DocumentFragment is now invalid. This
703 patch introduces a ShadowRoot-aware custom implementation of toJS() for
704 DocumentFragment to address the problem.
706 No new tests, already covered by:
707 plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html
709 * bindings/js/JSDocumentFragmentCustom.cpp:
710 (WebCore::createNewDocumentFragmentWrapper):
711 (WebCore::toJSNewlyCreated):
713 Provide a ShadowRoot-aware custom implementation of toJS() /
714 toJSNewlyCreated() for DocumentFragment.
716 * bindings/js/JSNodeCustom.cpp:
717 (WebCore::createWrapperInline):
718 Fix bug in toJS() implementation for Node as it was not handling
719 ShadowRoots properly either.
721 * dom/DocumentFragment.idl:
722 Use [CustomToJSObject] so we can provide our own custom implementation
725 2015-09-17 Antti Koivisto <antti@apple.com>
727 De-template ContainerNodeAlgorithms
728 https://bugs.webkit.org/show_bug.cgi?id=149286
730 Reviewed by Andreas Kling.
732 These are always used with ContainerNode/Node.
734 * dom/ContainerNode.cpp:
735 (WebCore::ContainerNode::removeDetachedChildren):
736 (WebCore::destroyRenderTreeIfNeeded):
737 (WebCore::ContainerNode::takeAllChildrenFrom):
738 (WebCore::ContainerNode::insertBeforeCommon):
739 (WebCore::ContainerNode::appendChildCommon):
741 Make append a member for consistency with insert.
743 (WebCore::ContainerNode::notifyChildInserted):
744 (WebCore::ContainerNode::notifyChildRemoved):
745 (WebCore::ContainerNode::parserInsertBefore):
746 (WebCore::ContainerNode::replaceChild):
747 (WebCore::ContainerNode::appendChild):
748 (WebCore::ContainerNode::parserAppendChild):
750 Also make rest of these ownership-taking functions take Ref<>&&.
752 * dom/ContainerNode.h:
753 (WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion):
754 (WebCore::ContainerNode::setFirstChild):
755 * dom/ContainerNodeAlgorithms.cpp:
756 (WebCore::notifyChildNodeRemoved):
757 (WebCore::addChildNodesToDeletionQueue):
758 (WebCore::removeDetachedChildrenInContainer):
759 (WebCore::collectFrameOwners):
760 (WebCore::assertConnectedSubrameCountIsConsistent):
761 (WebCore::disconnectSubframes):
762 * dom/ContainerNodeAlgorithms.h:
763 (WebCore::removeDetachedChildrenInContainer): Deleted.
764 (WebCore::appendChildToContainer): Deleted.
765 (WebCore::Private::NodeRemovalDispatcher::dispatch): Deleted.
766 (WebCore::Private::addChildNodesToDeletionQueue): Deleted.
767 * html/parser/HTMLConstructionSite.cpp:
769 (WebCore::executeInsertTask):
770 (WebCore::executeReparentTask):
771 (WebCore::executeInsertAlreadyParsedChildTask):
772 * html/track/WebVTTParser.cpp:
773 (WebCore::WebVTTTreeBuilder::constructTreeFromToken):
775 (WebCore::XMLErrors::appendErrorMessage):
776 (WebCore::createXHTMLParserErrorHeader):
777 (WebCore::XMLErrors::insertErrorMessageBlock):
778 * xml/parser/XMLDocumentParser.cpp:
779 (WebCore::XMLDocumentParser::enterText):
781 * xml/parser/XMLDocumentParserLibxml2.cpp:
782 (WebCore::XMLDocumentParser::startElementNs):
783 (WebCore::XMLDocumentParser::processingInstruction):
784 (WebCore::XMLDocumentParser::cdataBlock):
785 (WebCore::XMLDocumentParser::comment):
787 2015-09-17 Tim Horton <timothy_horton@apple.com>
789 Block Objective-C exceptions in DictionaryLookup
790 https://bugs.webkit.org/show_bug.cgi?id=149256
792 Reviewed by Anders Carlsson.
794 * editing/mac/DictionaryLookup.mm:
795 (WebCore::DictionaryLookup::rangeForSelection):
796 (WebCore::DictionaryLookup::rangeAtHitTestResult):
797 (WebCore::expandSelectionByCharacters):
798 (WebCore::DictionaryLookup::stringForPDFSelection):
799 (WebCore::showPopupOrCreateAnimationController):
800 (WebCore::DictionaryLookup::hidePopup):
801 It is possible for Lookup to throw an exception if one of its
802 related services dies for some reason. This shouldn't take down
803 our UI process, so block the exceptions.
805 2015-09-17 Yusuke Suzuki <utatane.tea@gmail.com>
807 [ES6] Add more fine-grained APIs and additional hooks to control module loader from WebCore
808 https://bugs.webkit.org/show_bug.cgi?id=149129
810 Reviewed by Saam Barati.
814 * bindings/js/JSDOMWindowBase.cpp:
815 * bindings/js/JSWorkerGlobalScopeBase.cpp:
817 2015-09-17 Alex Christensen <achristensen@webkit.org>
819 Switch AppleWin build to use CMake
820 https://bugs.webkit.org/show_bug.cgi?id=149163
822 Reviewed by Brent Fulgham.
824 * bindings/scripts/preprocess-idls.pl:
825 (CygwinPathIfNeeded):
826 (WriteFileIfChanged):
827 * bindings/scripts/preprocessor.pm:
829 Fix new cygwin quirks. Cygwin is now using some paths from CMake.
831 2015-09-17 Zalan Bujtas <zalan@apple.com>
833 Remove integral snapping functions from InlineBox class.
834 https://bugs.webkit.org/show_bug.cgi?id=136419
836 Reviewed by Simon Fraser.
838 We should not integral snap inlines during layout time.
840 Covered by existing tests.
842 * rendering/InlineBox.h:
843 (WebCore::InlineBox::pixelSnappedLogicalLeft): Deleted.
844 (WebCore::InlineBox::pixelSnappedLogicalRight): Deleted.
845 (WebCore::InlineBox::pixelSnappedLogicalTop): Deleted.
846 (WebCore::InlineBox::pixelSnappedLogicalBottom): Deleted.
847 * rendering/InlineFlowBox.cpp:
848 (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
849 (WebCore::InlineFlowBox::addBoxShadowVisualOverflow):
850 (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow):
851 (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
853 2015-09-17 Per Arne Vollan <peavo@outlook.com>
855 [WinCairo] Compile error, include file not found.
856 https://bugs.webkit.org/show_bug.cgi?id=149282
858 Reviewed by Alex Christensen.
861 Copy forwarding headers from new legacy directory, fixing CMake clean builds since r189746.
863 2015-09-17 Tim Horton <timothy_horton@apple.com>
865 Delete some dead code
866 https://bugs.webkit.org/show_bug.cgi?id=149255
868 Reviewed by Dan Bernstein.
870 No new tests, just cleanup.
872 * platform/RuntimeApplicationChecksIOS.h:
873 * platform/RuntimeApplicationChecksIOS.mm:
874 (WebCore::applicationIsEpicurious): Deleted.
875 (WebCore::applicationIsMASH): Deleted.
876 Nothing uses these application checks anymore.
878 * platform/ios/SoundIOS.mm:
879 (WebCore::systemBeep):
880 What a beep should be on iOS, I don't know.
881 What it should not be is a NSLog.
883 2015-09-17 Saam barati <sbarati@apple.com>
885 Interpreter::unwind() shouldn't be responsible for filtering out uncatchable exceptions
886 https://bugs.webkit.org/show_bug.cgi?id=149228
888 Reviewed by Mark Lam.
890 No new tests, already covered by current tests. This is not an observable behavior change.
892 * bindings/js/JSNodeFilterCustom.cpp:
893 (WebCore::JSNodeFilter::acceptNode):
895 2015-09-17 Zalan Bujtas <zalan@apple.com>
897 column-rule-style: outset/inset doesn't work
898 https://bugs.webkit.org/show_bug.cgi?id=148815
899 <rdar://problem/22582644>
901 Reviewed by David Hyatt.
903 https://drafts.csswg.org/css-multicol-1/#crs
904 The <‘border-style’> values are interpreted as in the collapsing border model.
906 Unskipped 4 multicolumn tests,
908 * rendering/RenderMultiColumnSet.cpp:
909 (WebCore::RenderMultiColumnSet::paintColumnRules):
910 * rendering/RenderTableCell.cpp:
911 (WebCore::collapsedBorderStyle): Deleted.
912 * rendering/style/RenderStyle.h:
913 (WebCore::collapsedBorderStyle):
915 2015-09-17 Chris Dumez <cdumez@apple.com>
917 Range.deleteContents cannot delete DocType
918 https://bugs.webkit.org/show_bug.cgi?id=148773
919 <rdar://problem/22571280>
921 Reviewed by Ryosuke Niwa.
923 Range.deleteContents() was not able to delete a DocumentType Node, and
924 was throwing a HIERARCHY_REQUEST_ERR. The DOM specification does not
925 say we should throw in such case:
926 https://dom.spec.whatwg.org/#dom-range-deletecontents
928 However, Range.extractContents() should still throw an exception
929 if any of the contained children in a DocumentType Node:
930 https://dom.spec.whatwg.org/#concept-range-extract (Step 12)
932 No new tests, already covered by existing test.
935 (WebCore::Range::deleteContents):
936 (WebCore::Range::extractContents):
937 (WebCore::Range::checkDeleteExtract):
940 2015-09-17 Eric Carlson <eric.carlson@apple.com>
942 [Mac MediaStream] Cleanup capture source classes
943 https://bugs.webkit.org/show_bug.cgi?id=149233
945 Reviewed by Jer Noble.
947 * platform/cf/CoreMediaSoftLink.cpp: Soft-link CMAudioFormatDescriptionGetStreamBasicDescription,
948 CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer, and CMSampleBufferGetNumSamples.
949 * platform/cf/CoreMediaSoftLink.h:
951 * platform/mediastream/mac/AVAudioCaptureSource.h:
952 (WebCore::AVAudioCaptureSource::Observer::~Observer):
953 * platform/mediastream/mac/AVAudioCaptureSource.mm:
954 (WebCore::AVAudioCaptureSource::AVAudioCaptureSource): Initialize m_inputDescription.
955 (WebCore::AVAudioCaptureSource::capabilities): 0 -> nullptr.
956 (WebCore::AVAudioCaptureSource::addObserver): New, add an observer and tell it to prepare.
957 (WebCore::AVAudioCaptureSource::removeObserver): New.
958 (WebCore::operator==): Compare AudioStreamBasicDescription.
959 (WebCore::operator!=):
960 (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Call
961 observer->prepare when passed a new stream description, call observer->process.
963 * platform/mediastream/mac/AVCaptureDeviceManager.mm:
964 (WebCore::refreshCaptureDeviceList): Set m_groupID and m_localizedName.
965 (WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Invalid constraint names should
966 be ignored, so return true when passed one.
967 (WebCore::AVCaptureDeviceManager::getSourcesInfo): This just didn't work, fix it.
968 (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Optional constraints are
969 optional so they don't need to be validated.
970 (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): m_audioSource -> m_audioAVMediaCaptureSource,
971 m_videoSource -> m_videoAVMediaCaptureSource.
972 (WebCore::AVCaptureDeviceManager::sourceWithUID): Ditto.
974 * platform/mediastream/mac/AVMediaCaptureSource.h:
975 (WebCore::AVMediaCaptureSource::session):
976 (WebCore::AVMediaCaptureSource::device):
977 (WebCore::AVMediaCaptureSource::currentStates):
978 (WebCore::AVMediaCaptureSource::constraints):
979 (WebCore::AVMediaCaptureSource::statesDidChanged):
980 (WebCore::AVMediaCaptureSource::createWeakPtr):
981 (WebCore::AVMediaCaptureSource::buffer): Deleted.
982 (WebCore::AVMediaCaptureSource::setBuffer): Deleted.
983 * platform/mediastream/mac/AVMediaCaptureSource.mm:
984 (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Initilize m_weakPtrFactory.
985 (WebCore::AVMediaCaptureSource::scheduleDeferredTask): New, call a function asynchronously on
987 (-[WebCoreAVMediaCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]): Don't
988 dispatch calls to the main thread, let the derived classes do that if necessary.
990 * platform/mediastream/mac/AVVideoCaptureSource.h:
991 (WebCore::AVVideoCaptureSource::width):
992 (WebCore::AVVideoCaptureSource::height):
993 (WebCore::AVVideoCaptureSource::previewLayer):
994 (WebCore::AVVideoCaptureSource::currentFrameSampleBuffer):
995 * platform/mediastream/mac/AVVideoCaptureSource.mm:
996 (WebCore::AVVideoCaptureSource::setFrameRateConstraint): Remove unwanted logging.
997 (WebCore::AVVideoCaptureSource::setupCaptureSession): Configure the AVCaptureVideoDataOutput so
998 it delivers 32-bit BGRA samples.
999 (WebCore::AVVideoCaptureSource::calculateFramerate): Return bool to signal if the frame rate
1001 (WebCore::AVVideoCaptureSource::processNewFrame): New. Process sample buffer, invalidate cached
1002 image, signal when characteristics change.
1003 (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Schedule
1004 call to processNewFrame on the main thread so we do all video processing on main thread.
1005 (WebCore::AVVideoCaptureSource::currentFrameImage): Create and return a CVImageBuffer of the
1006 current video frame.
1007 (WebCore::AVVideoCaptureSource::paintCurrentFrameInContext): Draw the current frame to a context.
1009 2015-09-15 Sergio Villar Senin <svillar@igalia.com>
1011 [CSS Grid Layout] Using automatic (instead of min-content) minimums for 'auto' tracks
1012 https://bugs.webkit.org/show_bug.cgi?id=142329
1014 Reviewed by Darin Adler.
1016 Based on Blink's r198697 by <svillar@igalia.com> and r200478 by <jfernandez@igalia.com>
1018 More precisely (syntax-wise), this would allow 'auto' to be used within the
1019 minmax() function (it's currently forbidden) and have the 'auto' keyword map
1020 to minmax(auto, auto) instead of minmax(min-content, max-content).
1021 - As a minimum, 'auto' would mean "use the specified minimum size, or if
1022 that is auto, treat as 0 or min-content per Flexbox rules".
1023 - As a maximum, 'auto' would mean "use the max-content size".
1025 Regarding the implementation, a new phase is added to the track sizing
1026 algorithm called ResolveIntrinsicMinimums (the former ResolveIntrinsicMinimums
1027 is now called ResolveContentBasedMinimums which does not include 'auto'
1028 resolution) which will be run before any other. This phase uses the minimum
1029 size of grid items (as specified by min-width/height).
1031 Tests: fast/css-grid-layout/grid-automatic-minimum-for-auto-columns.html
1032 fast/css-grid-layout/grid-automatic-minimum-for-auto-rows.html
1034 * css/CSSParser.cpp:
1035 (WebCore::CSSParser::parseGridBreadth):
1036 * rendering/RenderGrid.cpp:
1037 (WebCore::RenderGrid::computeUsedBreadthOfMinLength):
1038 (WebCore::RenderGrid::computeUsedBreadthOfMaxLength):
1039 (WebCore::RenderGrid::minSizeForChild):
1040 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
1041 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
1042 (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase):
1043 (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase):
1044 (WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase):
1045 (WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase):
1046 (WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase):
1047 (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
1048 * rendering/RenderGrid.h:
1049 * rendering/style/GridTrackSize.h:
1050 (WebCore::GridTrackSize::minTrackBreadth):
1051 (WebCore::GridTrackSize::maxTrackBreadth):
1052 (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes):
1053 (WebCore::GridTrackSize::hasIntrinsicMinTrackBreadth):
1054 (WebCore::GridTrackSize::hasAutoMinTrackBreadth):
1055 (WebCore::GridTrackSize::hasAutoMaxTrackBreadth):
1056 (WebCore::GridTrackSize::hasMaxContentOrAutoMaxTrackBreadth):
1057 (WebCore::GridTrackSize::hasAutoOrMinContentMinTrackBreadthAndIntrinsicMaxTrackBreadth):
1058 (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth): Deleted.
1060 2015-09-17 Javier Fernandez <jfernandez@igalia.com>
1062 [CSS Grid Layout] Relayout whenever Box Alignment properties change
1063 https://bugs.webkit.org/show_bug.cgi?id=148070
1065 Reviewed by Darin Adler.
1067 We were Reattaching the styles to the RenderTree whenever Content Alignment
1068 properties (align-items and justify-items) changed their values, since the
1069 Self Alignment properties depend on such values to resolve 'auto' values
1072 This patch removes such restriction, since we resolve the auto values
1073 whenever we access the alignment properties. The only thing we need to
1074 do is to mark a grid item for layout whenever the Default Alignment
1075 properties change from/to stretch, since it implies a resize of the grid
1076 items using 'auto' values for the Self Alignment properties.
1078 Tests: fast/css-grid-layout/relayout-align-items-changed.html
1079 fast/css-grid-layout/relayout-align-self-changed.html
1080 fast/css-grid-layout/relayout-justify-items-changed.html
1081 fast/css-grid-layout/relayout-justify-self-changed.html
1082 fast/repaint/align-items-change.html
1083 fast/repaint/align-items-overflow-change.html
1084 fast/repaint/align-self-change.html
1085 fast/repaint/align-self-overflow-change.html
1086 fast/repaint/justify-items-change.html
1087 fast/repaint/justify-items-legacy-change.html
1088 fast/repaint/justify-items-overflow-change.html
1089 fast/repaint/justify-self-change.html
1090 fast/repaint/justify-self-overflow-change.html
1092 * rendering/RenderGrid.cpp:
1093 (WebCore::defaultAlignmentIsStretch):
1094 (WebCore::RenderGrid::styleDidChange):
1095 * rendering/RenderGrid.h:
1096 * rendering/style/RenderStyle.cpp:
1097 (WebCore::RenderStyle::resolveAlignmentOverflow):
1098 (WebCore::RenderStyle::changeRequiresLayout):
1099 * style/StyleResolveTree.cpp:
1100 (WebCore::Style::determineChange): Deleted.
1102 2015-09-16 Carlos Garcia Campos <cgarcia@igalia.com>
1104 printing does not use minimum page zoom factor
1105 https://bugs.webkit.org/show_bug.cgi?id=108507
1107 Reviewed by Darin Adler.
1109 * page/PrintContext.cpp:
1110 (WebCore::PrintContext::beginAndComputePageRectsWithPageSize):
1111 Helper function to share common code from numberOfPages() and
1112 spoolAllPagesWithBoundaries().
1113 (WebCore::PrintContext::numberOfPages): Use beginAndComputePageRectsWithPageSize().
1114 (WebCore::PrintContext::spoolAllPagesWithBoundaries): Use
1115 beginAndComputePageRectsWithPageSize() and don't flip the Y axis
1116 for non Cocoa platforms.
1117 * page/PrintContext.h:
1119 2015-09-16 Ryosuke Niwa <rniwa@webkit.org>
1121 removeShadow shouldn't call ChildNodeRemovalNotifier with the shadow host as the removal point
1122 https://bugs.webkit.org/show_bug.cgi?id=149244
1124 Reviewed by Antti Koivisto.
1126 Since a shadow host is in a different tree than nodes in its shadow tree, it's incorrect to call
1127 removedFrom with the shadow host as the removal point. This causes HTMLSlotElement::removedFrom
1128 which will be added in the bug 149241 to call methods on a wrong ShadowRoot.
1130 We still keep the ad-hoc behavior of using the shadow host as the insertion/removal point when
1131 calling insertedInto and removedFrom on the shadow root itself to update the InDocument node flag.
1132 We may want to re-visit this design in the future.
1134 No new tests since I couldn't quite create a reduction. However, tests I'm adding in the bug 149241
1135 will crash without this change.
1137 I separated this patch from the bug 149241 to isolate the high-risk code change here.
1140 (WebCore::Element::addShadowRoot): Call insertedInto on ShadowRoot, and then call it on all its
1141 children separately with the insertion point set to the shadow root since insertedInto relies on
1142 insertion point's inDocument flag to be true when the shadow host is in the document.
1143 (WebCore::Element::removeShadowRoot): Ditto in the reverse order.
1145 2015-09-16 Gyuyoung Kim <gyuyoung.kim@webkit.org>
1147 Remove all uses of PassRefPtr in WebCore/inspector
1148 https://bugs.webkit.org/show_bug.cgi?id=149156
1150 Reviewed by Darin Adler.
1152 * inspector/DOMEditor.cpp:
1153 (WebCore::DOMEditor::InsertBeforeAction::InsertBeforeAction):
1154 (WebCore::DOMEditor::ReplaceChildNodeAction::ReplaceChildNodeAction):
1155 (WebCore::DOMEditor::insertBefore):
1156 (WebCore::DOMEditor::replaceChild):
1157 * inspector/DOMEditor.h:
1158 * inspector/DOMPatchSupport.cpp:
1159 (WebCore::DOMPatchSupport::removeChildAndMoveToNew):
1160 * inspector/InspectorDOMAgent.cpp:
1161 (WebCore::InspectorDOMAgent::highlightSelector):
1162 * inspector/InspectorDatabaseAgent.cpp:
1163 (WebCore::InspectorDatabaseAgent::didOpenDatabase):
1164 * inspector/InspectorDatabaseAgent.h:
1165 * inspector/InspectorDatabaseInstrumentation.h:
1166 * inspector/InspectorDatabaseResource.h:
1167 (WebCore::InspectorDatabaseResource::setDatabase):
1168 * inspector/InspectorFrontendHost.cpp:
1169 (WebCore::FrontendMenuProvider::create):
1170 * inspector/InspectorInstrumentation.cpp:
1171 (WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
1172 * inspector/InspectorLayerTreeAgent.h:
1173 * inspector/InspectorOverlay.cpp:
1174 (WebCore::InspectorOverlay::highlightNodeList):
1175 * inspector/InspectorOverlay.h:
1176 * inspector/InspectorPageAgent.cpp:
1177 (WebCore::InspectorPageAgent::sharedBufferContent):
1178 * inspector/InspectorPageAgent.h:
1179 * inspector/InspectorResourceAgent.cpp:
1180 * inspector/InspectorTimelineAgent.cpp:
1181 (WebCore::startProfiling):
1182 (WebCore::stopProfiling):
1183 (WebCore::InspectorTimelineAgent::stopFromConsole):
1184 * inspector/InspectorTimelineAgent.h:
1185 * inspector/InspectorWorkerResource.h:
1186 (WebCore::InspectorWorkerResource::create):
1187 * inspector/InstrumentingAgents.h:
1188 * inspector/NetworkResourcesData.cpp:
1189 (WebCore::createOtherResourceTextDecoder):
1190 (WebCore::NetworkResourcesData::addResourceSharedBuffer):
1191 * inspector/NetworkResourcesData.h:
1192 * inspector/TimelineRecordFactory.cpp:
1193 (WebCore::createQuad):
1194 * inspector/WebInjectedScriptHost.h:
1195 * inspector/WebInjectedScriptManager.cpp:
1196 (WebCore::WebInjectedScriptManager::WebInjectedScriptManager):
1197 * inspector/WebInjectedScriptManager.h:
1199 2015-09-16 Brady Eidson <beidson@apple.com>
1201 Have window.indexedDB.open return an IDBOpenDBRequest.
1202 https://bugs.webkit.org/show_bug.cgi?id=149234
1204 Reviewed by Alex Christensen.
1206 Test: storage/indexeddb/modern/opendatabase-request.html
1208 * Modules/indexeddb/client/IDBFactoryImpl.cpp:
1209 (WebCore::IDBClient::IDBFactory::open):
1210 (WebCore::IDBClient::IDBFactory::openInternal):
1211 * Modules/indexeddb/client/IDBFactoryImpl.h:
1213 2015-09-16 Antti Koivisto <antti@apple.com>
1215 Turn ChildNodeInsertion/RemovalNotifier classes into functions
1216 https://bugs.webkit.org/show_bug.cgi?id=149236
1218 Reviewed by Ryosuke Niwa.
1220 Less architecture, more readability.
1222 * dom/ContainerNode.cpp:
1223 (WebCore::ContainerNode::notifyChildInserted):
1224 (WebCore::ContainerNode::notifyChildRemoved):
1225 (WebCore::ContainerNode::removeChildren):
1226 * dom/ContainerNodeAlgorithms.cpp:
1227 (WebCore::notifyDescendantInsertedIntoDocument):
1228 (WebCore::notifyDescendantInsertedIntoTree):
1229 (WebCore::notifyNodeInsertedIntoDocument):
1230 (WebCore::notifyNodeInsertedIntoTree):
1231 (WebCore::notifyChildNodeInserted):
1232 (WebCore::notifyNodeRemovedFromDocument):
1233 (WebCore::notifyNodeRemovedFromTree):
1234 (WebCore::notifyChildNodeRemoved):
1235 (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument): Deleted.
1236 (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree): Deleted.
1237 (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument): Deleted.
1238 (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree): Deleted.
1239 * dom/ContainerNodeAlgorithms.h:
1240 (WebCore::ChildNodeInsertionNotifier::ChildNodeInsertionNotifier): Deleted.
1241 (WebCore::ChildNodeRemovalNotifier::ChildNodeRemovalNotifier): Deleted.
1242 (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument): Deleted.
1243 (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree): Deleted.
1244 (WebCore::ChildNodeInsertionNotifier::notify): Deleted.
1245 (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument): Deleted.
1246 (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromTree): Deleted.
1247 (WebCore::ChildNodeRemovalNotifier::notify): Deleted.
1249 (WebCore::Element::addShadowRoot):
1250 (WebCore::Element::removeShadowRoot):
1251 (WebCore::Element::createShadowRoot):
1253 2015-09-16 Gyuyoung Kim <gyuyoung.kim@webkit.org>
1255 Remove all uses of PassRefPtr in WebCore/bindings
1256 https://bugs.webkit.org/show_bug.cgi?id=149207
1258 Reviewed by Darin Adler.
1260 If RefPtr<>&& argument is passed to new variable or other function, we use copyRef() or WTF::move().
1261 copyRef() should be used when the argument continues to be used in following code. If it is final use
1262 inside function, we have to use WTF::move().
1264 * bridge/NP_jsobject.cpp:
1265 * bridge/NP_jsobject.h:
1266 * bridge/c/CRuntimeObject.cpp:
1267 (JSC::Bindings::CRuntimeObject::CRuntimeObject):
1268 * bridge/c/CRuntimeObject.h:
1269 (JSC::Bindings::CRuntimeObject::create):
1270 * bridge/c/c_instance.cpp:
1271 (JSC::Bindings::CInstance::CInstance):
1272 * bridge/c/c_instance.h:
1273 (JSC::Bindings::CInstance::create):
1274 * bridge/jsc/BridgeJSC.cpp:
1275 (JSC::Bindings::Array::Array):
1276 (JSC::Bindings::Instance::Instance):
1277 * bridge/jsc/BridgeJSC.h:
1278 * bridge/objc/ObjCRuntimeObject.h:
1279 (JSC::Bindings::ObjCRuntimeObject::create):
1280 * bridge/objc/ObjCRuntimeObject.mm:
1281 (JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject):
1282 * bridge/objc/WebScriptObjectProtocol.h:
1283 * bridge/objc/objc_instance.h:
1284 * bridge/objc/objc_instance.mm:
1285 (ObjcInstance::ObjcInstance):
1286 (ObjcInstance::create):
1287 * bridge/objc/objc_runtime.h:
1288 * bridge/objc/objc_runtime.mm:
1289 (JSC::Bindings::ObjcArray::ObjcArray):
1290 * bridge/runtime_object.cpp:
1291 (JSC::Bindings::RuntimeObject::RuntimeObject):
1292 * bridge/runtime_object.h:
1293 * bridge/runtime_root.cpp:
1294 (JSC::Bindings::RootObject::create):
1295 * bridge/runtime_root.h:
1297 2015-09-16 Chris Dumez <cdumez@apple.com>
1299 Element's attribute NS API should defined treat undefined namespace as null
1300 https://bugs.webkit.org/show_bug.cgi?id=149238
1301 <rdar://problem/22562204>
1303 Reviewed by Ryosuke Niwa.
1305 Element's attribute NS API should treat defined undefined namespace as null
1306 instead of converting it to the "undefined" String. This is because the
1307 namespace parameter is a nullable String as per the DOM spec:
1308 - https://dom.spec.whatwg.org/#element
1310 The attribute is nullable and WebIDL says undefined should be converted
1311 to null for nullable parameters:
1312 - https://heycam.github.io/webidl/#es-nullable-type (step 3)
1314 Firefox follows the specification.
1316 No new tests, already covered by existing test.
1320 2015-09-16 Chris Dumez <cdumez@apple.com>
1322 Possible small iOS PLT regression from r189537
1323 https://bugs.webkit.org/show_bug.cgi?id=149232
1325 Reviewed by Ryosuke Niwa.
1327 r189537 may have regressed PLT a bit on iOS. That change added a couple
1328 of extra branches to throw exceptions. This patch marks those branches
1329 as UNLIKELY() as we already do for other similar checks in the JS
1332 * bindings/scripts/CodeGeneratorJS.pm:
1333 (GenerateImplementation):
1334 * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1335 (webkit_dom_test_obj_get_property):
1336 (webkit_dom_test_obj_class_init):
1337 (webkit_dom_test_obj_get_strict_type_checking_attribute):
1338 (webkit_dom_test_obj_set_strict_type_checking_attribute):
1339 * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1340 * bindings/scripts/test/JS/JSTestObj.cpp:
1341 (WebCore::jsTestObjStrictTypeCheckingAttribute):
1342 (WebCore::setJSTestObjStrictTypeCheckingAttribute):
1343 * bindings/scripts/test/ObjC/DOMTestObj.h:
1344 * bindings/scripts/test/ObjC/DOMTestObj.mm:
1345 (-[DOMTestObj strictTypeCheckingAttribute]):
1346 (-[DOMTestObj setStrictTypeCheckingAttribute:]):
1347 * bindings/scripts/test/TestObj.idl:
1348 * html/HTMLTableElement.cpp:
1349 (WebCore::HTMLTableElement::setTHead):
1350 (WebCore::HTMLTableElement::setTFoot):
1352 2015-09-16 Joseph Pecoraro <pecoraro@apple.com>
1354 Web Inspector: Fix common typo "supress" => "suppress"
1355 https://bugs.webkit.org/show_bug.cgi?id=149199
1357 Reviewed by Gyuyoung Kim.
1359 * html/shadow/ContentDistributor.h:
1360 (WebCore::ContentDistributor::needsDistribution):
1361 * page/ContentSecurityPolicy.cpp:
1362 (WebCore::ContentSecurityPolicy::reportViolation):
1363 * platform/NotImplemented.h:
1364 * platform/graphics/ca/win/LayerChangesFlusher.cpp:
1365 (WebCore::LayerChangesFlusher::hookCallback):
1366 * platform/mac/HIDGamepadProvider.cpp:
1367 (WebCore::HIDGamepadProvider::deviceRemoved):
1368 * platform/win/makesafeseh.asm:
1370 2015-09-16 Chris Dumez <cdumez@apple.com>
1372 WebIDL: Rename [ReturnNewObject] to [NewObject] and use it more consistently in DOM
1373 https://bugs.webkit.org/show_bug.cgi?id=149192
1375 Reviewed by Darin Adler.
1377 Rename [ReturnNewObject] to [NewObject] and use it more consistently in
1380 This aligns our IDL extended attribute naming with standard Web IDL:
1381 https://heycam.github.io/webidl/#NewObject
1383 We already have [ReturnNewObject] in most places that the DOM
1384 specification uses [NewObject] but we are missing a few so I'll
1386 https://dom.spec.whatwg.org/#interface-document
1388 Using [NewObject] lets the bindings generator know that the API in
1389 question always returns new objects and that we can bypass the check
1390 for existing wrappers and directly create a new wrapper for the
1393 This patch also adds support for generating the toJSNewlyCreated()
1394 utility function for most types. Previously, to use [ReturnNewObject]
1395 for a new type, you needed to add the type to a hard-coded list in
1396 the bindings generator then provide your own implementation for
1397 toJSNewlyCreated() as custom bindings.
1399 No new-exposed behavior change.
1401 * bindings/js/JSDocumentCustom.cpp:
1402 * bindings/js/JSEventCustom.cpp:
1403 * bindings/js/JSNodeListCustom.cpp:
1404 Add toJSNewlyCreated() custom implementation for Node, Event and
1405 Document, that shares code with the existing toJS() implementation for
1408 * bindings/js/JSCDATASectionCustom.cpp: Removed.
1409 * bindings/js/JSTextCustom.cpp: Removed.
1410 * bindings/js/JSTouchCustom.cpp: Removed.
1411 * bindings/js/JSTouchListCustom.cpp: Removed.
1412 Drop several custom bindings files as the bindings generator is
1413 now able to generate the toJSNewlyCreated() utility function for
1416 * bindings/scripts/CodeGeneratorJS.pm:
1417 - Rename [ReturnNewObject] to [NewObject].
1418 - Generate a toJSNewlyCreated() whenever we generate a toJS() already.
1419 Get rid of the hard-coded list of types that need a
1422 * bindings/scripts/IDLAttributes.txt:
1423 Rename [ReturnNewObject] to [NewObject].
1425 * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1426 * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1427 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1428 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
1429 * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1430 * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1431 * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1432 * bindings/scripts/test/JS/JSTestEventConstructor.h:
1433 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1434 * bindings/scripts/test/JS/JSTestEventTarget.h:
1435 * bindings/scripts/test/JS/JSTestException.cpp:
1436 * bindings/scripts/test/JS/JSTestException.h:
1437 * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1438 * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1439 * bindings/scripts/test/JS/JSTestInterface.cpp:
1440 * bindings/scripts/test/JS/JSTestInterface.h:
1441 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1442 * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1443 * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1444 * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1445 * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1446 * bindings/scripts/test/JS/JSTestNondeterministic.h:
1447 * bindings/scripts/test/JS/JSTestObj.cpp:
1448 * bindings/scripts/test/JS/JSTestObj.h:
1449 * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1450 * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1451 * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1452 * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1453 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1454 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1455 * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1456 * bindings/scripts/test/JS/JSTestTypedefs.h:
1457 * bindings/scripts/test/JS/JSattribute.cpp:
1458 * bindings/scripts/test/JS/JSattribute.h:
1459 * bindings/scripts/test/JS/JSreadonly.cpp:
1460 * bindings/scripts/test/JS/JSreadonly.h:
1461 Rebaseline bindings tests.
1464 * dom/CDATASection.idl:
1466 * dom/DocumentFragment.idl:
1467 * dom/DocumentType.idl:
1468 * dom/EntityReference.idl:
1469 * dom/ProcessingInstruction.idl:
1470 Add [JSGenerateToJSObject] so that the bindings generator generates
1471 a toJS() / toJSNewlyCreated() for this type. While it is not strictly
1472 needed, it avoids falling back to using the toJS() from Node which
1473 calls the virtual nodeType() function to determine the node type.
1474 This change was made for efficiency purposes.
1476 * dom/DOMImplementation.idl:
1477 Rename [ReturnNewObject] to [NewObject] and add it to createHTMLDocument()
1478 as well, as per the specification:
1479 https://dom.spec.whatwg.org/#interface-domimplementation
1482 Rename [ReturnNewObject] to [NewObject] and add it to more operations
1483 as per he DOM specification:
1484 https://dom.spec.whatwg.org/#document
1487 Add [NewObject] to cloneNode() as per the DOM specification:
1488 https://dom.spec.whatwg.org/#node
1490 * dom/ParentNode.idl:
1491 Add [NewObject] to querySelectorAll() as per the DOM specification:
1492 https://dom.spec.whatwg.org/#parentnode
1495 Add [NewObject] for several operations, as per the DOM specification:
1496 https://dom.spec.whatwg.org/#interface-range
1498 2015-09-16 Brady Eidson <beidson@apple.com>
1500 Have window.indexedDB.deleteDatabase return an IDBOpenDBRequest.
1501 https://bugs.webkit.org/show_bug.cgi?id=149229
1503 Reviewed by Alex Christensen.
1505 Test: storage/indexeddb/modern/deletedatabase-request.html
1506 storage/indexeddb/modern/deletedatabase-null-name-exception.html
1509 * WebCore.xcodeproj/project.pbxproj:
1511 * Modules/indexeddb/IDBDatabaseIdentifier.cpp: Added.
1512 (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
1513 * Modules/indexeddb/IDBDatabaseIdentifier.h: Added.
1514 (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
1515 (WebCore::IDBDatabaseIdentifier::isHashTableDeletedValue):
1516 (WebCore::IDBDatabaseIdentifier::hash):
1517 (WebCore::IDBDatabaseIdentifier::isValid):
1518 (WebCore::IDBDatabaseIdentifier::operator==):
1519 (WebCore::IDBDatabaseIdentifier::databaseName):
1520 (WebCore::IDBDatabaseIdentifierHash::hash):
1521 (WebCore::IDBDatabaseIdentifierHash::equal):
1522 (WebCore::IDBDatabaseIdentifierHashTraits::isEmptyValue):
1524 * Modules/indexeddb/client/IDBFactoryImpl.cpp:
1525 (WebCore::IDBClient::shouldThrowSecurityException):
1526 (WebCore::IDBClient::IDBFactory::getDatabaseNames):
1527 (WebCore::IDBClient::IDBFactory::open):
1528 (WebCore::IDBClient::IDBFactory::deleteDatabase):
1529 * Modules/indexeddb/client/IDBFactoryImpl.h:
1531 * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
1532 (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
1533 * Modules/indexeddb/client/IDBOpenDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
1534 (WebCore::IDBClient::IDBOpenDBRequest::create):
1536 * Modules/indexeddb/client/IDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
1537 (WebCore::IDBClient::IDBRequest::IDBRequest):
1538 (WebCore::IDBClient::IDBRequest::result):
1539 (WebCore::IDBClient::IDBRequest::errorCode):
1540 (WebCore::IDBClient::IDBRequest::error):
1541 (WebCore::IDBClient::IDBRequest::source):
1542 (WebCore::IDBClient::IDBRequest::transaction):
1543 (WebCore::IDBClient::IDBRequest::readyState):
1544 (WebCore::IDBClient::IDBRequest::eventTargetInterface):
1545 (WebCore::IDBClient::IDBRequest::activeDOMObjectName):
1546 (WebCore::IDBClient::IDBRequest::canSuspendForPageCache):
1547 * Modules/indexeddb/client/IDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.h.
1549 * platform/Logging.h:
1551 2015-09-16 Chris Dumez <cdumez@apple.com>
1553 Add initial support for [Unforgeable] IDL extended attribute
1554 https://bugs.webkit.org/show_bug.cgi?id=149147
1556 Reviewed by Darin Adler.
1558 Add initial support for [Unforgeable] IDL extended attribute:
1559 https://heycam.github.io/webidl/#Unforgeable
1561 In particular, attributes marked as unforgeable are now:
1562 - on the instance rather than the prototype
1563 - non-configurable. WebKit does not match the Web IDL specification
1564 and most properties are currently non-configurable already. However,
1565 I added an extra check for [Unforgeable] so that unforgeable
1566 attributes stay unconfigurable if we later decide to match the spec
1567 and mark properties as configurable.
1569 Operation marked as unforgeable are now non-configurable. However, this
1570 patch does not move them from the prototype to the instance yet. This
1571 needs to be addressed in a follow-up patch as this is a larger change.
1573 This patch also drops support for the undocumented
1574 [OperationsNotDeletable] IDL extended attribute. It is no longer needed
1575 now that we support [Unforgeable] and still support [NotDeletable] for
1578 Test: fast/dom/unforgeable-attributes.html
1580 * Modules/plugins/QuickTimePluginReplacement.idl:
1581 Drop [OperationsNotDeletable] on the interface and mark the only
1582 operation on this interface as [NotDeletable]. There is no behavior
1583 change but this allows us to drop support for a non-standard and
1584 undocumented IDL extended attribute.
1586 * bindings/scripts/CodeGeneratorJS.pm:
1587 (AttributeShouldBeOnInstance):
1588 (GenerateAttributesHashTable):
1589 (GenerateImplementation):
1590 Add initial support for [Unforgeable] IDL extended attribute.
1592 * bindings/scripts/IDLAttributes.txt:
1593 Add [Unforgeable]. Drop [OperationsNotDeletable].
1595 * crypto/CryptoKeyPair.idl:
1596 Drop [OperationsNotDeletable] on the interface as this interface has
1600 * page/DOMWindow.idl:
1601 * page/Location.idl:
1602 Mark attributes / interfaces as [Unforgeable] as per the latest HTML
1604 https://html.spec.whatwg.org/multipage/dom.html#document
1605 https://html.spec.whatwg.org/multipage/browsers.html#window
1606 https://html.spec.whatwg.org/multipage/browsers.html#the-location-interface
1608 2015-09-16 Zalan Bujtas <zalan@apple.com>
1610 Simple line layout: Glitch selecting long text.
1611 https://bugs.webkit.org/show_bug.cgi?id=149204
1612 rdar://problem/22646472
1614 Reviewed by Antti Koivisto.
1616 When long text is split into multiple RenderText objects, we ignore renderer boundaries while
1617 collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
1618 This patch ensures that fragments with hypen character ignore renderer boundaries too.
1620 Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
1622 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1623 (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1625 2015-09-16 Brady Eidson <beidson@apple.com>
1627 Remove stray logging string mistakenly left in r189746.
1629 * Modules/indexeddb/legacy/LegacyFactory.cpp:
1630 (WebCore::LegacyFactory::deleteDatabase):
1632 2015-09-16 Chris Fleizach <cfleizach@apple.com>
1634 AX: No VoiceOver typing feedback in some search fields
1635 https://bugs.webkit.org/show_bug.cgi?id=149177
1637 Reviewed by Mario Sanchez Prada.
1639 If SearchFieldRole is not marked as a TextControl, it does not end up returning the accessibilityValue,
1640 which is needed to output the right text to VoiceOver.
1642 Test: accessibility/ax-value-with-search.html
1644 * accessibility/AccessibilityObject.cpp:
1645 (WebCore::AccessibilityObject::isTextControl):
1647 2015-09-16 Manuel Rego Casasnovas <rego@igalia.com>
1649 [css-grid] Grid container's height should include scrollbar
1650 https://bugs.webkit.org/show_bug.cgi?id=149210
1652 Reviewed by Sergio Villar Senin.
1654 Add scrollbar's size in the grid container's height calculation at
1655 RenderGrid::layoutGridItems().
1657 Test: fast/css-grid-layout/grid-container-margin-border-padding-scrollbar.html
1659 * rendering/RenderGrid.cpp:
1660 (WebCore::RenderGrid::layoutGridItems): Include scrollbarLogicalHeight()
1661 while computing the grid's logical height.
1663 2015-09-16 Carlos Garcia Campos <cgarcia@igalia.com>
1665 Unreviewed. Fix GObject DOM bindings API break after r189676.
1667 webkit_dom_character_data_append_data() used to raise exceptions.
1669 * bindings/scripts/CodeGeneratorGObject.pm:
1670 (FunctionUsedToRaiseException):
1672 2015-09-15 Commit Queue <commit-queue@webkit.org>
1674 Unreviewed, rolling out r189847.
1675 https://bugs.webkit.org/show_bug.cgi?id=149208
1677 Asserts on all the tests (Requested by ap on #webkit).
1681 "Simple line layout: Glitch selecting long text."
1682 https://bugs.webkit.org/show_bug.cgi?id=149204
1683 http://trac.webkit.org/changeset/189847
1685 2015-09-15 Zalan Bujtas <zalan@apple.com>
1687 Simple line layout: Glitch selecting long text.
1688 https://bugs.webkit.org/show_bug.cgi?id=149204
1689 rdar://problem/22646472
1691 Reviewed by Antti Koivisto.
1693 When long text is split into multiple RenderText objects, we ignore renderer boundaries while
1694 collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
1695 This patch ensures that fragments with hypen character ignore renderer boundaries too.
1697 Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
1699 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1700 (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1702 2015-09-15 Ryosuke Niwa <rniwa@webkit.org>
1704 GTK+ build fix attempt after r189841.
1706 * PlatformGTK.cmake:
1708 2015-09-15 Chris Dumez <cdumez@apple.com>
1710 Document.createElement(localName) does not handle correctly missing or null parameter
1711 https://bugs.webkit.org/show_bug.cgi?id=149184
1712 <rdar://problem/22565070>
1714 Reviewed by Ryosuke Niwa.
1716 Document.createElement(localName) does not handle correct missing or
1718 - https://dom.spec.whatwg.org/#interface-document
1720 As per the specification, the parameter is a non-nullable DOMString and
1721 is mandatory. Therefore, as per Web IDL, we should have the following
1723 1. If the parameter is missing, we should throw an exception
1724 2. If the parameter is null, we should convert it to the "null" string
1725 and create a <null> element.
1727 Chrome and Firefox behave according to the specification. However,
1729 1. Create a <undefined> element
1730 2. Throw an InvalidCharacterError
1732 This patch aligns WebKit's behavior with the specification and other
1735 No new tests, already covered by existing tests.
1739 2015-09-15 Ryosuke Niwa <rniwa@webkit.org>
1741 Add ShadowRoot interface and Element.prototype.attachShadow
1742 https://bugs.webkit.org/show_bug.cgi?id=149187
1744 Reviewed by Antti Koivisto.
1746 Add back ShadowRoot IDL interface and Element.prototype.attachShadow in accordance with
1747 http://w3c.github.io/webcomponents/spec/shadow/ at db27e6e36eab512d86edcdabb33ed27b5751acd7 excluding getSelection(),
1748 elementFromPoint(), elementsFromPoint(), caretPositionFromPoint(), and styleSheets attribute on ShadowRoot interface.
1750 The feature is enabled by default on Mac and iOS ports for testing and disabled by default elsewhere.
1752 Also added HTMLElement::canHaveUserAgentShadowRoot which returns false by default and overridden elsewhere to return true
1753 to distinguish elements for which attachShadow is supposed to throw NotSupported.
1754 See https://w3c.github.io/webcomponents/spec/shadow/#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict
1756 Tests: fast/shadow-dom/Element-interface-attachShadow.html
1757 fast/shadow-dom/Element-interface-shadowRoot-attribute.html
1758 fast/shadow-dom/ShadowRoot-interface.html
1761 * Configurations/FeatureDefines.xcconfig:
1762 * DerivedSources.cpp:
1763 * DerivedSources.make:
1764 * PlatformGTK.cmake:
1765 * WebCore.vcxproj/WebCore.vcxproj:
1766 * WebCore.vcxproj/WebCore.vcxproj.filters:
1767 * WebCore.xcodeproj/project.pbxproj:
1768 * css/SelectorChecker.cpp:
1769 (WebCore::SelectorChecker::matchRecursively):
1771 (WebCore::Element::bindingsOffsetParent):
1772 (WebCore::Element::offsetParent):
1773 (WebCore::Element::addShadowRoot):
1774 (WebCore::Element::createShadowRoot):
1775 (WebCore::Element::attachShadow): Added.
1776 (WebCore::Element::bindingShadowRoot): Added. Returns null unless the attached shadow root is in the "open" mode.
1778 * dom/Element.idl: Added attachShadow and shadowRoot. We only expose these to JS for now since Dictionary argument isn't
1779 supported by other binding code.
1780 * dom/ShadowRoot.cpp: Removed an unused enum.
1782 (WebCore::ShadowRoot::Type): Replaced old-style enum "ShadowRootType" by an enum class named "Type". Also added two new
1783 values Open and Closed for author shadow roots.
1784 (WebCore::ShadowRoot::type):
1785 * dom/ShadowRoot.idl: Added.
1786 * html/HTMLButtonElement.h:
1787 * html/HTMLDetailsElement.h:
1788 (HTMLButtonElement::canHaveUserAgentShadowRoot): Ditto.
1789 * html/HTMLElement.h:
1790 (WebCore::HTMLElement::canHaveUserAgentShadowRoot): Added. Returns false by default.
1791 * html/HTMLInputElement.h:
1792 * html/HTMLKeygenElement.h:
1793 * html/HTMLMarqueeElement.h:
1794 * html/HTMLMediaElement.h:
1795 * html/HTMLMeterElement.h:
1796 * html/HTMLPlugInElement.h:
1797 * html/HTMLProgressElement.h:
1798 * html/HTMLSelectElement.h:
1799 * html/HTMLSummaryElement.h:
1800 * html/HTMLTextAreaElement.h:
1801 * html/shadow/InsertionPoint.h:
1802 (ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints):
1803 * rendering/RenderElement.cpp:
1804 (WebCore::RenderElement::selectionPseudoStyle):
1805 * rendering/RenderLayer.cpp:
1806 (WebCore::rendererForScrollbar):
1807 * svg/SVGElement.cpp:
1808 (WebCore::SVGElement::correspondingUseElement):
1809 * testing/Internals.cpp:
1810 (WebCore::Internals::shadowRootType):
1812 2015-09-15 Brent Fulgham <bfulgham@apple.com>
1814 [Win] Unreviewed release fix after r189832
1816 * platform/graphics/ca/win/PlatformCALayerWin.h: The implementation
1817 should exist in Release builds as well.
1819 2015-09-15 Benjamin Poulain <bpoulain@apple.com>
1821 Style invalidation affecting siblings does not work with inline-style changes
1822 https://bugs.webkit.org/show_bug.cgi?id=149189
1824 Reviewed by Antti Koivisto.
1826 Style::resolveTree() made the assumption that inline style changes only affect
1827 descendants and should not participate in "StyleRecalcAffectsNextSiblingElementStyle".
1828 That was wrong. If the inline style change through CSSOM, it can cause the creation
1829 of a style attribute, which is observable through "StyleRecalcAffectsNextSiblingElementStyle".
1831 This patch removes the incorrect assumption. Style invalidation is always propagated now.
1833 Tests: fast/css/style-attribute-invalidation-propagates-to-counted-siblings.html
1834 fast/css/style-attribute-invalidation-propagates-to-direct-siblings.html
1835 fast/css/style-attribute-invalidation-propagates-to-indirect-siblings.html
1837 * css/PropertySetCSSStyleDeclaration.cpp:
1838 (WebCore::InlineCSSStyleDeclaration::didMutate): Deleted.
1839 * dom/StyledElement.cpp:
1840 (WebCore::StyledElement::inlineStyleChanged):
1841 * dom/StyledElement.h:
1842 (WebCore::StyledElement::invalidateStyleAttribute):
1843 Clean up inline-style invalidation a tiny bit.
1845 * style/StyleResolveTree.cpp:
1846 (WebCore::Style::resolveTree):
1849 2015-09-15 Joseph Pecoraro <pecoraro@apple.com>
1851 Web Inspector: Paused Debugger prevents page reload
1852 https://bugs.webkit.org/show_bug.cgi?id=148174
1854 Reviewed by Brian Burg.
1856 When navigating the page while paused, suppress any pausing until the page
1857 has completed navigation. If not paused and navigating, you can still pause
1858 in pagehide and unload handlers or other late page events.
1860 Could not write a reliable test for this at the moment.
1861 InspectorTest.reloadPage has multiple issues with the output,
1862 so I'll investigate making reload tests more reliable later.
1864 * inspector/InspectorController.h:
1865 * inspector/InspectorController.cpp:
1866 (WebCore::InspectorController::resume): Deleted.
1867 * loader/FrameLoader.cpp:
1868 (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1869 We now use existing InspectorInstrumentation functions instead of a method
1870 on InspectorController during load. In dropping the method InspectorController
1871 can drop a member variable no longer used.
1873 * inspector/InspectorInstrumentation.h:
1874 (WebCore::InspectorInstrumentation::willStartProvisionalLoad):
1875 Add a new instrumentation hook.
1877 * inspector/InspectorInstrumentation.cpp:
1878 (WebCore::InspectorInstrumentation::willStartProvisionalLoadImpl):
1879 (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1880 When starting or completing main frame navigations, let the PageDebuggerAgent do some work.
1882 * inspector/PageDebuggerAgent.h:
1883 * inspector/PageDebuggerAgent.cpp:
1884 (WebCore::PageDebuggerAgent::mainFrameStartedLoading):
1885 (WebCore::PageDebuggerAgent::mainFrameStoppedLoading):
1886 (WebCore::PageDebuggerAgent::mainFrameNavigated):
1887 Suppress pausing if navigating while paused. Otherwise behave as normal.
1889 2015-09-15 Brent Fulgham <bfulgham@apple.com>
1891 [Win] Provide a means for viewing the layer tree
1892 https://bugs.webkit.org/show_bug.cgi?id=149165
1894 Reviewed by Simon Fraser.
1896 Revise the old fprintf logic to generate a string
1897 containing the layer tree so that it can be output
1898 to the debugger (or elsewhere).
1900 * platform/graphics/ca/PlatformCALayer.h: Rename 'printTree'
1901 to 'printLayerTree', and make it available in release builds.
1902 * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1903 (WebCore::CACFLayerTreeHost::printLayerTree): Added. Calls into
1904 the PlatformCALayer implementation.
1905 * platform/graphics/ca/win/CACFLayerTreeHost.h:
1906 * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1907 (printIndent): Revise to use two-space indent and use StringBuilder.
1908 (printTransform): Ditto.
1909 (printColor): Added helper function.
1910 (printLayer): Revised to output information on the layer contents.
1911 (PlatformCALayerWin::printLayerTree): Renamed from 'printTree'.
1912 (PlatformCALayerWin::printTree): Deleted.
1913 * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1914 (PlatformCALayerWinInternal::drawRepaintCounters): Drive-by fix. Match the
1915 cocoa repaint counter logic by not painting counters for the layers that
1916 contain the tile grid.
1917 * platform/graphics/ca/win/PlatformCALayerWin.h:
1918 * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1919 (PlatformCALayerWinInternal::drawRepaintCounters):
1921 2015-09-15 Myles C. Maxfield <mmaxfield@apple.com>
1923 REGRESSION(r155554): Nested isolates can cause an infinite loop when laying out bidi runs
1924 https://bugs.webkit.org/show_bug.cgi?id=149153
1926 Reviewed by David Hyatt.
1928 When traversing bidi runs, we might encounter a run which is supposed to be isolated. In this
1929 situation, we will append a placeholder run in the run list, and remember a pointer to these
1930 isolated runs inside BidiResolver. Then, once we're done traversing the bidi runs, we return
1931 to the isolated runs and handle them separately (and replace the placeholder with the result).
1933 However, due to the fact that our BidiRuns start at leaf nodes, we have to keep track of which
1934 local root of the render tree we were inspecting (to ensure that we visit the same node
1935 multiple times if there are nested isolate spans). We were not correctly keeping track of this
1936 local root, which was leading us to consider the same root multiple times, thereby leading to
1939 The solution is simply to keep root information alongside the isolated run information inside
1940 BidiResolver. However, BidiResolver is inside platform/, which means that this new type should
1941 be a template argument, just like how BidiRun itself is a template argument.
1943 This new type, BidiIsolatedRun, holds all the information that our isolate-revisiting logic
1944 needs inside constructBidiRunsForSegment(). It also holds a reference to the placeholder run
1945 which we will replace.
1947 Test: fast/text/international/unicode-bidi-isolate-nested-crash.html
1949 * platform/graphics/GraphicsContext.cpp:
1950 (WebCore::GraphicsContext::drawBidiText): BidiIsolatedRun template argument is unused, so pass
1952 * platform/text/BidiResolver.h: Add template argument.
1953 (WebCore::BidiResolver::isolatedRuns):
1954 (WebCore::IsolatedRun>::~BidiResolver):
1955 (WebCore::IsolatedRun>::appendRun):
1956 (WebCore::IsolatedRun>::embed):
1957 (WebCore::IsolatedRun>::checkDirectionInLowerRaiseEmbeddingLevel):
1958 (WebCore::IsolatedRun>::lowerExplicitEmbeddingLevel):
1959 (WebCore::IsolatedRun>::raiseExplicitEmbeddingLevel):
1960 (WebCore::IsolatedRun>::commitExplicitEmbedding):
1961 (WebCore::IsolatedRun>::updateStatusLastFromCurrentDirection):
1962 (WebCore::IsolatedRun>::reorderRunsFromLevels):
1963 (WebCore::IsolatedRun>::createBidiRunsForLine):
1964 (WebCore::IsolatedRun>::setMidpointForIsolatedRun): Use references instead of pointers.
1965 (WebCore::IsolatedRun>::midpointForIsolatedRun): Ditto.
1966 (WebCore::Run>::~BidiResolver): Deleted.
1967 (WebCore::Run>::appendRun): Deleted.
1968 (WebCore::Run>::embed): Deleted.
1969 (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
1970 (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
1971 (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
1972 (WebCore::Run>::commitExplicitEmbedding): Deleted.
1973 (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
1974 (WebCore::Run>::reorderRunsFromLevels): Deleted.
1975 (WebCore::Run>::createBidiRunsForLine): Deleted.
1976 (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
1977 (WebCore::Run>::midpointForIsolatedRun): Deleted.
1978 * rendering/InlineIterator.h:
1979 (WebCore::BidiIsolatedRun::BidiIsolatedRun): New type.
1980 (WebCore::addPlaceholderRunForIsolatedInline): Create new type, and include local root
1982 (WebCore::IsolateTracker::addFakeRunIfNecessary): Include local root information.
1983 (WebCore::InlineBidiResolver::appendRun): Ditto.
1984 * rendering/RenderBlockLineLayout.cpp: Update for new BidiIsolatedRun type.
1985 (WebCore::setUpResolverToResumeInIsolate):
1986 (WebCore::constructBidiRunsForSegment):
1987 * rendering/line/TrailingObjects.h:
1989 2015-09-15 Brady Eidson <beidson@apple.com>
1991 Add empty IDBFactory implementation for Modern IDB.
1992 https://bugs.webkit.org/show_bug.cgi?id=149191
1994 Reviewed by Jer Noble.
1996 No new tests (No behavior change).
1998 * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1999 (WebCore::DOMWindowIndexedDatabase::indexedDB):
2001 * Modules/indexeddb/client/IDBFactoryImpl.cpp:
2002 (WebCore::IDBClient::IDBFactory::create):
2003 (WebCore::IDBClient::IDBFactory::IDBFactory):
2004 (WebCore::IDBClient::IDBFactory::getDatabaseNames):
2005 (WebCore::IDBClient::IDBFactory::open):
2006 (WebCore::IDBClient::IDBFactory::deleteDatabase):
2007 (WebCore::IDBClient::IDBFactory::cmp):
2008 * Modules/indexeddb/client/IDBFactoryImpl.h:
2011 * WebCore.xcodeproj/project.pbxproj:
2013 * loader/EmptyClients.cpp:
2014 * page/DatabaseProvider.h:
2016 2015-09-15 Antti Koivisto <antti@apple.com>
2018 Split FontDescription into lower and higher level types
2019 https://bugs.webkit.org/show_bug.cgi?id=149036
2021 Reviewed by Darin Adler.
2023 Currently FontDescription is used through the text subsystem. However much of the data it
2024 carries is only needed by FontCascade and text layout but not by the lower level Font/FontCache
2025 layer. This makes code confusing. For example families specified in FontDescription are ignored
2028 Split it into a low level FontDescription and a high level FontCascadeDescription type:
2030 FontDescription <-> Font
2031 FontCascadeDescription <-> FontCascade
2033 The former only carries information that is needed to instantiate a Font or fetch it from the FontCache.
2034 The latter has additional data for CSS font cascade semantics and other higher level features.
2036 2015-09-15 Myles C. Maxfield <mmaxfield@apple.com>
2038 GraphicsContext::drawBidiText()'s BidiResolver should not have isolated runs
2039 https://bugs.webkit.org/show_bug.cgi?id=149193
2041 Reviewed by Anders Carlsson.
2043 There are two users of BidiResolver, one which needs isolated runs (in RenderBlockLineLayout) and
2044 one which doesn't (in GraphicsContext::drawBidiText()). Because of [1], the isolated runs vector
2045 is migrating to a new type outside of platform/. Therefore, only the first user of BidiResolver
2046 should have this member variable.
2048 This is achieved by creating two subclasses of BidiResolver, and using the Curiously Repeating
2049 Template pattern to downcast into specializations.
2051 [1] https://bugs.webkit.org/show_bug.cgi?id=149153
2053 No new tests because there is no behavior change.
2055 * platform/text/BidiResolver.h:
2056 (WebCore::BidiResolverBase::BidiResolverBase):
2057 (WebCore::BidiResolverBase::increment):
2058 (WebCore::BidiResolverBase::appendRun):
2059 (WebCore::BidiResolverBase::incrementInternal):
2060 (WebCore::IsolateRun>::~BidiResolverWithIsolate):
2061 (WebCore::Subclass>::appendRunInternal):
2062 (WebCore::Subclass>::embed):
2063 (WebCore::Subclass>::checkDirectionInLowerRaiseEmbeddingLevel):
2064 (WebCore::Subclass>::lowerExplicitEmbeddingLevel):
2065 (WebCore::Subclass>::raiseExplicitEmbeddingLevel):
2066 (WebCore::Subclass>::commitExplicitEmbedding):
2067 (WebCore::Subclass>::updateStatusLastFromCurrentDirection):
2068 (WebCore::Subclass>::reorderRunsFromLevels):
2069 (WebCore::Subclass>::createBidiRunsForLine):
2070 (WebCore::Subclass>::setMidpointForIsolatedRun):
2071 (WebCore::Subclass>::midpointForIsolatedRun):
2072 (WebCore::BidiResolver::BidiResolver): Deleted.
2073 (WebCore::BidiResolver::increment): Deleted.
2074 (WebCore::BidiResolver::isolatedRuns): Deleted.
2075 (WebCore::Run>::~BidiResolver): Deleted.
2076 (WebCore::Run>::appendRun): Deleted.
2077 (WebCore::Run>::embed): Deleted.
2078 (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
2079 (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
2080 (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
2081 (WebCore::Run>::commitExplicitEmbedding): Deleted.
2082 (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
2083 (WebCore::Run>::reorderRunsFromLevels): Deleted.
2084 (WebCore::Run>::createBidiRunsForLine): Deleted.
2085 (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
2086 (WebCore::Run>::midpointForIsolatedRun): Deleted.
2087 * rendering/InlineIterator.h:
2088 (WebCore::InlineBidiResolver::incrementInternal):
2089 (WebCore::InlineBidiResolver::appendRunInternal):
2090 (WebCore::InlineBidiResolver::increment): Deleted.
2091 (WebCore::InlineBidiResolver::appendRun): Deleted.
2092 * rendering/line/TrailingObjects.h:
2094 2015-09-15 Chris Dumez <cdumez@apple.com>
2096 new Event() without parameter should throw
2097 https://bugs.webkit.org/show_bug.cgi?id=149146
2098 <rdar://problem/22565070>
2100 Reviewed by Ryosuke Niwa.
2102 new Event() without parameter should throw because the type parameter
2103 is mandatory as per the specification:
2104 https://dom.spec.whatwg.org/#interface-event
2106 Both Firefox and Chrome throw in this case. However, WebKit was
2107 creating an event whose type is the string "undefined". This patch
2108 aligns our behavior with the specification and other major browsers.
2110 No new tests, already covered by existing test.
2112 * bindings/scripts/CodeGeneratorJS.pm:
2113 (GenerateConstructorDefinition):
2114 * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2115 (WebCore::JSTestEventConstructorConstructor::constructJSTestEventConstructor):
2117 2015-09-15 Carlos Alberto Lopez Perez <clopez@igalia.com>
2119 [GTK] Build failure with ACCELERATED_2D_CANVAS when cairo-gl has built with OpenGLESv2 support only.
2120 https://bugs.webkit.org/show_bug.cgi?id=149172
2122 Reviewed by Martin Robinson.
2124 No new tests, no behavior change.
2126 * platform/graphics/glx/GLContextGLX.cpp:
2127 (WebCore::GLContextGLX::cairoDevice):
2129 2015-09-15 Chris Dumez <cdumez@apple.com>
2131 Element.getAttributeNS() should return null if the attribute does not exist
2132 https://bugs.webkit.org/show_bug.cgi?id=149180
2133 <rdar://problem/22561011>
2135 Reviewed by Ryosuke Niwa.
2137 Element.getAttributeNS() should return null if the attribute does not
2138 exist, similarly to what Element.getAttribute() does:
2139 - https://dom.spec.whatwg.org/#element (both return a nullable DOMString).
2140 - https://dom.spec.whatwg.org/#dom-element-getattributens (step 2)
2142 Firefox and Chrome match the specification. However, WebKit was returning
2143 an empty string for getAttributeNS() and null for getAttribute(). This
2144 patch aligns WebKit's behavior with the specification and other browsers.
2146 No new tests, already covered by existing tests.
2150 2015-09-15 Ryosuke Niwa <rniwa@webkit.org>
2152 ContentDistribution should be only used for details elements
2153 https://bugs.webkit.org/show_bug.cgi?id=149148
2155 Reviewed by Antti Koivisto.
2157 Extracted ShadowRootWithInsertionPoints out of ShadowRoot for HTMLDetailsElement and HTMLSummaryElement.
2159 We don't add a separate .h and .cpp files since this is a temporary measure until we replace it with
2160 a slot-based shadow DOM implementation.
2162 No new tests. There should be no observable behavioral change.
2165 (WebCore::Element::addShadowRoot): Removed the call to didShadowBoundaryChange since this function is only
2166 called in ensureUserAgentShadowRoot. Also moved the call to didAddUserAgentShadowRoot for
2167 HTMLDetailsElement's shadow root which uses this function instead of ensureUserAgentShadowRoot.
2168 (WebCore::Element::removeShadowRoot): Removed the call to invalidateDistribution since it's only called by
2170 (WebCore::Element::createShadowRoot):
2171 (WebCore::Element::ensureUserAgentShadowRoot): Moved the call didAddUserAgentShadowRoot into addShadowRoot
2172 since HTMLDetailsElement uses a subclass of ShadowRoot.
2173 (WebCore::Element::childrenChanged):
2174 (WebCore::Element::removeAllEventListeners):
2177 (Element::addShadowRoot): Made this function a protected member as it's now used by HTMLDetailsElement.
2179 * dom/ShadowRoot.cpp:
2180 (WebCore::ShadowRoot::childrenChanged): Deleted.
2183 (WebCore::ShadowRoot::distributor): Made this a virtual function and return nullptr by default.
2184 (WebCore::ShadowRoot::isOrphan):
2186 * html/HTMLDetailsElement.cpp:
2187 (WebCore::HTMLDetailsElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
2189 * html/HTMLInputElement.cpp:
2190 (WebCore::HTMLInputElement::runPostTypeUpdateTasks): Removed the call to invalidateDistribution since it's
2191 only relevant for HTMLDetailsElement's shadow DOM.
2193 * html/HTMLSummaryElement.cpp:
2194 (WebCore::HTMLSummaryElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
2196 * html/shadow/ContentDistributor.cpp:
2197 (WebCore::ContentDistributor::distribute):
2198 (WebCore::ContentDistributor::ensureDistribution):
2199 (WebCore::ContentDistributor::invalidateDistribution):
2201 * html/shadow/InsertionPoint.cpp:
2202 (WebCore::InsertionPoint::childrenChanged):
2203 (WebCore::InsertionPoint::insertedInto):
2204 (WebCore::InsertionPoint::removedFrom):
2205 (WebCore::findInsertionPointOf):
2206 (WebCore::ShadowRootWithInsertionPoints::childrenChanged): Moved from ShadowRoot.
2208 * html/shadow/InsertionPoint.h:
2209 (WebCore::ShadowRootWithInsertionPoints::create): Added.
2210 (WebCore::ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints): Added.
2212 2015-09-15 Brent Fulgham <bfulgham@apple.com>
2214 [Win] Tiled drawing is rendering more times than it should
2215 https://bugs.webkit.org/show_bug.cgi?id=149144
2216 <rdar://problem/22313905>
2218 Reviewed by Simon Fraser.
2220 Provide a more faithful implemenation of the Objective C tiled drawing logic.
2221 (1) Create a new WebTiledBackingLayerWin class that represents a the
2222 container of tiles. This matches the Objective C design.
2223 (2) Move implementation of several methods (e.g., isOpaque) to the internal
2224 class implementation so that the Tile Drawing logic can perform special
2225 handling in these cases.
2226 (3) Remove the duplicated Tiled Drawing logic from PlatformCALayerWinInternal,
2227 since it was just duplicating code in TileController and TileGrid.
2228 (4) Clean up the display callback code to avoid performing incorrect flipping
2229 of the coordinate system.
2231 * PlatformAppleWin.cmake: Add new WebTiledBackingLayerWin file.
2232 * WebCore.vcxproj/WebCore.vcxproj: Add the new WebTiledBackingLayerWin files.
2233 * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2234 * platform/graphics/ca/PlatformCALayer.cpp:
2235 (PlatformCALayer::flipContext): Added convenience method.
2236 (PlatformCALayer::drawRepaintIndicator): Ditto.
2237 * platform/graphics/ca/TileGrid.cpp:
2238 (TileGrid::platformCALayerPaintContents): Flip the context before drawing the repaint
2239 indicator on Windows.
2240 * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2241 (PlatformCALayerWin::PlatformCALayerWin): Create a WebTiledBackingLayerWin
2242 object if using tiled drawing.
2243 (PlatformCALayerWin::~PlatformCALayerWin):
2244 (PlatformCALayerWin::isOpaque): Move implementation to internal class.
2245 (PlatformCALayerWin::setOpaque): Ditto.
2246 (PlatformCALayerWin::setBorderWidth): Ditto.
2247 (PlatformCALayerWin::setBorderColor): Ditto.
2248 (PlatformCALayerWin::contentsScale): Ditto.
2249 (PlatformCALayerWin::setContentsScale): Ditto.
2250 (PlatformCALayerWin::cornerRadius): Ditto.
2251 (PlatformCALayerWin::tiledBacking): Ditto.
2252 (PlatformCALayerWin::drawTextAtPoint): New helper method to draw repaint counter
2253 text. Needed to work around bug in CG.
2254 * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2255 (PlatformCALayerWinInternal::PlatformCALayerWinInternal): Remove tiling-logic
2256 related member variables.
2257 (PlatformCALayerWinInternal::~PlatformCALayerWinInternal):
2258 (shouldInvertBeforeDrawingContent): Added convenience method.
2259 (shouldInvertBeforeDrawingRepaintCounters): Ditto.
2260 (PlatformCALayerWinInternal::displayCallback):
2261 (PlatformCALayerWinInternal::drawRepaintCounters): Helper method to
2262 share code between the two layer classes.
2263 (PlatformCALayerWinInternal::internalSetNeedsDisplay): use nullptr.
2264 (PlatformCALayerWinInternal::setNeedsDisplay): Ditto.
2265 (PlatformCALayerWinInternal::setNeedsDisplayInRect): Move tiled code
2266 to WebTiledBackingLayerWin and simplify the remaing code.
2267 (PlatformCALayerWinInternal::setSublayers): Remove tile code.
2268 (PlatformCALayerWinInternal::getSublayers): Ditto.
2269 (PlatformCALayerWinInternal::removeAllSublayers): Ditto.
2270 (PlatformCALayerWinInternal::insertSublayer): Ditto.
2271 (PlatformCALayerWinInternal::sublayerCount): Ditto.
2272 (PlatformCALayerWinInternal::indexOfSublayer): Ditto.
2273 (PlatformCALayerWinInternal::sublayerAtIndex): Ditto.
2274 (PlatformCALayerWinInternal::setBounds): Ditto.
2275 (PlatformCALayerWinInternal::setFrame): Ditto.
2276 (PlatformCALayerWinInternal::isOpaque): Ditto.
2277 (PlatformCALayerWinInternal::setOpaque): Ditto.
2278 (PlatformCALayerWinInternal::contentsScale): Ditto.
2279 (PlatformCALayerWinInternal::setContentsScale): Ditto.
2280 (PlatformCALayerWinInternal::setBorderWidth): Ditto.
2281 (PlatformCALayerWinInternal::setBorderColor): Ditto.
2282 (layerTypeIsTiled): Deleted.
2283 (PlatformCALayerWinInternal::constrainedSize): Deleted.
2284 (PlatformCALayerWinInternal::tileDisplayCallback): Deleted.
2285 (PlatformCALayerWinInternal::addTile): Deleted.
2286 (PlatformCALayerWinInternal::removeTile): Deleted.
2287 (PlatformCALayerWinInternal::tileAtIndex): Deleted.
2288 (PlatformCALayerWinInternal::tileCount): Deleted.
2289 (PlatformCALayerWinInternal::updateTiles): Deleted.
2290 (PlatformCALayerWinInternal::drawTile): Deleted.
2291 (PlatformCALayerWinInternal::createTileController): Deleted.
2292 (PlatformCALayerWinInternal::tiledBacking): Deleted.
2293 * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
2294 (WebCore::PlatformCALayerWinInternal::owner):
2295 * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp: Added.
2296 (WebTiledBackingLayerWin::WebTiledBackingLayerWin):
2297 (WebTiledBackingLayerWin::~WebTiledBackingLayerWin):
2298 (DisplayOnMainThreadContext::DisplayOnMainThreadContext):
2299 (redispatchOnMainQueue):
2300 (WebTiledBackingLayerWin::displayCallback):
2301 (WebTiledBackingLayerWin::setNeedsDisplay):
2302 (WebTiledBackingLayerWin::setNeedsDisplayInRect):
2303 (WebTiledBackingLayerWin::setBounds):
2304 (WebTiledBackingLayerWin::isOpaque):
2305 (WebTiledBackingLayerWin::setOpaque):
2306 (WebTiledBackingLayerWin::contentsScale):
2307 (WebTiledBackingLayerWin::setContentsScale):
2308 (WebTiledBackingLayerWin::setBorderWidth):
2309 (WebTiledBackingLayerWin::setBorderColor):
2310 (WebTiledBackingLayerWin::createTileController):
2311 (WebTiledBackingLayerWin::tiledBacking):
2312 (WebTiledBackingLayerWin::invalidate):
2313 * platform/graphics/ca/win/WebTiledBackingLayerWin.h: Added.
2315 2015-09-14 David Hyatt <hyatt@apple.com>
2317 [New Block-Inside-Inline Model] Implement margin collapsing across contiguous anonymous inline blocks.
2318 https://bugs.webkit.org/show_bug.cgi?id=149132
2320 Reviewed by Zalan Bujtas.
2322 Added new tests inside fast/block/inside-inlines/
2324 * rendering/InlineFlowBox.cpp:
2325 (WebCore::InlineFlowBox::anonymousInlineBlock):
2326 Change this accessor to be more robust and be willing to both recur (in case we ever do decide intermediate line boxes should exist)
2327 and to type check. This is not currently needed, but I'm just being paranoid and future proof.
2329 (WebCore::InlineFlowBox::addToLine):
2330 Again, for thoroughness, I am making sure to propagate the hasAnonymousInlineBlock() bit through to parents. This is only needed
2331 if we build intermediate line boxes for lines with anonymous inline blocks.
2333 (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
2334 Anonymous inline blocks receive a layout via layoutBlockChild, in order to make sure that margin collapsing runs. This means
2335 that unlike other line objects, the position of the child has been determined already. Therefore we simply set the position
2336 of the line box that wraps the anonymous inline block to the already-computed position for that block.
2338 Also patch the code that sets lineTop and lineBottom using the root box's dimensions. We don't really care about the root line
2339 box on anonymous inline block lines and just want to set lineTop and lineBottom to fit the anonymous inline block.
2341 * rendering/RenderBlockFlow.cpp:
2342 (WebCore::RenderBlockFlow::collapseMargins):
2343 (WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
2344 Refactor collapseMargins to call a helper function that can pass in a previous "sibling", and that can handle the child
2345 being null. We do this to perform a margin collapse when anonymous inline blocks run up against regular lines (which is like
2346 collapsing with a sibling block "child").
2348 * rendering/RenderBlockFlow.h:
2349 Tweak the MarginInfo constructor to take a const RenderBlockFlow. Tweak some line layout methods to pass in the LineLayoutState
2350 so that MarginInfo is available during line layout.
2352 * rendering/RenderBlockLineLayout.cpp:
2353 (WebCore::RenderBlockFlow::createLineBoxes):
2354 When we create a new line box, if it is not an anonymous inline block line and our previous line was, simulate a margin
2355 collapse in order to possibly push the line box down or up. Re-use the pagination adjustment code to rewind line layout
2356 and perform it again if pushed below a float.
2358 (WebCore::constructBidiRunsForSegment):
2359 (WebCore::RenderBlockFlow::layoutRunsAndFloats):
2360 (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
2361 (WebCore::RenderBlockFlow::layoutLineBoxes):
2362 (WebCore::RenderBlockFlow::determineStartPosition):
2363 (WebCore::RenderBlockFlow::matchedEndLine):
2364 (WebCore::RenderBlockFlow::updateRegionForLine):
2365 (WebCore::RenderBlockFlow::marginCollapseLinesFromStart):
2366 Patch line layout to run margin collapsing when anonymous inline blocks are encountered. This involves making sure
2367 margin info and float bottom positions are passed through so that layoutBlockChild can be properly called on
2368 anonymous inline blocks that we encounter.
2370 In addition line layout when it syncs dirty lines has to run margin collapsing on earlier lines in order to make
2371 sure margin info is properly set up at the first dirty line position.
2373 Note that there will be more improvements/changes in this area (dirty line syncing), as the current model is inefficient
2374 when many anonymous inline blocks are scattered throughout a large-scale line box tree.
2376 * rendering/RootInlineBox.cpp:
2377 (WebCore::RootInlineBox::alignBoxesInBlockDirection):
2378 (WebCore::RootInlineBox::ascentAndDescentForBox):
2379 Make sure to rely on the block layout code for the placement of the boxes themselves. Set up the line box code to not have
2380 an effect on ascent/descent.
2382 * rendering/line/BreakingContext.h:
2383 (WebCore::BreakingContext::BreakingContext):
2384 (WebCore::BreakingContext::handleReplaced):
2385 When we encounter an anonymous inline block, lay it out when it is seen. We have to delay the layout, since we have
2386 to be able to perform it mid-line-layout when the containing block's logical height is at the correct value and all previous
2387 lines are placed. Margin info also has to be current.
2389 * rendering/line/LineBreaker.cpp:
2390 * rendering/line/LineBreaker.h:
2391 Patched to pass LineLayoutState through so that the stuff we need to perform block layout is available (margin info and float vars).
2393 * rendering/line/LineLayoutState.h:
2394 Add the block layout margin and float bottom information to the line layout state so that we have it available when performing
2395 layouts and margin collapses on anonymous inline block children.
2397 2015-09-15 Brady Eidson <beidson@apple.com>
2399 Make the IDBAny::Type enum into an enum class.
2400 https://bugs.webkit.org/show_bug.cgi?id=149169.
2402 Reviewed by Oliver Hunt.
2404 No new tests (Cleanup, no behavior change).
2406 * Modules/indexeddb/IDBAny.h:
2407 * Modules/indexeddb/legacy/LegacyAny.cpp:
2408 (WebCore::LegacyAny::createInvalid):
2409 (WebCore::LegacyAny::createNull):
2410 (WebCore::LegacyAny::LegacyAny):
2411 (WebCore::LegacyAny::domStringList):
2412 (WebCore::LegacyAny::idbCursor):
2413 (WebCore::LegacyAny::idbCursorWithValue):
2414 (WebCore::LegacyAny::idbDatabase):
2415 (WebCore::LegacyAny::idbFactory):
2416 (WebCore::LegacyAny::idbIndex):
2417 (WebCore::LegacyAny::idbObjectStore):
2418 (WebCore::LegacyAny::idbTransaction):
2419 (WebCore::LegacyAny::scriptValue):
2420 (WebCore::LegacyAny::string):
2421 (WebCore::LegacyAny::integer):
2422 (WebCore::LegacyAny::legacyCursor):
2423 (WebCore::LegacyAny::legacyCursorWithValue):
2424 (WebCore::LegacyAny::legacyDatabase):
2425 (WebCore::LegacyAny::legacyFactory):
2426 (WebCore::LegacyAny::legacyIndex):
2427 (WebCore::LegacyAny::legacyObjectStore):
2428 (WebCore::LegacyAny::legacyTransaction):
2429 * Modules/indexeddb/legacy/LegacyCursor.cpp:
2430 (WebCore::LegacyCursor::LegacyCursor):
2431 (WebCore::LegacyCursor::effectiveObjectStore):
2432 * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
2433 * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp:
2434 (WebCore::LegacyOpenDBRequest::dispatchEvent):
2435 * Modules/indexeddb/legacy/LegacyRequest.cpp:
2436 (WebCore::LegacyRequest::getResultCursor):
2437 (WebCore::effectiveObjectStore):
2438 * bindings/js/JSIDBAnyCustom.cpp:
2440 * inspector/InspectorIndexedDBAgent.cpp:
2441 * page/DatabaseProvider.h:
2443 2015-09-15 Brady Eidson <beidson@apple.com>
2445 Move most IDB object encoding/decoding from WebKit2 to WebCore.
2446 https://bugs.webkit.org/show_bug.cgi?id=149152
2448 Reviewed by Alex Christensen.
2450 No new tests (Cleanup, no behavior change).
2452 * Modules/indexeddb/IDBDatabaseMetadata.h:
2453 (WebCore::IDBDatabaseMetadata::encode):
2454 (WebCore::IDBDatabaseMetadata::decode):
2455 * Modules/indexeddb/IDBIndexMetadata.h:
2456 (WebCore::IDBIndexMetadata::encode):
2457 (WebCore::IDBIndexMetadata::decode):
2458 * Modules/indexeddb/IDBKeyData.h:
2459 (WebCore::IDBKeyData::encode):
2460 (WebCore::IDBKeyData::decode):
2461 * Modules/indexeddb/IDBKeyPath.h:
2462 (WebCore::IDBKeyPath::encode):
2463 (WebCore::IDBKeyPath::decode):
2464 * Modules/indexeddb/IDBKeyRangeData.h:
2465 (WebCore::IDBKeyRangeData::encode):
2466 (WebCore::IDBKeyRangeData::decode):
2467 * Modules/indexeddb/IDBObjectStoreMetadata.h:
2468 (WebCore::IDBObjectStoreMetadata::encode):
2469 (WebCore::IDBObjectStoreMetadata::decode):
2471 2015-09-14 Brady Eidson <beidson@apple.com>
2473 Make the enum IDBKey::Type into a utility enum class.
2474 https://bugs.webkit.org/show_bug.cgi?id=149149
2476 Reviewed by Alex Christensen.
2478 No new tests (Cleanup, no behavior change).
2480 * Modules/indexeddb/IDBKey.cpp:
2481 (WebCore::IDBKey::isValid):
2482 (WebCore::IDBKey::compare):
2483 * Modules/indexeddb/IDBKey.h:
2484 (WebCore::IDBKey::createNumber):
2485 (WebCore::IDBKey::createDate):
2486 (WebCore::IDBKey::createMultiEntryArray):
2487 (WebCore::IDBKey::createArray):
2488 (WebCore::IDBKey::type):
2489 (WebCore::IDBKey::array):
2490 (WebCore::IDBKey::string):
2491 (WebCore::IDBKey::date):
2492 (WebCore::IDBKey::number):
2493 (WebCore::IDBKey::compareTypes):
2494 (WebCore::IDBKey::IDBKey):
2495 * Modules/indexeddb/IDBKeyData.cpp:
2496 (WebCore::IDBKeyData::IDBKeyData):
2497 (WebCore::IDBKeyData::maybeCreateIDBKey):
2498 (WebCore::IDBKeyData::isolatedCopy):
2499 (WebCore::IDBKeyData::encode):
2500 (WebCore::IDBKeyData::decode):
2501 (WebCore::IDBKeyData::compare):
2502 (WebCore::IDBKeyData::loggingString):
2503 (WebCore::IDBKeyData::setArrayValue):
2504 (WebCore::IDBKeyData::setStringValue):
2505 (WebCore::IDBKeyData::setDateValue):
2506 (WebCore::IDBKeyData::setNumberValue):
2507 * Modules/indexeddb/IDBKeyData.h:
2508 (WebCore::IDBKeyData::IDBKeyData):
2509 (WebCore::IDBKeyData::minimum):
2510 (WebCore::IDBKeyData::maximum):
2511 * Modules/indexeddb/IndexedDB.h:
2512 * bindings/js/IDBBindingUtilities.cpp:
2513 (WebCore::idbKeyToJSValue):
2514 (WebCore::createIDBKeyFromValue):
2515 (WebCore::createIDBKeyFromScriptValueAndKeyPath):
2516 (WebCore::generateIndexKeysForValue):
2517 * inspector/InspectorIndexedDBAgent.cpp:
2519 2015-09-15 Javier Fernandez <jfernandez@igalia.com>
2521 [CSS Grid Layout] Using {row, column}-axis terms in alignment related logic
2522 https://bugs.webkit.org/show_bug.cgi?id=148942
2524 Reviewed by Sergio Villar Senin.
2526 This patch changes the names of several functions and variables
2527 defined to implement the alignment logic. We want to use from now
2528 on the terms row-axis and column-axis when referring to the
2529 alignment direction the logic is applied to.
2531 No new tests, no new functionality.
2533 * rendering/RenderGrid.cpp:
2534 (WebCore::RenderGrid::columnAxisOffsetForChild):
2535 (WebCore::RenderGrid::rowAxisOffsetForChild):
2536 (WebCore::RenderGrid::findChildLogicalPosition):
2537 * rendering/RenderGrid.h:
2539 2015-09-14 Gyuyoung Kim <gyuyoung.kim@webkit.org>
2541 Remove all uses of PassRefPtr in WebCore/xml
2542 https://bugs.webkit.org/show_bug.cgi?id=149114
2544 Reviewed by Darin Adler.
2546 * dom/DecodedDataDocumentParser.h:
2547 * dom/DocumentParser.h:
2548 * dom/RawDataDocumentParser.h:
2549 * html/FTPDirectoryDocument.cpp:
2550 (WebCore::FTPDirectoryDocumentParser::append):
2551 * html/parser/HTMLDocumentParser.cpp:
2552 (WebCore::HTMLDocumentParser::append):
2553 * html/parser/HTMLDocumentParser.h:
2554 * html/parser/TextDocumentParser.cpp:
2555 (WebCore::TextDocumentParser::append):
2556 * html/parser/TextDocumentParser.h:
2557 * xml/NativeXPathNSResolver.cpp:
2558 (WebCore::NativeXPathNSResolver::NativeXPathNSResolver):
2559 * xml/NativeXPathNSResolver.h:
2560 (WebCore::NativeXPathNSResolver::create):
2561 * xml/XMLErrors.cpp:
2562 (WebCore::createXHTMLParserErrorHeader):
2563 * xml/XMLHttpRequestProgressEventThrottle.cpp:
2564 (WebCore::XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent):
2565 (WebCore::XMLHttpRequestProgressEventThrottle::dispatchEvent):
2566 (WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents):
2567 * xml/XMLHttpRequestProgressEventThrottle.h:
2568 * xml/XMLSerializer.h:
2569 * xml/XPathEvaluator.cpp:
2570 (WebCore::XPathEvaluator::createExpression):
2571 (WebCore::XPathEvaluator::createNSResolver):
2572 (WebCore::XPathEvaluator::evaluate):
2573 * xml/XPathEvaluator.h:
2574 * xml/XPathNodeSet.h: Fix style errors.
2575 (WebCore::XPath::NodeSet::NodeSet):
2576 (WebCore::XPath::NodeSet::append):
2577 * xml/XPathPath.cpp:
2578 (WebCore::XPath::Filter::evaluate):
2579 (WebCore::XPath::LocationPath::evaluate):
2580 * xml/XPathValue.h: ditto.
2581 (WebCore::XPath::Value::Value):
2582 (WebCore::XPath::Value::Data::create):
2583 (WebCore::XPath::Value::Data::Data):
2584 * xml/XSLTProcessor.cpp:
2585 (WebCore::XSLTProcessor::transformToDocument):
2586 (WebCore::XSLTProcessor::transformToFragment):
2587 * xml/XSLTProcessor.h:
2588 (WebCore::XSLTProcessor::setXSLStyleSheet):
2589 (WebCore::XSLTProcessor::importStylesheet):
2590 * xml/parser/XMLDocumentParser.cpp:
2591 (WebCore::XMLDocumentParser::append):
2592 * xml/parser/XMLDocumentParser.h:
2594 2015-09-14 Dewei Zhu <dewei_zhu@apple.com>
2596 Polish code for r189579.
2597 https://bugs.webkit.org/show_bug.cgi?id=149131
2599 Reviewed by Chris Dumez.
2601 Use more self-explaining function name "characterSetWithUTF8Fallback" instead of
2602 "characterSetForBindings". Optimize the way to get text encoding.
2605 (WebCore::Document::characterSetWithUTF8Fallback):
2606 (WebCore::Document::encoding): Deleted.
2607 (WebCore::Document::characterSetForBindings): Deleted.
2609 (WebCore::Document::encoding):
2610 (WebCore::Document::textEncoding):
2612 * loader/DocumentWriter.cpp:
2613 (WebCore::DocumentWriter::createDecoderIfNeeded):
2614 * loader/FormSubmission.cpp:
2615 (WebCore::encodingFromAcceptCharset):
2617 2015-09-14 Chris Dumez <cdumez@apple.com>
2619 Drop non-standard [IsIndex] WebKit IDL extended attribute
2620 https://bugs.webkit.org/show_bug.cgi?id=149122
2621 <rdar://problem/22547139>
2623 Reviewed by Darin Adler.
2625 Drop non-standard [IsIndex] WebKit IDL extended attribute. This attribute
2626 causes us to throw an IndexSizeError if the input value is negative. Web
2627 IDL supports no such thing. Instead Web IDL supports:
2628 1. Default behavior: the input value wraps around if it does not fit.
2629 2. [EnforceRange]: A TypeError is thrown if the input value does not fit [1].
2630 3. [Clamp]: The input value will be clamped if it does not fit [2].
2632 Our bindings generator supports all three. We don't need the non-standard
2635 We previously used [IsIndex] in places where we're supposed to wrap around
2636 as per Web IDL. Therefore, we threw for negative values but other browsers
2637 don't. For e.g., CharacterData.substringData(offset, -1) is supposed to
2638 return the substring from offset to the end of the string. It does so in
2639 Firefox and Chrome. However, WebKit was throwing an Exception.
2641 This change impacts the CharacterData and the SVGTextContentElement
2642 API. The compatibility risk is low because we were throwing an exception
2643 for negative values and we now wrap the value around instead, as other
2646 No new tests, already covered by existing tests.
2648 [1] https://heycam.github.io/webidl/#EnforceRange
2649 [2] https://heycam.github.io/webidl/#Clamp
2651 * bindings/scripts/CodeGeneratorJS.pm:
2652 (GenerateParametersCheck): Deleted.
2653 * bindings/scripts/IDLAttributes.txt:
2654 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2655 (WebCore::jsTestEventTargetPrototypeFunctionItem):
2656 * bindings/scripts/test/TestEventTarget.idl:
2657 * dom/CharacterData.cpp:
2658 (WebCore::CharacterData::deleteData):
2659 (WebCore::CharacterData::replaceData):
2660 * dom/CharacterData.idl:
2661 * dom/ClientRectList.idl:
2662 * svg/SVGTextContentElement.cpp:
2663 (WebCore::SVGTextContentElement::getSubStringLength):
2664 (WebCore::SVGTextContentElement::selectSubString):
2665 * svg/SVGTextContentElement.idl:
2667 2015-09-14 Chris Dumez <cdumez@apple.com>
2669 Document.createNodeIterator(null) / Document.createTreeWalker(null) should throw a TypeError
2670 https://bugs.webkit.org/show_bug.cgi?id=149126
2671 <rdar://problem/22564891>
2673 Reviewed by Ryosuke Niwa.
2675 Document.createNodeIterator(null) / Document.createTreeWalker(null)
2676 should throw a TypeError:
2677 https://dom.spec.whatwg.org/#interface-document
2679 This is because the parameter is not nullable and Web IDL says we
2680 should throw a TypeError in this case.
2682 Firefox and Chrome throw an exception in this case. This patch
2683 aligns our behavior with the specification and other major browsers.
2685 No new tests, already covered by existing W3C test.
2688 (WebCore::Document::createNodeIterator):
2689 (WebCore::Document::createTreeWalker):
2692 * dom/NodeIterator.cpp:
2693 (WebCore::NodeIterator::NodeIterator):
2694 * dom/NodeIterator.h:
2695 (WebCore::NodeIterator::create):
2696 * dom/Traversal.cpp:
2697 (WebCore::NodeIteratorBase::NodeIteratorBase):
2699 * dom/TreeWalker.cpp:
2700 (WebCore::TreeWalker::TreeWalker):
2702 (WebCore::TreeWalker::create):
2704 2015-09-14 Alex Christensen <achristensen@webkit.org>
2706 Fix Windows clean build after r189746
2708 * WebCore.vcxproj/copyForwardingHeaders.cmd:
2709 Copy headers from new legacy directory.
2711 2015-09-14 Chris Dumez <cdumez@apple.com>
2713 window.HTMLDetailsElement should exist
2714 https://bugs.webkit.org/show_bug.cgi?id=149139
2716 Reviewed by Ryosuke Niwa.
2718 window.HTMLDetailsElement should exist:
2719 https://html.spec.whatwg.org/multipage/forms.html#the-details-element
2721 Drop the [NoInterfaceObject] IDL extended attribute in WebKit to
2722 address the problem.
2724 No new tests, already covered by existing tests.
2726 * html/HTMLDetailsElement.idl:
2728 2015-09-14 Alex Christensen <achristensen@webkit.org>
2730 Fix AppleWin CMake build
2731 https://bugs.webkit.org/show_bug.cgi?id=149137
2733 Reviewed by Brent Fulgham.
2735 * PlatformAppleWin.cmake:
2736 Spell Inband correctly.
2737 * css/makegrammar.pl:
2738 Add quotes so bison can be in a directory with spaces in it.
2740 2015-09-14 Alex Christensen <achristensen@webkit.org>
2742 [Win] Unreviewed build fix after r189746
2744 * WebCore.vcxproj/WebCoreIncludeCommon.props:
2745 Include new legacy directory.
2747 2015-09-14 Alex Christensen <achristensen@webkit.org>
2749 Progress towards CMake on Mac.
2750 https://bugs.webkit.org/show_bug.cgi?id=149123
2752 Reviewed by Chris Dumez.
2755 Added some more files.
2756 * PlatformMac.cmake:
2757 Added more files and listed the strange ObjC bindings.
2758 * contentextensions/DFACombiner.cpp:
2759 * contentextensions/DFACombiner.h:
2760 Added preprocessor protection.
2761 * platform/FileSystem.h:
2762 Include utility. It's needed to compile the different configurations.
2763 * platform/ScrollAnimator.cpp:
2764 ScrollAnimator is an abstract class on Mac. Don't compile it.
2765 * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2766 FontAntialiasingStateSaver.h is only used on iOS.
2767 * rendering/RenderThemeMac.mm:
2768 config.h needs to be outside the #if !PLATFORM(IOS) to compile correctly without precompiled headers.
2770 2015-09-14 Brady Eidson <beidson@apple.com>
2772 Rename current concrete IDB implementation to "Legacy".
2773 https://bugs.webkit.org/show_bug.cgi?id=149118
2775 Reviewed by Alex Christensen.
2777 No new tests (No change in behavior).
2779 This patch makes IDL bindings abstract.
2780 It then renames the current concrete implementations of the bindings from "IDB" to "Legacy".
2781 Finally it moves those files and their support classes to a "legacy" subfolder.
2784 * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
2785 * Modules/indexeddb/IDBAny.cpp:
2786 * Modules/indexeddb/IDBAny.h:
2787 * Modules/indexeddb/IDBCursor.cpp:
2788 * Modules/indexeddb/IDBCursor.h:
2789 * Modules/indexeddb/IDBCursor.idl:
2790 * Modules/indexeddb/IDBCursorWithValue.cpp:
2791 * Modules/indexeddb/IDBCursorWithValue.h:
2792 * Modules/indexeddb/IDBCursorWithValue.idl:
2793 * Modules/indexeddb/IDBDatabase.cpp:
2794 * Modules/indexeddb/IDBDatabase.h:
2795 * Modules/indexeddb/IDBDatabase.idl:
2796 * Modules/indexeddb/IDBFactory.cpp:
2797 * Modules/indexeddb/IDBFactory.h:
2798 * Modules/indexeddb/IDBFactory.idl:
2799 * Modules/indexeddb/IDBIndex.cpp:
2800 * Modules/indexeddb/IDBIndex.h:
2801 * Modules/indexeddb/IDBIndex.idl:
2802 * Modules/indexeddb/IDBObjectStore.cpp:
2803 * Modules/indexeddb/IDBObjectStore.h:
2804 * Modules/indexeddb/IDBObjectStore.idl:
2805 * Modules/indexeddb/IDBOpenDBRequest.cpp:
2806 * Modules/indexeddb/IDBOpenDBRequest.h:
2807 * Modules/indexeddb/IDBOpenDBRequest.idl:
2808 * Modules/indexeddb/IDBRequest.cpp:
2809 * Modules/indexeddb/IDBRequest.h:
2810 * Modules/indexeddb/IDBRequest.idl:
2811 * Modules/indexeddb/IDBTransaction.cpp:
2812 * Modules/indexeddb/IDBTransaction.h:
2813 * Modules/indexeddb/IDBTransaction.idl:
2814 * Modules/indexeddb/IDBVersionChangeEvent.cpp:
2815 * Modules/indexeddb/IDBVersionChangeEvent.h:
2816 * Modules/indexeddb/legacy/IDBCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCallbacks.h.
2817 * Modules/indexeddb/legacy/IDBCursorBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp.
2818 * Modules/indexeddb/legacy/IDBCursorBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.h.
2819 * Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp.
2820 * Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.h.
2821 * Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp.
2822 * Modules/indexeddb/legacy/IDBDatabaseBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h.
2823 * Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
2824 * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp.
2825 * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h.
2826 * Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Renamed from Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h.
2827 * Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingDeleteCall.h.
2828 * Modules/indexeddb/legacy/IDBPendingOpenCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingOpenCall.h.
2829 * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp.
2830 * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.h.
2831 * Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp.
2832 * Modules/indexeddb/legacy/IDBTransactionBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.h.
2833 * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp.
2834 * Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h.
2835 * Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp.
2836 * Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h.
2837 * Modules/indexeddb/legacy/LegacyAny.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBAny.cpp.
2838 * Modules/indexeddb/legacy/LegacyAny.h: Added.
2839 * Modules/indexeddb/legacy/LegacyCursor.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.cpp.
2840 * Modules/indexeddb/legacy/LegacyCursor.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.h.
2841 * Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp.
2842 * Modules/indexeddb/legacy/LegacyCursorWithValue.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h.
2843 * Modules/indexeddb/legacy/LegacyDatabase.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.cpp.
2844 * Modules/indexeddb/legacy/LegacyDatabase.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.h.
2845 * Modules/indexeddb/legacy/LegacyFactory.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.cpp.
2846 * Modules/indexeddb/legacy/LegacyFactory.h: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.h.
2847 * Modules/indexeddb/legacy/LegacyIndex.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBIndex.cpp.
2848 * Modules/indexeddb/legacy/LegacyIndex.h: Added.
2849 * Modules/indexeddb/legacy/LegacyObjectStore.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp.
2850 * Modules/indexeddb/legacy/LegacyObjectStore.h: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.h.
2851 * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp.
2852 * Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h.
2853 * Modules/indexeddb/legacy/LegacyRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.cpp.
2854 * Modules/indexeddb/legacy/LegacyRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.h.
2855 * Modules/indexeddb/legacy/LegacyTransaction.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.cpp.
2856 * Modules/indexeddb/legacy/LegacyTransaction.h: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.h.
2857 * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp.
2858 * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h.
2859 * WebCore.xcodeproj/project.pbxproj:
2860 * WebCore.vcxproj/WebCore.vcxproj:
2862 2015-09-14 Gyuyoung Kim <gyuyoung.kim@webkit.org>
2864 [EFL] Remove create() factory function in EvasGLContext and EvasGLSurface
2865 https://bugs.webkit.org/show_bug.cgi?id=149110
2867 Reviewed by Csaba Osztrogonác.
2869 It is not good implementation we support both create() factory function and public constructor.
2870 In EvasGLContext and EvasGLSurface cases, those have supported both. However create() factory is only
2871 used by EwkView. Thus let's remove the create() function, then EwkView creates EvasGLContext using
2872 std::make_unique<> directly.
2874 * platform/graphics/efl/EvasGLContext.h:
2875 (WebCore::EvasGLContext::create): Deleted.
2876 * platform/graphics/efl/EvasGLSurface.h:
2877 (WebCore::EvasGLSurface::create): Deleted.
2879 2015-09-09 Sergio Villar Senin <svillar@igalia.com>
2881 min-width/height should default to auto for grid items
2882 https://bugs.webkit.org/show_bug.cgi?id=146021
2884 Reviewed by Darin Adler.
2886 Based on Blink's r194408, r194863 and r194887 by <rego@igalia.com>.
2888 From the spec (http://dev.w3.org/csswg/css-grid/#grid-items):
2889 "The auto value of min-width and min-height behaves on grid
2890 items in the relevant axis analogously to its behavior on flex
2891 items in the main axis."
2893 From now on the default value for min-width and min-height for
2894 grid items is auto, meaning that in general, grid items won't
2895 shrink bellow their content.
2897 The change is not exactly the same as the one in Blink because
2898 this one takes into account vertical writting modes, something
2899 that was not well handled in the original one.
2901 Tests: fast/css-grid-layout/min-width-height-auto-overflow.html
2902 fast/css-grid-layout/min-width-height-auto.html
2904 * rendering/RenderBox.cpp:
2905 (WebCore::RenderBox::computeLogicalWidthInRegion):
2906 (WebCore::RenderBox::computeLogicalHeight):
2908 2015-09-14 Manuel Rego Casasnovas <rego@igalia.com>
2910 [css-grid] Percentage columns should remove scrollbar's width
2911 https://bugs.webkit.org/show_bug.cgi?id=149116
2913 Reviewed by Sergio Villar Senin.
2915 Currently the calculation of percentage columns was not subtracting the
2917 Fixed RenderGrid::computeUsedBreadthOfSpecifiedLength()
2918 to avoid this problem.
2920 Test: fast/css-grid-layout/grid-percent-track-scrollbar.html
2922 * rendering/RenderGrid.cpp:
2923 (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2925 2015-09-13 Chris Dumez <cdumez@apple.com>
2927 Improve Node pre-insertion validation when the parent is a Document
2928 https://bugs.webkit.org/show_bug.cgi?id=149109
2929 <rdar://problem/22560436>
2931 Reviewed by Ryosuke Niwa.
2933 Improve Node pre-insertion validation when the parent is a Document to
2934 match the specification:
2935 https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
2936 https://dom.spec.whatwg.org/#concept-node-replace
2938 This affects the following API: Node.insertBefore(), Node.appendChild(),
2939 Node.replaceChild().
2941 WebKit current fails to do the following checks whenever the parent is a
2942 Document from pre-insertion validation:
2943 1. If the inserted Node is a DocumentFragment, we should make sure it
2944 contains only one Element.
2945 -> This is because a Document can have only one child that is an
2947 2.a. If an Element is inserted, we should make sure it is not inserted
2948 before a DocumentType.
2949 2.b. If a DocumentType is inserted, we should make sure it is not
2950 inserted after an Element.
2951 -> This is because the DocType must come before the optional Element
2954 Firefox and Chrome already match the specification here. This patch
2955 aligns WebKit's behavior with those browsers and the specification.
2957 [1] https://dom.spec.whatwg.org/#node-trees
2959 No new tests, already covered by existing W3C tests.
2961 * dom/ContainerNode.cpp:
2962 (WebCore::checkAcceptChild):
2963 (WebCore::checkAddChild):
2964 (WebCore::checkReplaceChild):
2965 (WebCore::ContainerNode::insertBefore):
2966 (WebCore::ContainerNode::appendChild):
2967 (WebCore::containsConsideringHostElements): Deleted.
2968 (WebCore::checkAcceptChildGuaranteedNodeTypes): Deleted.
2970 (WebCore::Document::canAcceptChild):
2971 (WebCore::Document::cloneNodeInternal): Deleted.
2974 2015-09-13 Chris Dumez <cdumez@apple.com>
2976 Document.adoptNode() should be able to explicitly adopt a DocumentType node
2977 https://bugs.webkit.org/show_bug.cgi?id=149097
2978 <rdar://problem/22549345>
2980 Reviewed by Ryosuke Niwa.
2982 Document.adoptNode() should be able to explicitly adopt a DocumentType
2983 node as per the latest DOM specification:
2984 https://dom.spec.whatwg.org/#dom-document-adoptnode
2986 Chrome and Firefox match the specidicaiton but WebKit was throwing a
2989 No new tests, already covered by existing test.
2992 (WebCore::Document::adoptNode): Deleted.
2994 2015-09-13 Chris Dumez <cdumez@apple.com>
2996 Document.title does not behave according to specification
2997 https://bugs.webkit.org/show_bug.cgi?id=149098
2999 Reviewed by Ryosuke Niwa.
3001 Update Document.title to behave according to the latest DOM specification:
3002 https://html.spec.whatwg.org/multipage/dom.html#document.title
3004 In particular, the following Web-Exposed changes were made:
3005 1. The title Element should be the first title element in the document
3006 (in tree order) [1]. Previously, WebKit would use the first title
3007 Element *added* to the Document. Document.title returns the text
3008 content of the title Element so this change is web-exposed.
3009 2. If the title Element is replaced after the title has been set by the
3010 JS (via the document.title setter), we should update the value
3011 returned by the document.title getter. Previously, WebKit would set
3012 a flag if the title was explicitly set by JS via document.title
3013 setter and later title element changes would not override the title
3014 set by the JS. This behavior isn't specified and does not match the
3015 behavior of other browsers.
3017 The new behavior is also consistent with the behavior of Firefox and
3020 Some refactoring was made for the sake of clarity now that our
3021 implementation has changed. See details below.
3023 [1] https://html.spec.whatwg.org/multipage/dom.html#the-title-element-2
3025 No new tests, already covered by existing tests.
3028 (WebCore::Document::updateTitleFromTitleElement):
3029 New convenience method that calls updateTitle() with the text of the
3030 document's current title Element. If there is no title Element, it
3033 (WebCore::Document::updateTitleElement):
3034 Method which updates the Document's title Element whenever a title
3035 Element is added or removed from the Document. Once the title Element
3036 is updated, it takes care of calling updateTitleFromTitleElement() to
3037 update the Document's title.
3039 (WebCore::Document::titleElementAdded):
3040 (WebCore::Document::titleElementRemoved):
3041 (WebCore::Document::titleElementTextChanged):
3042 New Document public API called by HTMLTitleElement / SVGTitleElement
3043 whenever a title Element is added / removed from the Document or
3044 whenever the title element's text has changed. These methods will
3045 take care of calling updateTitleElement() / updateTitleFromTitleElement()
3047 Previously, we would only have 2 methods:
3048 - setTitleElement() which would be called whenever a title Element was
3049 added to the document or when its text had changed. The name was
3050 confusing because it would not necessarily set the document's title
3051 Element and it would be used both for title element update and a
3052 simple title update. This method has been split into 2:
3053 titleElementAdded() and titleElementTextChanged().
3054 - removeTitle() which would be called whenever a title Element was
3055 removed. The naming was confusing because it would not necessarily
3056 remove the Document's title Element. This is now called
3057 titleElementRemoved().
3059 * html/HTMLTitleElement.cpp:
3060 (WebCore::HTMLTitleElement::insertedInto):
3061 Call the new titleElementAdded() instead of setTitleElement().
3063 (WebCore::HTMLTitleElement::removedFrom):
3064 Call the new titleElementRemoved() instead of removeTitle().
3066 (WebCore::HTMLTitleElement::childrenChanged):
3067 Call the new titleElementTextChanged() instead of
3068 setTitleElement() / removeTitle() as we don't really want
3069 to remove or add a title Element. We merely want to notify
3070 the document that the title element text has changed in
3071 case it is the current title Element of the Document.
3073 (WebCore::HTMLTitleElement::computedTextWithDirection):
3074 Rename textWithDirection() to computedTextWithDirection() to
3075 make it clear it is not a simple getter and make it private
3076 as it is only used to set the m_title member which caches the
3079 * html/HTMLTitleElement.h:
3080 Add new textWithDirection() getter which returns m_title. This
3081 is needed so that Document can query the title of the Element.
3082 Previously, HTMLTitleElement would pass directly m_title to
3083 the Document when calling Document::setTitleElement().
3085 * svg/SVGTitleElement.cpp:
3086 (WebCore::SVGTitleElement::insertedInto):
3087 Call the new titleElementAdded() instead of setTitleElement().
3089 (WebCore::SVGTitleElement::removedFrom):
3090 Call the new titleElementRemoved() instead of removeTitle().
3092 (WebCore::SVGTitleElement::childrenChanged):
3093 Call the new titleElementTextChanged() instead of
3096 2015-09-13 Chris Dumez <cdumez@apple.com>
3098 document.lastModified should use the user's local time zone
3099 https://bugs.webkit.org/show_bug.cgi?id=149092
3100 <rdar://problem/22567705>
3102 Reviewed by Ryosuke Niwa.
3104 document.lastModified should use the user's local time zone:
3105 https://html.spec.whatwg.org/multipage/dom.html#dom-document-lastmodified
3107 Chrome and Firefox comply with the specification but WebKit was using
3108 UTC. This patch aligns WebKit's behavior with the specification and
3111 No new tests, already covered by existing tests.
3114 (WebCore::Document::lastModified):
3115 (WebCore::Document::setCookieURL): Deleted.
3117 2015-09-13 Chris Dumez <cdumez@apple.com>
3119 Node.baseURI should not return null for detached nodes
3120 https://bugs.webkit.org/show_bug.cgi?id=149104
3121 <rdar://problem/22559535>
3123 Reviewed by Sam Weinig.
3125 Node.baseURI should not return null for detached nodes. It should return
3126 the node document's base URL. The node document is set when the node is
3127 created so it is valid even if the node is detached [1]:
3128 https://dom.spec.whatwg.org/#dom-node-baseuri
3130 WebKit was traversing the ancestors to find the base URL, which only
3131 works if the node is attached. Also, WebKit was taking into account
3132 the xml:base attribute when computing the baseURI.
3134 Both Chrome and Firefox already dropped support for xml:base:
3135 https://code.google.com/p/chromium/issues/detail?id=341854
3136 https://bugzilla.mozilla.org/show_bug.cgi?id=903372
3138 Firefox complies with the specification. Chrome's baseURI still only
3139 works for attached Nodes as their implementation still traverses the
3140 DOM tree, despite dropping support for xml:base.
3142 This patch drops support xml:base when computing Node.baseURI, as
3143 Firefox, Chrome and the latest DOM specification do. It also makes
3144 Node.baseURI work for detached Nodes by returning the base URL of the
3145 node Document. This means we no longer have to traverse the Node's
3146 ancestors in the DOM tree. This is consistent with the behavior of
3147 Firefox and the latest DOM specification.
3149 This patch does not drop the SVGElement.xmlbase attribute yet. However,
3150 we should probably consider making this change as well given that:
3151 - The SVG2 specification dropped it
3152 - Chrome dropped it.
3153 - It no longers impacts Node.baseURI
3155 [1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=20976
3157 No new tests, already covered by existing test.
3160 (WebCore::Document::setContent): Deleted.
3162 (WebCore::Document::inputCursor): Deleted.
3163 * dom/DocumentType.cpp:
3164 (WebCore::DocumentType::nodeName): Deleted.
3165 * dom/DocumentType.h:
3167 (WebCore::Element::imageSourceURL): Deleted.
3168 (WebCore::Element::rendererIsNeeded): Deleted.
3169 (WebCore::Element::createElementRenderer): Deleted.
3170 (WebCore::Element::insertedInto): Deleted.
3173 (WebCore::Node::baseURI):
3175 * svg/SVGElement.idl:
3177 2015-09-13 Chris Dumez <cdumez@apple.com>
3179 CharacterData API parameters should not be optional
3180 https://bugs.webkit.org/show_bug.cgi?id=149101
3181 <rdar://problem/22546954>
3183 Reviewed by Sam Weinig.
3185 CharacterData API parameters should not be optional as per the DOM
3187 https://dom.spec.whatwg.org/#characterdata
3189 The parameters are also mandatory in Firefox and Chrome. However,
3190 those parameters are optional in WebKit. When DOMString parameters
3191 were omitted, we would use the "undefined" string instead. When
3192 unsigned long parameters were omitted, we would use 0 instead.
3193 This patch aligns our behavior with the specification and other
3196 No new tests, already covered by existing tests.
3198 * dom/CharacterData.cpp:
3199 (WebCore::CharacterData::appendData):
3200 * dom/CharacterData.h:
3201 * dom/CharacterData.idl:
3203 (WebCore::Element::mergeWithNextTextNode):
3205 (WebCore::Node::normalize):
3206 * xml/parser/XMLDocumentParser.cpp:
3207 (WebCore::XMLDocumentParser::exitText):
3209 2015-09-13 Gyuyoung Kim <gyuyoung.kim@webkit.org>
3211 Remove all uses of PassRefPtr in crypto, storage, and history
3212 https://bugs.webkit.org/show_bug.cgi?id=149091
3214 Reviewed by Andreas Kling.
3216 * crypto/CryptoKeyPair.cpp:
3217 (WebCore::CryptoKeyPair::CryptoKeyPair):
3218 * crypto/CryptoKeyPair.h:
3219 (WebCore::CryptoKeyPair::create):
3220 * crypto/SubtleCrypto.h:
3221 (WebCore::SubtleCrypto::create):
3222 * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
3223 (WebCore::CryptoKeyRSA::create):
3224 * crypto/keys/CryptoKeyAES.cpp:
3225 (WebCore::CryptoKeyAES::generate):
3226 * crypto/keys/CryptoKeyAES.h:
3227 * crypto/keys/CryptoKeyHMAC.cpp:
3228 (WebCore::CryptoKeyHMAC::generate):
3229 * crypto/keys/CryptoKeyHMAC.h:
3230 * crypto/keys/CryptoKeyRSA.h:
3231 * crypto/mac/CryptoKeyRSAMac.cpp:
3232 (WebCore::CryptoKeyRSA::create):
3233 * history/BackForwardController.cpp:
3234 (WebCore::BackForwardController::BackForwardController):
3235 * history/BackForwardController.h:
3236 * history/HistoryItem.cpp:
3237 (WebCore::HistoryItem::setStateObject):
3238 (WebCore::HistoryItem::setFormData):
3239 * history/HistoryItem.h:
3240 (WebCore::HistoryItem::stateObject):
3241 * loader/EmptyClients.cpp:
3243 (WebCore::Page::Page):
3244 * storage/Storage.cpp:
3245 (WebCore::Storage::create):
3246 (WebCore::Storage::Storage):
3247 * storage/Storage.h:
3248 * storage/StorageArea.h:
3249 * storage/StorageMap.cpp:
3250 (WebCore::StorageMap::copy):
3251 (WebCore::StorageMap::setItem):
3252 (WebCore::StorageMap::setItemIgnoringQuota):
3253 (WebCore::StorageMap::removeItem):
3254 * storage/StorageMap.h:
3255 * storage/StorageNamespace.h:
3257 2015-09-12 Chris Dumez <cdumez@apple.com>
3259 window.EventTarget should exist
3260 https://bugs.webkit.org/show_bug.cgi?id=149085
3261 <rdar://problem/22546774>
3263 Reviewed by Sam Weinig.
3265 Drop [NoInterfaceObject] for the EventTarget interface to match Chrome,
3266 Firefox and the specification:
3267 https://dom.spec.whatwg.org/#interface-eventtarget
3269 No new tests, already covered by existing tests.
3271 * dom/EventTarget.idl:
3273 2015-09-12 Brian Burg <bburg@apple.com>
3275 Web Inspector: disambiguate inspected/frontend controllers and pages in backend code
3276 https://bugs.webkit.org/show_bug.cgi?id=149071
3278 Reviewed by Joseph Pecoraro.
3280 Be consistent about prefixing pages, inspector controllers, and window controllers
3281 with either "frontend" or "inspected", as appropriate. This change makes obvious some bugs
3282 in the frontend connection code, which are tracked by https://webkit.org/b/149006.
3284 No new tests, no behavior change.
3287 * inspector/InspectorClient.h:
3288 * inspector/InspectorController.cpp:
3289 (WebCore::InspectorController::inspectedPageDestroyed):
3290 (WebCore::InspectorController::show):
3291 (WebCore::InspectorController::close):
3292 * inspector/InspectorFrontendClientLocal.cpp:
3293 (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
3294 (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
3295 (WebCore::InspectorFrontendClientLocal::canAttachWindow):
3296 (WebCore::InspectorFrontendClientLocal::changeAttachedWindowHeight):
3297 (WebCore::InspectorFrontendClientLocal::changeAttachedWindowWidth):
3298 (WebCore::InspectorFrontendClientLocal::openInNewTab):
3299 (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight):
3300 (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
3301 (WebCore::InspectorFrontendClientLocal::isUnderTest):
3302 * inspector/InspectorFrontendClientLocal.h:
3303 * inspector/InspectorOverlay.cpp:
3304 (WebCore::InspectorOverlay::freePage):
3305 * loader/EmptyClients.h:
3307 2015-09-12 Chris Dumez <cdumez@apple.com>
3309 ChildNode.replaceWith() without argument should replace the node with an empty DocumentFragment
3310 https://bugs.webkit.org/show_bug.cgi?id=149073
3311 <rdar://problem/22547801>
3313 Reviewed by Ryosuke Niwa.
3315 ChildNode.replaceWith() without argument should replace the node with
3316 an empty DocumentFragment, as per the specification:
3317 https://dom.spec.whatwg.org/#dom-childnode-replacewith
3318 https://dom.spec.whatwg.org/#converting-nodes-into-a-node
3320 Previously, WebKit did not do anything in this case. This patch fixes
3323 No new tests, already covered by existing test.
3326 (WebCore::Node::replaceWith):
3328 2015-09-12 Gyuyoung Kim <gyuyoung.kim@webkit.org>
3330 Remove all uses of PassRefPtr in WebCore/plugins
3331 https://bugs.webkit.org/show_bug.cgi?id=149055
3333 Reviewed by Darin Adler.
3335 * plugins/DOMMimeType.cpp:
3336 (WebCore::DOMMimeType::DOMMimeType):
3337 (WebCore::DOMMimeType::enabledPlugin):
3338 * plugins/DOMMimeType.h:
3339 (WebCore::DOMMimeType::create):
3340 * plugins/DOMMimeTypeArray.cpp:
3341 (WebCore::DOMMimeTypeArray::item):
3342 * plugins/DOMMimeTypeArray.h:
3343 * plugins/DOMPlugin.cpp:
3344 (WebCore::DOMPlugin::item):
3345 * plugins/DOMPlugin.h:
3346 * plugins/DOMPluginArray.cpp:
3347 (WebCore::DOMPluginArray::item):
3348 * plugins/DOMPluginArray.h:
3349 * plugins/PluginViewBase.h:
3350 (WebCore::PluginViewBase::bindingInstance):
3352 2015-09-12 Gyuyoung Kim <gyuyoung.kim@webkit.org>
3354 Remove all uses of PassRefPtr in WebCore/accessibility and WebCore/fileapi
3355 https://bugs.webkit.org/show_bug.cgi?id=149059
3357 Reviewed by Darin Adler.
3359 * accessibility/AXObjectCache.cpp:
3360 * accessibility/AccessibilityObject.cpp:
3361 (WebCore::rangeClosestToRange):
3362 (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
3363 (WebCore::AccessibilityObject::selectionRange):
3364 (WebCore::AccessibilityObject::selectText):
3365 * accessibility/AccessibilityObject.h:
3366 * accessibility/ios/AXObjectCacheIOS.mm:
3367 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3368 (-[WebAccessibilityObjectWrapper _convertToDOMRange:]):
3369 (-[WebAccessibilityObjectWrapper textMarkerForPosition:]):
3370 * accessibility/mac/AXObjectCacheMac.mm:
3371 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3372 (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
3373 * fileapi/FileList.h:
3374 (WebCore::FileList::append):
3375 * fileapi/WebKitBlobBuilder.cpp:
3376 (WebCore::BlobBuilder::append):
3377 * fileapi/WebKitBlobBuilder.h:
3379 2015-09-11 Said Abou-Hallawa <sabouhallawa@apple.com>
3381 SVGColor custom text format is different from the CSS color custom text format
3382 https://bugs.webkit.org/show_bug.cgi?id=148879
3384 Reviewed by Daniel Bates.
3386 Implement the serialization of a CSS color value as it is described in
3387 <https://drafts.csswg.org/cssom/#serializing-css-values>. Add the new
3388 function Color::cssText() which is refactored from the existing function
3389 Color::serialized(). Use the new function for serializing the SVGColor
3390 always and also for Color but only when the alpha component is not 1.
3392 Test: svg/css/computed-style-rgb-color.html
3394 * css/CSSPrimitiveValue.cpp:
3395 (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Move the code
3396 for serializing the color from this function to Color::cssText().
3398 * platform/graphics/Color.cpp:
3399 (WebCore::Color::serialized): Call Color::cssText() if the alpha component
3400 is not 1 and delete the repeated code. <