1 2015-09-18 Chris Dumez <cdumez@apple.com>
3 classList.toggle(name, force) treats undefined `force` argument as false
4 https://bugs.webkit.org/show_bug.cgi?id=148582
5 <rdar://problem/22545600>
7 Reviewed by Ryosuke Niwa.
9 classList.toggle(name, force) treats undefined `force` argument as false.
10 However, according to the Web IDL specification, we should treat undefined
11 as if the value was missing for optional parameters that do not have a
13 https://heycam.github.io/webidl/#dfn-overload-resolution-algorithm (Step 14.4).
15 For optional parameters that have a default value, undefined should be
16 converted into the default value. This is supported as of r189957.
18 In this patch, we use custom bindings to provide a spec-compliant version
19 of DOMTokenList.toggle(). Unfortunately, adding such support in the
20 bindings generator would be a non-trivial task (I guess, we would have to
21 generalize using WTF::Optional<> type for all optional parameters in our
22 implementation. Also we cannot use the default value support added in
23 r189957 because the toggle() implementation needs to be able to
24 distinguish all 3 states for the 'force' parameter: true, false or
27 The new behavior matches the behavior of Firefox and the specification.
29 Test: fast/dom/Element/class-list-toggle.html
32 * WebCore.vcxproj/WebCore.vcxproj:
33 * WebCore.vcxproj/WebCore.vcxproj.filters:
34 * WebCore.xcodeproj/project.pbxproj:
35 * bindings/js/JSBindingsAllInOne.cpp:
36 * bindings/js/JSDOMTokenListCustom.cpp: Added.
37 (WebCore::JSDOMTokenList::toggle):
38 * html/DOMTokenList.h:
39 * html/DOMTokenList.idl:
41 2015-09-17 Joseph Pecoraro <pecoraro@apple.com>
43 Web Inspector: Remove unused canClearBrowserCookies / canClearBrowserCache protocol methods
44 https://bugs.webkit.org/show_bug.cgi?id=149307
46 Reviewed by Brian Burg.
48 * inspector/InspectorClient.h:
49 (WebCore::InspectorClient::canClearBrowserCache): Deleted.
50 (WebCore::InspectorClient::clearBrowserCache): Deleted.
51 (WebCore::InspectorClient::canClearBrowserCookies): Deleted.
52 (WebCore::InspectorClient::clearBrowserCookies): Deleted.
53 These were unimplemented by any ports.
55 * inspector/CommandLineAPIHost.cpp:
56 * inspector/InspectorController.cpp:
57 (WebCore::InspectorController::InspectorController):
58 * inspector/InspectorResourceAgent.cpp:
59 (WebCore::InspectorResourceAgent::InspectorResourceAgent):
60 (WebCore::InspectorResourceAgent::canClearBrowserCache): Deleted.
61 (WebCore::InspectorResourceAgent::clearBrowserCache): Deleted.
62 (WebCore::InspectorResourceAgent::canClearBrowserCookies): Deleted.
63 (WebCore::InspectorResourceAgent::clearBrowserCookies): Deleted.
64 * inspector/InspectorResourceAgent.h:
65 * inspector/InspectorTimelineAgent.cpp:
66 (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
67 * inspector/InspectorTimelineAgent.h:
68 * inspector/WorkerInspectorController.cpp:
69 (WebCore::WorkerInspectorController::WorkerInspectorController):
70 Remove uses of InspectorClient where it is no longer needed.
72 2015-09-16 Ryosuke Niwa <rniwa@webkit.org>
74 Update features.json for Shadow DOM and Web Components
75 https://bugs.webkit.org/show_bug.cgi?id=149249
77 Reviewed by Antti Koivisto.
79 Updated the status of Shadow DOM and made myself the point of contact for shadow DOM and web components.
83 2015-09-17 Chris Dumez <cdumez@apple.com>
85 [WebIDL] Add support for default parameter values
86 https://bugs.webkit.org/show_bug.cgi?id=149263
87 <rdar://problem/22545600>
89 Reviewed by Ryosuke Niwa.
91 Add support for default parameter values to our Web IDL parser and JS
92 bindings generator. This allows the bindings to convert undefined to
93 the parameter's default value for optional parameters:
94 https://heycam.github.io/webidl/#dfn-optional-argument-default-value
96 Previously, our bindings generator would just convert undefined to
97 0 / false / "undefined" for optional parameters, depending on the
100 This patch uses the new default parameter support to fix a bug in
101 document.createNodeIterator() / document.createTreeWalker()'s handling
102 of the whatToShow parameter:
103 https://dom.spec.whatwg.org/#document
105 WebKit currently was undefined to 0 in this case, even though it should
106 use the parameter's default value: OxFFFFFFFF.
108 I am planning to go through other optional parameters in a follow-up
109 patch and add default values where needed.
111 No new tests, already covered by existing layout tests and
112 added bindings tests coverage.
114 * bindings/scripts/CodeGeneratorJS.pm:
115 (GenerateParametersCheck):
116 * bindings/scripts/IDLParser.pm:
117 (parseOptionalOrRequiredArgument):
118 * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
119 (webkit_dom_test_obj_method_with_optional_arg_and_default_value):
120 (webkit_dom_test_obj_method_with_optional_string_and_default_value):
121 * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
122 * bindings/scripts/test/JS/JSTestObj.cpp:
123 (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
124 (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
125 * bindings/scripts/test/ObjC/DOMTestObj.h:
126 * bindings/scripts/test/ObjC/DOMTestObj.mm:
127 (-[DOMTestObj methodWithOptionalArgAndDefaultValue:]):
128 (-[DOMTestObj methodWithOptionalStringAndDefaultValue:]):
129 * bindings/scripts/test/TestObj.idl:
132 2015-09-17 Dean Jackson <dino@apple.com>
134 Multi-hop reference cycles not detected.
135 https://bugs.webkit.org/show_bug.cgi?id=149181
137 Reviewed by Jon Honeycutt.
139 SVG's cycle detection was not picking up a
140 case where an element was drawing a pattern, that
141 referenced another pattern, that referenced another
142 pattern, that referenced the original pattern.
144 The issue was that we were forgetting to check the
145 children of the renderer itself, rather than just
146 the children of the referenced renderers.
148 Found by running a test from Blink.
150 I also took the opportunity to clean up the debugging
151 code that logs cycle detection.
153 Test: svg/custom/pattern-3-step-cycle.html
155 * platform/Logging.h: Add a new SVG channel. I can't believe we
156 didn't already have one!
157 * rendering/svg/SVGResourcesCycleSolver.cpp:
158 (WebCore::SVGResourcesCycleSolver::resourceContainsCycles): Check the referenced
159 resources for cycles.
160 (WebCore::SVGResourcesCycleSolver::resolveCycles): Logging update.
162 2015-09-17 Dean Jackson <dino@apple.com>
164 Cyclic resources were not detected if the reference had deep containers
165 https://bugs.webkit.org/show_bug.cgi?id=149182
167 Reviewed by Jon Honeycutt.
169 During our examination of the SVG rendering tree looking for cycles,
170 if a resource pointed to something that had a nested structure, and
171 one of the parent nodes in that structure was a container object
172 without resources itself, we were not looking into the children.
174 Test: svg/custom/pattern-content-cycle-w-resourceless-container.html
176 * rendering/svg/SVGResourcesCycleSolver.cpp:
177 (WebCore::SVGResourcesCycleSolver::resourceContainsCycles): We should still
178 check all children resources, but not exit early if there are none. Instead
179 we should recurse into any children.
180 (WebCore::SVGResourcesCycleSolver::resolveCycles): Changes to some debug
181 code that no longer compiled (it's still off by default, but at least
184 2015-09-17 Myles C. Maxfield <mmaxfield@apple.com>
186 REGRESSION(r188871): 50% regression in page load time of Wikipedia home page
187 https://bugs.webkit.org/show_bug.cgi?id=149320
189 Reviewed by Daniel Bates.
191 This is due to <rdar://problem/22144016> about how language-specific
192 font fallback is an order of magnitude slower than regular non-language-
193 specific font-fallback. This performance problem has been fixed, but not
196 No new tests because there is no correctness change.
198 * platform/graphics/ios/FontCacheIOS.mm:
199 (WebCore::platformLookupFallbackFont):
201 2015-09-17 Ryosuke Niwa <rniwa@webkit.org>
203 Add HTMLSlotElement, Element.slot, and NonDocumentTypeChildNode.assignedSlot
204 https://bugs.webkit.org/show_bug.cgi?id=149241
206 Reviewed by Antti Koivisto.
208 Implement the slotting algorithm and related features: slot element, slot attribute, and assignedSlot
209 as specified by https://w3c.github.io/webcomponents/spec/shadow/#slotting-algorithm
210 as of 8bf56e8ea5521a7a911efd1cabeb2be0d5c3ca74.
212 The slotting algorithm is implemented by the newly introduced SlotAssignment class which is created on
213 demand by ShadowRoot when a HTMLSlotElement is inserted into the shadow root. SlotAssignment contains
214 a HashMap of a slot name to SlotInfo structure, which holds the number of slot elements of the said name,
215 the first element if it's known, and an ordered list of the assigned nodes.
217 When there is exactly one slot element of a given name, "element" returns the slot element in O(1).
218 When another slot of the same name is inserted into the same shadow tree, we increment "elementCount" and
219 set "element" to nullptr since we don't know which slot element comes first in the tree order without O(n)
220 tree traversal, which is lazily done in resolveAllSlotElements.
222 Observe that SlotInfo's "element" can be nullptr in two occasions: (1) when there is no slot element of
223 the given name (SlotAssignment::assignSlots may insert such an entry), and (2) when there are more than
224 one slot elements of the same name and we haven't run resolveAllSlotElements.
226 Resolving assigned nodes, on the other hand, is always O(n) unless all assignments are up to date, and
227 lazily computed by assignSlots. This is because inserting or removing a node doesn't tell us the relative
228 ordering of the node with respect to other nodes assigned to the same slot. For example, let's say we have
229 child nodes (A, B, C, D) and (A, D) are assigned to slot Alpha and (B, C) are assigned to slot Beta. If we
230 insert a new node E between nodes B and C and this node is assigned to slot Alpha, then we must create an
231 ordered list (A, E, D) for slot Alpha. Unfortunately, determining where to insert E in this list can cost
232 O(n) child traversal in the worst case.
234 Tests: fast/shadow-dom/HTMLSlotElement-interface.html
235 fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html
238 * DerivedSources.cpp:
239 * DerivedSources.make:
240 * WebCore.vcxproj/WebCore.vcxproj:
241 * WebCore.vcxproj/WebCore.vcxproj.filters:
242 * WebCore.xcodeproj/project.pbxproj:
244 (WebCore::Element::attributeChanged): Invalidate the slot assignments when slot attribute is changed.
245 (WebCore::Element::childrenChanged): Ditto for when a child node is inserted or removed. We can avoid it
246 when there is no default slot and only text nodes are removed or added in the future.
247 * dom/Element.idl: Added slot attribute on Element.
249 (WebCore::Node::assignedSlot): Added. Returns the assigned slot if the slot is in an open shadow tree.
251 * dom/NonDocumentTypeChildNode.idl: Added assignedSlot. Only expose in JS for now to avoid generating
252 the binding code for HTMLSlotElement in other languages.
253 * dom/ShadowRoot.cpp:
254 (WebCore::ShadowRoot::findAssignedSlot): Added. Forwards it to the implementation in SlotAssignment.
255 (WebCore::ShadowRoot::addSlotElementByName): Ditto.
256 (WebCore::ShadowRoot::removeSlotElementByName): Ditto.
257 (WebCore::ShadowRoot::invalidateSlotAssignments): Ditto.
258 (WebCore::ShadowRoot::assignedNodesForSlot): Ditto.
260 (WebCore::ShadowRoot): Added m_slotAssignments as a member.
261 * dom/SlotAssignment.cpp: Added.
262 (WebCore::treatNullAsEmpty): Added. See https://w3c.github.io/webcomponents/spec/shadow/#dfn-default-slot
263 (WebCore::SlotAssignment::findAssignedSlot): Find the slot element to which a given node is assigned.
264 Since there could be multiple slot elements of the same name (or lack thereof), call findFirstSlotElement
265 to find the first slot element.
266 (WebCore::SlotAssignment::addSlotElementByName): Added. Called when a new slot element is inserted into
267 the associated shadow tree. When a slot element's name is changed, removeSlotElementByName is called on
268 with the old name before addSlotElementByName is called with the new name.
269 (WebCore::SlotAssignment::removeSlotElementByName): Ditto for removal.
270 (WebCore::SlotAssignment::assignedNodesForSlot): Added. Finds the ordered list of assigned nodes for
271 a given slot element. When there are multiple slot elements of the same name, we return the list only if
272 SlotInfo::element matches the argument.
273 (WebCore::SlotAssignment::findFirstSlotElement): Added. Resolves SlotInfo::element if needed.
274 (WebCore::SlotAssignment::resolveAllSlotElements): Finds SlotInfo::element for all slots. We resolve all
275 slots simultaneously to avoid doing O(number of nodes) tree traversal for O(number of slots) to avoid
276 the worst case O(n^2) behavior when all nodes in the shadow tree are slot elements of the same name.
277 (WebCore::SlotAssignment::assignSlots): Added. Computes the slot assignments by traversing each child
278 of the shadow host and adding to the appropriate SlotInfo::assignedNodes, creating a new entry if needed.
279 * dom/SlotAssignment.h: Added.
280 (WebCore::SlotAssignment::SlotAssignment):
281 (WebCore::SlotAssignment::invalidate):
282 (WebCore::SlotAssignment::SlotInfo::SlotInfo):
283 (WebCore::SlotAssignment::SlotInfo::hasSlotElements):
284 (WebCore::SlotAssignment::SlotInfo::hasDuplicatedSlotElements):
285 (WebCore::SlotAssignment::SlotInfo::shouldResolveSlotElement):
286 * html/HTMLAttributeNames.in: Added slot attribute.
287 * html/HTMLSlotElement.cpp: Added.
288 (WebCore::HTMLSlotElement::create):
289 (WebCore::HTMLSlotElement::HTMLSlotElement):
290 (WebCore::HTMLSlotElement::insertedInto): Calls addSlotElementByName.
291 (WebCore::HTMLSlotElement::removedFrom): Calls removeSlotElementByName. Because the element had already
292 been removed from the shadow tree, we can't use containingShadowRoot() to find the ShadowRoot here.
293 (WebCore::HTMLSlotElement::attributeChanged): Calls removeSlotElementByName and addSlotElementByName.
294 (WebCore::HTMLSlotElement::getDistributedNodes): Returns an ordered list of the assigned nodes.
295 * html/HTMLSlotElement.h: Added.
296 * html/HTMLSlotElement.idl: Added.
297 * html/HTMLTagNames.in: Added slot element.
299 2015-09-17 Chris Dumez <cdumez@apple.com>
301 Regression(r189881): release assertion hit in toJS(ExecState*, JSDOMGlobalObject*, DocumentFragment*)
302 https://bugs.webkit.org/show_bug.cgi?id=149281
304 Reviewed by Ryosuke Niwa.
306 After r189881, we started generating a toJS() function for DocumentFragment
307 as an optimization. DocumentFragment has a subclass (ShadowRoot) but the
308 default toJS() implementation should have still been acceptable given that
309 the subclass is not web-exposed and therefore does not have a JS wrapper.
311 However, the ShadowRoot interface was introduced shortly after in r189841
312 and to toJS() implementation for DocumentFragment is now invalid. This
313 patch introduces a ShadowRoot-aware custom implementation of toJS() for
314 DocumentFragment to address the problem.
316 No new tests, already covered by:
317 plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html
319 * bindings/js/JSDocumentFragmentCustom.cpp:
320 (WebCore::createNewDocumentFragmentWrapper):
321 (WebCore::toJSNewlyCreated):
323 Provide a ShadowRoot-aware custom implementation of toJS() /
324 toJSNewlyCreated() for DocumentFragment.
326 * bindings/js/JSNodeCustom.cpp:
327 (WebCore::createWrapperInline):
328 Fix bug in toJS() implementation for Node as it was not handling
329 ShadowRoots properly either.
331 * dom/DocumentFragment.idl:
332 Use [CustomToJSObject] so we can provide our own custom implementation
335 2015-09-17 Antti Koivisto <antti@apple.com>
337 De-template ContainerNodeAlgorithms
338 https://bugs.webkit.org/show_bug.cgi?id=149286
340 Reviewed by Andreas Kling.
342 These are always used with ContainerNode/Node.
344 * dom/ContainerNode.cpp:
345 (WebCore::ContainerNode::removeDetachedChildren):
346 (WebCore::destroyRenderTreeIfNeeded):
347 (WebCore::ContainerNode::takeAllChildrenFrom):
348 (WebCore::ContainerNode::insertBeforeCommon):
349 (WebCore::ContainerNode::appendChildCommon):
351 Make append a member for consistency with insert.
353 (WebCore::ContainerNode::notifyChildInserted):
354 (WebCore::ContainerNode::notifyChildRemoved):
355 (WebCore::ContainerNode::parserInsertBefore):
356 (WebCore::ContainerNode::replaceChild):
357 (WebCore::ContainerNode::appendChild):
358 (WebCore::ContainerNode::parserAppendChild):
360 Also make rest of these ownership-taking functions take Ref<>&&.
362 * dom/ContainerNode.h:
363 (WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion):
364 (WebCore::ContainerNode::setFirstChild):
365 * dom/ContainerNodeAlgorithms.cpp:
366 (WebCore::notifyChildNodeRemoved):
367 (WebCore::addChildNodesToDeletionQueue):
368 (WebCore::removeDetachedChildrenInContainer):
369 (WebCore::collectFrameOwners):
370 (WebCore::assertConnectedSubrameCountIsConsistent):
371 (WebCore::disconnectSubframes):
372 * dom/ContainerNodeAlgorithms.h:
373 (WebCore::removeDetachedChildrenInContainer): Deleted.
374 (WebCore::appendChildToContainer): Deleted.
375 (WebCore::Private::NodeRemovalDispatcher::dispatch): Deleted.
376 (WebCore::Private::addChildNodesToDeletionQueue): Deleted.
377 * html/parser/HTMLConstructionSite.cpp:
379 (WebCore::executeInsertTask):
380 (WebCore::executeReparentTask):
381 (WebCore::executeInsertAlreadyParsedChildTask):
382 * html/track/WebVTTParser.cpp:
383 (WebCore::WebVTTTreeBuilder::constructTreeFromToken):
385 (WebCore::XMLErrors::appendErrorMessage):
386 (WebCore::createXHTMLParserErrorHeader):
387 (WebCore::XMLErrors::insertErrorMessageBlock):
388 * xml/parser/XMLDocumentParser.cpp:
389 (WebCore::XMLDocumentParser::enterText):
391 * xml/parser/XMLDocumentParserLibxml2.cpp:
392 (WebCore::XMLDocumentParser::startElementNs):
393 (WebCore::XMLDocumentParser::processingInstruction):
394 (WebCore::XMLDocumentParser::cdataBlock):
395 (WebCore::XMLDocumentParser::comment):
397 2015-09-17 Tim Horton <timothy_horton@apple.com>
399 Block Objective-C exceptions in DictionaryLookup
400 https://bugs.webkit.org/show_bug.cgi?id=149256
402 Reviewed by Anders Carlsson.
404 * editing/mac/DictionaryLookup.mm:
405 (WebCore::DictionaryLookup::rangeForSelection):
406 (WebCore::DictionaryLookup::rangeAtHitTestResult):
407 (WebCore::expandSelectionByCharacters):
408 (WebCore::DictionaryLookup::stringForPDFSelection):
409 (WebCore::showPopupOrCreateAnimationController):
410 (WebCore::DictionaryLookup::hidePopup):
411 It is possible for Lookup to throw an exception if one of its
412 related services dies for some reason. This shouldn't take down
413 our UI process, so block the exceptions.
415 2015-09-17 Yusuke Suzuki <utatane.tea@gmail.com>
417 [ES6] Add more fine-grained APIs and additional hooks to control module loader from WebCore
418 https://bugs.webkit.org/show_bug.cgi?id=149129
420 Reviewed by Saam Barati.
424 * bindings/js/JSDOMWindowBase.cpp:
425 * bindings/js/JSWorkerGlobalScopeBase.cpp:
427 2015-09-17 Alex Christensen <achristensen@webkit.org>
429 Switch AppleWin build to use CMake
430 https://bugs.webkit.org/show_bug.cgi?id=149163
432 Reviewed by Brent Fulgham.
434 * bindings/scripts/preprocess-idls.pl:
435 (CygwinPathIfNeeded):
436 (WriteFileIfChanged):
437 * bindings/scripts/preprocessor.pm:
439 Fix new cygwin quirks. Cygwin is now using some paths from CMake.
441 2015-09-17 Zalan Bujtas <zalan@apple.com>
443 Remove integral snapping functions from InlineBox class.
444 https://bugs.webkit.org/show_bug.cgi?id=136419
446 Reviewed by Simon Fraser.
448 We should not integral snap inlines during layout time.
450 Covered by existing tests.
452 * rendering/InlineBox.h:
453 (WebCore::InlineBox::pixelSnappedLogicalLeft): Deleted.
454 (WebCore::InlineBox::pixelSnappedLogicalRight): Deleted.
455 (WebCore::InlineBox::pixelSnappedLogicalTop): Deleted.
456 (WebCore::InlineBox::pixelSnappedLogicalBottom): Deleted.
457 * rendering/InlineFlowBox.cpp:
458 (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
459 (WebCore::InlineFlowBox::addBoxShadowVisualOverflow):
460 (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow):
461 (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
463 2015-09-17 Per Arne Vollan <peavo@outlook.com>
465 [WinCairo] Compile error, include file not found.
466 https://bugs.webkit.org/show_bug.cgi?id=149282
468 Reviewed by Alex Christensen.
471 Copy forwarding headers from new legacy directory, fixing CMake clean builds since r189746.
473 2015-09-17 Tim Horton <timothy_horton@apple.com>
475 Delete some dead code
476 https://bugs.webkit.org/show_bug.cgi?id=149255
478 Reviewed by Dan Bernstein.
480 No new tests, just cleanup.
482 * platform/RuntimeApplicationChecksIOS.h:
483 * platform/RuntimeApplicationChecksIOS.mm:
484 (WebCore::applicationIsEpicurious): Deleted.
485 (WebCore::applicationIsMASH): Deleted.
486 Nothing uses these application checks anymore.
488 * platform/ios/SoundIOS.mm:
489 (WebCore::systemBeep):
490 What a beep should be on iOS, I don't know.
491 What it should not be is a NSLog.
493 2015-09-17 Saam barati <sbarati@apple.com>
495 Interpreter::unwind() shouldn't be responsible for filtering out uncatchable exceptions
496 https://bugs.webkit.org/show_bug.cgi?id=149228
498 Reviewed by Mark Lam.
500 No new tests, already covered by current tests. This is not an observable behavior change.
502 * bindings/js/JSNodeFilterCustom.cpp:
503 (WebCore::JSNodeFilter::acceptNode):
505 2015-09-17 Zalan Bujtas <zalan@apple.com>
507 column-rule-style: outset/inset doesn't work
508 https://bugs.webkit.org/show_bug.cgi?id=148815
509 <rdar://problem/22582644>
511 Reviewed by David Hyatt.
513 https://drafts.csswg.org/css-multicol-1/#crs
514 The <‘border-style’> values are interpreted as in the collapsing border model.
516 Unskipped 4 multicolumn tests,
518 * rendering/RenderMultiColumnSet.cpp:
519 (WebCore::RenderMultiColumnSet::paintColumnRules):
520 * rendering/RenderTableCell.cpp:
521 (WebCore::collapsedBorderStyle): Deleted.
522 * rendering/style/RenderStyle.h:
523 (WebCore::collapsedBorderStyle):
525 2015-09-17 Chris Dumez <cdumez@apple.com>
527 Range.deleteContents cannot delete DocType
528 https://bugs.webkit.org/show_bug.cgi?id=148773
529 <rdar://problem/22571280>
531 Reviewed by Ryosuke Niwa.
533 Range.deleteContents() was not able to delete a DocumentType Node, and
534 was throwing a HIERARCHY_REQUEST_ERR. The DOM specification does not
535 say we should throw in such case:
536 https://dom.spec.whatwg.org/#dom-range-deletecontents
538 However, Range.extractContents() should still throw an exception
539 if any of the contained children in a DocumentType Node:
540 https://dom.spec.whatwg.org/#concept-range-extract (Step 12)
542 No new tests, already covered by existing test.
545 (WebCore::Range::deleteContents):
546 (WebCore::Range::extractContents):
547 (WebCore::Range::checkDeleteExtract):
550 2015-09-17 Eric Carlson <eric.carlson@apple.com>
552 [Mac MediaStream] Cleanup capture source classes
553 https://bugs.webkit.org/show_bug.cgi?id=149233
555 Reviewed by Jer Noble.
557 * platform/cf/CoreMediaSoftLink.cpp: Soft-link CMAudioFormatDescriptionGetStreamBasicDescription,
558 CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer, and CMSampleBufferGetNumSamples.
559 * platform/cf/CoreMediaSoftLink.h:
561 * platform/mediastream/mac/AVAudioCaptureSource.h:
562 (WebCore::AVAudioCaptureSource::Observer::~Observer):
563 * platform/mediastream/mac/AVAudioCaptureSource.mm:
564 (WebCore::AVAudioCaptureSource::AVAudioCaptureSource): Initialize m_inputDescription.
565 (WebCore::AVAudioCaptureSource::capabilities): 0 -> nullptr.
566 (WebCore::AVAudioCaptureSource::addObserver): New, add an observer and tell it to prepare.
567 (WebCore::AVAudioCaptureSource::removeObserver): New.
568 (WebCore::operator==): Compare AudioStreamBasicDescription.
569 (WebCore::operator!=):
570 (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Call
571 observer->prepare when passed a new stream description, call observer->process.
573 * platform/mediastream/mac/AVCaptureDeviceManager.mm:
574 (WebCore::refreshCaptureDeviceList): Set m_groupID and m_localizedName.
575 (WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Invalid constraint names should
576 be ignored, so return true when passed one.
577 (WebCore::AVCaptureDeviceManager::getSourcesInfo): This just didn't work, fix it.
578 (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Optional constraints are
579 optional so they don't need to be validated.
580 (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): m_audioSource -> m_audioAVMediaCaptureSource,
581 m_videoSource -> m_videoAVMediaCaptureSource.
582 (WebCore::AVCaptureDeviceManager::sourceWithUID): Ditto.
584 * platform/mediastream/mac/AVMediaCaptureSource.h:
585 (WebCore::AVMediaCaptureSource::session):
586 (WebCore::AVMediaCaptureSource::device):
587 (WebCore::AVMediaCaptureSource::currentStates):
588 (WebCore::AVMediaCaptureSource::constraints):
589 (WebCore::AVMediaCaptureSource::statesDidChanged):
590 (WebCore::AVMediaCaptureSource::createWeakPtr):
591 (WebCore::AVMediaCaptureSource::buffer): Deleted.
592 (WebCore::AVMediaCaptureSource::setBuffer): Deleted.
593 * platform/mediastream/mac/AVMediaCaptureSource.mm:
594 (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Initilize m_weakPtrFactory.
595 (WebCore::AVMediaCaptureSource::scheduleDeferredTask): New, call a function asynchronously on
597 (-[WebCoreAVMediaCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]): Don't
598 dispatch calls to the main thread, let the derived classes do that if necessary.
600 * platform/mediastream/mac/AVVideoCaptureSource.h:
601 (WebCore::AVVideoCaptureSource::width):
602 (WebCore::AVVideoCaptureSource::height):
603 (WebCore::AVVideoCaptureSource::previewLayer):
604 (WebCore::AVVideoCaptureSource::currentFrameSampleBuffer):
605 * platform/mediastream/mac/AVVideoCaptureSource.mm:
606 (WebCore::AVVideoCaptureSource::setFrameRateConstraint): Remove unwanted logging.
607 (WebCore::AVVideoCaptureSource::setupCaptureSession): Configure the AVCaptureVideoDataOutput so
608 it delivers 32-bit BGRA samples.
609 (WebCore::AVVideoCaptureSource::calculateFramerate): Return bool to signal if the frame rate
611 (WebCore::AVVideoCaptureSource::processNewFrame): New. Process sample buffer, invalidate cached
612 image, signal when characteristics change.
613 (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Schedule
614 call to processNewFrame on the main thread so we do all video processing on main thread.
615 (WebCore::AVVideoCaptureSource::currentFrameImage): Create and return a CVImageBuffer of the
617 (WebCore::AVVideoCaptureSource::paintCurrentFrameInContext): Draw the current frame to a context.
619 2015-09-15 Sergio Villar Senin <svillar@igalia.com>
621 [CSS Grid Layout] Using automatic (instead of min-content) minimums for 'auto' tracks
622 https://bugs.webkit.org/show_bug.cgi?id=142329
624 Reviewed by Darin Adler.
626 Based on Blink's r198697 by <svillar@igalia.com> and r200478 by <jfernandez@igalia.com>
628 More precisely (syntax-wise), this would allow 'auto' to be used within the
629 minmax() function (it's currently forbidden) and have the 'auto' keyword map
630 to minmax(auto, auto) instead of minmax(min-content, max-content).
631 - As a minimum, 'auto' would mean "use the specified minimum size, or if
632 that is auto, treat as 0 or min-content per Flexbox rules".
633 - As a maximum, 'auto' would mean "use the max-content size".
635 Regarding the implementation, a new phase is added to the track sizing
636 algorithm called ResolveIntrinsicMinimums (the former ResolveIntrinsicMinimums
637 is now called ResolveContentBasedMinimums which does not include 'auto'
638 resolution) which will be run before any other. This phase uses the minimum
639 size of grid items (as specified by min-width/height).
641 Tests: fast/css-grid-layout/grid-automatic-minimum-for-auto-columns.html
642 fast/css-grid-layout/grid-automatic-minimum-for-auto-rows.html
645 (WebCore::CSSParser::parseGridBreadth):
646 * rendering/RenderGrid.cpp:
647 (WebCore::RenderGrid::computeUsedBreadthOfMinLength):
648 (WebCore::RenderGrid::computeUsedBreadthOfMaxLength):
649 (WebCore::RenderGrid::minSizeForChild):
650 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
651 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
652 (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase):
653 (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase):
654 (WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase):
655 (WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase):
656 (WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase):
657 (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
658 * rendering/RenderGrid.h:
659 * rendering/style/GridTrackSize.h:
660 (WebCore::GridTrackSize::minTrackBreadth):
661 (WebCore::GridTrackSize::maxTrackBreadth):
662 (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes):
663 (WebCore::GridTrackSize::hasIntrinsicMinTrackBreadth):
664 (WebCore::GridTrackSize::hasAutoMinTrackBreadth):
665 (WebCore::GridTrackSize::hasAutoMaxTrackBreadth):
666 (WebCore::GridTrackSize::hasMaxContentOrAutoMaxTrackBreadth):
667 (WebCore::GridTrackSize::hasAutoOrMinContentMinTrackBreadthAndIntrinsicMaxTrackBreadth):
668 (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth): Deleted.
670 2015-09-17 Javier Fernandez <jfernandez@igalia.com>
672 [CSS Grid Layout] Relayout whenever Box Alignment properties change
673 https://bugs.webkit.org/show_bug.cgi?id=148070
675 Reviewed by Darin Adler.
677 We were Reattaching the styles to the RenderTree whenever Content Alignment
678 properties (align-items and justify-items) changed their values, since the
679 Self Alignment properties depend on such values to resolve 'auto' values
682 This patch removes such restriction, since we resolve the auto values
683 whenever we access the alignment properties. The only thing we need to
684 do is to mark a grid item for layout whenever the Default Alignment
685 properties change from/to stretch, since it implies a resize of the grid
686 items using 'auto' values for the Self Alignment properties.
688 Tests: fast/css-grid-layout/relayout-align-items-changed.html
689 fast/css-grid-layout/relayout-align-self-changed.html
690 fast/css-grid-layout/relayout-justify-items-changed.html
691 fast/css-grid-layout/relayout-justify-self-changed.html
692 fast/repaint/align-items-change.html
693 fast/repaint/align-items-overflow-change.html
694 fast/repaint/align-self-change.html
695 fast/repaint/align-self-overflow-change.html
696 fast/repaint/justify-items-change.html
697 fast/repaint/justify-items-legacy-change.html
698 fast/repaint/justify-items-overflow-change.html
699 fast/repaint/justify-self-change.html
700 fast/repaint/justify-self-overflow-change.html
702 * rendering/RenderGrid.cpp:
703 (WebCore::defaultAlignmentIsStretch):
704 (WebCore::RenderGrid::styleDidChange):
705 * rendering/RenderGrid.h:
706 * rendering/style/RenderStyle.cpp:
707 (WebCore::RenderStyle::resolveAlignmentOverflow):
708 (WebCore::RenderStyle::changeRequiresLayout):
709 * style/StyleResolveTree.cpp:
710 (WebCore::Style::determineChange): Deleted.
712 2015-09-16 Carlos Garcia Campos <cgarcia@igalia.com>
714 printing does not use minimum page zoom factor
715 https://bugs.webkit.org/show_bug.cgi?id=108507
717 Reviewed by Darin Adler.
719 * page/PrintContext.cpp:
720 (WebCore::PrintContext::beginAndComputePageRectsWithPageSize):
721 Helper function to share common code from numberOfPages() and
722 spoolAllPagesWithBoundaries().
723 (WebCore::PrintContext::numberOfPages): Use beginAndComputePageRectsWithPageSize().
724 (WebCore::PrintContext::spoolAllPagesWithBoundaries): Use
725 beginAndComputePageRectsWithPageSize() and don't flip the Y axis
726 for non Cocoa platforms.
727 * page/PrintContext.h:
729 2015-09-16 Ryosuke Niwa <rniwa@webkit.org>
731 removeShadow shouldn't call ChildNodeRemovalNotifier with the shadow host as the removal point
732 https://bugs.webkit.org/show_bug.cgi?id=149244
734 Reviewed by Antti Koivisto.
736 Since a shadow host is in a different tree than nodes in its shadow tree, it's incorrect to call
737 removedFrom with the shadow host as the removal point. This causes HTMLSlotElement::removedFrom
738 which will be added in the bug 149241 to call methods on a wrong ShadowRoot.
740 We still keep the ad-hoc behavior of using the shadow host as the insertion/removal point when
741 calling insertedInto and removedFrom on the shadow root itself to update the InDocument node flag.
742 We may want to re-visit this design in the future.
744 No new tests since I couldn't quite create a reduction. However, tests I'm adding in the bug 149241
745 will crash without this change.
747 I separated this patch from the bug 149241 to isolate the high-risk code change here.
750 (WebCore::Element::addShadowRoot): Call insertedInto on ShadowRoot, and then call it on all its
751 children separately with the insertion point set to the shadow root since insertedInto relies on
752 insertion point's inDocument flag to be true when the shadow host is in the document.
753 (WebCore::Element::removeShadowRoot): Ditto in the reverse order.
755 2015-09-16 Gyuyoung Kim <gyuyoung.kim@webkit.org>
757 Remove all uses of PassRefPtr in WebCore/inspector
758 https://bugs.webkit.org/show_bug.cgi?id=149156
760 Reviewed by Darin Adler.
762 * inspector/DOMEditor.cpp:
763 (WebCore::DOMEditor::InsertBeforeAction::InsertBeforeAction):
764 (WebCore::DOMEditor::ReplaceChildNodeAction::ReplaceChildNodeAction):
765 (WebCore::DOMEditor::insertBefore):
766 (WebCore::DOMEditor::replaceChild):
767 * inspector/DOMEditor.h:
768 * inspector/DOMPatchSupport.cpp:
769 (WebCore::DOMPatchSupport::removeChildAndMoveToNew):
770 * inspector/InspectorDOMAgent.cpp:
771 (WebCore::InspectorDOMAgent::highlightSelector):
772 * inspector/InspectorDatabaseAgent.cpp:
773 (WebCore::InspectorDatabaseAgent::didOpenDatabase):
774 * inspector/InspectorDatabaseAgent.h:
775 * inspector/InspectorDatabaseInstrumentation.h:
776 * inspector/InspectorDatabaseResource.h:
777 (WebCore::InspectorDatabaseResource::setDatabase):
778 * inspector/InspectorFrontendHost.cpp:
779 (WebCore::FrontendMenuProvider::create):
780 * inspector/InspectorInstrumentation.cpp:
781 (WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
782 * inspector/InspectorLayerTreeAgent.h:
783 * inspector/InspectorOverlay.cpp:
784 (WebCore::InspectorOverlay::highlightNodeList):
785 * inspector/InspectorOverlay.h:
786 * inspector/InspectorPageAgent.cpp:
787 (WebCore::InspectorPageAgent::sharedBufferContent):
788 * inspector/InspectorPageAgent.h:
789 * inspector/InspectorResourceAgent.cpp:
790 * inspector/InspectorTimelineAgent.cpp:
791 (WebCore::startProfiling):
792 (WebCore::stopProfiling):
793 (WebCore::InspectorTimelineAgent::stopFromConsole):
794 * inspector/InspectorTimelineAgent.h:
795 * inspector/InspectorWorkerResource.h:
796 (WebCore::InspectorWorkerResource::create):
797 * inspector/InstrumentingAgents.h:
798 * inspector/NetworkResourcesData.cpp:
799 (WebCore::createOtherResourceTextDecoder):
800 (WebCore::NetworkResourcesData::addResourceSharedBuffer):
801 * inspector/NetworkResourcesData.h:
802 * inspector/TimelineRecordFactory.cpp:
803 (WebCore::createQuad):
804 * inspector/WebInjectedScriptHost.h:
805 * inspector/WebInjectedScriptManager.cpp:
806 (WebCore::WebInjectedScriptManager::WebInjectedScriptManager):
807 * inspector/WebInjectedScriptManager.h:
809 2015-09-16 Brady Eidson <beidson@apple.com>
811 Have window.indexedDB.open return an IDBOpenDBRequest.
812 https://bugs.webkit.org/show_bug.cgi?id=149234
814 Reviewed by Alex Christensen.
816 Test: storage/indexeddb/modern/opendatabase-request.html
818 * Modules/indexeddb/client/IDBFactoryImpl.cpp:
819 (WebCore::IDBClient::IDBFactory::open):
820 (WebCore::IDBClient::IDBFactory::openInternal):
821 * Modules/indexeddb/client/IDBFactoryImpl.h:
823 2015-09-16 Antti Koivisto <antti@apple.com>
825 Turn ChildNodeInsertion/RemovalNotifier classes into functions
826 https://bugs.webkit.org/show_bug.cgi?id=149236
828 Reviewed by Ryosuke Niwa.
830 Less architecture, more readability.
832 * dom/ContainerNode.cpp:
833 (WebCore::ContainerNode::notifyChildInserted):
834 (WebCore::ContainerNode::notifyChildRemoved):
835 (WebCore::ContainerNode::removeChildren):
836 * dom/ContainerNodeAlgorithms.cpp:
837 (WebCore::notifyDescendantInsertedIntoDocument):
838 (WebCore::notifyDescendantInsertedIntoTree):
839 (WebCore::notifyNodeInsertedIntoDocument):
840 (WebCore::notifyNodeInsertedIntoTree):
841 (WebCore::notifyChildNodeInserted):
842 (WebCore::notifyNodeRemovedFromDocument):
843 (WebCore::notifyNodeRemovedFromTree):
844 (WebCore::notifyChildNodeRemoved):
845 (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument): Deleted.
846 (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree): Deleted.
847 (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument): Deleted.
848 (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree): Deleted.
849 * dom/ContainerNodeAlgorithms.h:
850 (WebCore::ChildNodeInsertionNotifier::ChildNodeInsertionNotifier): Deleted.
851 (WebCore::ChildNodeRemovalNotifier::ChildNodeRemovalNotifier): Deleted.
852 (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument): Deleted.
853 (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree): Deleted.
854 (WebCore::ChildNodeInsertionNotifier::notify): Deleted.
855 (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument): Deleted.
856 (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromTree): Deleted.
857 (WebCore::ChildNodeRemovalNotifier::notify): Deleted.
859 (WebCore::Element::addShadowRoot):
860 (WebCore::Element::removeShadowRoot):
861 (WebCore::Element::createShadowRoot):
863 2015-09-16 Gyuyoung Kim <gyuyoung.kim@webkit.org>
865 Remove all uses of PassRefPtr in WebCore/bindings
866 https://bugs.webkit.org/show_bug.cgi?id=149207
868 Reviewed by Darin Adler.
870 If RefPtr<>&& argument is passed to new variable or other function, we use copyRef() or WTF::move().
871 copyRef() should be used when the argument continues to be used in following code. If it is final use
872 inside function, we have to use WTF::move().
874 * bridge/NP_jsobject.cpp:
875 * bridge/NP_jsobject.h:
876 * bridge/c/CRuntimeObject.cpp:
877 (JSC::Bindings::CRuntimeObject::CRuntimeObject):
878 * bridge/c/CRuntimeObject.h:
879 (JSC::Bindings::CRuntimeObject::create):
880 * bridge/c/c_instance.cpp:
881 (JSC::Bindings::CInstance::CInstance):
882 * bridge/c/c_instance.h:
883 (JSC::Bindings::CInstance::create):
884 * bridge/jsc/BridgeJSC.cpp:
885 (JSC::Bindings::Array::Array):
886 (JSC::Bindings::Instance::Instance):
887 * bridge/jsc/BridgeJSC.h:
888 * bridge/objc/ObjCRuntimeObject.h:
889 (JSC::Bindings::ObjCRuntimeObject::create):
890 * bridge/objc/ObjCRuntimeObject.mm:
891 (JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject):
892 * bridge/objc/WebScriptObjectProtocol.h:
893 * bridge/objc/objc_instance.h:
894 * bridge/objc/objc_instance.mm:
895 (ObjcInstance::ObjcInstance):
896 (ObjcInstance::create):
897 * bridge/objc/objc_runtime.h:
898 * bridge/objc/objc_runtime.mm:
899 (JSC::Bindings::ObjcArray::ObjcArray):
900 * bridge/runtime_object.cpp:
901 (JSC::Bindings::RuntimeObject::RuntimeObject):
902 * bridge/runtime_object.h:
903 * bridge/runtime_root.cpp:
904 (JSC::Bindings::RootObject::create):
905 * bridge/runtime_root.h:
907 2015-09-16 Chris Dumez <cdumez@apple.com>
909 Element's attribute NS API should defined treat undefined namespace as null
910 https://bugs.webkit.org/show_bug.cgi?id=149238
911 <rdar://problem/22562204>
913 Reviewed by Ryosuke Niwa.
915 Element's attribute NS API should treat defined undefined namespace as null
916 instead of converting it to the "undefined" String. This is because the
917 namespace parameter is a nullable String as per the DOM spec:
918 - https://dom.spec.whatwg.org/#element
920 The attribute is nullable and WebIDL says undefined should be converted
921 to null for nullable parameters:
922 - https://heycam.github.io/webidl/#es-nullable-type (step 3)
924 Firefox follows the specification.
926 No new tests, already covered by existing test.
930 2015-09-16 Chris Dumez <cdumez@apple.com>
932 Possible small iOS PLT regression from r189537
933 https://bugs.webkit.org/show_bug.cgi?id=149232
935 Reviewed by Ryosuke Niwa.
937 r189537 may have regressed PLT a bit on iOS. That change added a couple
938 of extra branches to throw exceptions. This patch marks those branches
939 as UNLIKELY() as we already do for other similar checks in the JS
942 * bindings/scripts/CodeGeneratorJS.pm:
943 (GenerateImplementation):
944 * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
945 (webkit_dom_test_obj_get_property):
946 (webkit_dom_test_obj_class_init):
947 (webkit_dom_test_obj_get_strict_type_checking_attribute):
948 (webkit_dom_test_obj_set_strict_type_checking_attribute):
949 * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
950 * bindings/scripts/test/JS/JSTestObj.cpp:
951 (WebCore::jsTestObjStrictTypeCheckingAttribute):
952 (WebCore::setJSTestObjStrictTypeCheckingAttribute):
953 * bindings/scripts/test/ObjC/DOMTestObj.h:
954 * bindings/scripts/test/ObjC/DOMTestObj.mm:
955 (-[DOMTestObj strictTypeCheckingAttribute]):
956 (-[DOMTestObj setStrictTypeCheckingAttribute:]):
957 * bindings/scripts/test/TestObj.idl:
958 * html/HTMLTableElement.cpp:
959 (WebCore::HTMLTableElement::setTHead):
960 (WebCore::HTMLTableElement::setTFoot):
962 2015-09-16 Joseph Pecoraro <pecoraro@apple.com>
964 Web Inspector: Fix common typo "supress" => "suppress"
965 https://bugs.webkit.org/show_bug.cgi?id=149199
967 Reviewed by Gyuyoung Kim.
969 * html/shadow/ContentDistributor.h:
970 (WebCore::ContentDistributor::needsDistribution):
971 * page/ContentSecurityPolicy.cpp:
972 (WebCore::ContentSecurityPolicy::reportViolation):
973 * platform/NotImplemented.h:
974 * platform/graphics/ca/win/LayerChangesFlusher.cpp:
975 (WebCore::LayerChangesFlusher::hookCallback):
976 * platform/mac/HIDGamepadProvider.cpp:
977 (WebCore::HIDGamepadProvider::deviceRemoved):
978 * platform/win/makesafeseh.asm:
980 2015-09-16 Chris Dumez <cdumez@apple.com>
982 WebIDL: Rename [ReturnNewObject] to [NewObject] and use it more consistently in DOM
983 https://bugs.webkit.org/show_bug.cgi?id=149192
985 Reviewed by Darin Adler.
987 Rename [ReturnNewObject] to [NewObject] and use it more consistently in
990 This aligns our IDL extended attribute naming with standard Web IDL:
991 https://heycam.github.io/webidl/#NewObject
993 We already have [ReturnNewObject] in most places that the DOM
994 specification uses [NewObject] but we are missing a few so I'll
996 https://dom.spec.whatwg.org/#interface-document
998 Using [NewObject] lets the bindings generator know that the API in
999 question always returns new objects and that we can bypass the check
1000 for existing wrappers and directly create a new wrapper for the
1003 This patch also adds support for generating the toJSNewlyCreated()
1004 utility function for most types. Previously, to use [ReturnNewObject]
1005 for a new type, you needed to add the type to a hard-coded list in
1006 the bindings generator then provide your own implementation for
1007 toJSNewlyCreated() as custom bindings.
1009 No new-exposed behavior change.
1011 * bindings/js/JSDocumentCustom.cpp:
1012 * bindings/js/JSEventCustom.cpp:
1013 * bindings/js/JSNodeListCustom.cpp:
1014 Add toJSNewlyCreated() custom implementation for Node, Event and
1015 Document, that shares code with the existing toJS() implementation for
1018 * bindings/js/JSCDATASectionCustom.cpp: Removed.
1019 * bindings/js/JSTextCustom.cpp: Removed.
1020 * bindings/js/JSTouchCustom.cpp: Removed.
1021 * bindings/js/JSTouchListCustom.cpp: Removed.
1022 Drop several custom bindings files as the bindings generator is
1023 now able to generate the toJSNewlyCreated() utility function for
1026 * bindings/scripts/CodeGeneratorJS.pm:
1027 - Rename [ReturnNewObject] to [NewObject].
1028 - Generate a toJSNewlyCreated() whenever we generate a toJS() already.
1029 Get rid of the hard-coded list of types that need a
1032 * bindings/scripts/IDLAttributes.txt:
1033 Rename [ReturnNewObject] to [NewObject].
1035 * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1036 * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1037 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1038 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
1039 * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1040 * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1041 * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1042 * bindings/scripts/test/JS/JSTestEventConstructor.h:
1043 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1044 * bindings/scripts/test/JS/JSTestEventTarget.h:
1045 * bindings/scripts/test/JS/JSTestException.cpp:
1046 * bindings/scripts/test/JS/JSTestException.h:
1047 * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1048 * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1049 * bindings/scripts/test/JS/JSTestInterface.cpp:
1050 * bindings/scripts/test/JS/JSTestInterface.h:
1051 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1052 * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1053 * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1054 * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1055 * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1056 * bindings/scripts/test/JS/JSTestNondeterministic.h:
1057 * bindings/scripts/test/JS/JSTestObj.cpp:
1058 * bindings/scripts/test/JS/JSTestObj.h:
1059 * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1060 * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1061 * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1062 * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1063 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1064 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1065 * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1066 * bindings/scripts/test/JS/JSTestTypedefs.h:
1067 * bindings/scripts/test/JS/JSattribute.cpp:
1068 * bindings/scripts/test/JS/JSattribute.h:
1069 * bindings/scripts/test/JS/JSreadonly.cpp:
1070 * bindings/scripts/test/JS/JSreadonly.h:
1071 Rebaseline bindings tests.
1074 * dom/CDATASection.idl:
1076 * dom/DocumentFragment.idl:
1077 * dom/DocumentType.idl:
1078 * dom/EntityReference.idl:
1079 * dom/ProcessingInstruction.idl:
1080 Add [JSGenerateToJSObject] so that the bindings generator generates
1081 a toJS() / toJSNewlyCreated() for this type. While it is not strictly
1082 needed, it avoids falling back to using the toJS() from Node which
1083 calls the virtual nodeType() function to determine the node type.
1084 This change was made for efficiency purposes.
1086 * dom/DOMImplementation.idl:
1087 Rename [ReturnNewObject] to [NewObject] and add it to createHTMLDocument()
1088 as well, as per the specification:
1089 https://dom.spec.whatwg.org/#interface-domimplementation
1092 Rename [ReturnNewObject] to [NewObject] and add it to more operations
1093 as per he DOM specification:
1094 https://dom.spec.whatwg.org/#document
1097 Add [NewObject] to cloneNode() as per the DOM specification:
1098 https://dom.spec.whatwg.org/#node
1100 * dom/ParentNode.idl:
1101 Add [NewObject] to querySelectorAll() as per the DOM specification:
1102 https://dom.spec.whatwg.org/#parentnode
1105 Add [NewObject] for several operations, as per the DOM specification:
1106 https://dom.spec.whatwg.org/#interface-range
1108 2015-09-16 Brady Eidson <beidson@apple.com>
1110 Have window.indexedDB.deleteDatabase return an IDBOpenDBRequest.
1111 https://bugs.webkit.org/show_bug.cgi?id=149229
1113 Reviewed by Alex Christensen.
1115 Test: storage/indexeddb/modern/deletedatabase-request.html
1116 storage/indexeddb/modern/deletedatabase-null-name-exception.html
1119 * WebCore.xcodeproj/project.pbxproj:
1121 * Modules/indexeddb/IDBDatabaseIdentifier.cpp: Added.
1122 (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
1123 * Modules/indexeddb/IDBDatabaseIdentifier.h: Added.
1124 (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
1125 (WebCore::IDBDatabaseIdentifier::isHashTableDeletedValue):
1126 (WebCore::IDBDatabaseIdentifier::hash):
1127 (WebCore::IDBDatabaseIdentifier::isValid):
1128 (WebCore::IDBDatabaseIdentifier::operator==):
1129 (WebCore::IDBDatabaseIdentifier::databaseName):
1130 (WebCore::IDBDatabaseIdentifierHash::hash):
1131 (WebCore::IDBDatabaseIdentifierHash::equal):
1132 (WebCore::IDBDatabaseIdentifierHashTraits::isEmptyValue):
1134 * Modules/indexeddb/client/IDBFactoryImpl.cpp:
1135 (WebCore::IDBClient::shouldThrowSecurityException):
1136 (WebCore::IDBClient::IDBFactory::getDatabaseNames):
1137 (WebCore::IDBClient::IDBFactory::open):
1138 (WebCore::IDBClient::IDBFactory::deleteDatabase):
1139 * Modules/indexeddb/client/IDBFactoryImpl.h:
1141 * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
1142 (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
1143 * Modules/indexeddb/client/IDBOpenDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
1144 (WebCore::IDBClient::IDBOpenDBRequest::create):
1146 * Modules/indexeddb/client/IDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
1147 (WebCore::IDBClient::IDBRequest::IDBRequest):
1148 (WebCore::IDBClient::IDBRequest::result):
1149 (WebCore::IDBClient::IDBRequest::errorCode):
1150 (WebCore::IDBClient::IDBRequest::error):
1151 (WebCore::IDBClient::IDBRequest::source):
1152 (WebCore::IDBClient::IDBRequest::transaction):
1153 (WebCore::IDBClient::IDBRequest::readyState):
1154 (WebCore::IDBClient::IDBRequest::eventTargetInterface):
1155 (WebCore::IDBClient::IDBRequest::activeDOMObjectName):
1156 (WebCore::IDBClient::IDBRequest::canSuspendForPageCache):
1157 * Modules/indexeddb/client/IDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.h.
1159 * platform/Logging.h:
1161 2015-09-16 Chris Dumez <cdumez@apple.com>
1163 Add initial support for [Unforgeable] IDL extended attribute
1164 https://bugs.webkit.org/show_bug.cgi?id=149147
1166 Reviewed by Darin Adler.
1168 Add initial support for [Unforgeable] IDL extended attribute:
1169 https://heycam.github.io/webidl/#Unforgeable
1171 In particular, attributes marked as unforgeable are now:
1172 - on the instance rather than the prototype
1173 - non-configurable. WebKit does not match the Web IDL specification
1174 and most properties are currently non-configurable already. However,
1175 I added an extra check for [Unforgeable] so that unforgeable
1176 attributes stay unconfigurable if we later decide to match the spec
1177 and mark properties as configurable.
1179 Operation marked as unforgeable are now non-configurable. However, this
1180 patch does not move them from the prototype to the instance yet. This
1181 needs to be addressed in a follow-up patch as this is a larger change.
1183 This patch also drops support for the undocumented
1184 [OperationsNotDeletable] IDL extended attribute. It is no longer needed
1185 now that we support [Unforgeable] and still support [NotDeletable] for
1188 Test: fast/dom/unforgeable-attributes.html
1190 * Modules/plugins/QuickTimePluginReplacement.idl:
1191 Drop [OperationsNotDeletable] on the interface and mark the only
1192 operation on this interface as [NotDeletable]. There is no behavior
1193 change but this allows us to drop support for a non-standard and
1194 undocumented IDL extended attribute.
1196 * bindings/scripts/CodeGeneratorJS.pm:
1197 (AttributeShouldBeOnInstance):
1198 (GenerateAttributesHashTable):
1199 (GenerateImplementation):
1200 Add initial support for [Unforgeable] IDL extended attribute.
1202 * bindings/scripts/IDLAttributes.txt:
1203 Add [Unforgeable]. Drop [OperationsNotDeletable].
1205 * crypto/CryptoKeyPair.idl:
1206 Drop [OperationsNotDeletable] on the interface as this interface has
1210 * page/DOMWindow.idl:
1211 * page/Location.idl:
1212 Mark attributes / interfaces as [Unforgeable] as per the latest HTML
1214 https://html.spec.whatwg.org/multipage/dom.html#document
1215 https://html.spec.whatwg.org/multipage/browsers.html#window
1216 https://html.spec.whatwg.org/multipage/browsers.html#the-location-interface
1218 2015-09-16 Zalan Bujtas <zalan@apple.com>
1220 Simple line layout: Glitch selecting long text.
1221 https://bugs.webkit.org/show_bug.cgi?id=149204
1222 rdar://problem/22646472
1224 Reviewed by Antti Koivisto.
1226 When long text is split into multiple RenderText objects, we ignore renderer boundaries while
1227 collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
1228 This patch ensures that fragments with hypen character ignore renderer boundaries too.
1230 Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
1232 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1233 (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1235 2015-09-16 Brady Eidson <beidson@apple.com>
1237 Remove stray logging string mistakenly left in r189746.
1239 * Modules/indexeddb/legacy/LegacyFactory.cpp:
1240 (WebCore::LegacyFactory::deleteDatabase):
1242 2015-09-16 Chris Fleizach <cfleizach@apple.com>
1244 AX: No VoiceOver typing feedback in some search fields
1245 https://bugs.webkit.org/show_bug.cgi?id=149177
1247 Reviewed by Mario Sanchez Prada.
1249 If SearchFieldRole is not marked as a TextControl, it does not end up returning the accessibilityValue,
1250 which is needed to output the right text to VoiceOver.
1252 Test: accessibility/ax-value-with-search.html
1254 * accessibility/AccessibilityObject.cpp:
1255 (WebCore::AccessibilityObject::isTextControl):
1257 2015-09-16 Manuel Rego Casasnovas <rego@igalia.com>
1259 [css-grid] Grid container's height should include scrollbar
1260 https://bugs.webkit.org/show_bug.cgi?id=149210
1262 Reviewed by Sergio Villar Senin.
1264 Add scrollbar's size in the grid container's height calculation at
1265 RenderGrid::layoutGridItems().
1267 Test: fast/css-grid-layout/grid-container-margin-border-padding-scrollbar.html
1269 * rendering/RenderGrid.cpp:
1270 (WebCore::RenderGrid::layoutGridItems): Include scrollbarLogicalHeight()
1271 while computing the grid's logical height.
1273 2015-09-16 Carlos Garcia Campos <cgarcia@igalia.com>
1275 Unreviewed. Fix GObject DOM bindings API break after r189676.
1277 webkit_dom_character_data_append_data() used to raise exceptions.
1279 * bindings/scripts/CodeGeneratorGObject.pm:
1280 (FunctionUsedToRaiseException):
1282 2015-09-15 Commit Queue <commit-queue@webkit.org>
1284 Unreviewed, rolling out r189847.
1285 https://bugs.webkit.org/show_bug.cgi?id=149208
1287 Asserts on all the tests (Requested by ap on #webkit).
1291 "Simple line layout: Glitch selecting long text."
1292 https://bugs.webkit.org/show_bug.cgi?id=149204
1293 http://trac.webkit.org/changeset/189847
1295 2015-09-15 Zalan Bujtas <zalan@apple.com>
1297 Simple line layout: Glitch selecting long text.
1298 https://bugs.webkit.org/show_bug.cgi?id=149204
1299 rdar://problem/22646472
1301 Reviewed by Antti Koivisto.
1303 When long text is split into multiple RenderText objects, we ignore renderer boundaries while
1304 collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
1305 This patch ensures that fragments with hypen character ignore renderer boundaries too.
1307 Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
1309 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1310 (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1312 2015-09-15 Ryosuke Niwa <rniwa@webkit.org>
1314 GTK+ build fix attempt after r189841.
1316 * PlatformGTK.cmake:
1318 2015-09-15 Chris Dumez <cdumez@apple.com>
1320 Document.createElement(localName) does not handle correctly missing or null parameter
1321 https://bugs.webkit.org/show_bug.cgi?id=149184
1322 <rdar://problem/22565070>
1324 Reviewed by Ryosuke Niwa.
1326 Document.createElement(localName) does not handle correct missing or
1328 - https://dom.spec.whatwg.org/#interface-document
1330 As per the specification, the parameter is a non-nullable DOMString and
1331 is mandatory. Therefore, as per Web IDL, we should have the following
1333 1. If the parameter is missing, we should throw an exception
1334 2. If the parameter is null, we should convert it to the "null" string
1335 and create a <null> element.
1337 Chrome and Firefox behave according to the specification. However,
1339 1. Create a <undefined> element
1340 2. Throw an InvalidCharacterError
1342 This patch aligns WebKit's behavior with the specification and other
1345 No new tests, already covered by existing tests.
1349 2015-09-15 Ryosuke Niwa <rniwa@webkit.org>
1351 Add ShadowRoot interface and Element.prototype.attachShadow
1352 https://bugs.webkit.org/show_bug.cgi?id=149187
1354 Reviewed by Antti Koivisto.
1356 Add back ShadowRoot IDL interface and Element.prototype.attachShadow in accordance with
1357 http://w3c.github.io/webcomponents/spec/shadow/ at db27e6e36eab512d86edcdabb33ed27b5751acd7 excluding getSelection(),
1358 elementFromPoint(), elementsFromPoint(), caretPositionFromPoint(), and styleSheets attribute on ShadowRoot interface.
1360 The feature is enabled by default on Mac and iOS ports for testing and disabled by default elsewhere.
1362 Also added HTMLElement::canHaveUserAgentShadowRoot which returns false by default and overridden elsewhere to return true
1363 to distinguish elements for which attachShadow is supposed to throw NotSupported.
1364 See https://w3c.github.io/webcomponents/spec/shadow/#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict
1366 Tests: fast/shadow-dom/Element-interface-attachShadow.html
1367 fast/shadow-dom/Element-interface-shadowRoot-attribute.html
1368 fast/shadow-dom/ShadowRoot-interface.html
1371 * Configurations/FeatureDefines.xcconfig:
1372 * DerivedSources.cpp:
1373 * DerivedSources.make:
1374 * PlatformGTK.cmake:
1375 * WebCore.vcxproj/WebCore.vcxproj:
1376 * WebCore.vcxproj/WebCore.vcxproj.filters:
1377 * WebCore.xcodeproj/project.pbxproj:
1378 * css/SelectorChecker.cpp:
1379 (WebCore::SelectorChecker::matchRecursively):
1381 (WebCore::Element::bindingsOffsetParent):
1382 (WebCore::Element::offsetParent):
1383 (WebCore::Element::addShadowRoot):
1384 (WebCore::Element::createShadowRoot):
1385 (WebCore::Element::attachShadow): Added.
1386 (WebCore::Element::bindingShadowRoot): Added. Returns null unless the attached shadow root is in the "open" mode.
1388 * dom/Element.idl: Added attachShadow and shadowRoot. We only expose these to JS for now since Dictionary argument isn't
1389 supported by other binding code.
1390 * dom/ShadowRoot.cpp: Removed an unused enum.
1392 (WebCore::ShadowRoot::Type): Replaced old-style enum "ShadowRootType" by an enum class named "Type". Also added two new
1393 values Open and Closed for author shadow roots.
1394 (WebCore::ShadowRoot::type):
1395 * dom/ShadowRoot.idl: Added.
1396 * html/HTMLButtonElement.h:
1397 * html/HTMLDetailsElement.h:
1398 (HTMLButtonElement::canHaveUserAgentShadowRoot): Ditto.
1399 * html/HTMLElement.h:
1400 (WebCore::HTMLElement::canHaveUserAgentShadowRoot): Added. Returns false by default.
1401 * html/HTMLInputElement.h:
1402 * html/HTMLKeygenElement.h:
1403 * html/HTMLMarqueeElement.h:
1404 * html/HTMLMediaElement.h:
1405 * html/HTMLMeterElement.h:
1406 * html/HTMLPlugInElement.h:
1407 * html/HTMLProgressElement.h:
1408 * html/HTMLSelectElement.h:
1409 * html/HTMLSummaryElement.h:
1410 * html/HTMLTextAreaElement.h:
1411 * html/shadow/InsertionPoint.h:
1412 (ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints):
1413 * rendering/RenderElement.cpp:
1414 (WebCore::RenderElement::selectionPseudoStyle):
1415 * rendering/RenderLayer.cpp:
1416 (WebCore::rendererForScrollbar):
1417 * svg/SVGElement.cpp:
1418 (WebCore::SVGElement::correspondingUseElement):
1419 * testing/Internals.cpp:
1420 (WebCore::Internals::shadowRootType):
1422 2015-09-15 Brent Fulgham <bfulgham@apple.com>
1424 [Win] Unreviewed release fix after r189832
1426 * platform/graphics/ca/win/PlatformCALayerWin.h: The implementation
1427 should exist in Release builds as well.
1429 2015-09-15 Benjamin Poulain <bpoulain@apple.com>
1431 Style invalidation affecting siblings does not work with inline-style changes
1432 https://bugs.webkit.org/show_bug.cgi?id=149189
1434 Reviewed by Antti Koivisto.
1436 Style::resolveTree() made the assumption that inline style changes only affect
1437 descendants and should not participate in "StyleRecalcAffectsNextSiblingElementStyle".
1438 That was wrong. If the inline style change through CSSOM, it can cause the creation
1439 of a style attribute, which is observable through "StyleRecalcAffectsNextSiblingElementStyle".
1441 This patch removes the incorrect assumption. Style invalidation is always propagated now.
1443 Tests: fast/css/style-attribute-invalidation-propagates-to-counted-siblings.html
1444 fast/css/style-attribute-invalidation-propagates-to-direct-siblings.html
1445 fast/css/style-attribute-invalidation-propagates-to-indirect-siblings.html
1447 * css/PropertySetCSSStyleDeclaration.cpp:
1448 (WebCore::InlineCSSStyleDeclaration::didMutate): Deleted.
1449 * dom/StyledElement.cpp:
1450 (WebCore::StyledElement::inlineStyleChanged):
1451 * dom/StyledElement.h:
1452 (WebCore::StyledElement::invalidateStyleAttribute):
1453 Clean up inline-style invalidation a tiny bit.
1455 * style/StyleResolveTree.cpp:
1456 (WebCore::Style::resolveTree):
1459 2015-09-15 Joseph Pecoraro <pecoraro@apple.com>
1461 Web Inspector: Paused Debugger prevents page reload
1462 https://bugs.webkit.org/show_bug.cgi?id=148174
1464 Reviewed by Brian Burg.
1466 When navigating the page while paused, suppress any pausing until the page
1467 has completed navigation. If not paused and navigating, you can still pause
1468 in pagehide and unload handlers or other late page events.
1470 Could not write a reliable test for this at the moment.
1471 InspectorTest.reloadPage has multiple issues with the output,
1472 so I'll investigate making reload tests more reliable later.
1474 * inspector/InspectorController.h:
1475 * inspector/InspectorController.cpp:
1476 (WebCore::InspectorController::resume): Deleted.
1477 * loader/FrameLoader.cpp:
1478 (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1479 We now use existing InspectorInstrumentation functions instead of a method
1480 on InspectorController during load. In dropping the method InspectorController
1481 can drop a member variable no longer used.
1483 * inspector/InspectorInstrumentation.h:
1484 (WebCore::InspectorInstrumentation::willStartProvisionalLoad):
1485 Add a new instrumentation hook.
1487 * inspector/InspectorInstrumentation.cpp:
1488 (WebCore::InspectorInstrumentation::willStartProvisionalLoadImpl):
1489 (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1490 When starting or completing main frame navigations, let the PageDebuggerAgent do some work.
1492 * inspector/PageDebuggerAgent.h:
1493 * inspector/PageDebuggerAgent.cpp:
1494 (WebCore::PageDebuggerAgent::mainFrameStartedLoading):
1495 (WebCore::PageDebuggerAgent::mainFrameStoppedLoading):
1496 (WebCore::PageDebuggerAgent::mainFrameNavigated):
1497 Suppress pausing if navigating while paused. Otherwise behave as normal.
1499 2015-09-15 Brent Fulgham <bfulgham@apple.com>
1501 [Win] Provide a means for viewing the layer tree
1502 https://bugs.webkit.org/show_bug.cgi?id=149165
1504 Reviewed by Simon Fraser.
1506 Revise the old fprintf logic to generate a string
1507 containing the layer tree so that it can be output
1508 to the debugger (or elsewhere).
1510 * platform/graphics/ca/PlatformCALayer.h: Rename 'printTree'
1511 to 'printLayerTree', and make it available in release builds.
1512 * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1513 (WebCore::CACFLayerTreeHost::printLayerTree): Added. Calls into
1514 the PlatformCALayer implementation.
1515 * platform/graphics/ca/win/CACFLayerTreeHost.h:
1516 * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1517 (printIndent): Revise to use two-space indent and use StringBuilder.
1518 (printTransform): Ditto.
1519 (printColor): Added helper function.
1520 (printLayer): Revised to output information on the layer contents.
1521 (PlatformCALayerWin::printLayerTree): Renamed from 'printTree'.
1522 (PlatformCALayerWin::printTree): Deleted.
1523 * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1524 (PlatformCALayerWinInternal::drawRepaintCounters): Drive-by fix. Match the
1525 cocoa repaint counter logic by not painting counters for the layers that
1526 contain the tile grid.
1527 * platform/graphics/ca/win/PlatformCALayerWin.h:
1528 * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1529 (PlatformCALayerWinInternal::drawRepaintCounters):
1531 2015-09-15 Myles C. Maxfield <mmaxfield@apple.com>
1533 REGRESSION(r155554): Nested isolates can cause an infinite loop when laying out bidi runs
1534 https://bugs.webkit.org/show_bug.cgi?id=149153
1536 Reviewed by David Hyatt.
1538 When traversing bidi runs, we might encounter a run which is supposed to be isolated. In this
1539 situation, we will append a placeholder run in the run list, and remember a pointer to these
1540 isolated runs inside BidiResolver. Then, once we're done traversing the bidi runs, we return
1541 to the isolated runs and handle them separately (and replace the placeholder with the result).
1543 However, due to the fact that our BidiRuns start at leaf nodes, we have to keep track of which
1544 local root of the render tree we were inspecting (to ensure that we visit the same node
1545 multiple times if there are nested isolate spans). We were not correctly keeping track of this
1546 local root, which was leading us to consider the same root multiple times, thereby leading to
1549 The solution is simply to keep root information alongside the isolated run information inside
1550 BidiResolver. However, BidiResolver is inside platform/, which means that this new type should
1551 be a template argument, just like how BidiRun itself is a template argument.
1553 This new type, BidiIsolatedRun, holds all the information that our isolate-revisiting logic
1554 needs inside constructBidiRunsForSegment(). It also holds a reference to the placeholder run
1555 which we will replace.
1557 Test: fast/text/international/unicode-bidi-isolate-nested-crash.html
1559 * platform/graphics/GraphicsContext.cpp:
1560 (WebCore::GraphicsContext::drawBidiText): BidiIsolatedRun template argument is unused, so pass
1562 * platform/text/BidiResolver.h: Add template argument.
1563 (WebCore::BidiResolver::isolatedRuns):
1564 (WebCore::IsolatedRun>::~BidiResolver):
1565 (WebCore::IsolatedRun>::appendRun):
1566 (WebCore::IsolatedRun>::embed):
1567 (WebCore::IsolatedRun>::checkDirectionInLowerRaiseEmbeddingLevel):
1568 (WebCore::IsolatedRun>::lowerExplicitEmbeddingLevel):
1569 (WebCore::IsolatedRun>::raiseExplicitEmbeddingLevel):
1570 (WebCore::IsolatedRun>::commitExplicitEmbedding):
1571 (WebCore::IsolatedRun>::updateStatusLastFromCurrentDirection):
1572 (WebCore::IsolatedRun>::reorderRunsFromLevels):
1573 (WebCore::IsolatedRun>::createBidiRunsForLine):
1574 (WebCore::IsolatedRun>::setMidpointForIsolatedRun): Use references instead of pointers.
1575 (WebCore::IsolatedRun>::midpointForIsolatedRun): Ditto.
1576 (WebCore::Run>::~BidiResolver): Deleted.
1577 (WebCore::Run>::appendRun): Deleted.
1578 (WebCore::Run>::embed): Deleted.
1579 (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
1580 (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
1581 (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
1582 (WebCore::Run>::commitExplicitEmbedding): Deleted.
1583 (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
1584 (WebCore::Run>::reorderRunsFromLevels): Deleted.
1585 (WebCore::Run>::createBidiRunsForLine): Deleted.
1586 (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
1587 (WebCore::Run>::midpointForIsolatedRun): Deleted.
1588 * rendering/InlineIterator.h:
1589 (WebCore::BidiIsolatedRun::BidiIsolatedRun): New type.
1590 (WebCore::addPlaceholderRunForIsolatedInline): Create new type, and include local root
1592 (WebCore::IsolateTracker::addFakeRunIfNecessary): Include local root information.
1593 (WebCore::InlineBidiResolver::appendRun): Ditto.
1594 * rendering/RenderBlockLineLayout.cpp: Update for new BidiIsolatedRun type.
1595 (WebCore::setUpResolverToResumeInIsolate):
1596 (WebCore::constructBidiRunsForSegment):
1597 * rendering/line/TrailingObjects.h:
1599 2015-09-15 Brady Eidson <beidson@apple.com>
1601 Add empty IDBFactory implementation for Modern IDB.
1602 https://bugs.webkit.org/show_bug.cgi?id=149191
1604 Reviewed by Jer Noble.
1606 No new tests (No behavior change).
1608 * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1609 (WebCore::DOMWindowIndexedDatabase::indexedDB):
1611 * Modules/indexeddb/client/IDBFactoryImpl.cpp:
1612 (WebCore::IDBClient::IDBFactory::create):
1613 (WebCore::IDBClient::IDBFactory::IDBFactory):
1614 (WebCore::IDBClient::IDBFactory::getDatabaseNames):
1615 (WebCore::IDBClient::IDBFactory::open):
1616 (WebCore::IDBClient::IDBFactory::deleteDatabase):
1617 (WebCore::IDBClient::IDBFactory::cmp):
1618 * Modules/indexeddb/client/IDBFactoryImpl.h:
1621 * WebCore.xcodeproj/project.pbxproj:
1623 * loader/EmptyClients.cpp:
1624 * page/DatabaseProvider.h:
1626 2015-09-15 Antti Koivisto <antti@apple.com>
1628 Split FontDescription into lower and higher level types
1629 https://bugs.webkit.org/show_bug.cgi?id=149036
1631 Reviewed by Darin Adler.
1633 Currently FontDescription is used through the text subsystem. However much of the data it
1634 carries is only needed by FontCascade and text layout but not by the lower level Font/FontCache
1635 layer. This makes code confusing. For example families specified in FontDescription are ignored
1638 Split it into a low level FontDescription and a high level FontCascadeDescription type:
1640 FontDescription <-> Font
1641 FontCascadeDescription <-> FontCascade
1643 The former only carries information that is needed to instantiate a Font or fetch it from the FontCache.
1644 The latter has additional data for CSS font cascade semantics and other higher level features.
1646 2015-09-15 Myles C. Maxfield <mmaxfield@apple.com>
1648 GraphicsContext::drawBidiText()'s BidiResolver should not have isolated runs
1649 https://bugs.webkit.org/show_bug.cgi?id=149193
1651 Reviewed by Anders Carlsson.
1653 There are two users of BidiResolver, one which needs isolated runs (in RenderBlockLineLayout) and
1654 one which doesn't (in GraphicsContext::drawBidiText()). Because of [1], the isolated runs vector
1655 is migrating to a new type outside of platform/. Therefore, only the first user of BidiResolver
1656 should have this member variable.
1658 This is achieved by creating two subclasses of BidiResolver, and using the Curiously Repeating
1659 Template pattern to downcast into specializations.
1661 [1] https://bugs.webkit.org/show_bug.cgi?id=149153
1663 No new tests because there is no behavior change.
1665 * platform/text/BidiResolver.h:
1666 (WebCore::BidiResolverBase::BidiResolverBase):
1667 (WebCore::BidiResolverBase::increment):
1668 (WebCore::BidiResolverBase::appendRun):
1669 (WebCore::BidiResolverBase::incrementInternal):
1670 (WebCore::IsolateRun>::~BidiResolverWithIsolate):
1671 (WebCore::Subclass>::appendRunInternal):
1672 (WebCore::Subclass>::embed):
1673 (WebCore::Subclass>::checkDirectionInLowerRaiseEmbeddingLevel):
1674 (WebCore::Subclass>::lowerExplicitEmbeddingLevel):
1675 (WebCore::Subclass>::raiseExplicitEmbeddingLevel):
1676 (WebCore::Subclass>::commitExplicitEmbedding):
1677 (WebCore::Subclass>::updateStatusLastFromCurrentDirection):
1678 (WebCore::Subclass>::reorderRunsFromLevels):
1679 (WebCore::Subclass>::createBidiRunsForLine):
1680 (WebCore::Subclass>::setMidpointForIsolatedRun):
1681 (WebCore::Subclass>::midpointForIsolatedRun):
1682 (WebCore::BidiResolver::BidiResolver): Deleted.
1683 (WebCore::BidiResolver::increment): Deleted.
1684 (WebCore::BidiResolver::isolatedRuns): Deleted.
1685 (WebCore::Run>::~BidiResolver): Deleted.
1686 (WebCore::Run>::appendRun): Deleted.
1687 (WebCore::Run>::embed): Deleted.
1688 (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
1689 (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
1690 (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
1691 (WebCore::Run>::commitExplicitEmbedding): Deleted.
1692 (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
1693 (WebCore::Run>::reorderRunsFromLevels): Deleted.
1694 (WebCore::Run>::createBidiRunsForLine): Deleted.
1695 (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
1696 (WebCore::Run>::midpointForIsolatedRun): Deleted.
1697 * rendering/InlineIterator.h:
1698 (WebCore::InlineBidiResolver::incrementInternal):
1699 (WebCore::InlineBidiResolver::appendRunInternal):
1700 (WebCore::InlineBidiResolver::increment): Deleted.
1701 (WebCore::InlineBidiResolver::appendRun): Deleted.
1702 * rendering/line/TrailingObjects.h:
1704 2015-09-15 Chris Dumez <cdumez@apple.com>
1706 new Event() without parameter should throw
1707 https://bugs.webkit.org/show_bug.cgi?id=149146
1708 <rdar://problem/22565070>
1710 Reviewed by Ryosuke Niwa.
1712 new Event() without parameter should throw because the type parameter
1713 is mandatory as per the specification:
1714 https://dom.spec.whatwg.org/#interface-event
1716 Both Firefox and Chrome throw in this case. However, WebKit was
1717 creating an event whose type is the string "undefined". This patch
1718 aligns our behavior with the specification and other major browsers.
1720 No new tests, already covered by existing test.
1722 * bindings/scripts/CodeGeneratorJS.pm:
1723 (GenerateConstructorDefinition):
1724 * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1725 (WebCore::JSTestEventConstructorConstructor::constructJSTestEventConstructor):
1727 2015-09-15 Carlos Alberto Lopez Perez <clopez@igalia.com>
1729 [GTK] Build failure with ACCELERATED_2D_CANVAS when cairo-gl has built with OpenGLESv2 support only.
1730 https://bugs.webkit.org/show_bug.cgi?id=149172
1732 Reviewed by Martin Robinson.
1734 No new tests, no behavior change.
1736 * platform/graphics/glx/GLContextGLX.cpp:
1737 (WebCore::GLContextGLX::cairoDevice):
1739 2015-09-15 Chris Dumez <cdumez@apple.com>
1741 Element.getAttributeNS() should return null if the attribute does not exist
1742 https://bugs.webkit.org/show_bug.cgi?id=149180
1743 <rdar://problem/22561011>
1745 Reviewed by Ryosuke Niwa.
1747 Element.getAttributeNS() should return null if the attribute does not
1748 exist, similarly to what Element.getAttribute() does:
1749 - https://dom.spec.whatwg.org/#element (both return a nullable DOMString).
1750 - https://dom.spec.whatwg.org/#dom-element-getattributens (step 2)
1752 Firefox and Chrome match the specification. However, WebKit was returning
1753 an empty string for getAttributeNS() and null for getAttribute(). This
1754 patch aligns WebKit's behavior with the specification and other browsers.
1756 No new tests, already covered by existing tests.
1760 2015-09-15 Ryosuke Niwa <rniwa@webkit.org>
1762 ContentDistribution should be only used for details elements
1763 https://bugs.webkit.org/show_bug.cgi?id=149148
1765 Reviewed by Antti Koivisto.
1767 Extracted ShadowRootWithInsertionPoints out of ShadowRoot for HTMLDetailsElement and HTMLSummaryElement.
1769 We don't add a separate .h and .cpp files since this is a temporary measure until we replace it with
1770 a slot-based shadow DOM implementation.
1772 No new tests. There should be no observable behavioral change.
1775 (WebCore::Element::addShadowRoot): Removed the call to didShadowBoundaryChange since this function is only
1776 called in ensureUserAgentShadowRoot. Also moved the call to didAddUserAgentShadowRoot for
1777 HTMLDetailsElement's shadow root which uses this function instead of ensureUserAgentShadowRoot.
1778 (WebCore::Element::removeShadowRoot): Removed the call to invalidateDistribution since it's only called by
1780 (WebCore::Element::createShadowRoot):
1781 (WebCore::Element::ensureUserAgentShadowRoot): Moved the call didAddUserAgentShadowRoot into addShadowRoot
1782 since HTMLDetailsElement uses a subclass of ShadowRoot.
1783 (WebCore::Element::childrenChanged):
1784 (WebCore::Element::removeAllEventListeners):
1787 (Element::addShadowRoot): Made this function a protected member as it's now used by HTMLDetailsElement.
1789 * dom/ShadowRoot.cpp:
1790 (WebCore::ShadowRoot::childrenChanged): Deleted.
1793 (WebCore::ShadowRoot::distributor): Made this a virtual function and return nullptr by default.
1794 (WebCore::ShadowRoot::isOrphan):
1796 * html/HTMLDetailsElement.cpp:
1797 (WebCore::HTMLDetailsElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
1799 * html/HTMLInputElement.cpp:
1800 (WebCore::HTMLInputElement::runPostTypeUpdateTasks): Removed the call to invalidateDistribution since it's
1801 only relevant for HTMLDetailsElement's shadow DOM.
1803 * html/HTMLSummaryElement.cpp:
1804 (WebCore::HTMLSummaryElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
1806 * html/shadow/ContentDistributor.cpp:
1807 (WebCore::ContentDistributor::distribute):
1808 (WebCore::ContentDistributor::ensureDistribution):
1809 (WebCore::ContentDistributor::invalidateDistribution):
1811 * html/shadow/InsertionPoint.cpp:
1812 (WebCore::InsertionPoint::childrenChanged):
1813 (WebCore::InsertionPoint::insertedInto):
1814 (WebCore::InsertionPoint::removedFrom):
1815 (WebCore::findInsertionPointOf):
1816 (WebCore::ShadowRootWithInsertionPoints::childrenChanged): Moved from ShadowRoot.
1818 * html/shadow/InsertionPoint.h:
1819 (WebCore::ShadowRootWithInsertionPoints::create): Added.
1820 (WebCore::ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints): Added.
1822 2015-09-15 Brent Fulgham <bfulgham@apple.com>
1824 [Win] Tiled drawing is rendering more times than it should
1825 https://bugs.webkit.org/show_bug.cgi?id=149144
1826 <rdar://problem/22313905>
1828 Reviewed by Simon Fraser.
1830 Provide a more faithful implemenation of the Objective C tiled drawing logic.
1831 (1) Create a new WebTiledBackingLayerWin class that represents a the
1832 container of tiles. This matches the Objective C design.
1833 (2) Move implementation of several methods (e.g., isOpaque) to the internal
1834 class implementation so that the Tile Drawing logic can perform special
1835 handling in these cases.
1836 (3) Remove the duplicated Tiled Drawing logic from PlatformCALayerWinInternal,
1837 since it was just duplicating code in TileController and TileGrid.
1838 (4) Clean up the display callback code to avoid performing incorrect flipping
1839 of the coordinate system.
1841 * PlatformAppleWin.cmake: Add new WebTiledBackingLayerWin file.
1842 * WebCore.vcxproj/WebCore.vcxproj: Add the new WebTiledBackingLayerWin files.
1843 * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1844 * platform/graphics/ca/PlatformCALayer.cpp:
1845 (PlatformCALayer::flipContext): Added convenience method.
1846 (PlatformCALayer::drawRepaintIndicator): Ditto.
1847 * platform/graphics/ca/TileGrid.cpp:
1848 (TileGrid::platformCALayerPaintContents): Flip the context before drawing the repaint
1849 indicator on Windows.
1850 * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1851 (PlatformCALayerWin::PlatformCALayerWin): Create a WebTiledBackingLayerWin
1852 object if using tiled drawing.
1853 (PlatformCALayerWin::~PlatformCALayerWin):
1854 (PlatformCALayerWin::isOpaque): Move implementation to internal class.
1855 (PlatformCALayerWin::setOpaque): Ditto.
1856 (PlatformCALayerWin::setBorderWidth): Ditto.
1857 (PlatformCALayerWin::setBorderColor): Ditto.
1858 (PlatformCALayerWin::contentsScale): Ditto.
1859 (PlatformCALayerWin::setContentsScale): Ditto.
1860 (PlatformCALayerWin::cornerRadius): Ditto.
1861 (PlatformCALayerWin::tiledBacking): Ditto.
1862 (PlatformCALayerWin::drawTextAtPoint): New helper method to draw repaint counter
1863 text. Needed to work around bug in CG.
1864 * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1865 (PlatformCALayerWinInternal::PlatformCALayerWinInternal): Remove tiling-logic
1866 related member variables.
1867 (PlatformCALayerWinInternal::~PlatformCALayerWinInternal):
1868 (shouldInvertBeforeDrawingContent): Added convenience method.
1869 (shouldInvertBeforeDrawingRepaintCounters): Ditto.
1870 (PlatformCALayerWinInternal::displayCallback):
1871 (PlatformCALayerWinInternal::drawRepaintCounters): Helper method to
1872 share code between the two layer classes.
1873 (PlatformCALayerWinInternal::internalSetNeedsDisplay): use nullptr.
1874 (PlatformCALayerWinInternal::setNeedsDisplay): Ditto.
1875 (PlatformCALayerWinInternal::setNeedsDisplayInRect): Move tiled code
1876 to WebTiledBackingLayerWin and simplify the remaing code.
1877 (PlatformCALayerWinInternal::setSublayers): Remove tile code.
1878 (PlatformCALayerWinInternal::getSublayers): Ditto.
1879 (PlatformCALayerWinInternal::removeAllSublayers): Ditto.
1880 (PlatformCALayerWinInternal::insertSublayer): Ditto.
1881 (PlatformCALayerWinInternal::sublayerCount): Ditto.
1882 (PlatformCALayerWinInternal::indexOfSublayer): Ditto.
1883 (PlatformCALayerWinInternal::sublayerAtIndex): Ditto.
1884 (PlatformCALayerWinInternal::setBounds): Ditto.
1885 (PlatformCALayerWinInternal::setFrame): Ditto.
1886 (PlatformCALayerWinInternal::isOpaque): Ditto.
1887 (PlatformCALayerWinInternal::setOpaque): Ditto.
1888 (PlatformCALayerWinInternal::contentsScale): Ditto.
1889 (PlatformCALayerWinInternal::setContentsScale): Ditto.
1890 (PlatformCALayerWinInternal::setBorderWidth): Ditto.
1891 (PlatformCALayerWinInternal::setBorderColor): Ditto.
1892 (layerTypeIsTiled): Deleted.
1893 (PlatformCALayerWinInternal::constrainedSize): Deleted.
1894 (PlatformCALayerWinInternal::tileDisplayCallback): Deleted.
1895 (PlatformCALayerWinInternal::addTile): Deleted.
1896 (PlatformCALayerWinInternal::removeTile): Deleted.
1897 (PlatformCALayerWinInternal::tileAtIndex): Deleted.
1898 (PlatformCALayerWinInternal::tileCount): Deleted.
1899 (PlatformCALayerWinInternal::updateTiles): Deleted.
1900 (PlatformCALayerWinInternal::drawTile): Deleted.
1901 (PlatformCALayerWinInternal::createTileController): Deleted.
1902 (PlatformCALayerWinInternal::tiledBacking): Deleted.
1903 * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
1904 (WebCore::PlatformCALayerWinInternal::owner):
1905 * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp: Added.
1906 (WebTiledBackingLayerWin::WebTiledBackingLayerWin):
1907 (WebTiledBackingLayerWin::~WebTiledBackingLayerWin):
1908 (DisplayOnMainThreadContext::DisplayOnMainThreadContext):
1909 (redispatchOnMainQueue):
1910 (WebTiledBackingLayerWin::displayCallback):
1911 (WebTiledBackingLayerWin::setNeedsDisplay):
1912 (WebTiledBackingLayerWin::setNeedsDisplayInRect):
1913 (WebTiledBackingLayerWin::setBounds):
1914 (WebTiledBackingLayerWin::isOpaque):
1915 (WebTiledBackingLayerWin::setOpaque):
1916 (WebTiledBackingLayerWin::contentsScale):
1917 (WebTiledBackingLayerWin::setContentsScale):
1918 (WebTiledBackingLayerWin::setBorderWidth):
1919 (WebTiledBackingLayerWin::setBorderColor):
1920 (WebTiledBackingLayerWin::createTileController):
1921 (WebTiledBackingLayerWin::tiledBacking):
1922 (WebTiledBackingLayerWin::invalidate):
1923 * platform/graphics/ca/win/WebTiledBackingLayerWin.h: Added.
1925 2015-09-14 David Hyatt <hyatt@apple.com>
1927 [New Block-Inside-Inline Model] Implement margin collapsing across contiguous anonymous inline blocks.
1928 https://bugs.webkit.org/show_bug.cgi?id=149132
1930 Reviewed by Zalan Bujtas.
1932 Added new tests inside fast/block/inside-inlines/
1934 * rendering/InlineFlowBox.cpp:
1935 (WebCore::InlineFlowBox::anonymousInlineBlock):
1936 Change this accessor to be more robust and be willing to both recur (in case we ever do decide intermediate line boxes should exist)
1937 and to type check. This is not currently needed, but I'm just being paranoid and future proof.
1939 (WebCore::InlineFlowBox::addToLine):
1940 Again, for thoroughness, I am making sure to propagate the hasAnonymousInlineBlock() bit through to parents. This is only needed
1941 if we build intermediate line boxes for lines with anonymous inline blocks.
1943 (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
1944 Anonymous inline blocks receive a layout via layoutBlockChild, in order to make sure that margin collapsing runs. This means
1945 that unlike other line objects, the position of the child has been determined already. Therefore we simply set the position
1946 of the line box that wraps the anonymous inline block to the already-computed position for that block.
1948 Also patch the code that sets lineTop and lineBottom using the root box's dimensions. We don't really care about the root line
1949 box on anonymous inline block lines and just want to set lineTop and lineBottom to fit the anonymous inline block.
1951 * rendering/RenderBlockFlow.cpp:
1952 (WebCore::RenderBlockFlow::collapseMargins):
1953 (WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
1954 Refactor collapseMargins to call a helper function that can pass in a previous "sibling", and that can handle the child
1955 being null. We do this to perform a margin collapse when anonymous inline blocks run up against regular lines (which is like
1956 collapsing with a sibling block "child").
1958 * rendering/RenderBlockFlow.h:
1959 Tweak the MarginInfo constructor to take a const RenderBlockFlow. Tweak some line layout methods to pass in the LineLayoutState
1960 so that MarginInfo is available during line layout.
1962 * rendering/RenderBlockLineLayout.cpp:
1963 (WebCore::RenderBlockFlow::createLineBoxes):
1964 When we create a new line box, if it is not an anonymous inline block line and our previous line was, simulate a margin
1965 collapse in order to possibly push the line box down or up. Re-use the pagination adjustment code to rewind line layout
1966 and perform it again if pushed below a float.
1968 (WebCore::constructBidiRunsForSegment):
1969 (WebCore::RenderBlockFlow::layoutRunsAndFloats):
1970 (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1971 (WebCore::RenderBlockFlow::layoutLineBoxes):
1972 (WebCore::RenderBlockFlow::determineStartPosition):
1973 (WebCore::RenderBlockFlow::matchedEndLine):
1974 (WebCore::RenderBlockFlow::updateRegionForLine):
1975 (WebCore::RenderBlockFlow::marginCollapseLinesFromStart):
1976 Patch line layout to run margin collapsing when anonymous inline blocks are encountered. This involves making sure
1977 margin info and float bottom positions are passed through so that layoutBlockChild can be properly called on
1978 anonymous inline blocks that we encounter.
1980 In addition line layout when it syncs dirty lines has to run margin collapsing on earlier lines in order to make
1981 sure margin info is properly set up at the first dirty line position.
1983 Note that there will be more improvements/changes in this area (dirty line syncing), as the current model is inefficient
1984 when many anonymous inline blocks are scattered throughout a large-scale line box tree.
1986 * rendering/RootInlineBox.cpp:
1987 (WebCore::RootInlineBox::alignBoxesInBlockDirection):
1988 (WebCore::RootInlineBox::ascentAndDescentForBox):
1989 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
1990 an effect on ascent/descent.
1992 * rendering/line/BreakingContext.h:
1993 (WebCore::BreakingContext::BreakingContext):
1994 (WebCore::BreakingContext::handleReplaced):
1995 When we encounter an anonymous inline block, lay it out when it is seen. We have to delay the layout, since we have
1996 to be able to perform it mid-line-layout when the containing block's logical height is at the correct value and all previous
1997 lines are placed. Margin info also has to be current.
1999 * rendering/line/LineBreaker.cpp:
2000 * rendering/line/LineBreaker.h:
2001 Patched to pass LineLayoutState through so that the stuff we need to perform block layout is available (margin info and float vars).
2003 * rendering/line/LineLayoutState.h:
2004 Add the block layout margin and float bottom information to the line layout state so that we have it available when performing
2005 layouts and margin collapses on anonymous inline block children.
2007 2015-09-15 Brady Eidson <beidson@apple.com>
2009 Make the IDBAny::Type enum into an enum class.
2010 https://bugs.webkit.org/show_bug.cgi?id=149169.
2012 Reviewed by Oliver Hunt.
2014 No new tests (Cleanup, no behavior change).
2016 * Modules/indexeddb/IDBAny.h:
2017 * Modules/indexeddb/legacy/LegacyAny.cpp:
2018 (WebCore::LegacyAny::createInvalid):
2019 (WebCore::LegacyAny::createNull):
2020 (WebCore::LegacyAny::LegacyAny):
2021 (WebCore::LegacyAny::domStringList):
2022 (WebCore::LegacyAny::idbCursor):
2023 (WebCore::LegacyAny::idbCursorWithValue):
2024 (WebCore::LegacyAny::idbDatabase):
2025 (WebCore::LegacyAny::idbFactory):
2026 (WebCore::LegacyAny::idbIndex):
2027 (WebCore::LegacyAny::idbObjectStore):
2028 (WebCore::LegacyAny::idbTransaction):
2029 (WebCore::LegacyAny::scriptValue):
2030 (WebCore::LegacyAny::string):
2031 (WebCore::LegacyAny::integer):
2032 (WebCore::LegacyAny::legacyCursor):
2033 (WebCore::LegacyAny::legacyCursorWithValue):
2034 (WebCore::LegacyAny::legacyDatabase):
2035 (WebCore::LegacyAny::legacyFactory):
2036 (WebCore::LegacyAny::legacyIndex):
2037 (WebCore::LegacyAny::legacyObjectStore):
2038 (WebCore::LegacyAny::legacyTransaction):
2039 * Modules/indexeddb/legacy/LegacyCursor.cpp:
2040 (WebCore::LegacyCursor::LegacyCursor):
2041 (WebCore::LegacyCursor::effectiveObjectStore):
2042 * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
2043 * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp:
2044 (WebCore::LegacyOpenDBRequest::dispatchEvent):
2045 * Modules/indexeddb/legacy/LegacyRequest.cpp:
2046 (WebCore::LegacyRequest::getResultCursor):
2047 (WebCore::effectiveObjectStore):
2048 * bindings/js/JSIDBAnyCustom.cpp:
2050 * inspector/InspectorIndexedDBAgent.cpp:
2051 * page/DatabaseProvider.h:
2053 2015-09-15 Brady Eidson <beidson@apple.com>
2055 Move most IDB object encoding/decoding from WebKit2 to WebCore.
2056 https://bugs.webkit.org/show_bug.cgi?id=149152
2058 Reviewed by Alex Christensen.
2060 No new tests (Cleanup, no behavior change).
2062 * Modules/indexeddb/IDBDatabaseMetadata.h:
2063 (WebCore::IDBDatabaseMetadata::encode):
2064 (WebCore::IDBDatabaseMetadata::decode):
2065 * Modules/indexeddb/IDBIndexMetadata.h:
2066 (WebCore::IDBIndexMetadata::encode):
2067 (WebCore::IDBIndexMetadata::decode):
2068 * Modules/indexeddb/IDBKeyData.h:
2069 (WebCore::IDBKeyData::encode):
2070 (WebCore::IDBKeyData::decode):
2071 * Modules/indexeddb/IDBKeyPath.h:
2072 (WebCore::IDBKeyPath::encode):
2073 (WebCore::IDBKeyPath::decode):
2074 * Modules/indexeddb/IDBKeyRangeData.h:
2075 (WebCore::IDBKeyRangeData::encode):
2076 (WebCore::IDBKeyRangeData::decode):
2077 * Modules/indexeddb/IDBObjectStoreMetadata.h:
2078 (WebCore::IDBObjectStoreMetadata::encode):
2079 (WebCore::IDBObjectStoreMetadata::decode):
2081 2015-09-14 Brady Eidson <beidson@apple.com>
2083 Make the enum IDBKey::Type into a utility enum class.
2084 https://bugs.webkit.org/show_bug.cgi?id=149149
2086 Reviewed by Alex Christensen.
2088 No new tests (Cleanup, no behavior change).
2090 * Modules/indexeddb/IDBKey.cpp:
2091 (WebCore::IDBKey::isValid):
2092 (WebCore::IDBKey::compare):
2093 * Modules/indexeddb/IDBKey.h:
2094 (WebCore::IDBKey::createNumber):
2095 (WebCore::IDBKey::createDate):
2096 (WebCore::IDBKey::createMultiEntryArray):
2097 (WebCore::IDBKey::createArray):
2098 (WebCore::IDBKey::type):
2099 (WebCore::IDBKey::array):
2100 (WebCore::IDBKey::string):
2101 (WebCore::IDBKey::date):
2102 (WebCore::IDBKey::number):
2103 (WebCore::IDBKey::compareTypes):
2104 (WebCore::IDBKey::IDBKey):
2105 * Modules/indexeddb/IDBKeyData.cpp:
2106 (WebCore::IDBKeyData::IDBKeyData):
2107 (WebCore::IDBKeyData::maybeCreateIDBKey):
2108 (WebCore::IDBKeyData::isolatedCopy):
2109 (WebCore::IDBKeyData::encode):
2110 (WebCore::IDBKeyData::decode):
2111 (WebCore::IDBKeyData::compare):
2112 (WebCore::IDBKeyData::loggingString):
2113 (WebCore::IDBKeyData::setArrayValue):
2114 (WebCore::IDBKeyData::setStringValue):
2115 (WebCore::IDBKeyData::setDateValue):
2116 (WebCore::IDBKeyData::setNumberValue):
2117 * Modules/indexeddb/IDBKeyData.h:
2118 (WebCore::IDBKeyData::IDBKeyData):
2119 (WebCore::IDBKeyData::minimum):
2120 (WebCore::IDBKeyData::maximum):
2121 * Modules/indexeddb/IndexedDB.h:
2122 * bindings/js/IDBBindingUtilities.cpp:
2123 (WebCore::idbKeyToJSValue):
2124 (WebCore::createIDBKeyFromValue):
2125 (WebCore::createIDBKeyFromScriptValueAndKeyPath):
2126 (WebCore::generateIndexKeysForValue):
2127 * inspector/InspectorIndexedDBAgent.cpp:
2129 2015-09-15 Javier Fernandez <jfernandez@igalia.com>
2131 [CSS Grid Layout] Using {row, column}-axis terms in alignment related logic
2132 https://bugs.webkit.org/show_bug.cgi?id=148942
2134 Reviewed by Sergio Villar Senin.
2136 This patch changes the names of several functions and variables
2137 defined to implement the alignment logic. We want to use from now
2138 on the terms row-axis and column-axis when referring to the
2139 alignment direction the logic is applied to.
2141 No new tests, no new functionality.
2143 * rendering/RenderGrid.cpp:
2144 (WebCore::RenderGrid::columnAxisOffsetForChild):
2145 (WebCore::RenderGrid::rowAxisOffsetForChild):
2146 (WebCore::RenderGrid::findChildLogicalPosition):
2147 * rendering/RenderGrid.h:
2149 2015-09-14 Gyuyoung Kim <gyuyoung.kim@webkit.org>
2151 Remove all uses of PassRefPtr in WebCore/xml
2152 https://bugs.webkit.org/show_bug.cgi?id=149114
2154 Reviewed by Darin Adler.
2156 * dom/DecodedDataDocumentParser.h:
2157 * dom/DocumentParser.h:
2158 * dom/RawDataDocumentParser.h:
2159 * html/FTPDirectoryDocument.cpp:
2160 (WebCore::FTPDirectoryDocumentParser::append):
2161 * html/parser/HTMLDocumentParser.cpp:
2162 (WebCore::HTMLDocumentParser::append):
2163 * html/parser/HTMLDocumentParser.h:
2164 * html/parser/TextDocumentParser.cpp:
2165 (WebCore::TextDocumentParser::append):
2166 * html/parser/TextDocumentParser.h:
2167 * xml/NativeXPathNSResolver.cpp:
2168 (WebCore::NativeXPathNSResolver::NativeXPathNSResolver):
2169 * xml/NativeXPathNSResolver.h:
2170 (WebCore::NativeXPathNSResolver::create):
2171 * xml/XMLErrors.cpp:
2172 (WebCore::createXHTMLParserErrorHeader):
2173 * xml/XMLHttpRequestProgressEventThrottle.cpp:
2174 (WebCore::XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent):
2175 (WebCore::XMLHttpRequestProgressEventThrottle::dispatchEvent):
2176 (WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents):
2177 * xml/XMLHttpRequestProgressEventThrottle.h:
2178 * xml/XMLSerializer.h:
2179 * xml/XPathEvaluator.cpp:
2180 (WebCore::XPathEvaluator::createExpression):
2181 (WebCore::XPathEvaluator::createNSResolver):
2182 (WebCore::XPathEvaluator::evaluate):
2183 * xml/XPathEvaluator.h:
2184 * xml/XPathNodeSet.h: Fix style errors.
2185 (WebCore::XPath::NodeSet::NodeSet):
2186 (WebCore::XPath::NodeSet::append):
2187 * xml/XPathPath.cpp:
2188 (WebCore::XPath::Filter::evaluate):
2189 (WebCore::XPath::LocationPath::evaluate):
2190 * xml/XPathValue.h: ditto.
2191 (WebCore::XPath::Value::Value):
2192 (WebCore::XPath::Value::Data::create):
2193 (WebCore::XPath::Value::Data::Data):
2194 * xml/XSLTProcessor.cpp:
2195 (WebCore::XSLTProcessor::transformToDocument):
2196 (WebCore::XSLTProcessor::transformToFragment):
2197 * xml/XSLTProcessor.h:
2198 (WebCore::XSLTProcessor::setXSLStyleSheet):
2199 (WebCore::XSLTProcessor::importStylesheet):
2200 * xml/parser/XMLDocumentParser.cpp:
2201 (WebCore::XMLDocumentParser::append):
2202 * xml/parser/XMLDocumentParser.h:
2204 2015-09-14 Dewei Zhu <dewei_zhu@apple.com>
2206 Polish code for r189579.
2207 https://bugs.webkit.org/show_bug.cgi?id=149131
2209 Reviewed by Chris Dumez.
2211 Use more self-explaining function name "characterSetWithUTF8Fallback" instead of
2212 "characterSetForBindings". Optimize the way to get text encoding.
2215 (WebCore::Document::characterSetWithUTF8Fallback):
2216 (WebCore::Document::encoding): Deleted.
2217 (WebCore::Document::characterSetForBindings): Deleted.
2219 (WebCore::Document::encoding):
2220 (WebCore::Document::textEncoding):
2222 * loader/DocumentWriter.cpp:
2223 (WebCore::DocumentWriter::createDecoderIfNeeded):
2224 * loader/FormSubmission.cpp:
2225 (WebCore::encodingFromAcceptCharset):
2227 2015-09-14 Chris Dumez <cdumez@apple.com>
2229 Drop non-standard [IsIndex] WebKit IDL extended attribute
2230 https://bugs.webkit.org/show_bug.cgi?id=149122
2231 <rdar://problem/22547139>
2233 Reviewed by Darin Adler.
2235 Drop non-standard [IsIndex] WebKit IDL extended attribute. This attribute
2236 causes us to throw an IndexSizeError if the input value is negative. Web
2237 IDL supports no such thing. Instead Web IDL supports:
2238 1. Default behavior: the input value wraps around if it does not fit.
2239 2. [EnforceRange]: A TypeError is thrown if the input value does not fit [1].
2240 3. [Clamp]: The input value will be clamped if it does not fit [2].
2242 Our bindings generator supports all three. We don't need the non-standard
2245 We previously used [IsIndex] in places where we're supposed to wrap around
2246 as per Web IDL. Therefore, we threw for negative values but other browsers
2247 don't. For e.g., CharacterData.substringData(offset, -1) is supposed to
2248 return the substring from offset to the end of the string. It does so in
2249 Firefox and Chrome. However, WebKit was throwing an Exception.
2251 This change impacts the CharacterData and the SVGTextContentElement
2252 API. The compatibility risk is low because we were throwing an exception
2253 for negative values and we now wrap the value around instead, as other
2256 No new tests, already covered by existing tests.
2258 [1] https://heycam.github.io/webidl/#EnforceRange
2259 [2] https://heycam.github.io/webidl/#Clamp
2261 * bindings/scripts/CodeGeneratorJS.pm:
2262 (GenerateParametersCheck): Deleted.
2263 * bindings/scripts/IDLAttributes.txt:
2264 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2265 (WebCore::jsTestEventTargetPrototypeFunctionItem):
2266 * bindings/scripts/test/TestEventTarget.idl:
2267 * dom/CharacterData.cpp:
2268 (WebCore::CharacterData::deleteData):
2269 (WebCore::CharacterData::replaceData):
2270 * dom/CharacterData.idl:
2271 * dom/ClientRectList.idl:
2272 * svg/SVGTextContentElement.cpp:
2273 (WebCore::SVGTextContentElement::getSubStringLength):
2274 (WebCore::SVGTextContentElement::selectSubString):
2275 * svg/SVGTextContentElement.idl:
2277 2015-09-14 Chris Dumez <cdumez@apple.com>
2279 Document.createNodeIterator(null) / Document.createTreeWalker(null) should throw a TypeError
2280 https://bugs.webkit.org/show_bug.cgi?id=149126
2281 <rdar://problem/22564891>
2283 Reviewed by Ryosuke Niwa.
2285 Document.createNodeIterator(null) / Document.createTreeWalker(null)
2286 should throw a TypeError:
2287 https://dom.spec.whatwg.org/#interface-document
2289 This is because the parameter is not nullable and Web IDL says we
2290 should throw a TypeError in this case.
2292 Firefox and Chrome throw an exception in this case. This patch
2293 aligns our behavior with the specification and other major browsers.
2295 No new tests, already covered by existing W3C test.
2298 (WebCore::Document::createNodeIterator):
2299 (WebCore::Document::createTreeWalker):
2302 * dom/NodeIterator.cpp:
2303 (WebCore::NodeIterator::NodeIterator):
2304 * dom/NodeIterator.h:
2305 (WebCore::NodeIterator::create):
2306 * dom/Traversal.cpp:
2307 (WebCore::NodeIteratorBase::NodeIteratorBase):
2309 * dom/TreeWalker.cpp:
2310 (WebCore::TreeWalker::TreeWalker):
2312 (WebCore::TreeWalker::create):
2314 2015-09-14 Alex Christensen <achristensen@webkit.org>
2316 Fix Windows clean build after r189746
2318 * WebCore.vcxproj/copyForwardingHeaders.cmd:
2319 Copy headers from new legacy directory.
2321 2015-09-14 Chris Dumez <cdumez@apple.com>
2323 window.HTMLDetailsElement should exist
2324 https://bugs.webkit.org/show_bug.cgi?id=149139
2326 Reviewed by Ryosuke Niwa.
2328 window.HTMLDetailsElement should exist:
2329 https://html.spec.whatwg.org/multipage/forms.html#the-details-element
2331 Drop the [NoInterfaceObject] IDL extended attribute in WebKit to
2332 address the problem.
2334 No new tests, already covered by existing tests.
2336 * html/HTMLDetailsElement.idl:
2338 2015-09-14 Alex Christensen <achristensen@webkit.org>
2340 Fix AppleWin CMake build
2341 https://bugs.webkit.org/show_bug.cgi?id=149137
2343 Reviewed by Brent Fulgham.
2345 * PlatformAppleWin.cmake:
2346 Spell Inband correctly.
2347 * css/makegrammar.pl:
2348 Add quotes so bison can be in a directory with spaces in it.
2350 2015-09-14 Alex Christensen <achristensen@webkit.org>
2352 [Win] Unreviewed build fix after r189746
2354 * WebCore.vcxproj/WebCoreIncludeCommon.props:
2355 Include new legacy directory.
2357 2015-09-14 Alex Christensen <achristensen@webkit.org>
2359 Progress towards CMake on Mac.
2360 https://bugs.webkit.org/show_bug.cgi?id=149123
2362 Reviewed by Chris Dumez.
2365 Added some more files.
2366 * PlatformMac.cmake:
2367 Added more files and listed the strange ObjC bindings.
2368 * contentextensions/DFACombiner.cpp:
2369 * contentextensions/DFACombiner.h:
2370 Added preprocessor protection.
2371 * platform/FileSystem.h:
2372 Include utility. It's needed to compile the different configurations.
2373 * platform/ScrollAnimator.cpp:
2374 ScrollAnimator is an abstract class on Mac. Don't compile it.
2375 * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2376 FontAntialiasingStateSaver.h is only used on iOS.
2377 * rendering/RenderThemeMac.mm:
2378 config.h needs to be outside the #if !PLATFORM(IOS) to compile correctly without precompiled headers.
2380 2015-09-14 Brady Eidson <beidson@apple.com>
2382 Rename current concrete IDB implementation to "Legacy".
2383 https://bugs.webkit.org/show_bug.cgi?id=149118
2385 Reviewed by Alex Christensen.
2387 No new tests (No change in behavior).
2389 This patch makes IDL bindings abstract.
2390 It then renames the current concrete implementations of the bindings from "IDB" to "Legacy".
2391 Finally it moves those files and their support classes to a "legacy" subfolder.
2394 * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
2395 * Modules/indexeddb/IDBAny.cpp:
2396 * Modules/indexeddb/IDBAny.h:
2397 * Modules/indexeddb/IDBCursor.cpp:
2398 * Modules/indexeddb/IDBCursor.h:
2399 * Modules/indexeddb/IDBCursor.idl:
2400 * Modules/indexeddb/IDBCursorWithValue.cpp:
2401 * Modules/indexeddb/IDBCursorWithValue.h:
2402 * Modules/indexeddb/IDBCursorWithValue.idl:
2403 * Modules/indexeddb/IDBDatabase.cpp:
2404 * Modules/indexeddb/IDBDatabase.h:
2405 * Modules/indexeddb/IDBDatabase.idl:
2406 * Modules/indexeddb/IDBFactory.cpp:
2407 * Modules/indexeddb/IDBFactory.h:
2408 * Modules/indexeddb/IDBFactory.idl:
2409 * Modules/indexeddb/IDBIndex.cpp:
2410 * Modules/indexeddb/IDBIndex.h:
2411 * Modules/indexeddb/IDBIndex.idl:
2412 * Modules/indexeddb/IDBObjectStore.cpp:
2413 * Modules/indexeddb/IDBObjectStore.h:
2414 * Modules/indexeddb/IDBObjectStore.idl:
2415 * Modules/indexeddb/IDBOpenDBRequest.cpp:
2416 * Modules/indexeddb/IDBOpenDBRequest.h:
2417 * Modules/indexeddb/IDBOpenDBRequest.idl:
2418 * Modules/indexeddb/IDBRequest.cpp:
2419 * Modules/indexeddb/IDBRequest.h:
2420 * Modules/indexeddb/IDBRequest.idl:
2421 * Modules/indexeddb/IDBTransaction.cpp:
2422 * Modules/indexeddb/IDBTransaction.h:
2423 * Modules/indexeddb/IDBTransaction.idl:
2424 * Modules/indexeddb/IDBVersionChangeEvent.cpp:
2425 * Modules/indexeddb/IDBVersionChangeEvent.h:
2426 * Modules/indexeddb/legacy/IDBCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCallbacks.h.
2427 * Modules/indexeddb/legacy/IDBCursorBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp.
2428 * Modules/indexeddb/legacy/IDBCursorBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.h.
2429 * Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp.
2430 * Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.h.
2431 * Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp.
2432 * Modules/indexeddb/legacy/IDBDatabaseBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h.
2433 * Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
2434 * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp.
2435 * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h.
2436 * Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Renamed from Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h.
2437 * Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingDeleteCall.h.
2438 * Modules/indexeddb/legacy/IDBPendingOpenCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingOpenCall.h.
2439 * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp.
2440 * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.h.
2441 * Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp.
2442 * Modules/indexeddb/legacy/IDBTransactionBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.h.
2443 * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp.
2444 * Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h.
2445 * Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp.
2446 * Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h.
2447 * Modules/indexeddb/legacy/LegacyAny.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBAny.cpp.
2448 * Modules/indexeddb/legacy/LegacyAny.h: Added.
2449 * Modules/indexeddb/legacy/LegacyCursor.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.cpp.
2450 * Modules/indexeddb/legacy/LegacyCursor.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.h.
2451 * Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp.
2452 * Modules/indexeddb/legacy/LegacyCursorWithValue.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h.
2453 * Modules/indexeddb/legacy/LegacyDatabase.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.cpp.
2454 * Modules/indexeddb/legacy/LegacyDatabase.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.h.
2455 * Modules/indexeddb/legacy/LegacyFactory.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.cpp.
2456 * Modules/indexeddb/legacy/LegacyFactory.h: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.h.
2457 * Modules/indexeddb/legacy/LegacyIndex.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBIndex.cpp.
2458 * Modules/indexeddb/legacy/LegacyIndex.h: Added.
2459 * Modules/indexeddb/legacy/LegacyObjectStore.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp.
2460 * Modules/indexeddb/legacy/LegacyObjectStore.h: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.h.
2461 * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp.
2462 * Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h.
2463 * Modules/indexeddb/legacy/LegacyRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.cpp.
2464 * Modules/indexeddb/legacy/LegacyRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.h.
2465 * Modules/indexeddb/legacy/LegacyTransaction.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.cpp.
2466 * Modules/indexeddb/legacy/LegacyTransaction.h: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.h.
2467 * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp.
2468 * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h.
2469 * WebCore.xcodeproj/project.pbxproj:
2470 * WebCore.vcxproj/WebCore.vcxproj:
2472 2015-09-14 Gyuyoung Kim <gyuyoung.kim@webkit.org>
2474 [EFL] Remove create() factory function in EvasGLContext and EvasGLSurface
2475 https://bugs.webkit.org/show_bug.cgi?id=149110
2477 Reviewed by Csaba Osztrogonác.
2479 It is not good implementation we support both create() factory function and public constructor.
2480 In EvasGLContext and EvasGLSurface cases, those have supported both. However create() factory is only
2481 used by EwkView. Thus let's remove the create() function, then EwkView creates EvasGLContext using
2482 std::make_unique<> directly.
2484 * platform/graphics/efl/EvasGLContext.h:
2485 (WebCore::EvasGLContext::create): Deleted.
2486 * platform/graphics/efl/EvasGLSurface.h:
2487 (WebCore::EvasGLSurface::create): Deleted.
2489 2015-09-09 Sergio Villar Senin <svillar@igalia.com>
2491 min-width/height should default to auto for grid items
2492 https://bugs.webkit.org/show_bug.cgi?id=146021
2494 Reviewed by Darin Adler.
2496 Based on Blink's r194408, r194863 and r194887 by <rego@igalia.com>.
2498 From the spec (http://dev.w3.org/csswg/css-grid/#grid-items):
2499 "The auto value of min-width and min-height behaves on grid
2500 items in the relevant axis analogously to its behavior on flex
2501 items in the main axis."
2503 From now on the default value for min-width and min-height for
2504 grid items is auto, meaning that in general, grid items won't
2505 shrink bellow their content.
2507 The change is not exactly the same as the one in Blink because
2508 this one takes into account vertical writting modes, something
2509 that was not well handled in the original one.
2511 Tests: fast/css-grid-layout/min-width-height-auto-overflow.html
2512 fast/css-grid-layout/min-width-height-auto.html
2514 * rendering/RenderBox.cpp:
2515 (WebCore::RenderBox::computeLogicalWidthInRegion):
2516 (WebCore::RenderBox::computeLogicalHeight):
2518 2015-09-14 Manuel Rego Casasnovas <rego@igalia.com>
2520 [css-grid] Percentage columns should remove scrollbar's width
2521 https://bugs.webkit.org/show_bug.cgi?id=149116
2523 Reviewed by Sergio Villar Senin.
2525 Currently the calculation of percentage columns was not subtracting the
2527 Fixed RenderGrid::computeUsedBreadthOfSpecifiedLength()
2528 to avoid this problem.
2530 Test: fast/css-grid-layout/grid-percent-track-scrollbar.html
2532 * rendering/RenderGrid.cpp:
2533 (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2535 2015-09-13 Chris Dumez <cdumez@apple.com>
2537 Improve Node pre-insertion validation when the parent is a Document
2538 https://bugs.webkit.org/show_bug.cgi?id=149109
2539 <rdar://problem/22560436>
2541 Reviewed by Ryosuke Niwa.
2543 Improve Node pre-insertion validation when the parent is a Document to
2544 match the specification:
2545 https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
2546 https://dom.spec.whatwg.org/#concept-node-replace
2548 This affects the following API: Node.insertBefore(), Node.appendChild(),
2549 Node.replaceChild().
2551 WebKit current fails to do the following checks whenever the parent is a
2552 Document from pre-insertion validation:
2553 1. If the inserted Node is a DocumentFragment, we should make sure it
2554 contains only one Element.
2555 -> This is because a Document can have only one child that is an
2557 2.a. If an Element is inserted, we should make sure it is not inserted
2558 before a DocumentType.
2559 2.b. If a DocumentType is inserted, we should make sure it is not
2560 inserted after an Element.
2561 -> This is because the DocType must come before the optional Element
2564 Firefox and Chrome already match the specification here. This patch
2565 aligns WebKit's behavior with those browsers and the specification.
2567 [1] https://dom.spec.whatwg.org/#node-trees
2569 No new tests, already covered by existing W3C tests.
2571 * dom/ContainerNode.cpp:
2572 (WebCore::checkAcceptChild):
2573 (WebCore::checkAddChild):
2574 (WebCore::checkReplaceChild):
2575 (WebCore::ContainerNode::insertBefore):
2576 (WebCore::ContainerNode::appendChild):
2577 (WebCore::containsConsideringHostElements): Deleted.
2578 (WebCore::checkAcceptChildGuaranteedNodeTypes): Deleted.
2580 (WebCore::Document::canAcceptChild):
2581 (WebCore::Document::cloneNodeInternal): Deleted.
2584 2015-09-13 Chris Dumez <cdumez@apple.com>
2586 Document.adoptNode() should be able to explicitly adopt a DocumentType node
2587 https://bugs.webkit.org/show_bug.cgi?id=149097
2588 <rdar://problem/22549345>
2590 Reviewed by Ryosuke Niwa.
2592 Document.adoptNode() should be able to explicitly adopt a DocumentType
2593 node as per the latest DOM specification:
2594 https://dom.spec.whatwg.org/#dom-document-adoptnode
2596 Chrome and Firefox match the specidicaiton but WebKit was throwing a
2599 No new tests, already covered by existing test.
2602 (WebCore::Document::adoptNode): Deleted.
2604 2015-09-13 Chris Dumez <cdumez@apple.com>
2606 Document.title does not behave according to specification
2607 https://bugs.webkit.org/show_bug.cgi?id=149098
2609 Reviewed by Ryosuke Niwa.
2611 Update Document.title to behave according to the latest DOM specification:
2612 https://html.spec.whatwg.org/multipage/dom.html#document.title
2614 In particular, the following Web-Exposed changes were made:
2615 1. The title Element should be the first title element in the document
2616 (in tree order) [1]. Previously, WebKit would use the first title
2617 Element *added* to the Document. Document.title returns the text
2618 content of the title Element so this change is web-exposed.
2619 2. If the title Element is replaced after the title has been set by the
2620 JS (via the document.title setter), we should update the value
2621 returned by the document.title getter. Previously, WebKit would set
2622 a flag if the title was explicitly set by JS via document.title
2623 setter and later title element changes would not override the title
2624 set by the JS. This behavior isn't specified and does not match the
2625 behavior of other browsers.
2627 The new behavior is also consistent with the behavior of Firefox and
2630 Some refactoring was made for the sake of clarity now that our
2631 implementation has changed. See details below.
2633 [1] https://html.spec.whatwg.org/multipage/dom.html#the-title-element-2
2635 No new tests, already covered by existing tests.
2638 (WebCore::Document::updateTitleFromTitleElement):
2639 New convenience method that calls updateTitle() with the text of the
2640 document's current title Element. If there is no title Element, it
2643 (WebCore::Document::updateTitleElement):
2644 Method which updates the Document's title Element whenever a title
2645 Element is added or removed from the Document. Once the title Element
2646 is updated, it takes care of calling updateTitleFromTitleElement() to
2647 update the Document's title.
2649 (WebCore::Document::titleElementAdded):
2650 (WebCore::Document::titleElementRemoved):
2651 (WebCore::Document::titleElementTextChanged):
2652 New Document public API called by HTMLTitleElement / SVGTitleElement
2653 whenever a title Element is added / removed from the Document or
2654 whenever the title element's text has changed. These methods will
2655 take care of calling updateTitleElement() / updateTitleFromTitleElement()
2657 Previously, we would only have 2 methods:
2658 - setTitleElement() which would be called whenever a title Element was
2659 added to the document or when its text had changed. The name was
2660 confusing because it would not necessarily set the document's title
2661 Element and it would be used both for title element update and a
2662 simple title update. This method has been split into 2:
2663 titleElementAdded() and titleElementTextChanged().
2664 - removeTitle() which would be called whenever a title Element was
2665 removed. The naming was confusing because it would not necessarily
2666 remove the Document's title Element. This is now called
2667 titleElementRemoved().
2669 * html/HTMLTitleElement.cpp:
2670 (WebCore::HTMLTitleElement::insertedInto):
2671 Call the new titleElementAdded() instead of setTitleElement().
2673 (WebCore::HTMLTitleElement::removedFrom):
2674 Call the new titleElementRemoved() instead of removeTitle().
2676 (WebCore::HTMLTitleElement::childrenChanged):
2677 Call the new titleElementTextChanged() instead of
2678 setTitleElement() / removeTitle() as we don't really want
2679 to remove or add a title Element. We merely want to notify
2680 the document that the title element text has changed in
2681 case it is the current title Element of the Document.
2683 (WebCore::HTMLTitleElement::computedTextWithDirection):
2684 Rename textWithDirection() to computedTextWithDirection() to
2685 make it clear it is not a simple getter and make it private
2686 as it is only used to set the m_title member which caches the
2689 * html/HTMLTitleElement.h:
2690 Add new textWithDirection() getter which returns m_title. This
2691 is needed so that Document can query the title of the Element.
2692 Previously, HTMLTitleElement would pass directly m_title to
2693 the Document when calling Document::setTitleElement().
2695 * svg/SVGTitleElement.cpp:
2696 (WebCore::SVGTitleElement::insertedInto):
2697 Call the new titleElementAdded() instead of setTitleElement().
2699 (WebCore::SVGTitleElement::removedFrom):
2700 Call the new titleElementRemoved() instead of removeTitle().
2702 (WebCore::SVGTitleElement::childrenChanged):
2703 Call the new titleElementTextChanged() instead of
2706 2015-09-13 Chris Dumez <cdumez@apple.com>
2708 document.lastModified should use the user's local time zone
2709 https://bugs.webkit.org/show_bug.cgi?id=149092
2710 <rdar://problem/22567705>
2712 Reviewed by Ryosuke Niwa.
2714 document.lastModified should use the user's local time zone:
2715 https://html.spec.whatwg.org/multipage/dom.html#dom-document-lastmodified
2717 Chrome and Firefox comply with the specification but WebKit was using
2718 UTC. This patch aligns WebKit's behavior with the specification and
2721 No new tests, already covered by existing tests.
2724 (WebCore::Document::lastModified):
2725 (WebCore::Document::setCookieURL): Deleted.
2727 2015-09-13 Chris Dumez <cdumez@apple.com>
2729 Node.baseURI should not return null for detached nodes
2730 https://bugs.webkit.org/show_bug.cgi?id=149104
2731 <rdar://problem/22559535>
2733 Reviewed by Sam Weinig.
2735 Node.baseURI should not return null for detached nodes. It should return
2736 the node document's base URL. The node document is set when the node is
2737 created so it is valid even if the node is detached [1]:
2738 https://dom.spec.whatwg.org/#dom-node-baseuri
2740 WebKit was traversing the ancestors to find the base URL, which only
2741 works if the node is attached. Also, WebKit was taking into account
2742 the xml:base attribute when computing the baseURI.
2744 Both Chrome and Firefox already dropped support for xml:base:
2745 https://code.google.com/p/chromium/issues/detail?id=341854
2746 https://bugzilla.mozilla.org/show_bug.cgi?id=903372
2748 Firefox complies with the specification. Chrome's baseURI still only
2749 works for attached Nodes as their implementation still traverses the
2750 DOM tree, despite dropping support for xml:base.
2752 This patch drops support xml:base when computing Node.baseURI, as
2753 Firefox, Chrome and the latest DOM specification do. It also makes
2754 Node.baseURI work for detached Nodes by returning the base URL of the
2755 node Document. This means we no longer have to traverse the Node's
2756 ancestors in the DOM tree. This is consistent with the behavior of
2757 Firefox and the latest DOM specification.
2759 This patch does not drop the SVGElement.xmlbase attribute yet. However,
2760 we should probably consider making this change as well given that:
2761 - The SVG2 specification dropped it
2762 - Chrome dropped it.
2763 - It no longers impacts Node.baseURI
2765 [1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=20976
2767 No new tests, already covered by existing test.
2770 (WebCore::Document::setContent): Deleted.
2772 (WebCore::Document::inputCursor): Deleted.
2773 * dom/DocumentType.cpp:
2774 (WebCore::DocumentType::nodeName): Deleted.
2775 * dom/DocumentType.h:
2777 (WebCore::Element::imageSourceURL): Deleted.
2778 (WebCore::Element::rendererIsNeeded): Deleted.
2779 (WebCore::Element::createElementRenderer): Deleted.
2780 (WebCore::Element::insertedInto): Deleted.
2783 (WebCore::Node::baseURI):
2785 * svg/SVGElement.idl:
2787 2015-09-13 Chris Dumez <cdumez@apple.com>
2789 CharacterData API parameters should not be optional
2790 https://bugs.webkit.org/show_bug.cgi?id=149101
2791 <rdar://problem/22546954>
2793 Reviewed by Sam Weinig.
2795 CharacterData API parameters should not be optional as per the DOM
2797 https://dom.spec.whatwg.org/#characterdata
2799 The parameters are also mandatory in Firefox and Chrome. However,
2800 those parameters are optional in WebKit. When DOMString parameters
2801 were omitted, we would use the "undefined" string instead. When
2802 unsigned long parameters were omitted, we would use 0 instead.
2803 This patch aligns our behavior with the specification and other
2806 No new tests, already covered by existing tests.
2808 * dom/CharacterData.cpp:
2809 (WebCore::CharacterData::appendData):
2810 * dom/CharacterData.h:
2811 * dom/CharacterData.idl:
2813 (WebCore::Element::mergeWithNextTextNode):
2815 (WebCore::Node::normalize):
2816 * xml/parser/XMLDocumentParser.cpp:
2817 (WebCore::XMLDocumentParser::exitText):
2819 2015-09-13 Gyuyoung Kim <gyuyoung.kim@webkit.org>
2821 Remove all uses of PassRefPtr in crypto, storage, and history
2822 https://bugs.webkit.org/show_bug.cgi?id=149091
2824 Reviewed by Andreas Kling.
2826 * crypto/CryptoKeyPair.cpp:
2827 (WebCore::CryptoKeyPair::CryptoKeyPair):
2828 * crypto/CryptoKeyPair.h:
2829 (WebCore::CryptoKeyPair::create):
2830 * crypto/SubtleCrypto.h:
2831 (WebCore::SubtleCrypto::create):
2832 * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
2833 (WebCore::CryptoKeyRSA::create):
2834 * crypto/keys/CryptoKeyAES.cpp:
2835 (WebCore::CryptoKeyAES::generate):
2836 * crypto/keys/CryptoKeyAES.h:
2837 * crypto/keys/CryptoKeyHMAC.cpp:
2838 (WebCore::CryptoKeyHMAC::generate):
2839 * crypto/keys/CryptoKeyHMAC.h:
2840 * crypto/keys/CryptoKeyRSA.h:
2841 * crypto/mac/CryptoKeyRSAMac.cpp:
2842 (WebCore::CryptoKeyRSA::create):
2843 * history/BackForwardController.cpp:
2844 (WebCore::BackForwardController::BackForwardController):
2845 * history/BackForwardController.h:
2846 * history/HistoryItem.cpp:
2847 (WebCore::HistoryItem::setStateObject):
2848 (WebCore::HistoryItem::setFormData):
2849 * history/HistoryItem.h:
2850 (WebCore::HistoryItem::stateObject):
2851 * loader/EmptyClients.cpp:
2853 (WebCore::Page::Page):
2854 * storage/Storage.cpp:
2855 (WebCore::Storage::create):
2856 (WebCore::Storage::Storage):
2857 * storage/Storage.h:
2858 * storage/StorageArea.h:
2859 * storage/StorageMap.cpp:
2860 (WebCore::StorageMap::copy):
2861 (WebCore::StorageMap::setItem):
2862 (WebCore::StorageMap::setItemIgnoringQuota):
2863 (WebCore::StorageMap::removeItem):
2864 * storage/StorageMap.h:
2865 * storage/StorageNamespace.h:
2867 2015-09-12 Chris Dumez <cdumez@apple.com>
2869 window.EventTarget should exist
2870 https://bugs.webkit.org/show_bug.cgi?id=149085
2871 <rdar://problem/22546774>
2873 Reviewed by Sam Weinig.
2875 Drop [NoInterfaceObject] for the EventTarget interface to match Chrome,
2876 Firefox and the specification:
2877 https://dom.spec.whatwg.org/#interface-eventtarget
2879 No new tests, already covered by existing tests.
2881 * dom/EventTarget.idl:
2883 2015-09-12 Brian Burg <bburg@apple.com>
2885 Web Inspector: disambiguate inspected/frontend controllers and pages in backend code
2886 https://bugs.webkit.org/show_bug.cgi?id=149071
2888 Reviewed by Joseph Pecoraro.
2890 Be consistent about prefixing pages, inspector controllers, and window controllers
2891 with either "frontend" or "inspected", as appropriate. This change makes obvious some bugs
2892 in the frontend connection code, which are tracked by https://webkit.org/b/149006.
2894 No new tests, no behavior change.
2897 * inspector/InspectorClient.h:
2898 * inspector/InspectorController.cpp:
2899 (WebCore::InspectorController::inspectedPageDestroyed):
2900 (WebCore::InspectorController::show):
2901 (WebCore::InspectorController::close):
2902 * inspector/InspectorFrontendClientLocal.cpp:
2903 (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
2904 (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
2905 (WebCore::InspectorFrontendClientLocal::canAttachWindow):
2906 (WebCore::InspectorFrontendClientLocal::changeAttachedWindowHeight):
2907 (WebCore::InspectorFrontendClientLocal::changeAttachedWindowWidth):
2908 (WebCore::InspectorFrontendClientLocal::openInNewTab):
2909 (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight):
2910 (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
2911 (WebCore::InspectorFrontendClientLocal::isUnderTest):
2912 * inspector/InspectorFrontendClientLocal.h:
2913 * inspector/InspectorOverlay.cpp:
2914 (WebCore::InspectorOverlay::freePage):
2915 * loader/EmptyClients.h:
2917 2015-09-12 Chris Dumez <cdumez@apple.com>
2919 ChildNode.replaceWith() without argument should replace the node with an empty DocumentFragment
2920 https://bugs.webkit.org/show_bug.cgi?id=149073
2921 <rdar://problem/22547801>
2923 Reviewed by Ryosuke Niwa.
2925 ChildNode.replaceWith() without argument should replace the node with
2926 an empty DocumentFragment, as per the specification:
2927 https://dom.spec.whatwg.org/#dom-childnode-replacewith
2928 https://dom.spec.whatwg.org/#converting-nodes-into-a-node
2930 Previously, WebKit did not do anything in this case. This patch fixes
2933 No new tests, already covered by existing test.
2936 (WebCore::Node::replaceWith):
2938 2015-09-12 Gyuyoung Kim <gyuyoung.kim@webkit.org>
2940 Remove all uses of PassRefPtr in WebCore/plugins
2941 https://bugs.webkit.org/show_bug.cgi?id=149055
2943 Reviewed by Darin Adler.
2945 * plugins/DOMMimeType.cpp:
2946 (WebCore::DOMMimeType::DOMMimeType):
2947 (WebCore::DOMMimeType::enabledPlugin):
2948 * plugins/DOMMimeType.h:
2949 (WebCore::DOMMimeType::create):
2950 * plugins/DOMMimeTypeArray.cpp:
2951 (WebCore::DOMMimeTypeArray::item):
2952 * plugins/DOMMimeTypeArray.h:
2953 * plugins/DOMPlugin.cpp:
2954 (WebCore::DOMPlugin::item):
2955 * plugins/DOMPlugin.h:
2956 * plugins/DOMPluginArray.cpp:
2957 (WebCore::DOMPluginArray::item):
2958 * plugins/DOMPluginArray.h:
2959 * plugins/PluginViewBase.h:
2960 (WebCore::PluginViewBase::bindingInstance):
2962 2015-09-12 Gyuyoung Kim <gyuyoung.kim@webkit.org>
2964 Remove all uses of PassRefPtr in WebCore/accessibility and WebCore/fileapi
2965 https://bugs.webkit.org/show_bug.cgi?id=149059
2967 Reviewed by Darin Adler.
2969 * accessibility/AXObjectCache.cpp:
2970 * accessibility/AccessibilityObject.cpp:
2971 (WebCore::rangeClosestToRange):
2972 (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
2973 (WebCore::AccessibilityObject::selectionRange):
2974 (WebCore::AccessibilityObject::selectText):
2975 * accessibility/AccessibilityObject.h:
2976 * accessibility/ios/AXObjectCacheIOS.mm:
2977 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2978 (-[WebAccessibilityObjectWrapper _convertToDOMRange:]):
2979 (-[WebAccessibilityObjectWrapper textMarkerForPosition:]):
2980 * accessibility/mac/AXObjectCacheMac.mm:
2981 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2982 (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
2983 * fileapi/FileList.h:
2984 (WebCore::FileList::append):
2985 * fileapi/WebKitBlobBuilder.cpp:
2986 (WebCore::BlobBuilder::append):
2987 * fileapi/WebKitBlobBuilder.h:
2989 2015-09-11 Said Abou-Hallawa <sabouhallawa@apple.com>
2991 SVGColor custom text format is different from the CSS color custom text format
2992 https://bugs.webkit.org/show_bug.cgi?id=148879
2994 Reviewed by Daniel Bates.
2996 Implement the serialization of a CSS color value as it is described in
2997 <https://drafts.csswg.org/cssom/#serializing-css-values>. Add the new
2998 function Color::cssText() which is refactored from the existing function
2999 Color::serialized(). Use the new function for serializing the SVGColor
3000 always and also for Color but only when the alpha component is not 1.
3002 Test: svg/css/computed-style-rgb-color.html
3004 * css/CSSPrimitiveValue.cpp:
3005 (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Move the code
3006 for serializing the color from this function to Color::cssText().
3008 * platform/graphics/Color.cpp:
3009 (WebCore::Color::serialized): Call Color::cssText() if the alpha component
3010 is not 1 and delete the repeated code.
3012 (WebCore::Color::cssText):
3013 * platform/graphics/Color.h: Add the new function to the header file.
3016 (WebCore::SVGColor::customCSSText): Call Color::cssText() always instead
3017 of calling Color::serialized() for serializing the SVGColor.
3019 2015-09-11 Nan Wang <n_wang@apple.com>
3021 AX: ARIA 1.1 @aria-current
3022 https://bugs.webkit.org/show_bug.cgi?id=146012
3024 Reviewed by Chris Fleizach.
3026 Tests: accessibility/aria-current.html
3027 inspector/dom/getAccessibilityPropertiesForNode_ariaCurrent.html
3029 Added support for ARIA 1.1 aria-current.
3031 * accessibility/AccessibilityObject.cpp:
3032 (WebCore::AccessibilityObject::invalidStatus):
3033 (WebCore::AccessibilityObject::ariaCurrentState):
3034 (WebCore::AccessibilityObject::hasTagName):
3035 * accessibility/AccessibilityObject.h:
3036 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3037 (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
3038 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3039 * html/HTMLAttributeNames.in:
3040 * inspector/InspectorDOMAgent.cpp:
3041 (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
3043 2015-09-11 Chris Dumez <cdumez@apple.com>
3045 DOMTokenList update steps for classList don't follow the spec
3046 https://bugs.webkit.org/show_bug.cgi?id=148589
3047 <rdar://problem/22547443>
3049 Reviewed by Ryosuke Niwa and Darin Adler.
3051 Update our DOMTokenList implementation to behave according to
3052 the latest DOM specification:
3053 https://dom.spec.whatwg.org/#interface-domtokenlist
3055 In particular, the following changes were made:
3056 - The stringifier now returns the result of the ordered set serializer
3057 for tokens. This means that we drop duplicate spaces and extra spaces
3059 - DOMSettableTokenList.value now returns the result of the ordered set
3060 serializer for tokens [4] as well.
3061 - When the DOMTokenList's tokens are updated and there is an associated
3062 Element attribute, we set the attribute value to be the the ordered
3063 set serializer for tokens. This is according to the DOMTokenList
3064 update steps in the specification [6]. Chrome does not match the
3065 specification either.
3067 Edge browser behaves according to the specification already. Firefox was
3068 implementing this via [7] but no recent progress. This makes the JS API
3069 nicer to use and interest was shown by jQuery Team.
3071 The following refactoring was done:
3072 - Merge ClassList / RelList into a single AttributeDOMTokenList class
3073 as their code is mostly duplicated and the only thing that changes
3074 is which attribute is associated (class vs rel). AttributeDOMTokenList
3075 now keeps the attribute name as a member so it could be used for any
3076 attribute. AttributeDOMTokenList overrides DOMTokenList's
3077 updateAfterTokenChange() to do update the attribute's value as per
3079 - We no longer use a SpaceSplitString for the internal representation
3080 as we need to sanitize the tokens (drop duplicates and extra spaces).
3081 DOMTokenList now has an internal Vector<AtomicString> containing the
3082 tokens that is constructed from the algorithm in [2]. As a result,
3083 most of the logic is now in DOMTokenList instead of its subclasses
3084 which means that most methods are no longer virtual. We only have
3085 one virtual function named updateAfterTokenChange() to do the update
3086 steps as AttributeDOMTokenList needs to update the associated
3089 This change does not seem to impact Dromaeo.
3091 [1] https://dom.spec.whatwg.org/#concept-ordered-set-serializer
3092 [2] https://dom.spec.whatwg.org/#ordered%20sets
3093 [3] https://dom.spec.whatwg.org/#stringification-behavior
3094 [4] https://dom.spec.whatwg.org/#dom-domsettabletokenlist-value
3095 [5] https://dom.spec.whatwg.org/#dom-domtokenlist-contains (step 2)
3096 [6] https://dom.spec.whatwg.org/#concept-DTL-update
3097 [7] https://bugzilla.mozilla.org/show_bug.cgi?id=869788
3099 No new tests, already covered by existing tests.
3102 (WebCore::Element::classAttributeChanged):
3103 When the class attribute changes, make sure to update the associated
3104 classList if there is one. We could do this lazily if it turns out
3105 to be a performance problem. However, chances are this is not as
3106 classList is rarely used and we only need to update the classList if
3107 it was ever accessed by JS for this Element.
3109 (WebCore::Element::insertedInto):
3110 Drop call to clearClassListValueForQuirksMode() as we no longer need
3111 to maintain a separate SpaceSplitString for classes when in quirks
3112 mode. This is because AttributeDOMTokenList now has its own Vector
3113 of classes in their original cases. It therefore no longer relies on
3114 Element::classNames() which has its case folded when in quirks mode.
3116 (WebCore::Element::classList):
3117 Return a AttributeDOMTokenList instead of a ClassList.
3119 * html/AttributeDOMTokenList.h: Added.
3120 * html/AttributeDOMTokenList.cpp: Added.
3121 (WebCore::AttributeDOMTokenList::AttributeDOMTokenList):
3122 Call DOMTokenList::setValue() using the attribute's value so that
3123 DOMTokenList can initialize its token Vector.
3125 (WebCore::AttributeDOMTokenList::attributeValueChanged):
3126 If the attribute value was changed by somebody else that the
3127 AttributeDOMTokenList, call DOMTokenList::setValue() so that it
3128 can update its token Vector.
3130 (WebCore::AttributeDOMTokenList::updateAfterTokenChange):
3131 This is called whenever the token Vector is changed via JS. In
3132 this case, we update the associated attribute's value.
3134 * html/ClassList.cpp: Removed.
3135 * html/ClassList.h: Removed.
3136 Now merged into AttributeDOMTokenList.
3138 * html/DOMSettableTokenList.cpp:
3139 * html/DOMSettableTokenList.h:
3140 Get rid of most of the code as most of the logic is now in
3141 DOMTokenList parent class.
3143 * html/DOMTokenList.cpp:
3144 (WebCore::DOMTokenList::validateToken):
3145 Use a String parameter instead of an AtomicString as this method does
3146 not need the input the be an AtomicString. This avoid atomizing
3147 String unnecessarily.
3149 (WebCore::DOMTokenList::validateTokens):
3152 (WebCore::DOMTokenList::contains):
3153 No longer use containsInternal() virtual function. We can now check
3154 the internal token Vector.
3156 (WebCore::DOMTokenList::add):
3157 Now update the internal Vector. Use a modern loop and try to minimize
3158 Vector capacity reallocation.
3160 (WebCore::DOMTokenList::remove):
3161 Now update the internal Vector.
3163 (WebCore::DOMTokenList::toggle):
3164 Now update the internal Vector and refactor the code so that it is
3165 structured exactly as the algorithm in the specification for
3168 (WebCore::DOMTokenList::value):
3169 Now return the result of the ordered set serializer for tokens. This
3171 - The DOMSettableTokenList.value() getter
3172 - The DOMTokenList stringifier
3173 - As attribute value when updating the associated attribute in
3174 AttributeDOMTokenList.
3176 (WebCore::DOMTokenList::setValue):
3177 Update the internal Vector using the algorithm in [2].
3179 * html/DOMTokenList.h:
3180 (WebCore::DOMTokenList::length):
3181 No longer virtual, now returns the size of the internal token Vector.
3183 (WebCore::DOMTokenList::item):
3184 No longer virtual, now returns the token at the given index in the
3187 * html/HTMLAnchorElement.cpp:
3188 (WebCore::HTMLAnchorElement::relList):
3189 Now return a AttributeDOMTokenList.
3191 * html/HTMLLinkElement.cpp:
3192 (WebCore::HTMLLinkElement::relList):
3193 Now return a AttributeDOMTokenList.
3195 * html/RelList.cpp: Removed.
3196 * html/RelList.h: Removed.
3197 Now merged into AttributeDOMTokenList.
3199 2015-09-11 Chris Dumez <cdumez@apple.com>
3201 Element.tagName should be upper-case for HTML elements in HTML documents
3202 https://bugs.webkit.org/show_bug.cgi?id=148843
3203 <rdar://problem/22559081>
3205 Reviewed by Ryosuke Niwa.
3207 Element.tagName should be upper-case for HTML elements in HTML documents,
3208 as per the DOM specification:
3209 https://dom.spec.whatwg.org/#dom-element-tagname
3211 Previously, WebKit would fail to upper-case the tagname if the element's
3212 tag had a prefix. This patch corrects this. This aligns our behavior with
3213 Firefox, Chrome and IE.
3215 No new tests, already covered by existing tests.
3217 * html/HTMLElement.cpp:
3218 (WebCore::HTMLElement::nodeName):
3220 2015-09-11 Chris Dumez <cdumez@apple.com>
3222 document.body = "text" should throw a TypeError, not a HierarchyRequestError
3223 https://bugs.webkit.org/show_bug.cgi?id=149057
3224 <rdar://problem/22567157>
3226 Reviewed by Ryosuke Niwa.
3228 document.body = "text" should throw a TypeError, not a
3229 HierarchyRequestError:
3230 https://html.spec.whatwg.org/multipage/dom.html#dom-document-body
3232 This is because "text" is a DOMString and it cannot be converted into an
3233 HTMLElement?. Therefore, the WebIDL specification says we should throw a
3234 TypeError in this case.
3236 Chrome and Firefox throw the right exception.
3238 No new tests, already covered by existing test.
3242 2015-09-11 Andreas Kling <akling@apple.com>
3244 [JSC] Weak should only accept cell pointees.
3245 <https://webkit.org/b/148955>
3247 Reviewed by Geoffrey Garen.
3249 Update WebCore bindings for the new Weak and Weak-related signatures.
3251 * bindings/js/JSCSSRuleListCustom.cpp:
3252 (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
3253 * bindings/js/JSCSSValueCustom.cpp:
3254 (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots):
3255 (WebCore::JSCSSValueOwner::finalize):
3256 * bindings/js/JSCallbackData.cpp:
3257 (WebCore::JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots):
3258 * bindings/js/JSCallbackData.h:
3259 * bindings/js/JSMutationObserverCustom.cpp:
3260 (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots):
3261 * bindings/js/JSNodeCustom.cpp:
3262 (WebCore::isReachableFromDOM):
3263 (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
3264 * bindings/js/JSNodeListCustom.cpp:
3265 (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
3266 * bindings/js/JSTextTrackCueCustom.cpp:
3267 (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
3268 * bindings/js/WebCoreTypedArrayController.cpp:
3269 (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots):
3270 (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize):
3271 * bindings/js/WebCoreTypedArrayController.h:
3272 * bindings/scripts/CodeGeneratorJS.pm:
3274 (GenerateImplementation):
3275 * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3276 (WebCore::JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots):
3277 (WebCore::JSTestActiveDOMObjectOwner::finalize):
3278 * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3279 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3280 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
3281 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
3282 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
3283 * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3284 (WebCore::JSTestCustomNamedGetterOwner::isReachableFromOpaqueRoots):
3285 (WebCore::JSTestCustomNamedGetterOwner::finalize):
3286 * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3287 * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3288 (WebCore::JSTestEventConstructorOwner::isReachableFromOpaqueRoots):
3289 (WebCore::JSTestEventConstructorOwner::finalize):
3290 * bindings/scripts/test/JS/JSTestEventConstructor.h:
3291 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3292 (WebCore::JSTestEventTargetOwner::isReachableFromOpaqueRoots):
3293 (WebCore::JSTestEventTargetOwner::finalize):
3294 * bindings/scripts/test/JS/JSTestEventTarget.h:
3295 * bindings/scripts/test/JS/JSTestException.cpp:
3296 (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots):
3297 (WebCore::JSTestExceptionOwner::finalize):
3298 * bindings/scripts/test/JS/JSTestException.h:
3299 * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3300 (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
3301 (WebCore::JSTestGenerateIsReachableOwner::finalize):
3302 * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
3303 * bindings/scripts/test/JS/JSTestInterface.cpp:
3304 (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots):
3305 (WebCore::JSTestInterfaceOwner::finalize):
3306 * bindings/scripts/test/JS/JSTestInterface.h:
3307 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3308 (WebCore::JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots):
3309 (WebCore::JSTestMediaQueryListListenerOwner::finalize):
3310 * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
3311 * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3312 (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots):
3313 (WebCore::JSTestNamedConstructorOwner::finalize):
3314 * bindings/scripts/test/JS/JSTestNamedConstructor.h:
3315 * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3316 (WebCore::JSTestNondeterministicOwner::isReachableFromOpaqueRoots):
3317 (WebCore::JSTestNondeterministicOwner::finalize):
3318 * bindings/scripts/test/JS/JSTestNondeterministic.h:
3319 * bindings/scripts/test/JS/JSTestObj.cpp:
3320 (WebCore::JSTestObjOwner::isReachableFromOpaqueRoots):
3321 (WebCore::JSTestObjOwner::finalize):
3322 * bindings/scripts/test/JS/JSTestObj.h:
3323 * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3324 (WebCore::JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots):
3325 (WebCore::JSTestOverloadedConstructorsOwner::finalize):
3326 * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
3327 * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3328 (WebCore::JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
3329 (WebCore::JSTestOverrideBuiltinsOwner::finalize):
3330 * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
3331 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3332 (WebCore::JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots):
3333 (WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize):
3334 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
3335 * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3336 (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots):
3337 (WebCore::JSTestTypedefsOwner::finalize):
3338 * bindings/scripts/test/JS/JSTestTypedefs.h:
3339 * bindings/scripts/test/JS/JSattribute.cpp:
3340 (WebCore::JSattributeOwner::isReachableFromOpaqueRoots):
3341 (WebCore::JSattributeOwner::finalize):
3342 * bindings/scripts/test/JS/JSattribute.h:
3343 * bindings/scripts/test/JS/JSreadonly.cpp:
3344 (WebCore::JSreadonlyOwner::isReachableFromOpaqueRoots):
3345 (WebCore::JSreadonlyOwner::finalize):
3346 * bindings/scripts/test/JS/JSreadonly.h:
3347 * bridge/runtime_root.cpp:
3348 (JSC::Bindings::RootObject::finalize):
3349 * bridge/runtime_root.h:
3351 2015-09-10 Chris Fleizach <cfleizach@apple.com>
3353 AX: Mavericks: Text cursor does not move along with VoiceOver cursor for text fields
3354 https://bugs.webkit.org/show_bug.cgi?id=148891
3356 Reviewed by Alexey Proskuryakov.
3358 Asychronous focus setting DOES work on Yosemite, just not Mavericks.
3360 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3361 (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
3362 (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
3364 2015-09-10 David Hyatt <hyatt@apple.com>
3366 [New Block-Inside-Inline Model] Self-collapsing block check needs to account for anonymous inline blocks
3367 https://bugs.webkit.org/show_bug.cgi?id=149042
3369 Reviewed by Dean Jackson.
3371 Added new tests in fast/block/inside-inlines/
3373 * rendering/InlineFlowBox.cpp:
3374 * rendering/InlineFlowBox.h:
3375 (WebCore::InlineFlowBox::anonymousInlineBlock):
3376 Add a new accessor to get the anonymousInlineBlock() for lines that wrap them.
3378 * rendering/RenderBlock.cpp:
3379 (WebCore::RenderBlock::childrenPreventSelfCollapsing):
3380 (WebCore::RenderBlock::isSelfCollapsingBlock):
3381 isSelfCollapsingBlock() now calls a virtual method that checks lines/children called childrenPreventSelfCollapsing.
3382 This lets us farm out the lines check to the derived RenderBlockFlow class.
3384 * rendering/RenderBlock.h:
3385 (WebCore::RenderBlock::childrenPreventSelfCollapsing):
3386 Added new virtual method for checking children.
3388 * rendering/RenderBlockFlow.cpp:
3389 * rendering/RenderBlockFlow.h:
3390 (WebCore::RenderBlockFlow::childrenPreventSelfCollapsing):
3391 Overridden to ensure that blocks can still be self-collapsing if they only contain anonymous inline-block lines that