Keep the already-parsed list of terms in custom property values so that we don't...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-09-24  David Hyatt  <hyatt@apple.com>
2
3         Keep the already-parsed list of terms in custom property values so that we don't have to re-parse them
4         later when doing variable resolution.
5         https://bugs.webkit.org/show_bug.cgi?id=149544
6
7         Reviewed by Dean Jackson.
8
9         * css/CSSComputedStyleDeclaration.cpp:
10         (WebCore::ComputedStyleExtractor::customPropertyValue):
11         (WebCore::ComputedStyleExtractor::customPropertyText):
12         Add a helper for getting the raw text. More closely parallels how non-custom properties work with the
13         extractor.
14
15         (WebCore::ComputedStyleExtractor::propertyValue):
16         Change propertyValue to use customPropertyText.
17
18         (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
19         Don't copy CSS custom properties into the style declaration. This is just used for things like editing, so
20         we didn't need to be putting the custom properties into this set.
21
22         (WebCore::CSSComputedStyleDeclaration::getPropertyValue):
23         Patched to go straight to the serialized string value.
24
25         (WebCore::ComputedStyleExtractor::customPropertyValue): Deleted.
26         Replaced by customPropertyText.
27
28         * css/CSSComputedStyleDeclaration.h:
29         Rename customPropertyValue to customPropertyText and make it just return a String.
30
31         * css/CSSCustomPropertyValue.h:
32         (WebCore::CSSCustomPropertyValue::create):
33         (WebCore::CSSCustomPropertyValue::customCSSText):
34         (WebCore::CSSCustomPropertyValue::name):
35         (WebCore::CSSCustomPropertyValue::equals):
36         (WebCore::CSSCustomPropertyValue::CSSCustomPropertyValue):
37         (WebCore::CSSCustomPropertyValue::value): Deleted.
38         Changed to hold both a CSSParserValueList, which it adopts from the CSSParser, and a string value that
39         is constructed lazily only if the value is serialized. Now the problematic serialization code will only
40         run if someone uses the CSS OM to trigger a serialization (this should be a rare occurrence, so perf
41         improves with this change).
42
43         * css/CSSGrammar.y.in:
44         Change parsing of custom properties to be identical to regular properties. This refactoring allows
45         us to simply invoke the parser from style declarations as well and makes everything behave more
46         similarly to normal property parsing.
47
48         * css/CSSParser.cpp:
49         (WebCore::CSSParser::parseValue):
50         (WebCore::CSSParser::parseCustomPropertyValue):
51         (WebCore::CSSParser::parseCustomPropertyDeclaration):
52         (WebCore::CSSParser::addCustomPropertyDeclaration): Deleted.
53         * css/CSSParser.h:
54         (WebCore::CSSParser::setCustomPropertyName):
55         We now have a method for parsing custom properties that can be invoked from style declarations. The
56         parser list is now adopted by the CSSCustomPropertyValue.
57
58         * css/CSSParserValues.cpp:
59         (WebCore::CSSParserValueList::toString):
60         Build the string serialization code right into CSSParserValueList.
61
62         * css/CSSParserValues.h:
63         Add a toString() method for serialization.
64
65         * css/StyleProperties.cpp:
66         (WebCore::MutableStyleProperties::setProperty):
67         (WebCore::MutableStyleProperties::setCustomProperty):
68         Changed to use the new CSSParser functions. This makes the code behave almost identically to regular
69         property parsing.
70
71         * css/StyleResolver.cpp:
72         (WebCore::StyleResolver::applyProperty):
73         * rendering/style/RenderStyle.h:
74         * rendering/style/StyleCustomPropertyData.h:
75         Change the mapping on RenderStyle to store the custom CSS values. This way we can get to the original
76         parser lists for each variable when it comes time to do variable resolution.
77
78 2015-09-24  Chris Dumez  <cdumez@apple.com>
79
80         Rewrite Range::insertNode() as per the latest DOM specification
81         https://bugs.webkit.org/show_bug.cgi?id=149528
82
83         Reviewed by Ryosuke Niwa.
84
85         Rewrite Range::insertNode() as per the latest DOM specification:
86         - https://dom.spec.whatwg.org/#concept-range-insert
87
88         Our previous implementation seemed outdated as we were failing a lot of
89         W3C tests that Firefox is passing.
90
91         No new tests, already covered by existing tests.
92
93         * dom/ContainerNode.cpp:
94         (WebCore::ContainerNode::ensurePreInsertionValidity):
95         (WebCore::checkPreReplacementValidity):
96         (WebCore::ContainerNode::insertBefore):
97         (WebCore::ContainerNode::replaceChild):
98         (WebCore::ContainerNode::appendChild):
99         * dom/ContainerNode.h:
100         * dom/Range.cpp:
101         (WebCore::Range::insertNode):
102         (WebCore::Range::surroundContents):
103         (WebCore::Range::toString): Deleted.
104         (WebCore::Range::toHTML): Deleted.
105         (WebCore::Range::text): Deleted.
106         (WebCore::Range::createContextualFragment): Deleted.
107         (WebCore::Range::detach): Deleted.
108         (WebCore::Range::absoluteBoundingBox): Deleted.
109         * dom/Range.h:
110
111 2015-09-24  Brent Fulgham  <bfulgham@apple.com>
112
113         [Win] Unreviewed build failure.
114
115         * bindings/js/WebCoreJSClientData.h: Make sure Streams API headers
116         are only included if the feature is on.
117
118 2015-09-24  Ryosuke Niwa  <rniwa@webkit.org>
119
120         Make event dispatching respect slotting
121         https://bugs.webkit.org/show_bug.cgi?id=149243
122
123         Reviewed by Antti Koivisto.
124
125         There are primarily two cases to consider: getting out of a shadow root to its host,
126         and moving into a slot from an assigned node.
127
128         When getting out of a shadow root, either the event originated in its shadow tree
129         including its nodes' shadow trees (1) or it moved into this shadow tree via a slot (2).
130         In (1), event.target should be set to the shadow host. In (2), it should be set to the
131         first node in the event path that belongs to the same tree as the shadow host. In order
132         to find such a node in O(1), we use a stack of event targets in each (shadow) tree. We
133         push event.target of the current tree whenever we move up to a slot from an assigned node
134         and pop it out of the stack when we move out of the shadow tree.
135
136         A follow up patch is needed to update the code to resolve related targets.
137
138         Tests: fast/shadow-dom/event-inside-shadow-tree.html
139                fast/shadow-dom/event-inside-slotted-node.html
140
141         * dom/EventDispatcher.cpp:
142         (WebCore::EventPath::EventPath):
143
144 2015-09-24  Chris Dumez  <cdumez@apple.com>
145
146         Drop XPATH_NAMESPACE_NODE from Node::NodeType enum
147         https://bugs.webkit.org/show_bug.cgi?id=149532
148
149         Reviewed by Ryosuke Niwa.
150
151         Drop XPATH_NAMESPACE_NODE from Node::NodeType enum as there is currently
152         no way to construct such Node in WebKit. This avoid having to handle this
153         Node type everywhere.
154
155         * bindings/gobject/WebKitDOMPrivate.cpp:
156         (WebKit::wrap): Deleted.
157         * bindings/objc/DOM.mm:
158         (kitClass): Deleted.
159         * dom/Document.cpp:
160         (WebCore::Document::importNode):
161         (WebCore::Document::adoptNode): Deleted.
162         (WebCore::Document::childTypeAllowed): Deleted.
163         (WebCore::Document::canAcceptChild): Deleted.
164         * dom/Node.cpp:
165         (WebCore::Node::dumpStatistics): Deleted.
166         (WebCore::Node::textContent): Deleted.
167         (WebCore::Node::ancestorElement): Deleted.
168         * dom/Node.h:
169         * dom/Range.cpp:
170         (WebCore::Range::checkNodeWOffset):
171         (WebCore::lengthOfContentsInNode): Deleted.
172         (WebCore::Range::processContentsBetweenOffsets): Deleted.
173         (WebCore::Range::surroundContents): Deleted.
174         * editing/MarkupAccumulator.cpp:
175         (WebCore::MarkupAccumulator::appendStartMarkup): Deleted.
176         * xml/XPathFunctions.cpp:
177         (WebCore::XPath::expandedNameLocalPart): Deleted.
178         * xml/XPathStep.cpp:
179         (WebCore::XPath::Step::nodesInAxis):
180         (WebCore::XPath::primaryNodeType): Deleted.
181         * xml/XPathUtil.cpp:
182         (WebCore::XPath::stringValue): Deleted.
183         (WebCore::XPath::isValidContextNode): Deleted.
184
185 2015-09-24  David Hyatt  <hyatt@apple.com>
186
187         Add support for CSS Custom Properties (in preparation for implementing CSS Variables).
188         https://bugs.webkit.org/show_bug.cgi?id=130397
189
190         Reviewed by Antti Koivisto.
191
192         Added new tests in fast/css/custom-properties.
193
194         * WebCore.xcodeproj/project.pbxproj:
195         Add new header files to the project (CSSCustomPropertyValue and StyleCustomPropertyData).
196
197         * css/CSSComputedStyleDeclaration.cpp:
198         (WebCore::ComputedStyleExtractor::customPropertyValue):
199         (WebCore::ComputedStyleExtractor::propertyValue):
200         If a custom property value is queried (i.e., it starts with "--"), then we use our
201         customPropertyValue lookup to go to the RenderStyle and fetch the appropriate custom property
202         value from the StyleCustomPropertyData.
203
204         (WebCore::CSSComputedStyleDeclaration::length):
205         (WebCore::CSSComputedStyleDeclaration::item):
206         Patched to include custom properties in the returned array. They appear at the end of the array
207         after the built-in properties.
208
209         (WebCore::ComputedStyleExtractor::propertyMatches):
210         Patched to check custom properties.
211
212         (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
213         Make sure the custom properties get copied into the StyleDeclaration.
214
215         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
216         (WebCore::CSSComputedStyleDeclaration::getPropertyValue):
217         Patched to call customPropertyValue for custom properties.
218
219         * css/CSSComputedStyleDeclaration.h:
220         Add customPropertyValue() to ComputedStyleExtractor.
221
222         * css/CSSCustomPropertyValue.h: Added.
223         (WebCore::CSSCustomPropertyValue::create):
224         (WebCore::CSSCustomPropertyValue::equals):
225         (WebCore::CSSCustomPropertyValue::customCSSText):
226         (WebCore::CSSCustomPropertyValue::name):
227         (WebCore::CSSCustomPropertyValue::value):
228         (WebCore::CSSCustomPropertyValue::CSSCustomPropertyValue):
229         Custom properties are parsed as a property with an ID of CSSPropertyCustom and a CSSCustomPropertyValue
230         that holds both the name and the value of the property. Ultimately we might want to just ditch property IDs in
231         favor of AtomicStrings for all properties, and then the need to special case custom properties would go
232         away. For now, though, this is the way we work custom properties into the existing system.
233
234         * css/CSSGrammar.y.in:
235         Add a production for recognizing custom properties and storing them using a property ID of CSSPropertyCustom
236         and a CSSCustomPropertyValue that has the name/value pair.
237
238         * css/CSSParser.cpp:
239         (WebCore::filterProperties):
240         Patched to track seen custom properties and to handle them correctly.
241
242         (WebCore::CSSParser::createStyleProperties):
243         Pass in a seenCustomProperties table to ensure we bail when encountering the same custom property twice.
244
245         (WebCore::CSSParser::addCustomPropertyDeclaration):
246         Called from the grammar production to create the CSSCustomPropertyValue.
247
248         (WebCore::isCustomPropertyIdentifier):
249         Recognize the -- custom property during lexing.
250
251         (WebCore::CSSParser::parseIdentifier):
252         Patched to return a CUSTOM_PROPERTY token when a custom property is identified.
253
254          * css/CSSParser.h:
255         (WebCore::isCustomPropertyName):
256         Add a helper function for asking if a property name is custom.
257
258         * css/CSSValue.cpp:
259         (WebCore::CSSValue::equals):
260         (WebCore::CSSValue::cssText):
261         (WebCore::CSSValue::destroy):
262         * css/CSSValue.h:
263         Patched to add support for CSSCustomPropertyValue.
264
265         * css/PropertySetCSSStyleDeclaration.cpp:
266         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
267         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
268         (WebCore::PropertySetCSSStyleDeclaration::getPropertyPriority):
269         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
270         (WebCore::PropertySetCSSStyleDeclaration::removeProperty):
271         Add code for handling custom properties in the CSS OM.
272
273         * css/StyleProperties.cpp:
274         (WebCore::StyleProperties::getPropertyValue):
275         (WebCore::StyleProperties::getCustomPropertyValue):
276         (WebCore::StyleProperties::getPropertyCSSValue):
277         (WebCore::StyleProperties::getCustomPropertyCSSValue):
278         (WebCore::MutableStyleProperties::removeProperty):
279         (WebCore::MutableStyleProperties::removeCustomProperty):
280         (WebCore::StyleProperties::propertyIsImportant):
281         (WebCore::StyleProperties::customPropertyIsImportant):
282         (WebCore::MutableStyleProperties::setProperty):
283         (WebCore::MutableStyleProperties::setCustomProperty):
284         (WebCore::MutableStyleProperties::addParsedProperty):
285         (WebCore::MutableStyleProperties::findPropertyIndex):
286         (WebCore::ImmutableStyleProperties::findCustomPropertyIndex):
287         (WebCore::MutableStyleProperties::findCustomPropertyIndex):
288         (WebCore::MutableStyleProperties::findCSSPropertyWithID):
289         (WebCore::MutableStyleProperties::findCustomCSSPropertyWithName):
290         (WebCore::StyleProperties::propertyMatches):
291         (WebCore::StyleProperties::PropertyReference::cssName):
292         * css/StyleProperties.h:
293         (WebCore::StyleProperties::findCustomPropertyIndex):
294         Patched to support handling custom properties in the CSS OM. We have to create equivalent methods that operate
295         on AtomicString propertyNames instead of on property IDs.
296
297         * css/StyleResolver.cpp:
298         (WebCore::StyleResolver::CascadedProperties::customProperties):
299         (WebCore::StyleResolver::styleForKeyframe):
300         (WebCore::StyleResolver::styleForPage):
301         (WebCore::StyleResolver::applyMatchedProperties):
302         (WebCore::StyleResolver::applyProperty):
303         (WebCore::StyleResolver::CascadedProperties::set):
304         (WebCore::StyleResolver::applyCascadedProperties):
305         The resolver has to hold a HashMap from AtomicStrings to Properties. It matches identically to how built-in
306         properties work except that an extensible table (HashMap) is used to hold the property data.
307
308         * css/makeprop.pl:
309         Patched to include the special CSSPropertyCustom value of 1 (just after the CSSPropertyInvalid id value but before the first
310         built-in property value).
311
312         * inspector/InspectorStyleSheet.cpp:
313         (WebCore::InspectorStyle::getText):
314         (WebCore::lowercasePropertyName):
315         (WebCore::InspectorStyle::populateAllProperties):
316         Patch inspector to not lowercase CSS custom property names, since they are case-sensitive.
317
318         * rendering/style/RenderStyle.h:
319         * rendering/style/StyleCustomPropertyData.h: Added.
320         (WebCore::StyleCustomPropertyData::create):
321         (WebCore::StyleCustomPropertyData::copy):
322         (WebCore::StyleCustomPropertyData::operator==):
323         (WebCore::StyleCustomPropertyData::operator!=):
324         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
325         (WebCore::StyleCustomPropertyData::getCustomPropertyValue):
326         (WebCore::StyleCustomPropertyData::hasCustomProperty):
327         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
328         * rendering/style/StyleRareInheritedData.cpp:
329         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
330         (WebCore::StyleRareInheritedData::operator==):
331         * rendering/style/StyleRareInheritedData.h:
332         The front end storage in the RenderStyle for custom properties. For now, custom properties are always inherited, so the
333         data is in StyleRareInheritedData.
334
335 2015-09-24  Chris Dumez  <cdumez@apple.com>
336
337         Optimize Range's lengthOfContentsInNode() for DocumentType Nodes
338         https://bugs.webkit.org/show_bug.cgi?id=149529
339
340         Reviewed by Darin Adler.
341
342         Optimize Range's lengthOfContentsInNode() for DocumentType Nodes:
343         - https://dom.spec.whatwg.org/#concept-node-length
344
345         We currently call Node::countChildNodes() unnecessarily on DocumentType
346         Nodes instead of simply returning 0.
347
348         * dom/Range.cpp:
349         (WebCore::lengthOfContentsInNode):
350         (WebCore::Range::processContents):
351
352 2015-09-24  ChangSeok Oh  <changseok.oh@collabora.com>
353
354         Unreviewed, fix typo errors in a comment ("passed" -> "Passed", "Overwise" -> "Otherwise")
355
356         * css/mediaControlsGtk.css:
357
358 2015-09-24  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
359
360         Reduce almost uses of PassRefPtr in Webcore/testing
361         https://bugs.webkit.org/show_bug.cgi?id=149449
362
363         Reviewed by Darin Adler.
364
365         This patch removes all uses of PassRefPtr except for Internals::serializeObject() and Internals::deserializeObject().
366         It will be removed by upcoming patch.
367
368         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
369         (WebCore::CDMSessionClearKey::generateKeyRequest):
370         * Modules/encryptedmedia/CDMSessionClearKey.h:
371         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
372         (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
373         * platform/graphics/CDMSession.h:
374         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
375         (WebCore::CDMSessionAVFoundationCF::generateKeyRequest):
376         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
377         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
378         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
379         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
380         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
381         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
382         (WebCore::CDMSessionMediaSourceAVFObjC::generateKeyRequest):
383         * testing/InternalSettings.h:
384         (WebCore::InternalSettings::create):
385         * testing/Internals.cpp:
386         (WebCore::Internals::create):
387         (WebCore::Internals::computedStyleIncludingVisitedInfo):
388         (WebCore::Internals::markerRangeForNode):
389         (WebCore::Internals::rangeFromLocationAndLength):
390         (WebCore::Internals::subrange):
391         (WebCore::Internals::nodesFromRect):
392         (WebCore::Internals::mallocStatistics):
393         (WebCore::Internals::typeConversions):
394         (WebCore::Internals::memoryInfo):
395         (WebCore::Internals::serializeObject):
396         (WebCore::Internals::deserializeBuffer):
397         (WebCore::Internals::createTimeRanges):
398         * testing/Internals.h:
399         * testing/MallocStatistics.h:
400         (WebCore::MallocStatistics::create):
401         * testing/MemoryInfo.h:
402         (WebCore::MemoryInfo::create):
403         * testing/MockCDM.cpp:
404         (WebCore::MockCDMSession::generateKeyRequest):
405         * testing/TypeConversions.h:
406         (WebCore::TypeConversions::create):
407
408 2015-09-24  Ryosuke Niwa  <rniwa@webkit.org>
409
410         Ran sort-Xcode-project-file.
411
412         * WebCore.xcodeproj/project.pbxproj:
413
414 2015-09-24  ChangSeok Oh  <changseok.oh@collabora.com>
415
416         [GTK] playbutton in media controls is not changed when it is clicked.
417         https://bugs.webkit.org/show_bug.cgi?id=149113
418
419         Reviewed by Philippe Normand.
420
421         When the play button in media controls is clicked, a 'paused' class is added or removed
422         for the element to update its appearance. Although Document::recalcStyle is triggered
423         by that class attribute change, the play button is not changed since there is
424         no difference in styles whether having the 'paused' class or not. Gtk port
425         does not define the -webkit-media-controls-play-button.paused. To fix this,
426         -webkit-media-controls-play-button.paused is newly defined with a dummy style,
427         "position: relative;", which should not change the play button appearance,
428         but be clearly different in style.
429
430         Test: media/media-controls-play-button-updates.html
431
432         * css/mediaControlsGtk.css:
433         (video::-webkit-media-controls-play-button.paused):
434
435 2015-09-24  Carlos Garcia Campos  <cgarcia@igalia.com>
436
437         Unreviewed. Fix GObject DOM API breaks after r190120.
438
439         EntityReference has been removed from the DOM spec. Generate an
440         empy GObject implementation to keep API and ABI
441         compatibility. also add a deprecated impementation for the methods
442         using WebKitEntityReference.
443
444         * PlatformGTK.cmake: Do not generate bindings for EntityReference.idl.
445         * bindings/gobject/WebKitDOMDeprecated.cpp:
446         (webkit_dom_entity_reference_init):
447         (webkit_dom_entity_reference_class_init):
448         (webkit_dom_node_iterator_get_expand_entity_references):
449         (webkit_dom_tree_walker_get_expand_entity_references):
450         (webkit_dom_document_create_entity_reference):
451         * bindings/gobject/WebKitDOMDeprecated.h:
452         * bindings/gobject/WebKitDOMDeprecated.symbols:
453         * bindings/scripts/CodeGeneratorGObject.pm:
454         (SkipFunction): Remove FIXME.
455         * dom/Document.idl: Do not generate createEntityReference for GObject.
456         * dom/EntityReference.idl: Do not generate empty files for GObject.
457
458 2015-09-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
459
460         [Streams API] Add support for JS builtins constructor
461         https://bugs.webkit.org/show_bug.cgi?id=149497
462
463         Reviewed by Darin Adler.
464
465         Covered by existing tests.
466
467         Making CountQueuingStrategy fully JS built-in implemented.
468         Adding support for calling a JS builtin initialization function just after creating the JSXX object.
469         This JS function must be named initializeXX and be in XX.Js file.
470         The JSBuiltinConstructor keyword is added to the binding generator.
471
472         * CMakeLists.txt: Adding CountQueuingStrategy.js, removing JSCountQueuingStrategyCustom.cpp.
473         * DerivedSources.cpp: Ditto.
474         * DerivedSources.make: Ditto.
475         * Modules/streams/CountQueuingStrategy.h: Making CountQueuingStrategy a dummy class.
476         (WebCore::CountQueuingStrategy::create):
477         (WebCore::CountQueuingStrategy::~CountQueuingStrategy):
478         (WebCore::CountQueuingStrategy::CountQueuingStrategy):
479         * Modules/streams/CountQueuingStrategy.idl:
480         * Modules/streams/CountQueuingStrategy.js: Added.
481         (size):
482         (initializeCountQueuingStrategy):
483         * WebCore.vcxproj/WebCore.vcxproj: Removing JSCountQueuingStrategyCustom.cpp.
484         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
485         * WebCore.xcodeproj/project.pbxproj: Ditto.
486         * bindings/js/JSBindingsAllInOne.cpp: Ditto.
487         * bindings/js/JSCountQueuingStrategyCustom.cpp: Removed.
488         * bindings/js/JSDOMBinding.cpp: Adding support for DOMConstructorJSBuiltinObject.
489         (WebCore::callInitializeFunction):
490         (WebCore::DOMConstructorJSBuiltinObject::visitChildren):
491         * bindings/js/JSDOMBinding.h: Diitto.
492         (WebCore::createFromJSBuiltin):
493         (WebCore::DOMConstructorJSBuiltinObject::DOMConstructorJSBuiltinObject):
494         * bindings/js/WebCoreJSClientData.h: Adding support for CQS builtins functions.
495         (WebCore::WebCoreJSClientData::WebCoreJSClientData):
496         (WebCore::WebCoreJSClientData::countQueuingStrategyBuiltins):
497         * bindings/scripts/CodeGeneratorJS.pm:
498         (GetJSBuiltinFunctionName):
499         (GetFunctionName):
500         (InstanceNeedsVisitChildren): Generating visitChildren method in case of JSBuiltinConstructor.
501         (GetParentConstructorClassName): Refactoring to make JSXXConstructor derive from DOMConstructorJSBuiltinObject in case of JSBuiltinConstructor.
502         (GenerateConstructorDeclaration): Ditto.
503         (GenerateConstructorDefinition): Generate specific constructor in case of JSBuiltinConstructor.
504         (GenerateConstructorHelperMethods): Refactoring to use Base class.
505         (IsConstructable): Ditto.
506         (ConstructorHasProperties): Deleted.
507         * bindings/scripts/IDLAttributes.txt: Adding JSBuiltinConstructor.
508         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
509         (WebCore::JSTestActiveDOMObjectConstructor::JSTestActiveDOMObjectConstructor):
510         * bindings/scripts/test/JS/JSTestCallback.cpp:
511         (WebCore::JSTestCallbackConstructor::JSTestCallbackConstructor):
512         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
513         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor):
514         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
515         (WebCore::JSTestCustomNamedGetterConstructor::JSTestCustomNamedGetterConstructor):
516         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
517         (WebCore::JSTestEventConstructorConstructor::JSTestEventConstructorConstructor):
518         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
519         (WebCore::JSTestEventTargetConstructor::JSTestEventTargetConstructor):
520         * bindings/scripts/test/JS/JSTestException.cpp:
521         (WebCore::JSTestExceptionConstructor::JSTestExceptionConstructor):
522         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
523         (WebCore::JSTestGenerateIsReachableConstructor::JSTestGenerateIsReachableConstructor):
524         * bindings/scripts/test/JS/JSTestInterface.cpp:
525         (WebCore::JSTestInterfaceConstructor::JSTestInterfaceConstructor):
526         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
527         (WebCore::JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor):
528         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
529         (WebCore::JSTestNamedConstructorConstructor::JSTestNamedConstructorConstructor):
530         (WebCore::JSTestNamedConstructorNamedConstructor::JSTestNamedConstructorNamedConstructor):
531         * bindings/scripts/test/JS/JSTestNode.cpp:
532         (WebCore::JSTestNodeConstructor::JSTestNodeConstructor):
533         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
534         (WebCore::JSTestNondeterministicConstructor::JSTestNondeterministicConstructor):
535         * bindings/scripts/test/JS/JSTestObj.cpp:
536         (WebCore::JSTestObjConstructor::JSTestObjConstructor):
537         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
538         (WebCore::JSTestOverloadedConstructorsConstructor::JSTestOverloadedConstructorsConstructor):
539         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
540         (WebCore::JSTestOverrideBuiltinsConstructor::JSTestOverrideBuiltinsConstructor):
541         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
542         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor):
543         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
544         (WebCore::JSTestTypedefsConstructor::JSTestTypedefsConstructor):
545         * bindings/scripts/test/JS/JSattribute.cpp:
546         (WebCore::JSattributeConstructor::JSattributeConstructor):
547         * bindings/scripts/test/JS/JSreadonly.cpp:
548         (WebCore::JSreadonlyConstructor::JSreadonlyConstructor):
549
550 2015-09-23  Chris Dumez  <cdumez@apple.com>
551
552         Simplify / Optimize Range::selectNode()
553         https://bugs.webkit.org/show_bug.cgi?id=149515
554
555         Reviewed by Ryosuke Niwa.
556
557         Simplify / Optimize Range::selectNode():
558         1. Do a null-check on refNode->parentNode() instead of checking the
559            nodeType(), which is virtual. Attr, DocumentFragment and Document
560            Nodes do not have a parent and thus are covered by this check.
561            Also, setStartBefore() / setEndAfter() were already doing a null
562            check on the parent.
563         2. Call lower-level setStart() / setEnd() directly, instead of using
564            setStartBefore() / setEndAfter() as intermediary. As a result:
565            2.a. We avoid doing a redundant null checks on refNode and its parent
566                 (inside those intermediate functions)
567            2.b. We only call refNode->computeNodeIndex() once instead of twice
568                 (in each of those intermediate functions). computeNodeIndex()
569                 is not a trivial getter as its needs to traverse all the
570                 previous siblings.
571
572         The implementation now matches exactly the text of the DOM specification
573         as well:
574         https://dom.spec.whatwg.org/#concept-range-select
575
576         No new layout tests, no web-exposed behavior intended.
577
578         * dom/Range.cpp:
579         (WebCore::Range::selectNode):
580
581 2015-09-23  Myles C. Maxfield  <mmaxfield@apple.com>
582
583         [Cocoa] [Font Features] Implement font-variant-*
584         https://bugs.webkit.org/show_bug.cgi?id=148413
585
586         Reviewed by Darin Adler.
587
588         This patch is the first pass of implementing of the font-variant-* properties. Specifically,
589         these properties are:
590         font-variant-ligatures
591         font-variant-position
592         font-variant-caps
593         font-variant-numeric
594         font-variant-alternates
595         font-variant-east-asian
596
597         These new properties are held inside FontDescription as bit fields. At font creation time,
598         we consult with the FontDescription to figure out which variants are specified. We then
599         convert those variants to font features, and resolve these font features with the additional
600         features specified by font-feature-settings (as the spec requires). This patch also makes
601         our caches sensitive to these new properties of FontDescription so we don't look up cached,
602         stale fonts.
603
604         The implementation has some caveats, however. They are listed here:
605         1. These new properties need to interact correctly with @font-face declarations. In
606         particular, only certain properties of the FontDescription should be considered when
607         detecting if a @font-face declaration applies to a particular element. This discrimination
608         does not happen correctly. In addition, any feature-specific CSS properties inside the
609         @font-face declaration need to be consulted at a particular point during the feature
610         resolve. This does not currently occur.
611         2. One of the properties, font-variant-alternates, has a few values which require custom
612         CSS functions, which makes modeling the properties as bit fields tricky. These extra values
613         need to be implemented. This patch implements all the values which do not require extra CSS
614         features.
615         3. These new properties have a shorthand, font-variant, which is designed to be backward-
616         compatible with CSS 2.1's concept of font-variant. In particular, CSS 2.1 allows you to use
617         "normal" and "small-caps" with font-variant. Both of these values are values of the new
618         property font-variant-caps. However, our existing implementation of small-caps does not
619         use font features when they exist; instead, it simply draws text at a smaller font size and
620         uses (effectively) text-transform to force capital letters. This implementation needs to be
621         unified with the new font-variant-caps property so that we can expand font-variant to be
622         a shorthand for the new properties.
623         4. font-variant-position and font-variant-caps should provide appropriate synthesis if no
624         matching font-feature exists.
625         5. FontCascade::typesettingFeatures() is now no-longer accurate. Fixing this would be large
626         enough to warrant its own patch.
627         6. These properties are not tested with TrueType fonts.
628
629         Tests: css3/font-variant-all-webfont.html
630                css3/font-variant-parsing.html
631
632         * css/CSSComputedStyleDeclaration.cpp: Reconstruct StyleProperties from a RenderStyle.
633         (WebCore::appendLigaturesValue):
634         (WebCore::fontVariantLigaturesPropertyValue):
635         (WebCore::fontVariantPositionPropertyValue):
636         (WebCore::fontVariantCapsPropertyValue):
637         (WebCore::fontVariantNumericPropertyValue):
638         (WebCore::fontVariantAlternatesPropertyValue):
639         (WebCore::fontVariantEastAsianPropertyValue):
640         (WebCore::ComputedStyleExtractor::propertyValue):
641         * css/CSSFontFeatureValue.cpp: Update to FontFeatureTag instead of WTF::String.
642         (WebCore::CSSFontFeatureValue::CSSFontFeatureValue):
643         (WebCore::CSSFontFeatureValue::customCSSText):
644         * css/CSSFontFeatureValue.h: Ditto.
645         (WebCore::CSSFontFeatureValue::create):
646         (WebCore::CSSFontFeatureValue::tag):
647         * css/CSSParser.cpp: Parse the new properties according to the CSS3 fonts spec.
648         (WebCore::isValidKeywordPropertyAndValue):
649         (WebCore::isKeywordPropertyID):
650         (WebCore::CSSParser::parseValue):
651         (WebCore::CSSParser::parseFontFeatureTag):
652         (WebCore::CSSParser::parseFontVariantLigatures):
653         (WebCore::CSSParser::parseFontVariantNumeric):
654         (WebCore::CSSParser::parseFontVariantEastAsian):
655         * css/CSSParser.h:
656         * css/CSSPrimitiveValueMappings.h: For the three properties which are simple keyword value
657         properties, implement casting operators to automatically convert between RenderStyle
658         objects and CSS property objects.
659         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
660         (WebCore::CSSPrimitiveValue::operator FontVariantPosition):
661         (WebCore::CSSPrimitiveValue::operator FontVariantCaps):
662         (WebCore::CSSPrimitiveValue::operator FontVariantAlternates):
663         * css/CSSPropertyNames.in: New properties.
664         * css/CSSValueKeywords.in: New values.
665         * css/StyleBuilderConverter.h:
666         (WebCore::StyleBuilderConverter::convertFontFeatureSettings): Update to not use
667         RefPtrs.
668         * css/StyleBuilderCustom.h: Properties which are not simple keyword value properties are
669         decomposed into multiple members of FontDescription. These properties exist to convert
670         between these aggregate members and the CSS properties.
671         (WebCore::StyleBuilderCustom::applyInheritFontVariantLigatures):
672         (WebCore::StyleBuilderCustom::applyInitialFontVariantLigatures):
673         (WebCore::StyleBuilderCustom::applyValueFontVariantLigatures):
674         (WebCore::StyleBuilderCustom::applyInheritFontVariantNumeric):
675         (WebCore::StyleBuilderCustom::applyInitialFontVariantNumeric):
676         (WebCore::StyleBuilderCustom::applyValueFontVariantNumeric):
677         (WebCore::StyleBuilderCustom::applyInheritFontVariantEastAsian):
678         (WebCore::StyleBuilderCustom::applyInitialFontVariantEastAsian):
679         (WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian):
680         (WebCore::StyleBuilderCustom::applyInitialWebkitFontVariantLigatures): Deleted.
681         (WebCore::StyleBuilderCustom::applyInheritWebkitFontVariantLigatures): Deleted.
682         (WebCore::StyleBuilderCustom::applyValueWebkitFontVariantLigatures): Deleted.
683         * editing/cocoa/HTMLConverter.mm:
684         (HTMLConverter::computedAttributesForElement): Unprefix font-variant-ligatures.
685         * platform/graphics/FontCache.h: Update cache to be sensitive to new state in
686         FontDescription.
687         (WebCore::FontDescriptionKey::FontDescriptionKey):
688         (WebCore::FontDescriptionKey::operator==):
689         (WebCore::FontDescriptionKey::computeHash):
690         (WebCore::FontDescriptionKey::makeFlagsKey):
691         (WebCore::FontDescriptionKey::makeFlagKey): Deleted.
692         * platform/graphics/FontCascade.cpp:
693         (WebCore::FontCascade::codePath): These new variants should trigger the complex text
694         codepath.
695         * platform/graphics/FontCascade.h:
696         (WebCore::FontCascade::computeTypesettingFeatures): Update to use new state enum.
697         * platform/graphics/FontDescription.cpp: Add state to hold new property values.
698         (WebCore::FontDescription::FontDescription):
699         (WebCore::FontCascadeDescription::FontCascadeDescription): Deleted.
700         * platform/graphics/FontDescription.h: Add state to hold new property values.
701         (WebCore::FontDescription::featureSettings):
702         (WebCore::FontDescription::variantCommonLigatures):
703         (WebCore::FontDescription::variantDiscretionaryLigatures):
704         (WebCore::FontDescription::variantHistoricalLigatures):
705         (WebCore::FontDescription::variantContextualAlternates):
706         (WebCore::FontDescription::variantPosition):
707         (WebCore::FontDescription::variantCaps):
708         (WebCore::FontDescription::variantNumericFigure):
709         (WebCore::FontDescription::variantNumericSpacing):
710         (WebCore::FontDescription::variantNumericFraction):
711         (WebCore::FontDescription::variantNumericOrdinal):
712         (WebCore::FontDescription::variantNumericSlashedZero):
713         (WebCore::FontDescription::variantAlternates):
714         (WebCore::FontDescription::variantEastAsianVariant):
715         (WebCore::FontDescription::variantEastAsianWidth):
716         (WebCore::FontDescription::variantEastAsianRuby):
717         (WebCore::FontDescription::variantSettings):
718         (WebCore::FontDescription::setFeatureSettings):
719         (WebCore::FontDescription::setVariantCommonLigatures):
720         (WebCore::FontDescription::setVariantDiscretionaryLigatures):
721         (WebCore::FontDescription::setVariantHistoricalLigatures):
722         (WebCore::FontDescription::setVariantContextualAlternates):
723         (WebCore::FontDescription::setVariantPosition):
724         (WebCore::FontDescription::setVariantCaps):
725         (WebCore::FontDescription::setVariantNumericFigure):
726         (WebCore::FontDescription::setVariantNumericSpacing):
727         (WebCore::FontDescription::setVariantNumericFraction):
728         (WebCore::FontDescription::setVariantNumericOrdinal):
729         (WebCore::FontDescription::setVariantNumericSlashedZero):
730         (WebCore::FontDescription::setVariantAlternates):
731         (WebCore::FontDescription::setVariantEastAsianVariant):
732         (WebCore::FontDescription::setVariantEastAsianWidth):
733         (WebCore::FontDescription::setVariantEastAsianRuby):
734         (WebCore::FontDescription::operator==):
735         (WebCore::FontCascadeDescription::initialVariantPosition):
736         (WebCore::FontCascadeDescription::initialVariantCaps):
737         (WebCore::FontCascadeDescription::initialVariantAlternates):
738         (WebCore::FontCascadeDescription::commonLigaturesState): Deleted.
739         (WebCore::FontCascadeDescription::discretionaryLigaturesState): Deleted.
740         (WebCore::FontCascadeDescription::historicalLigaturesState): Deleted.
741         (WebCore::FontCascadeDescription::setCommonLigaturesState): Deleted.
742         (WebCore::FontCascadeDescription::setDiscretionaryLigaturesState): Deleted.
743         (WebCore::FontCascadeDescription::setHistoricalLigaturesState): Deleted.
744         (WebCore::FontCascadeDescription::operator==): Deleted.
745         * platform/graphics/FontFeatureSettings.cpp: Update to use FontFeatureTag instead of
746         WTF::String.
747         (WebCore::FontFeature::FontFeature):
748         (WebCore::FontFeature::operator==):
749         (WebCore::FontFeature::operator<):
750         (WebCore::FontFeatureSettings::hash):
751         (WebCore::FontFeatureSettings::create): Deleted.
752         * platform/graphics/FontFeatureSettings.h: Update to use FontFeatureTag instead of
753         WTF::String.
754         (WebCore::fontFeatureTag):
755         (WebCore::FontFeatureTagHash::hash):
756         (WebCore::FontFeatureTagHash::equal):
757         (WebCore::FontFeatureTagHashTraits::constructDeletedValue):
758         (WebCore::FontFeatureTagHashTraits::isDeletedValue):
759         (WebCore::FontFeature::tag):
760         (WebCore::FontFeatureSettings::operator==):
761         (WebCore::FontFeatureSettings::begin):
762         (WebCore::FontFeatureSettings::end):
763         (WebCore::FontFeatureSettings::FontFeatureSettings): Deleted.
764         * platform/graphics/cocoa/FontCacheCoreText.cpp: Ditto. Also, when computing font
765         features, consult with the state inside FontDescription.
766         (WebCore::tagEquals):
767         (WebCore::appendTrueTypeFeature):
768         (WebCore::appendOpenTypeFeature):
769         (WebCore::computeFeatureSettingsFromVariants):
770         (WebCore::preparePlatformFont):
771         (WebCore::platformFontLookupWithFamily):
772         (WebCore::fontWithFamily):
773         (WebCore::FontCache::createFontPlatformData):
774         (WebCore::FontCache::systemFallbackForCharacters):
775         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp: Update to use references instead of
776         pointers.
777         (WebCore::HarfBuzzShaper::setFontFeatures):
778         * platform/graphics/mac/FontCacheMac.mm:
779         (WebCore::platformFontWithFamily): Ditto.
780         * platform/graphics/mac/FontCustomPlatformData.cpp:
781         (WebCore::FontCustomPlatformData::fontPlatformData): Be sensitive to new state inside FontDescription.
782         * platform/text/TextFlags.h:
783         (WebCore::FontVariantSettings::isAllNormal): New state enums.
784         * rendering/RenderThemeIOS.mm:
785         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription): Be sensitive to new state inside
786         FontDescription.
787         * rendering/line/BreakingContext.h:
788
789 2015-09-23  Chris Dumez  <cdumez@apple.com>
790
791         Unreviewed, roll out r190085 as it seems to cause crashes in JSC
792         <rdar://problem/22825602>
793
794         * bindings/scripts/CodeGeneratorJS.pm:
795         (GenerateAttributesHashTable):
796         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
797         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
798         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
799         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
800         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
801         * bindings/scripts/test/JS/JSTestException.cpp:
802         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
803         * bindings/scripts/test/JS/JSTestInterface.cpp:
804         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
805         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
806         * bindings/scripts/test/JS/JSTestNode.cpp:
807         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
808         * bindings/scripts/test/JS/JSTestObj.cpp:
809         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
810         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
811         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
812         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
813         * bindings/scripts/test/JS/JSattribute.cpp:
814         * bindings/scripts/test/JS/JSreadonly.cpp:
815
816 2015-09-23  Chris Dumez  <cdumez@apple.com>
817
818         HTMLOutputElement.htmlFor should be settable
819         https://bugs.webkit.org/show_bug.cgi?id=149418
820
821         Reviewed by Ryosuke Niwa.
822
823         HTMLOutputElement.htmlFor should be settable as per the latest HTML
824         specification:
825         - https://html.spec.whatwg.org/multipage/forms.html#the-output-element
826
827         It is supposed to call DOMSettableTokenList.setValue() with the input
828         String. This patch adds support for this by adding [PutForwards=value]
829         IDL extended attribute.
830
831         This aligns our behavior with the specification, Firefox and Chrome.
832
833         No new tests, already covered by existing test.
834
835         * html/AttributeDOMTokenList.cpp:
836         (WebCore::AttributeDOMTokenList::AttributeDOMTokenList):
837         (WebCore::AttributeDOMTokenList::attributeValueChanged):
838         * html/AttributeDOMTokenList.h:
839         - Have AttributeDOMTokenList subclass DOMSettableTokenList instead of
840         DOMTokenList so that it can be used in places where the IDL expects
841         us to return a DOMSettableTokenList (e.g. HTMLOutputElement.htmlFor).
842         - Mark AttributeDOMTokenList as fast allocated.
843
844         * html/DOMSettableTokenList.cpp:
845         (WebCore::DOMSettableTokenList::setValue):
846         * html/DOMSettableTokenList.h:
847         - Move setValue() from DOMTokenList to DOMSettableTokenList
848           as it is only needed by DOMSettableTokenList.
849         - Get rid of the factory function as all call sites are using
850           AttributeDOMTokenList now.
851         - Stop inheriting RefCounted as AttributeDOMTokenList handles its
852           own refcounting.
853
854         * html/DOMTokenList.cpp:
855         (WebCore::DOMTokenList::setValueInternal):
856         * html/DOMTokenList.h:
857         Rename setValue() to setValueInternal() as this version does not
858         update the associated attribute value, only the tokens.
859
860         * html/HTMLLinkElement.cpp:
861         * html/HTMLLinkElement.h:
862         - Have HTMLLinkElement.sizes use an AttributeDOMTokenList instead of
863           a DOMSettableTokenList as there is an associated attribute. The
864           previous code had a bug has setting HTMLLinkElement.sizes would not
865           update the associated 'sizes' attribute. Switching to using
866           AttributeDOMTokenList fixes this and a new layout test has been added
867           to cover this.
868         - Create the AttributeDOMTokenList lazily to avoid updating it every
869           time the sizes attribute changes until it is actually accessed.
870
871         * html/HTMLOutputElement.cpp:
872         * html/HTMLOutputElement.h:
873         - Have HTMLLinkElement.htmlFor use an AttributeDOMTokenList instead of
874           a DOMSettableTokenList as there is an associated attribute.
875         - Create the AttributeDOMTokenList lazily to avoid updating it every
876           time the sizes attribute changes until it is actually accessed.
877
878         * html/HTMLOutputElement.idl:
879         Add [PutForwards=value] on the htmlFor attribute, as per the
880         HTML specification.
881
882 2015-09-23  Chris Dumez  <cdumez@apple.com>
883
884         TreeWalker.previousSibling()  / nextSibling() does not behave according to the specification
885         https://bugs.webkit.org/show_bug.cgi?id=149493
886
887         Reviewed by Darin Adler.
888
889         TreeWalker.previousSibling()  / nextSibling() does not behave according
890         to the specification:
891         - https://dom.spec.whatwg.org/#dom-treewalker-nextsibling
892         - https://dom.spec.whatwg.org/#dom-treewalker-previoussibling
893         - https://dom.spec.whatwg.org/#concept-traverse-siblings
894
895         In particular, the previous code would fail to update 'node' variable
896         in the case acceptNode() returned FILTER_REJECT. This patch fixes this
897         and refactors the function to match more closely the text of the spec
898         and avoid code duplication.
899
900         No new tests, already covered by existing test.
901
902         * dom/TreeWalker.cpp:
903         (WebCore::TreeWalker::traverseSiblings):
904         (WebCore::TreeWalker::previousSibling):
905         (WebCore::TreeWalker::nextSibling):
906         (WebCore::TreeWalker::previousNode): Deleted.
907         * dom/TreeWalker.h:
908
909 2015-09-23  Alex Christensen  <achristensen@webkit.org>
910
911         Fix CMake build.
912
913         * CMakeLists.txt:
914         Use {} instead of () for CMake variables.
915
916 2015-09-23  Tim Horton  <timothy_horton@apple.com>
917
918         Try to fix the CMake build.
919
920         * CMakeLists.txt:
921
922 2015-09-23  Tim Horton  <timothy_horton@apple.com>
923
924         Hopefully fix the production build.
925
926         * DerivedSources.make:
927         * WebCore.vcxproj/build-generated-files.pl:
928         * WebCore.xcodeproj/project.pbxproj:
929         * generate-js-builtins:
930         * make-generated-sources.sh:
931
932 2015-09-23  Ryosuke Niwa  <rniwa@webkit.org>
933
934         Mac production build fix attempt after r190155.
935
936         * WebCore.xcodeproj/project.pbxproj:
937
938 2015-09-23  Chris Dumez  <cdumez@apple.com>
939
940         Avoid unnecessary ancestor traversal in Range::selectNodeContents()
941         https://bugs.webkit.org/show_bug.cgi?id=149491
942
943         Reviewed by Andreas Kling.
944
945         Avoid unnecessary ancestor traversal in Range::selectNodeContents().
946         A DocumentType Node cannot have children, therefore, there is no need
947         to check if ancestors are docTypes. We now simply check if the current
948         node is a DocumentType Node, as per the specification:
949         - https://dom.spec.whatwg.org/#dom-range-selectnodecontents (step 1)
950
951         * dom/Range.cpp:
952         (WebCore::Range::selectNodeContents):
953
954 2015-09-23  Chris Dumez  <cdumez@apple.com>
955
956         Range's setStartBefore() / setStartAfter() / setEndBefore() / setEndAfter() do not match the specification
957         https://bugs.webkit.org/show_bug.cgi?id=149490
958
959         Reviewed by Andreas Kling.
960
961         Range's setStartBefore() / setStartAfter() / setEndBefore() / setEndAfter()
962         behavior do not match the DOM specification:
963         - https://dom.spec.whatwg.org/#dom-range-setstartbefore
964         - https://dom.spec.whatwg.org/#dom-range-setstartafter
965         - https://dom.spec.whatwg.org/#dom-range-setendbefore
966         - https://dom.spec.whatwg.org/#dom-range-setendafter
967
968         In particular, instead of step 2:
969         "If parent is null, throw an InvalidNodeTypeError exception."
970
971         Our implementation was doing more checks and throwing exceptions in cases
972         that the specification does not say we should. We were calling
973         checkNodeBA() which had restrictions on both the node type and its
974         root type. This is now replaced by a simple null check on the parent,
975         as per the specification.
976
977         Firefox's behavior matches the specification.
978
979         No new tests, already covered by existing tests.
980
981         * dom/Range.cpp:
982         (WebCore::Range::setStartAfter):
983         (WebCore::Range::setEndBefore):
984         (WebCore::Range::setEndAfter):
985         (WebCore::Range::setStartBefore):
986         (WebCore::Range::cloneRange): Deleted.
987         (WebCore::Range::selectNode): Deleted.
988         (WebCore::Range::selectNodeContents): Deleted.
989         (WebCore::Range::absoluteTextRects): Deleted.
990         * dom/Range.h:
991
992 2015-09-23  Commit Queue  <commit-queue@webkit.org>
993
994         Unreviewed, rolling out r190168.
995         https://bugs.webkit.org/show_bug.cgi?id=149502
996
997         it broke debug builds. (Requested by zalan on #webkit).
998
999         Reverted changeset:
1000
1001         "HTMLOutputElement.htmlFor should be settable"
1002         https://bugs.webkit.org/show_bug.cgi?id=149418
1003         http://trac.webkit.org/changeset/190168
1004
1005 2015-09-23  Commit Queue  <commit-queue@webkit.org>
1006
1007         Unreviewed, rolling out r190160.
1008         https://bugs.webkit.org/show_bug.cgi?id=149501
1009
1010         media/media-controls-play-button-updates.html fails on
1011         Yosemite and EFL (Requested by zalan on #webkit).
1012
1013         Reverted changeset:
1014
1015         "[GTK] playbutton in media controls is not changed when it is
1016         clicked."
1017         https://bugs.webkit.org/show_bug.cgi?id=149113
1018         http://trac.webkit.org/changeset/190160
1019
1020 2015-09-23  Antti Koivisto  <antti@apple.com>
1021
1022         Try to fix build.
1023
1024         * css/DocumentRuleSets.h:
1025         * inspector/InspectorInstrumentation.h:
1026
1027 2015-09-23  Antti Koivisto  <antti@apple.com>
1028
1029         Fix sorting
1030
1031         * dom/DOMAllInOne.cpp:
1032
1033 2015-09-22  Antti Koivisto  <antti@apple.com>
1034
1035         Split author style code out from DocumentStyleSheetCollection
1036         https://bugs.webkit.org/show_bug.cgi?id=149446
1037
1038         Reviewed by Andreas Kling.
1039
1040         Shadow trees may have their own author style. Factor the related code out so we can use
1041         it outside the document context.
1042
1043         DocumentStyleSheetCollection is replaced by two classes:
1044
1045         AuthorStyleSheets - author stylesheets and mutation optimization code
1046         ExtensionStyleSheets - user stylesheets, injected author stylesheets, content extension stylesheets
1047
1048         * WebCore.xcodeproj/project.pbxproj:
1049         * contentextensions/ContentExtensionsBackend.cpp:
1050         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
1051         * css/CSSStyleSheet.cpp:
1052         (WebCore::CSSStyleSheet::didMutateRules):
1053         * css/DocumentRuleSets.cpp:
1054         (WebCore::DocumentRuleSets::~DocumentRuleSets):
1055         (WebCore::DocumentRuleSets::initUserStyle):
1056         * css/DocumentRuleSets.h:
1057         (WebCore::DocumentRuleSets::sibling):
1058         (WebCore::DocumentRuleSets::uncommonAttribute):
1059         * css/InspectorCSSOMWrappers.cpp:
1060         (WebCore::InspectorCSSOMWrappers::collectFromStyleSheets):
1061         (WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
1062         (WebCore::InspectorCSSOMWrappers::collectFromDocumentStyleSheetCollection): Deleted.
1063         * css/InspectorCSSOMWrappers.h:
1064         * css/StyleResolver.cpp:
1065         (WebCore::StyleResolver::StyleResolver):
1066         (WebCore::StyleResolver::appendAuthorStyleSheets):
1067         * css/StyleSheetList.cpp:
1068         (WebCore::StyleSheetList::styleSheets):
1069         (WebCore::StyleSheetList::detachFromDocument):
1070         (WebCore::StyleSheetList::length):
1071         * dom/AuthorStyleSheets.cpp: Added.
1072         (WebCore::AuthorStyleSheets::AuthorStyleSheets):
1073         (WebCore::AuthorStyleSheets::combineCSSFeatureFlags):
1074         (WebCore::AuthorStyleSheets::resetCSSFeatureFlags):
1075         (WebCore::AuthorStyleSheets::addAuthorSheet):
1076         (WebCore::AuthorStyleSheets::removePendingSheet):
1077         (WebCore::AuthorStyleSheets::addStyleSheetCandidateNode):
1078         (WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode):
1079         (WebCore::AuthorStyleSheets::collectActiveStyleSheets):
1080         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
1081         (WebCore::filterEnabledNonemptyCSSStyleSheets):
1082         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
1083         (WebCore::AuthorStyleSheets::activeStyleSheetsForInspector):
1084         (WebCore::AuthorStyleSheets::activeStyleSheetsContains):
1085         (WebCore::AuthorStyleSheets::detachFromDocument):
1086         * dom/AuthorStyleSheets.h: Added.
1087         (WebCore::AuthorStyleSheets::activeStyleSheets):
1088         (WebCore::AuthorStyleSheets::styleSheets):
1089         (WebCore::AuthorStyleSheets::styleSheetsForStyleSheetList):
1090         (WebCore::AuthorStyleSheets::pendingUpdateType):
1091         (WebCore::AuthorStyleSheets::setPendingUpdateType):
1092         (WebCore::AuthorStyleSheets::flushPendingUpdates):
1093         (WebCore::AuthorStyleSheets::preferredStylesheetSetName):
1094         (WebCore::AuthorStyleSheets::selectedStylesheetSetName):
1095         (WebCore::AuthorStyleSheets::setPreferredStylesheetSetName):
1096         (WebCore::AuthorStyleSheets::setSelectedStylesheetSetName):
1097         (WebCore::AuthorStyleSheets::addPendingSheet):
1098         (WebCore::AuthorStyleSheets::hasPendingSheets):
1099         (WebCore::AuthorStyleSheets::usesFirstLineRules):
1100         (WebCore::AuthorStyleSheets::usesFirstLetterRules):
1101         (WebCore::AuthorStyleSheets::usesRemUnits):
1102         (WebCore::AuthorStyleSheets::setUsesRemUnit):
1103         (WebCore::AuthorStyleSheets::usesStyleBasedEditability):
1104         (WebCore::AuthorStyleSheets::setUsesStyleBasedEditability):
1105         * dom/Document.cpp:
1106         (WebCore::Document::Document):
1107         (WebCore::Document::~Document):
1108         (WebCore::Document::setCompatibilityMode):
1109         (WebCore::Document::recalcStyle):
1110         (WebCore::Document::createStyleResolver):
1111         (WebCore::Document::fontsNeedUpdate):
1112         (WebCore::Document::usesStyleBasedEditability):
1113         (WebCore::Document::processHttpEquiv):
1114         (WebCore::Document::preferredStylesheetSet):
1115         (WebCore::Document::selectedStylesheetSet):
1116         (WebCore::Document::setSelectedStylesheetSet):
1117         (WebCore::Document::scheduleOptimizedStyleSheetUpdate):
1118         (WebCore::Document::styleResolverChanged):
1119         (WebCore::Document::haveStylesheetsLoaded):
1120         (WebCore::Document::getCachedLocale):
1121         * dom/Document.h:
1122         (WebCore::Document::authorStyleSheets):
1123         (WebCore::Document::extensionStyleSheets):
1124         (WebCore::Document::gotoAnchorNeededAfterStylesheetsLoad):
1125         (WebCore::Document::setGotoAnchorNeededAfterStylesheetsLoad):
1126         (WebCore::Document::styleSheetCollection): Deleted.
1127         * dom/DocumentStyleSheetCollection.cpp: Removed.
1128         * dom/DocumentStyleSheetCollection.h: Removed.
1129         * dom/ExtensionStyleSheets.cpp: Copied from Source/WebCore/dom/DocumentStyleSheetCollection.cpp.
1130         (WebCore::ExtensionStyleSheets::ExtensionStyleSheets):
1131         (WebCore::ExtensionStyleSheets::pageUserSheet):
1132         (WebCore::ExtensionStyleSheets::clearPageUserSheet):
1133         (WebCore::ExtensionStyleSheets::updatePageUserSheet):
1134         (WebCore::ExtensionStyleSheets::injectedUserStyleSheets):
1135         (WebCore::ExtensionStyleSheets::injectedAuthorStyleSheets):
1136         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
1137         (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
1138         (WebCore::ExtensionStyleSheets::addUserSheet):
1139         (WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
1140         (WebCore::ExtensionStyleSheets::maybeAddContentExtensionSheet):
1141         (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
1142         (WebCore::ExtensionStyleSheets::detachFromDocument):
1143         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection): Deleted.
1144         (WebCore::DocumentStyleSheetCollection::combineCSSFeatureFlags): Deleted.
1145         (WebCore::DocumentStyleSheetCollection::resetCSSFeatureFlags): Deleted.
1146         (WebCore::DocumentStyleSheetCollection::pageUserSheet): Deleted.
1147         (WebCore::DocumentStyleSheetCollection::clearPageUserSheet): Deleted.
1148         (WebCore::DocumentStyleSheetCollection::updatePageUserSheet): Deleted.
1149         (WebCore::DocumentStyleSheetCollection::injectedUserStyleSheets): Deleted.
1150         (WebCore::DocumentStyleSheetCollection::injectedAuthorStyleSheets): Deleted.
1151         (WebCore::DocumentStyleSheetCollection::updateInjectedStyleSheetCache): Deleted.
1152         (WebCore::DocumentStyleSheetCollection::invalidateInjectedStyleSheetCache): Deleted.
1153         (WebCore::DocumentStyleSheetCollection::addAuthorSheet): Deleted.
1154         (WebCore::DocumentStyleSheetCollection::addUserSheet): Deleted.
1155         (WebCore::DocumentStyleSheetCollection::addDisplayNoneSelector): Deleted.
1156         (WebCore::DocumentStyleSheetCollection::maybeAddContentExtensionSheet): Deleted.
1157         (WebCore::DocumentStyleSheetCollection::styleResolverChangedTimerFired): Deleted.
1158         (WebCore::DocumentStyleSheetCollection::removePendingSheet): Deleted.
1159         (WebCore::DocumentStyleSheetCollection::addStyleSheetCandidateNode): Deleted.
1160         (WebCore::DocumentStyleSheetCollection::removeStyleSheetCandidateNode): Deleted.
1161         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets): Deleted.
1162         (WebCore::DocumentStyleSheetCollection::analyzeStyleSheetChange): Deleted.
1163         (WebCore::filterEnabledNonemptyCSSStyleSheets): Deleted.
1164         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets): Deleted.
1165         (WebCore::DocumentStyleSheetCollection::activeStyleSheetsForInspector): Deleted.
1166         (WebCore::DocumentStyleSheetCollection::activeStyleSheetsContains): Deleted.
1167         (WebCore::DocumentStyleSheetCollection::detachFromDocument): Deleted.
1168         * dom/ExtensionStyleSheets.h: Copied from Source/WebCore/dom/DocumentStyleSheetCollection.h.
1169         (WebCore::ExtensionStyleSheets::documentUserStyleSheets):
1170         (WebCore::DocumentStyleSheetCollection::styleSheetsForStyleSheetList): Deleted.
1171         (WebCore::DocumentStyleSheetCollection::activeAuthorStyleSheets): Deleted.
1172         (WebCore::DocumentStyleSheetCollection::documentUserStyleSheets): Deleted.
1173         (WebCore::DocumentStyleSheetCollection::documentAuthorStyleSheets): Deleted.
1174         (WebCore::DocumentStyleSheetCollection::pendingUpdateType): Deleted.
1175         (WebCore::DocumentStyleSheetCollection::setPendingUpdateType): Deleted.
1176         (WebCore::DocumentStyleSheetCollection::flushPendingUpdates): Deleted.
1177         (WebCore::DocumentStyleSheetCollection::preferredStylesheetSetName): Deleted.
1178         (WebCore::DocumentStyleSheetCollection::selectedStylesheetSetName): Deleted.
1179         (WebCore::DocumentStyleSheetCollection::setPreferredStylesheetSetName): Deleted.
1180         (WebCore::DocumentStyleSheetCollection::setSelectedStylesheetSetName): Deleted.
1181         (WebCore::DocumentStyleSheetCollection::addPendingSheet): Deleted.
1182         (WebCore::DocumentStyleSheetCollection::hasPendingSheets): Deleted.
1183         (WebCore::DocumentStyleSheetCollection::usesFirstLineRules): Deleted.
1184         (WebCore::DocumentStyleSheetCollection::usesFirstLetterRules): Deleted.
1185         (WebCore::DocumentStyleSheetCollection::usesRemUnits): Deleted.
1186         (WebCore::DocumentStyleSheetCollection::setUsesRemUnit): Deleted.
1187         (WebCore::DocumentStyleSheetCollection::usesStyleBasedEditability): Deleted.
1188         (WebCore::DocumentStyleSheetCollection::setUsesStyleBasedEditability): Deleted.
1189         * dom/InlineStyleSheetOwner.cpp:
1190         (WebCore::InlineStyleSheetOwner::insertedIntoDocument):
1191         (WebCore::InlineStyleSheetOwner::removedFromDocument):
1192         (WebCore::InlineStyleSheetOwner::clearDocumentData):
1193         (WebCore::InlineStyleSheetOwner::childrenChanged):
1194         (WebCore::InlineStyleSheetOwner::createSheet):
1195         (WebCore::InlineStyleSheetOwner::sheetLoaded):
1196         (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
1197         * dom/ProcessingInstruction.cpp:
1198         (WebCore::ProcessingInstruction::~ProcessingInstruction):
1199         (WebCore::ProcessingInstruction::nodeName):
1200         (WebCore::ProcessingInstruction::checkStyleSheet):
1201         (WebCore::ProcessingInstruction::sheetLoaded):
1202         (WebCore::ProcessingInstruction::insertedInto):
1203         (WebCore::ProcessingInstruction::removedFrom):
1204         * html/HTMLLinkElement.cpp:
1205         (WebCore::HTMLLinkElement::~HTMLLinkElement):
1206         (WebCore::HTMLLinkElement::insertedInto):
1207         (WebCore::HTMLLinkElement::removedFrom):
1208         (WebCore::HTMLLinkElement::addPendingSheet):
1209         (WebCore::HTMLLinkElement::removePendingSheet):
1210         * html/HTMLQuoteElement.cpp:
1211         * inspector/InspectorCSSAgent.cpp:
1212         (WebCore::InspectorCSSAgent::collectAllDocumentStyleSheets):
1213         (WebCore::InspectorCSSAgent::buildObjectForRule):
1214         * loader/DocumentLoader.cpp:
1215         (WebCore::DocumentLoader::commitData):
1216         * page/Page.cpp:
1217         (WebCore::Page::userStyleSheetLocationChanged):
1218         (WebCore::Page::setUserContentController):
1219         * page/PageGroup.cpp:
1220         * page/UserContentController.cpp:
1221         (WebCore::UserContentController::invalidateInjectedStyleSheetCacheInAllFrames):
1222         * rendering/RenderBlock.cpp:
1223         (WebCore::RenderBlock::lineHeight):
1224         (WebCore::RenderBlock::getFirstLetter):
1225         * rendering/RenderElement.cpp:
1226         (WebCore::RenderElement::uncachedFirstLineStyle):
1227         (WebCore::RenderElement::cachedFirstLineStyle):
1228         * rendering/RenderElement.h:
1229         (WebCore::RenderElement::firstLineStyle):
1230         (WebCore::RenderElement::setAncestorLineBoxDirty):
1231         * rendering/RenderInline.cpp:
1232         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
1233         (WebCore::RenderInline::lineHeight):
1234         * rendering/RenderLineBreak.cpp:
1235         (WebCore::RenderLineBreak::lineHeight):
1236         * rendering/RootInlineBox.cpp:
1237         (WebCore::RootInlineBox::verticalPositionForBox):
1238         * style/StyleResolveTree.cpp:
1239         (WebCore::Style::resolveLocal):
1240
1241 2015-09-23  Chris Dumez  <cdumez@apple.com>
1242
1243         HTMLOutputElement.htmlFor should be settable
1244         https://bugs.webkit.org/show_bug.cgi?id=149418
1245
1246         Reviewed by Ryosuke Niwa.
1247
1248         HTMLOutputElement.htmlFor should be settable as per the latest HTML
1249         specification:
1250         - https://html.spec.whatwg.org/multipage/forms.html#the-output-element
1251
1252         It is supposed to call DOMSettableTokenList.setValue() with the input
1253         String. This patch adds support for this by adding [PutForwards=value]
1254         IDL extended attribute.
1255
1256         This aligns our behavior with the specification, Firefox and Chrome.
1257
1258         No new tests, already covered by existing test.
1259
1260         * html/AttributeDOMTokenList.cpp:
1261         (WebCore::AttributeDOMTokenList::AttributeDOMTokenList):
1262         (WebCore::AttributeDOMTokenList::attributeValueChanged):
1263         * html/AttributeDOMTokenList.h:
1264         - Have AttributeDOMTokenList subclass DOMSettableTokenList instead of
1265         DOMTokenList so that it can be used in places where the IDL expects
1266         us to return a DOMSettableTokenList (e.g. HTMLOutputElement.htmlFor).
1267         - Mark AttributeDOMTokenList as fast allocated.
1268
1269         * html/DOMSettableTokenList.cpp:
1270         (WebCore::DOMSettableTokenList::setValue):
1271         * html/DOMSettableTokenList.h:
1272         - Move setValue() from DOMTokenList to DOMSettableTokenList
1273           as it is only needed by DOMSettableTokenList.
1274         - Get rid of the factory function as all call sites are using
1275           AttributeDOMTokenList now.
1276         - Stop inheriting RefCounted as AttributeDOMTokenList handles its
1277           own refcounting.
1278
1279         * html/DOMTokenList.cpp:
1280         (WebCore::DOMTokenList::setValueInternal):
1281         * html/DOMTokenList.h:
1282         Rename setValue() to setValueInternal() as this version does not
1283         update the associated attribute value, only the tokens.
1284
1285         * html/HTMLLinkElement.cpp:
1286         * html/HTMLLinkElement.h:
1287         - Have HTMLLinkElement.sizes use an AttributeDOMTokenList instead of
1288           a DOMSettableTokenList as there is an associated attribute. The
1289           previous code had a bug has setting HTMLLinkElement.sizes would not
1290           update the associated 'sizes' attribute. Switching to using
1291           AttributeDOMTokenList fixes this and a new layout test has been added
1292           to cover this.
1293         - Create the AttributeDOMTokenList lazily to avoid updating it every
1294           time the sizes attribute changes until it is actually accessed.
1295
1296         * html/HTMLOutputElement.cpp:
1297         * html/HTMLOutputElement.h:
1298         - Have HTMLLinkElement.htmlFor use an AttributeDOMTokenList instead of
1299           a DOMSettableTokenList as there is an associated attribute.
1300         - Create the AttributeDOMTokenList lazily to avoid updating it every
1301           time the sizes attribute changes until it is actually accessed.
1302
1303         * html/HTMLOutputElement.idl:
1304         Add [PutForwards=value] on the htmlFor attribute, as per the
1305         HTML specification.
1306
1307 2015-09-23  ChangSeok Oh  <changseok.oh@collabora.com>
1308
1309         [GTK] playbutton in media controls is not changed when it is clicked.
1310         https://bugs.webkit.org/show_bug.cgi?id=149113
1311
1312         Reviewed by Philippe Normand.
1313
1314         When the play button in media controls is clicked, a 'paused' class is added or removed
1315         for the element to update its appearance. Although Document::recalcStyle is triggered
1316         by that class attribute change, the play button is not changed since there is
1317         no difference in styles whether having the 'paused' class or not. Gtk port
1318         does not define the -webkit-media-controls-play-button.paused. To fix this,
1319         -webkit-media-controls-play-button.paused is newly defined with a dummy style,
1320         "position: relative;", which should not change the play button appearance,
1321         but be clearly different in style.
1322
1323         Test: media/media-controls-play-button-updates.html
1324
1325         * css/mediaControlsGtk.css:
1326         (video::-webkit-media-controls-play-button.paused):
1327
1328 2015-09-23  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1329
1330         [Streams API] Implement ReadableStream pipeThrough
1331         https://bugs.webkit.org/show_bug.cgi?id=147556
1332
1333         Reviewed by Darin Adler.
1334
1335         Adding initial support for JS builtins within WebCore.
1336         This patch allows implementing IDL interface methods in JS, by using the new JSBuiltin keyword.
1337         (No support yet for private identifiers, constructors or accessors).
1338         Integration of the built-in executables and names is implemented within WebCoreJSClientData.
1339         Two files are generated for each JS builtin file:
1340         - builtin h/cpp files similar to JSCBuiltins.cpp/.h, generated through WebCore/generate-js-builtins from JavaScriptCore/generate-js-builtins)
1341         - A builtin wrapper file mimicking BuiltinExecutables (generated from WebCore/generate-js-builtins)
1342         Contrary to JSC, each js file is generating its own cpp/h file.
1343         This allows including those files within the JSXX.cpp/.h files generated from the IDL where compilation guard may take effect.
1344
1345         Disabled GObject binding for JSBuiltin methods.
1346
1347         Test: streams/readable-stream-pipeThrough.html
1348
1349         * CMakeLists.txt: Triggering generate-js-builtins for JS files.
1350         * DerivedSources.make: Ditto.
1351         * ForwardingHeaders/builtins/BuiltinUtils.h: Added.
1352         * ForwardingHeaders/bytecode/UnlinkedFunctionExecutable.h: Added.
1353         * ForwardingHeaders/runtime/ConstructAbility.h: Added.
1354         * Modules/streams/ReadableStream.idl: Marking pipeThrough as JS builtin
1355         * Modules/streams/ReadableStream.js: Added.
1356         (pipeThrough):
1357         * bindings/js/JSReadableStreamCustom.cpp:
1358         * bindings/js/WebCoreJSClientData.h: Adding ReadableStreamBuiltinsWrapper to store ReadableStream builtin executable
1359         (WebCore::WebCoreJSClientData::WebCoreJSClientData):
1360         (WebCore::WebCoreJSClientData::readableStreamBuiltins):
1361         (WebCore::initNormalWorldClientData):
1362         * bindings/scripts/CodeGeneratorGObject.pm: Disabled GObject binding for JSBuiltin methods.
1363         * bindings/scripts/CodeGeneratorJS.pm: Adding support for JSBuiltin keyword.
1364         (GetFunctionName):
1365         (GenerateHeader):
1366         (GenerateImplementation):
1367         (GenerateHashTableValueArray):
1368         (ComputeFunctionSpecial):
1369         (UseJSBuiltins):
1370         * bindings/scripts/IDLAttributes.txt: Adding JSBuiltin.
1371         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1372         (webkit_dom_test_obj_js_builtin_method):
1373         (webkit_dom_test_obj_js_builtin_method_with_args):
1374         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1375         * bindings/scripts/test/JS/JSTestObj.cpp:
1376         * bindings/scripts/test/JS/JSTestObj.h:
1377         * bindings/scripts/test/ObjC/DOMTestObj.h:
1378         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1379         (-[DOMTestObj jsBuiltinMethod]):
1380         (-[DOMTestObj jsBuiltinMethodWithArgs:strArg:objArg:]):
1381         * bindings/scripts/test/TestObj.idl:
1382         * generate-js-builtins: Added.
1383
1384 2015-09-22  Ryosuke Niwa  <rniwa@webkit.org>
1385
1386         Event fired on a detached node does not bubble up
1387         https://bugs.webkit.org/show_bug.cgi?id=149488
1388
1389         Reviewed by Antti Koivisto.
1390
1391         The bug was caused by an explicit check inside EventPath to match an old Firefox behavior (see r19897).
1392         Since Firefox's behavior has changed to match DOM4: https://dom.spec.whatwg.org/#concept-event-dispatch
1393
1394         Fixed the bug by removing the check. The new behavior matches DO4 and behaviors of Firefox and Chrome.
1395
1396         Test: fast/events/event-propagation-in-detached-tree.html
1397
1398         * dom/EventDispatcher.cpp:
1399         (WebCore::EventPath::EventPath):
1400
1401 2015-09-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1402
1403         Add a file of pointer-lock to cmake ports
1404         https://bugs.webkit.org/show_bug.cgi?id=149453
1405
1406         Reviewed by Csaba Osztrogonác.
1407
1408         Some cmake ports will be able to enable POINTER_LOCK. To support it,
1409         this patch adds PointerLockController.cpp, and fix a build break in WK2.
1410
1411         * CMakeLists.txt:
1412
1413 2015-09-22  Chris Dumez  <cdumez@apple.com>
1414
1415         Drop unnecessary ancestor traversal in Range::selectNode()
1416         https://bugs.webkit.org/show_bug.cgi?id=149482
1417
1418         Reviewed by Ryosuke Niwa.
1419
1420         Drop unnecessary ancestor traversal in Range::selectNode(). It traversed
1421         the ancestors to throw a INVALID_NODE_TYPE_ERR if one of them was a
1422         DocumentType Node. However, it is impossible for a DocumentType Node to
1423         have children.
1424
1425         * dom/Range.cpp:
1426         (WebCore::Range::selectNode):
1427
1428 2015-09-22  Brian Weinstein  <bweinstein@apple.com>
1429
1430         Error message in ContentExtensionError.cpp shouldn't have two spaces between sentences.
1431         https://bugs.webkit.org/show_bug.cgi?id=149479
1432
1433         Reviewed by Andy Estes.
1434
1435         * contentextensions/ContentExtensionError.cpp:
1436         (WebCore::ContentExtensions::contentExtensionErrorCategory):
1437
1438 2015-09-22  Chris Dumez  <cdumez@apple.com>
1439
1440         Range.surroundContents() should check for partially contained non-Text nodes first
1441         https://bugs.webkit.org/show_bug.cgi?id=149476
1442
1443         Reviewed by Darin Adler.
1444
1445         Range.surroundContents() should check for partially contained non-Text
1446         nodes first, before checking the type of the newParent parameter:
1447         - https://dom.spec.whatwg.org/#dom-range-surroundcontents (step 1 and 2)
1448
1449         Firefox and Chrome follow the specification.
1450
1451         No new tests, already covered by existing test.
1452
1453         * dom/Range.cpp:
1454         (WebCore::Range::surroundContents):
1455
1456 2015-09-22  Commit Queue  <commit-queue@webkit.org>
1457
1458         Unreviewed, rolling out r190134.
1459         https://bugs.webkit.org/show_bug.cgi?id=149481
1460
1461         "Seems to cause crashes during garbage collection" (Requested
1462         by cdumez on #webkit).
1463
1464         Reverted changeset:
1465
1466         "HTMLOutputElement.htmlFor should be settable"
1467         https://bugs.webkit.org/show_bug.cgi?id=149418
1468         http://trac.webkit.org/changeset/190134
1469
1470 2015-09-22  Chris Dumez  <cdumez@apple.com>
1471
1472         Range.intersectsNode() does not behave according to the specification when start / end are equal
1473         https://bugs.webkit.org/show_bug.cgi?id=148774
1474         <rdar://problem/22571418>
1475
1476         Reviewed by Darin Adler.
1477
1478         Range.intersectsNode() does not behave according to the specification
1479         when start / end are equal:
1480         https://dom.spec.whatwg.org/#dom-range-intersectsnode
1481
1482         The specification says:
1483         "If (parent, offset) is before end and (parent, offset + 1) is after
1484         start, return true."
1485
1486         However, the way we were detecting "is before end" and "is after start"
1487         was flawed in the case where start / end were equal. This is because when
1488         comparePoint() return 0, then it means that the node/offset is not only
1489         equal to start but also equal to end. As such, it is not "after start"
1490         / "before end".
1491
1492         No new tests, already covered by existing.
1493
1494         * dom/Range.cpp:
1495         (WebCore::Range::intersectsNode):
1496         (WebCore::highestAncestorUnderCommonRoot): Deleted.
1497
1498 2015-09-22  Chris Dumez  <cdumez@apple.com>
1499
1500         HTMLOutputElement.htmlFor should be settable
1501         https://bugs.webkit.org/show_bug.cgi?id=149418
1502
1503         Reviewed by Darin Adler.
1504
1505         HTMLOutputElement.htmlFor should be settable as per the latest HTML
1506         specification:
1507         - https://html.spec.whatwg.org/multipage/forms.html#the-output-element
1508
1509         It is supposed to call DOMSettableTokenList.setValue() with the input
1510         String. This patch adds support for this by adding [PutForwards=value]
1511         IDL extended attribute.
1512
1513         This aligns our behavior with the specification, Firefox and Chrome.
1514
1515         No new tests, already covered by existing test.
1516
1517         * accessibility/AccessibilityObject.cpp:
1518         (WebCore::AccessibilityObject::classList):
1519         * dom/Element.cpp:
1520         (WebCore::Element::classList):
1521         * dom/ElementRareData.h:
1522         (WebCore::ElementRareData::setClassList):
1523         * html/AttributeDOMTokenList.h:
1524         * html/DOMSettableTokenList.h:
1525         * html/HTMLAnchorElement.cpp:
1526         (WebCore::HTMLAnchorElement::relList):
1527         * html/HTMLAnchorElement.h:
1528         * html/HTMLLinkElement.cpp:
1529         (WebCore::HTMLLinkElement::relList):
1530         * html/HTMLLinkElement.h:
1531         * html/HTMLOutputElement.cpp:
1532         (WebCore::HTMLOutputElement::HTMLOutputElement):
1533         (WebCore::HTMLOutputElement::parseAttribute):
1534         (WebCore::HTMLOutputElement::childrenChanged): Deleted.
1535         * html/HTMLOutputElement.h:
1536         * html/HTMLOutputElement.idl:
1537
1538 2015-09-22  Filip Pizlo  <fpizlo@apple.com>
1539
1540         Get rid of ENABLE(GGC)
1541         https://bugs.webkit.org/show_bug.cgi?id=149472
1542
1543         Reviewed by Mark Hahnenberg and Mark Lam.
1544
1545         No new tests because no new behavior.
1546
1547         * bindings/js/JSDOMWindowBase.cpp:
1548         (WebCore::JSDOMWindowBase::commonVM):
1549
1550 2015-09-22  Tim Horton  <timothy_horton@apple.com>
1551
1552         Make it more obvious when using an unaccelerated image buffer, and fix a few callers who do
1553         https://bugs.webkit.org/show_bug.cgi?id=149428
1554
1555         Reviewed by Simon Fraser and Darin Adler.
1556
1557         * platform/graphics/ImageBuffer.cpp:
1558         (WebCore::ImageBuffer::createCompatibleBuffer):
1559         * platform/graphics/ImageBuffer.h:
1560         (WebCore::ImageBuffer::create):
1561         Make the RenderingMode parameter to ImageBuffer::create non-optional.
1562
1563         * platform/graphics/GraphicsContext.h:
1564         (WebCore::GraphicsContext::renderingMode):
1565         * platform/graphics/GraphicsTypes.h:
1566         Add renderingMode() getter so that every caller doesn't need to do the conversion to RenderingMode.
1567
1568         * css/CSSFilterImageValue.cpp:
1569         (WebCore::CSSFilterImageValue::image):
1570         * html/canvas/WebGLRenderingContextBase.cpp:
1571         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
1572         * rendering/shapes/Shape.cpp:
1573         (WebCore::Shape::createRasterShape):
1574         * html/shadow/MediaControlElements.cpp:
1575         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
1576         * platform/graphics/cg/ImageBufferCG.cpp:
1577         (WebCore::ImageBuffer::putByteArray):
1578         These five callers create unconditionally unaccelerated ImageBuffers which
1579         should probably instead respect the acceleration bit from the context
1580         that the ImageBuffer will eventually be painted into. Bugs have been filed.
1581
1582         * html/HTMLCanvasElement.cpp:
1583         (WebCore::HTMLCanvasElement::createImageBuffer):
1584         * html/canvas/CanvasRenderingContext2D.cpp:
1585         (WebCore::CanvasRenderingContext2D::createCompositingBuffer):
1586         * platform/graphics/CrossfadeGeneratedImage.cpp:
1587         (WebCore::CrossfadeGeneratedImage::drawPattern):
1588         Adjust the argument order and remove defaults which are passed explicitly.
1589
1590         * page/FrameSnapshotting.cpp:
1591         (WebCore::snapshotFrameRect):
1592         Snapshots are (currently) meant to be taken without accelerated drawing.
1593         Make this explicit.
1594
1595         * platform/graphics/BitmapImage.cpp:
1596         (WebCore::BitmapImage::drawPattern):
1597         Make use of createCompatibleBuffer. This caller was previously creating
1598         an unconditionally unaccelerated context!
1599
1600         * platform/graphics/NamedImageGeneratedImage.cpp:
1601         (WebCore::NamedImageGeneratedImage::drawPattern):
1602         Remove a comment.
1603
1604         * platform/graphics/ShadowBlur.cpp:
1605         (WebCore::ScratchBuffer::getScratchBuffer):
1606         ShadowBlur is only used with unaccelerated contexts, so it's OK to hardcode Unaccelerated here.
1607
1608         * platform/graphics/filters/FilterEffect.cpp:
1609         (WebCore::FilterEffect::asImageBuffer):
1610         (WebCore::FilterEffect::createImageBufferResult):
1611         Flip the order of the arguments.
1612
1613         (WebCore::FilterEffect::openCLImageToImageBuffer):
1614         This caller was previously creating an unaccelerated buffer; instead, match the destination buffer.
1615
1616         * rendering/FilterEffectRenderer.cpp:
1617         (WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded):
1618         Adjust the argument order and remove defaults which are passed explicitly.
1619
1620         * rendering/RenderLayer.cpp:
1621         (WebCore::RenderLayer::calculateClipRects):
1622         Get rid of the unneeded renderingMode local, and factor out retrieval of Frame.
1623
1624         * rendering/svg/RenderSVGResourceClipper.cpp:
1625         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
1626         * rendering/svg/RenderSVGResourceMasker.cpp:
1627         (WebCore::RenderSVGResourceMasker::applyResource):
1628         These two callers are unconditionally creating unaccelerated buffers,
1629         and changing this to match the destination context seems to actually
1630         break things. This needs further investigation.
1631
1632         * rendering/svg/RenderSVGResourceGradient.cpp:
1633         (WebCore::createMaskAndSwapContextForTextGradient):
1634         This caller was previously creating an unaccelerated buffer; instead, match the destination buffer.
1635
1636         * rendering/svg/RenderSVGResourcePattern.cpp:
1637         (WebCore::RenderSVGResourcePattern::buildPattern):
1638         Make use of renderingMode().
1639
1640         * rendering/svg/SVGRenderingContext.cpp:
1641         (WebCore::SVGRenderingContext::createImageBuffer):
1642         Adjust the argument order.
1643
1644         * svg/graphics/SVGImage.cpp:
1645         (WebCore::SVGImage::nativeImageForCurrentFrame):
1646
1647 2015-09-22  Chris Dumez  <cdumez@apple.com>
1648
1649         XMLHttpRequest properties should be on the prototype
1650         https://bugs.webkit.org/show_bug.cgi?id=149465
1651
1652         Reviewed by Darin Adler.
1653
1654         Move most XMLHttpRequest properties to the prototype, as per the Web IDL
1655         specification. This should be web-compatible now that properties on the
1656         prototype are configurable after r190104.
1657
1658         The 'response' / 'responseText' properties are still incorrectly on the
1659         instance because they are currently using a [CustomGetter] in our IDL
1660         and the bindings generator currently does not move such properties to
1661         the prototype.
1662
1663         Test:
1664         fast/xmlhttprequest/xmlhttprequest-properties-prototype.html
1665         js/dom/xhr-prototype-define-property.html
1666
1667         * bindings/scripts/CodeGeneratorJS.pm:
1668         (InterfaceRequiresAttributesOnInstanceForCompatibility): Deleted.
1669
1670 2015-09-22  Chris Dumez  <cdumez@apple.com>
1671
1672         Drop support for legacy EntityReference DOM Node type
1673         https://bugs.webkit.org/show_bug.cgi?id=149348
1674
1675         Reviewed by Darin Adler.
1676
1677         Drop support for legacy EntityReference DOM Node type.
1678
1679         EntityReference has been dropped from the DOM specification:
1680         - https://dom.spec.whatwg.org/#dom-core-changes
1681
1682         EntityReference is not supported in Firefox:
1683         - https://developer.mozilla.org/en-US/docs/Web/API/EntityReference
1684         - https://developer.mozilla.org/en-US/docs/Web/API/NodeIterator.expandEntityReferences
1685         - https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker.expandEntityReferences
1686
1687         Chrome dropped support for EntityReference a while back (May 2013):
1688         - EntityReference: https://code.google.com/p/chromium/issues/detail?id=226628
1689         - NodeFilter / TreeWalker.expandEntityReferences:
1690           - https://groups.google.com/a/chromium.org/d/msg/blink-dev/-ZO3eja4maA/86T13XJwQpUJ
1691           - https://src.chromium.org/viewvc/blink?view=rev&revision=185771
1692
1693         IE also dropped support for EntityReference Nodes:
1694         https://msdn.microsoft.com/library/ff974819(v=vs.85).aspx (Remarks section)
1695
1696         No new tests, already covered by existing test.
1697
1698         * DerivedSources.cpp:
1699         * WebCore.vcxproj/WebCore.vcxproj:
1700         * WebCore.vcxproj/WebCore.vcxproj.filters:
1701         * WebCore.xcodeproj/project.pbxproj:
1702         * bindings/gobject/WebKitDOMPrivate.cpp:
1703         (WebKit::wrap): Deleted.
1704         * bindings/js/JSNodeCustom.cpp:
1705         (WebCore::createWrapperInline): Deleted.
1706         * bindings/objc/DOM.mm:
1707         (kitClass): Deleted.
1708         * bindings/scripts/CodeGeneratorGObject.pm:
1709         (SkipFunction): Skip webkit_dom_document_create_entity_reference until Carlos fixes it.
1710         * dom/Attr.cpp:
1711         (WebCore::Attr::childTypeAllowed):
1712         (WebCore::Attr::childrenChanged): Deleted.
1713         * dom/Attr.h:
1714         * dom/ContainerNode.cpp:
1715         (WebCore::checkAcceptChild): Deleted.
1716         (WebCore::checkAcceptChildGuaranteedNodeTypes): Deleted.
1717         (WebCore::ContainerNode::removeChild): Deleted.
1718         * dom/Document.cpp:
1719         (WebCore::Document::createEntityReference):
1720         (WebCore::Document::createNodeIterator):
1721         (WebCore::Document::createTreeWalker):
1722         (WebCore::Document::createEditingTextNode): Deleted.
1723         (WebCore::Document::importNode): Deleted.
1724         (WebCore::Document::adoptNode): Deleted.
1725         (WebCore::Document::scheduleForcedStyleRecalc): Deleted.
1726         (WebCore::Document::scheduleStyleRecalc): Deleted.
1727         (WebCore::Document::childTypeAllowed): Deleted.
1728         (WebCore::Document::canAcceptChild): Deleted.
1729         * dom/Document.h:
1730         * dom/Document.idl:
1731         * dom/DocumentFragment.cpp:
1732         (WebCore::DocumentFragment::childTypeAllowed): Deleted.
1733         * dom/Element.cpp:
1734         (WebCore::Element::childTypeAllowed): Deleted.
1735         * dom/EntityReference.cpp:
1736         (WebCore::EntityReference::EntityReference):
1737         * dom/EntityReference.h:
1738         * dom/EntityReference.idl:
1739         * dom/Node.cpp:
1740         (WebCore::Node::setNodeValue):
1741         (WebCore::Node::dumpStatistics): Deleted.
1742         (WebCore::Node::childNodes): Deleted.
1743         (WebCore::Node::lastDescendant): Deleted.
1744         (WebCore::Node::isDescendantOf): Deleted.
1745         (WebCore::Node::textContent): Deleted.
1746         (WebCore::Node::ancestorElement): Deleted.
1747         (WebCore::hashPointer): Deleted.
1748         * dom/Node.h:
1749         (WebCore::Node::isDocumentTypeNode): Deleted.
1750         * dom/NodeIterator.cpp:
1751         (WebCore::NodeIterator::NodeIterator):
1752         * dom/NodeIterator.h:
1753         (WebCore::NodeIterator::create):
1754         * dom/NodeIterator.idl:
1755         * dom/Range.cpp:
1756         (WebCore::Range::checkDeleteExtract):
1757         (WebCore::lengthOfContentsInNode): Deleted.
1758         (WebCore::Range::processContentsBetweenOffsets): Deleted.
1759         (WebCore::Range::insertNode): Deleted.
1760         (WebCore::Range::checkNodeWOffset): Deleted.
1761         (WebCore::Range::checkNodeBA): Deleted.
1762         (WebCore::Range::cloneRange): Deleted.
1763         (WebCore::Range::selectNode): Deleted.
1764         (WebCore::Range::selectNodeContents): Deleted.
1765         (WebCore::Range::surroundContents): Deleted.
1766         (WebCore::Range::shadowRoot): Deleted.
1767         (WebCore::Range::pastLastNode): Deleted.
1768         (WebCore::Range::absoluteBoundingBox): Deleted.
1769         (WebCore::Range::absoluteTextRects): Deleted.
1770         * dom/Range.h:
1771         * dom/ShadowRoot.cpp:
1772         (WebCore::ShadowRoot::childTypeAllowed): Deleted.
1773         * dom/Traversal.cpp:
1774         (WebCore::NodeIteratorBase::NodeIteratorBase):
1775         (WebCore::NodeIteratorBase::acceptNode): Deleted.
1776         * dom/Traversal.h:
1777         (WebCore::NodeIteratorBase::expandEntityReferences):
1778         * dom/TreeWalker.cpp:
1779         (WebCore::TreeWalker::TreeWalker):
1780         * dom/TreeWalker.h:
1781         (WebCore::TreeWalker::create):
1782         * dom/TreeWalker.idl:
1783         * editing/MarkupAccumulator.cpp:
1784         (WebCore::MarkupAccumulator::appendStartMarkup): Deleted.
1785         * xml/XPathUtil.cpp:
1786         (WebCore::XPath::isValidContextNode): Deleted.
1787
1788 2015-09-22  Eric Carlson  <eric.carlson@apple.com>
1789
1790         Unreviewed 32-bit Yosemite build fix.
1791
1792         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1793         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
1794
1795 2015-09-22  Eric Carlson  <eric.carlson@apple.com>
1796
1797         [MediaStream Mac] implement WebAudioSourceProvider
1798         https://bugs.webkit.org/show_bug.cgi?id=149419
1799
1800         Reviewed by Darin Adler.
1801
1802         * Modules/mediastream/MediaStreamTrack.cpp:
1803         (WebCore::MediaStreamTrack::audioSourceProvider): New.
1804         * Modules/mediastream/MediaStreamTrack.h:
1805
1806         * Modules/webaudio/AudioContext.cpp:
1807         (WebCore::AudioContext::createMediaStreamSource): Rewrite.
1808
1809         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
1810         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode): We know the Vector
1811           size, so reserve capacity.
1812
1813         * Modules/webaudio/MediaStreamAudioSource.cpp:
1814         (WebCore::MediaStreamAudioSource::audioSourceProvider): Add.
1815         * Modules/webaudio/MediaStreamAudioSource.h:
1816         (WebCore::MediaStreamAudioSource::~MediaStreamAudioSource):
1817         (WebCore::MediaStreamAudioSource::deviceId):
1818         (WebCore::MediaStreamAudioSource::setDeviceId):
1819         (WebCore::MediaStreamAudioSource::useIDForTrackID): Deleted.
1820
1821         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
1822         (WebCore::MediaStreamAudioSourceNode::create): Context and track can't be null so take references.
1823         (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode): Ditto.
1824         (WebCore::MediaStreamAudioSourceNode::~MediaStreamAudioSourceNode): Clear provider client.
1825         (WebCore::MediaStreamAudioSourceNode::setFormat): Create a resampler when necessary.
1826         (WebCore::MediaStreamAudioSourceNode::process): Process.
1827         (WebCore::MediaStreamAudioSourceNode::reset): Deleted.
1828         * Modules/webaudio/MediaStreamAudioSourceNode.h:
1829         (WebCore::MediaStreamAudioSourceNode::mediaStream):
1830         (WebCore::MediaStreamAudioSourceNode::audioSourceProvider): Deleted.
1831
1832         * WebCore.xcodeproj/project.pbxproj: Add WebAudioSourceProviderAVFObjC.cpp/h.
1833
1834         * platform/mediastream/MediaStreamTrackPrivate.cpp:
1835         (WebCore::MediaStreamTrackPrivate::audioSourceProvider): New, passthrough to source.
1836         * platform/mediastream/MediaStreamTrackPrivate.h:
1837         * platform/mediastream/RealtimeMediaSource.h:
1838         (WebCore::RealtimeMediaSource::audioSourceProvider):
1839
1840         * platform/mediastream/mac/AVAudioCaptureSource.h:
1841         * platform/mediastream/mac/AVAudioCaptureSource.mm:
1842         (WebCore::AVAudioCaptureSource::audioSourceProvider): New.
1843         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1844         * platform/mediastream/mac/AVMediaCaptureSource.h:
1845         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1846         (WebCore::AVMediaCaptureSource::audioSourceProvider): Assert, this shouldn't be reachable.
1847
1848         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h: Added.
1849         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm: Added.
1850         (WebCore::WebAudioSourceProviderAVFObjC::create):
1851         (WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC):
1852         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
1853         (WebCore::WebAudioSourceProviderAVFObjC::startProducingData):
1854         (WebCore::WebAudioSourceProviderAVFObjC::stopProducingData):
1855         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
1856         (WebCore::WebAudioSourceProviderAVFObjC::setClient):
1857         (WebCore::operator==):
1858         (WebCore::operator!=):
1859         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
1860         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
1861         (WebCore::WebAudioSourceProviderAVFObjC::process):
1862
1863 2015-09-22  sangdeug.kim  <sangdeug.kim@samsung.com>
1864
1865         CurrentTime on mediaController is set as 0 when playback is completed.
1866         https://bugs.webkit.org/show_bug.cgi?id=149154
1867
1868         Reviewed by Eric Carlson.
1869
1870         Test : media/media-controller-time-clamp.html
1871
1872         * html/MediaController.cpp:
1873         (MediaController::setCurrentTime):
1874         (MediaController::updatePlaybackState):
1875         * html/MediaController.h:
1876
1877 2015-09-22  Commit Queue  <commit-queue@webkit.org>
1878
1879         Unreviewed, rolling out r189616.
1880         https://bugs.webkit.org/show_bug.cgi?id=149456
1881
1882         suspected cause of multiple regressions (Requested by kling on
1883         #webkit).
1884
1885         Reverted changeset:
1886
1887         "[JSC] Weak should only accept cell pointees."
1888         https://bugs.webkit.org/show_bug.cgi?id=148955
1889         http://trac.webkit.org/changeset/189616
1890
1891 2015-09-22  Csaba Osztrogonác  <ossy@webkit.org>
1892
1893         Fix the all-in-one build with GCC
1894         https://bugs.webkit.org/show_bug.cgi?id=148428
1895
1896         Reviewed by Darin Adler.
1897
1898         Removed Source/WebCore/inspector/InspectorIndexedDBAgent.cpp from the all-in-one build.
1899
1900         * WebCore.vcxproj/WebCore.vcxproj:
1901         * inspector/InspectorAllInOne.cpp:
1902
1903 2015-09-22  Csaba Osztrogonác  <ossy@webkit.org>
1904
1905         Fix warnings in IDLParser.pm
1906         https://bugs.webkit.org/show_bug.cgi?id=149406
1907
1908         Reviewed by Alex Christensen.
1909
1910         * bindings/scripts/IDLParser.pm:
1911         (typeHasNullableSuffix):
1912         (typeRemoveNullableSuffix):
1913
1914 2015-09-22  Ryosuke Niwa  <rniwa@webkit.org>
1915
1916         invalidateSlotAssignments should trigger style recalc
1917         https://bugs.webkit.org/show_bug.cgi?id=149447
1918
1919         Reviewed by Antti Koivisto.
1920
1921         Invalidate the render tree of a shadow host when a new child is inserted, an existing child is removed,
1922         or slot attribute of a child is modified.
1923
1924         No new tests. Covered by existing tests added in r190101.
1925
1926         * dom/Element.cpp:
1927         (WebCore::Element::childrenChanged): Call invalidateSlotAssignments or invalidateDefaultSlotAssignments
1928         depending on the types of children being inserted or removed since text nodes can only be assigned into
1929         a default slot.
1930         * dom/ShadowRoot.cpp:
1931         (WebCore::ShadowRoot::invalidateSlotAssignments):
1932         (WebCore::ShadowRoot::invalidateDefaultSlotAssignments): Added.
1933         * dom/ShadowRoot.h:
1934         * dom/SlotAssignment.cpp:
1935         (WebCore::SlotAssignment::invalidate): Reconstruct the render tree for the whole host. We can optimize
1936         in the future by only invalidating active slot elements instead.
1937         (WebCore::SlotAssignment::invalidateDefaultSlot): Added.
1938         * dom/SlotAssignment.h:
1939
1940 2015-09-21  Chris Dumez  <cdumez@apple.com>
1941
1942         time element should use HTMLTimeElement interface
1943         https://bugs.webkit.org/show_bug.cgi?id=148840
1944         <rdar://problem/22586690>
1945
1946         Reviewed by Ryosuke Niwa.
1947
1948         Time element should be an instance of HTMLTimeElement instead of generic
1949         HTMLElement:
1950         https://html.spec.whatwg.org/multipage/semantics.html#the-time-element
1951
1952         Firefox exposes HTMLTimeElement. This patch aligns our behavior with
1953         the specification and Firefox.
1954
1955         No new tests, already covered by existing test.
1956
1957         * CMakeLists.txt:
1958         * DerivedSources.cpp:
1959         * DerivedSources.make:
1960         * WebCore.vcxproj/WebCore.vcxproj:
1961         * WebCore.vcxproj/WebCore.vcxproj.filters:
1962         * WebCore.xcodeproj/project.pbxproj:
1963         * html/HTMLElementsAllInOne.cpp:
1964         * html/HTMLTagNames.in:
1965         * html/HTMLTimeElement.cpp: Added.
1966         (WebCore::HTMLTimeElement::create):
1967         (WebCore::HTMLTimeElement::HTMLTimeElement):
1968         * html/HTMLTimeElement.h: Added.
1969         * html/HTMLTimeElement.idl: Added.
1970
1971 2015-09-21  Chris Dumez  <cdumez@apple.com>
1972
1973         DOM attributes on prototypes should be configurable
1974         https://bugs.webkit.org/show_bug.cgi?id=134364
1975
1976         Reviewed by Sam Weinig.
1977
1978         DOM attributes on prototypes should be configurable as per the Web IDL
1979         specification:
1980         https://heycam.github.io/webidl/#es-attributes
1981
1982         This patch aligns our behavior with the specification and Firefox.
1983
1984         Test: fast/dom/attributes-configurable.html
1985
1986         * bindings/scripts/CodeGeneratorJS.pm:
1987         (GenerateAttributesHashTable):
1988
1989 2015-09-21  Filip Pizlo  <fpizlo@apple.com>
1990
1991         Always use the compiler's CAS implementation and get rid of ENABLE(COMPARE_AND_SWAP)
1992         https://bugs.webkit.org/show_bug.cgi?id=149438
1993
1994         Reviewed by Mark Lam.
1995
1996         No new tests because no new behavior.
1997
1998         * platform/text/TextBreakIterator.cpp:
1999         (WebCore::compareAndSwapNonSharedCharacterBreakIterator):
2000         (WebCore::NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator):
2001
2002 2015-09-21  Timothy Horton  <timothy_horton@apple.com>
2003
2004         Allow DataDetectors to pre-filter telephone number menu items
2005         https://bugs.webkit.org/show_bug.cgi?id=149444
2006         <rdar://problem/19286320>
2007
2008         Reviewed by Sam Weinig.
2009
2010         * platform/spi/mac/DataDetectorsSPI.h:
2011         Add some SPI.
2012
2013 2015-09-21  Chris Dumez  <cdumez@apple.com>
2014
2015         Update HTMLTableRowElement.rowIndex to behave according to the specification
2016         https://bugs.webkit.org/show_bug.cgi?id=148842
2017         <rdar://problem/22586914>
2018
2019         Reviewed by Darin Adler.
2020
2021         Update HTMLTableRowElement.rowIndex to behave according to the
2022         specification:
2023         https://html.spec.whatwg.org/multipage/tables.html#dom-tr-rowindex
2024
2025         In particular, rowIndex no longer returns -1 for <tr> elements that are
2026         direct children of the table Element. Also,<tr> Elements in all <thead> /
2027         <tfoot> children of the table Element now get a rowIndex, as per the
2028         specification:
2029         - https://html.spec.whatwg.org/multipage/tables.html#dom-table-rows
2030
2031         Previously, only <tr> elements in the first <thead> and the first <tbody>
2032         children of the table would get a rowIndex.
2033
2034         Also, we now abort early and return -1 if the row is a grand-child of a
2035         table element but its direct parent is not a <thead> / <tbody> / <tfoot>.
2036         This avoid unnecessary traversal and matches the specification.
2037
2038         The code is refactored a bit to leverage HTMLTableElement.rows(), as
2039         per the specification:
2040         "return the index of the tr element in that table element's rows collection"
2041
2042         Previously, we would duplicate the table traversal logic. This
2043         simplifies the code and fixes a bug as the traversal logic was slightly
2044         different here and in HTMLTableRowsCollection. Because of this, only
2045         <tr> elements in the first <thead> / <tfoot> would get a rowIndex.
2046         Performance should be similar.
2047
2048         No new tests, already covered by existing test.
2049
2050         * html/HTMLTableRowElement.cpp:
2051         (WebCore::HTMLTableRowElement::rowIndex):
2052         (WebCore::HTMLTableRowElement::sectionRowIndex): Deleted.
2053         (WebCore::HTMLTableRowElement::insertCell): Deleted.
2054
2055 2015-09-21  Ryosuke Niwa  <rniwa@webkit.org>
2056
2057         Fix release builds with security assertion after r190007.
2058
2059         * dom/DocumentOrderedMap.cpp:
2060         * dom/DocumentOrderedMap.h:
2061
2062 2015-09-21  Gwang Yoon Hwang  <yoon@igalia.com>
2063
2064         [Threaded Compositor] Modified to use reference of GraphicsContext instead of pointer
2065         https://bugs.webkit.org/show_bug.cgi?id=149399
2066
2067         Reviewed by Darin Adler.
2068
2069         This fixes build failure after r189144
2070
2071         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2072         (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaint):
2073         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2074         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
2075         * platform/graphics/texmap/coordinated/CoordinatedSurface.h:
2076         * platform/graphics/texmap/coordinated/Tile.cpp:
2077         (WebCore::Tile::paintToSurfaceContext):
2078         * platform/graphics/texmap/coordinated/Tile.h:
2079         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
2080         * platform/graphics/texmap/coordinated/UpdateAtlas.cpp:
2081
2082 2015-09-21  Ryosuke Niwa  <rniwa@webkit.org>
2083
2084         The binding for getDistributedNodes unnecessarily makes a vector of nodes
2085         https://bugs.webkit.org/show_bug.cgi?id=149434
2086
2087         Reviewed by Darin Adler.
2088
2089         Added a jsArray for const Vector<T*>* so that we can generate the binding code for getDistributedNodes()
2090         without having to create Vector<RefPtr<Node>> out of Vector<Node*>*.
2091
2092         * bindings/js/JSDOMBinding.h:
2093         (WebCore::jsArray): Added.
2094         * html/HTMLSlotElement.cpp:
2095         (WebCore::HTMLSlotElement::assignedNodes):
2096         (WebCore::HTMLSlotElement::getDistributedNodes): Deleted.
2097         * html/HTMLSlotElement.h:
2098         * html/HTMLSlotElement.idl:
2099
2100 2015-09-21  Brent Fulgham  <bfulgham@apple.com>
2101
2102         [Win] Show tiled drawing debug overlay on Windows
2103         https://bugs.webkit.org/show_bug.cgi?id=149426
2104
2105         Reviewed by Dean Jackson.
2106
2107         No new tests: No change in behavior.
2108
2109         * platform/graphics/ca/PlatformCALayer.cpp:
2110         (WebCore::PlatformCALayer::drawRepaintIndicator): Revise signature to accept
2111         a scale value and a font size.
2112         (WebCore::PlatformCALayer::drawTextAtPoint): Revise signature for new arguments.
2113         * platform/graphics/ca/PlatformCALayer.h:
2114         * platform/graphics/ca/TileGrid.cpp:
2115         (WebCore::TileGrid::drawTileMapContents): Removing scaling and text drawing code,
2116         and call common CALayer drawing routine.
2117         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2118         (WebCore::CACFLayerTreeHost::create): Switch to nullptr.
2119         (WebCore::CACFLayerTreeHost::CACFLayerTreeHost): Switch to C++14 initializers.
2120         (WebCore::CACFLayerTreeHost::setPage): Added.
2121         (WebCore::CACFLayerTreeHost::rootLayer): Update debug info layer if requested by settings.
2122         (WebCore::CACFLayerTreeHost::layerTreeDidChange): Ditto.
2123         (WebCore::CACFLayerTreeHost::mainFrameTiledBacking): Added.
2124         (WebCore::CACFLayerTreeHost::updateDbugInfoLayer): Added.
2125         * platform/graphics/ca/win/CACFLayerTreeHost.h:
2126         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2127         (WebCore::PlatformCALayerWin::drawTextAtPoint): Revised signature for new arguments. Use
2128         argument for font size (rather than hard-coded '18'). Adjust font size by passed scale value.
2129         * platform/graphics/ca/win/PlatformCALayerWin.h:
2130
2131 2015-09-21  Chris Dumez  <cdumez@apple.com>
2132
2133         [JS Bindings] prototype.constructor should be writable
2134         https://bugs.webkit.org/show_bug.cgi?id=149412
2135         <rdar://problem/22545096>
2136
2137         Reviewed by Geoffrey Garen.
2138
2139         prototype.constructor should have the following properties:
2140         { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }
2141
2142         as per the Web IDL specification:
2143         https://heycam.github.io/webidl/#interface-prototype-object
2144
2145         In WebKit, it is currently not writable. It is writable in Firefox.
2146
2147         Test: fast/events/event-prototype-constructor-properties.html
2148
2149         * bindings/scripts/CodeGeneratorJS.pm:
2150         (GenerateAttributesHashTable):
2151         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2152         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2153         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2154         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2155         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2156         * bindings/scripts/test/JS/JSTestException.cpp:
2157         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2158         * bindings/scripts/test/JS/JSTestInterface.cpp:
2159         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2160         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2161         * bindings/scripts/test/JS/JSTestNode.cpp:
2162         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2163         * bindings/scripts/test/JS/JSTestObj.cpp:
2164         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2165         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2166         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2167         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2168         * bindings/scripts/test/JS/JSattribute.cpp:
2169         * bindings/scripts/test/JS/JSreadonly.cpp:
2170
2171 2015-09-21  Antti Koivisto  <antti@apple.com>
2172
2173         HTMLSlotElement should render its assigned nodes
2174         https://bugs.webkit.org/show_bug.cgi?id=149242
2175
2176         Reviewed by Ryosuke Niwa.
2177
2178         Support rendering the assigned nodes under HTMLSlotElement.
2179
2180         * dom/SlotAssignment.cpp:
2181         (WebCore::SlotAssignment::assignSlots):
2182
2183             Move the empty slot finding to the loop as the hash table may mutate.
2184
2185         * html/HTMLSlotElement.cpp:
2186         (WebCore::HTMLSlotElement::attributeChanged):
2187         (WebCore::HTMLSlotElement::assignedNodes):
2188         (WebCore::HTMLSlotElement::getDistributedNodes):
2189         * html/HTMLSlotElement.h:
2190         * style/StyleResolveTree.cpp:
2191         (WebCore::Style::attachBeforeOrAfterPseudoElementIfNeeded):
2192         (WebCore::Style::attachSlot):
2193         (WebCore::Style::attachRenderTree):
2194         (WebCore::Style::detachChildren):
2195         (WebCore::Style::detachShadowRoot):
2196         (WebCore::Style::detachSlot):
2197         (WebCore::Style::detachRenderTree):
2198         (WebCore::Style::resolveChildren):
2199         (WebCore::Style::resolveSlot):
2200         (WebCore::Style::resolveTree):
2201
2202 2015-09-21  Tim Horton  <timothy_horton@apple.com>
2203
2204         svg/custom/hidpi-masking-clipping.svg fails with accelerated drawing on
2205         https://bugs.webkit.org/show_bug.cgi?id=149413
2206         <rdar://problem/22787058>
2207
2208         Reviewed by Dean Jackson.
2209
2210         No new tests, this is covered by existing tests.
2211
2212         * rendering/svg/RenderSVGResourcePattern.cpp:
2213         (WebCore::RenderSVGResourcePattern::buildPattern):
2214         (WebCore::RenderSVGResourcePattern::applyResource):
2215         (WebCore::RenderSVGResourcePattern::createTileImage):
2216         * rendering/svg/RenderSVGResourcePattern.h:
2217         Make pattern images respect the accelerated bit of the parent GraphicsContext.
2218
2219 2015-09-21  Chris Dumez  <cdumez@apple.com>
2220
2221         DOMTokenList.add() / remove() should run the update steps even if tokens were not modified
2222         https://bugs.webkit.org/show_bug.cgi?id=148780
2223         <rdar://problem/22571794>
2224
2225         Reviewed by Ryosuke Niwa.
2226
2227         DOMTokenList.add() / remove() should run the update steps even if tokens
2228         were not modified, as per the DOM specification:
2229         - https://dom.spec.whatwg.org/#dom-domtokenlist-add
2230         - https://dom.spec.whatwg.org/#dom-domtokenlist-remove
2231
2232         The update steps are specified at:
2233         - https://dom.spec.whatwg.org/#concept-DTL-update
2234
2235         This will have several side effects if the DOMTokenList has an associated
2236         attribute. It will overwrite the attribute value which will:
2237         1. Generate a Mutation event.
2238         2. Possibly change the attribute value as the new value is the "ordered
2239            set serializer for tokens". So it will get rid of extra spaces and
2240            duplicates in the attribute value.
2241
2242         Firefox already behaves according to the specification.
2243
2244         No new tests, already covered by existing tests.
2245
2246         * html/DOMTokenList.cpp:
2247         (WebCore::DOMTokenList::addInternal):
2248         (WebCore::DOMTokenList::removeInternal):
2249         (WebCore::DOMTokenList::remove): Deleted.
2250
2251 2015-09-21  Eric Carlson  <eric.carlson@apple.com>
2252
2253         [MediaStream] Clean up MediaStream private interfaces
2254         https://bugs.webkit.org/show_bug.cgi?id=149381
2255
2256         Reviewed by Jer Noble.
2257
2258         No new tests, no functional change.
2259
2260         * Modules/mediastream/MediaStream.cpp:
2261         (WebCore::MediaStream::create):
2262         (WebCore::MediaStream::MediaStream):
2263         (WebCore::MediaStream::clone):
2264         (WebCore::MediaStream::getTrackById):
2265         (WebCore::MediaStream::getAudioTracks):
2266         (WebCore::MediaStream::getVideoTracks):
2267         (WebCore::MediaStream::getTracks):
2268         (WebCore::MediaStream::activeStatusChanged):
2269         (WebCore::MediaStream::didAddTrack):
2270         (WebCore::MediaStream::didRemoveTrack):
2271         (WebCore::MediaStream::registry):
2272         (WebCore::MediaStream::trackVectorForType):
2273         (WebCore::MediaStream::didAddTrackToPrivate): Deleted.
2274         (WebCore::MediaStream::didRemoveTrackFromPrivate): Deleted.
2275         * Modules/mediastream/MediaStream.h:
2276
2277         * Modules/mediastream/MediaStreamRegistry.cpp:
2278         (WebCore::MediaStreamRegistry::lookup):
2279         (WebCore::MediaStreamRegistry::MediaStreamRegistry):
2280         * Modules/mediastream/MediaStreamRegistry.h:
2281
2282         * Modules/mediastream/MediaStreamTrack.cpp:
2283         (WebCore::MediaStreamTrack::MediaStreamTrack):
2284         (WebCore::MediaStreamTrack::~MediaStreamTrack):
2285         (WebCore::MediaStreamTrack::kind):
2286         (WebCore::MediaStreamTrack::removeObserver):
2287         (WebCore::MediaStreamTrack::trackEnded):
2288         (WebCore::MediaStreamTrack::trackMutedChanged):
2289         (WebCore::MediaStreamTrack::trackStatesChanged):
2290         (WebCore::MediaStreamTrack::configureTrackRendering):
2291         * Modules/mediastream/MediaStreamTrack.h:
2292
2293         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2294         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsType):
2295         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load):
2296
2297         * platform/graphics/avfoundation/objc/MediaStreamPrivateAVFObjC.h:
2298         * platform/graphics/avfoundation/objc/MediaStreamPrivateAVFObjC.mm:
2299         (WebCore::MediaStreamPrivateAVFObjC::create):
2300         (WebCore::MediaStreamPrivateAVFObjC::MediaStreamPrivateAVFObjC):
2301
2302         * platform/mediastream/MediaStreamPrivate.cpp:
2303         (WebCore::MediaStreamPrivate::create):
2304         (WebCore::MediaStreamPrivate::MediaStreamPrivate):
2305         (WebCore::MediaStreamPrivate::~MediaStreamPrivate):
2306         (WebCore::MediaStreamPrivate::tracks):
2307         (WebCore::MediaStreamPrivate::addTrack):
2308         (WebCore::MediaStreamPrivate::removeTrack):
2309         * platform/mediastream/MediaStreamPrivate.h:
2310         (WebCore::MediaStreamPrivateClient::~MediaStreamPrivateClient):
2311         (WebCore::MediaStreamPrivate::id):
2312         (WebCore::MediaStreamPrivate::active):
2313         (WebCore::MediaStreamPrivate::MediaStreamPrivate): Deleted.
2314         (WebCore::MediaStreamPrivate::~MediaStreamPrivate): Deleted.
2315
2316         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2317         (WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
2318         (WebCore::MediaStreamTrackPrivate::~MediaStreamTrackPrivate):
2319         (WebCore::MediaStreamTrackPrivate::addObserver):
2320         (WebCore::MediaStreamTrackPrivate::removeObserver):
2321         (WebCore::MediaStreamTrackPrivate::label):
2322         (WebCore::MediaStreamTrackPrivate::endTrack):
2323         (WebCore::MediaStreamTrackPrivate::sourceStopped):
2324         (WebCore::MediaStreamTrackPrivate::sourceMutedChanged):
2325         (WebCore::MediaStreamTrackPrivate::sourceStatesChanged):
2326         (WebCore::MediaStreamTrackPrivate::preventSourceFromStopping):
2327         * platform/mediastream/MediaStreamTrackPrivate.h:
2328         (WebCore::MediaStreamTrackPrivate::Observer::~Observer):
2329         (WebCore::MediaStreamTrackPrivate::ended):
2330         (WebCore::MediaStreamTrackPrivate::startProducingData):
2331         (WebCore::MediaStreamTrackPrivate::stopProducingData):
2332         (WebCore::MediaStreamTrackPrivate::setMuted):
2333         (WebCore::MediaStreamTrackPrivateClient::~MediaStreamTrackPrivateClient): Deleted.
2334         (WebCore::MediaStreamTrackPrivate::setClient): Deleted.
2335         (WebCore::MediaStreamTrackPrivate::client): Deleted.
2336
2337         * platform/mediastream/MediaStreamTrackSourcesRequestClient.h:
2338         (WebCore::TrackSourceInfo::create):
2339         (WebCore::TrackSourceInfo::id):
2340         (WebCore::TrackSourceInfo::label):
2341         (WebCore::TrackSourceInfo::groupId):
2342         (WebCore::TrackSourceInfo::kind):
2343         (WebCore::TrackSourceInfo::TrackSourceInfo):
2344         (WebCore::TrackSourceInfo::deviceId): Deleted.
2345
2346         * platform/mediastream/RealtimeMediaSource.cpp:
2347         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
2348         (WebCore::RealtimeMediaSource::reset):
2349         (WebCore::RealtimeMediaSource::setMuted):
2350         (WebCore::RealtimeMediaSource::statesDidChanged):
2351         (WebCore::RealtimeMediaSource::readonly):
2352         * platform/mediastream/RealtimeMediaSource.h:
2353         (WebCore::RealtimeMediaSource::id):
2354         (WebCore::RealtimeMediaSource::persistentId):
2355         (WebCore::RealtimeMediaSource::setPersistentId):
2356         (WebCore::RealtimeMediaSource::type):
2357         (WebCore::RealtimeMediaSource::stopped):
2358         * platform/mediastream/RealtimeMediaSourceCenter.h:
2359         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2360         (WebCore::AVCaptureDeviceManager::getSourcesInfo):
2361
2362         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2363         (WebCore::RealtimeMediaSourceCenterMac::~RealtimeMediaSourceCenterMac):
2364         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
2365         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
2366         (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources):
2367         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
2368
2369         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
2370         (WebCore::RealtimeMediaSourceCenterOwr::~RealtimeMediaSourceCenterOwr):
2371         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
2372         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
2373
2374         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2375         (WebCore::MockRealtimeMediaSourceCenter::registerMockRealtimeMediaSourceCenter):
2376         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
2377         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
2378         (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources):
2379         * platform/mock/MockRealtimeMediaSourceCenter.h:
2380
2381 2015-09-21  Csaba Osztrogonác  <ossy@webkit.org>
2382
2383         Fix the !ENABLE(TEMPLATE_ELEMENT) build after r189945
2384         https://bugs.webkit.org/show_bug.cgi?id=149400
2385
2386         Reviewed by Darin Adler.
2387
2388         * xml/parser/XMLDocumentParserLibxml2.cpp:
2389         (WebCore::XMLDocumentParser::startElementNs):
2390
2391 2015-09-21  Chris Dumez  <cdumez@apple.com>
2392
2393         Range.cloneContents() / extractContents should throw a HierarchyRequestError when encountering a doctype
2394         https://bugs.webkit.org/show_bug.cgi?id=148770
2395         <rdar://problem/22570898>
2396
2397         Reviewed by Ryosuke Niwa.
2398
2399         Range.cloneContents() and Range.extractContents() should throw a
2400         HierarchyRequestError when encountering a doctype:
2401         - https://dom.spec.whatwg.org/#concept-range-clone (step 12)
2402         - https://dom.spec.whatwg.org/#concept-range-extract (step 12)
2403
2404         However, Range.deleteContents() should not:
2405         - https://dom.spec.whatwg.org/#dom-range-deletecontents
2406
2407         WebKit was not throwing in the Range.cloneContents() case. This
2408         aligns updates our behavior to match the specification and
2409         Firefox.
2410
2411         Tests: fast/dom/Range/clone-contents-document-type.html
2412                fast/dom/Range/delete-contents-document-type.html
2413                fast/dom/Range/extract-contents-document-type.html
2414
2415         * dom/Range.cpp:
2416         (WebCore::Range::processContentsBetweenOffsets):
2417
2418 2015-09-21  Tim Horton  <timothy_horton@apple.com>
2419
2420         UserMediaClientMock leaks every test run
2421         https://bugs.webkit.org/show_bug.cgi?id=149358
2422
2423         Reviewed by Eric Carlson.
2424
2425         * Modules/mediastream/UserMediaController.cpp:
2426         (WebCore::provideUserMediaTo):
2427         Make provideUserMediaTo operate unconditionally, just like all of the
2428         other similar functions, reverting r165733.
2429
2430         * Modules/mediastream/UserMediaController.h:
2431         * testing/Internals.cpp:
2432         (WebCore::Internals::Internals):
2433         Remove the existing UserMediaController supplement before installing a new one.
2434         This way, we're replacing it with the one Internals is trying to install,
2435         instead of leaking UserMediaClientMocks.
2436
2437 2015-09-21  Alex Christensen  <achristensen@webkit.org>
2438
2439         Generate WebCoreHeaderDetection.h with CMake on Windows
2440         https://bugs.webkit.org/show_bug.cgi?id=135861
2441
2442         Reviewed by Brent Fulgham.
2443
2444         This fixes many of the failing media tests.
2445
2446         * AVFoundationSupport.py:
2447         (lookFor):
2448         (fileContains):
2449         Use a command line parameter for the WebKitLibraries directory 
2450         to not require the WEBKIT_LIBRARIES environment variable with the CMake build.
2451         * DerivedSources.make:
2452         Pass WEBKIT_LIBRARIES as a command line parameter.
2453         * PlatformAppleWin.cmake:
2454         Added missing sources for video.
2455         * PlatformWin.cmake:
2456         Generate WebCoreHeaderDetection.h correctly and copy the media controls sources to WebKit.resources.
2457
2458 2015-09-21  ChangSeok Oh  <changseok.oh@collabora.com>
2459
2460         [GTK] media controls does not show up when playing video finishes.
2461         https://bugs.webkit.org/show_bug.cgi?id=149112
2462
2463         Reviewed by Philippe Normand.
2464
2465         GTK port does not show controls after playing video. This behavior is different
2466         from what Mac port does. They do show controls when playing video finishes.
2467         At least, we should update the timeline before showing it up not to show incorrect numbers
2468         when reappearing.
2469
2470         Test: media/media-controls-timeline-updates-after-playing.html
2471
2472         * Modules/mediacontrols/mediaControlsBase.js:
2473         (Controller.prototype.setPlaying):
2474         (Controller.prototype.showControls):
2475
2476 2015-09-21  ChangSeok Oh  <changseok.oh@collabora.com>
2477
2478         [GTK] timeline is not updated after few seconds when mouse hovers on controls
2479         https://bugs.webkit.org/show_bug.cgi?id=149111
2480
2481         Reviewed by Philippe Normand.
2482
2483         Timeline is not updated if controlsAreHidden is true. The problem here is that
2484         the function does not mean actually 'hidden' since it only checkes 'show' and 'hidden'
2485         class existences. The panel's visibility are not only controlled by the two classes,
2486         but also by video::-webkit-media-controls-panel:hover. The panel could be visible
2487         by setting the pseudo hover class. So we need to check if panel is hovered as well in controlsAreHidden().
2488
2489         Test: media/media-controls-timeline-updates-when-hovered.html
2490
2491         * Modules/mediacontrols/mediaControlsBase.js:
2492         (Controller.prototype.controlsAreHidden):
2493
2494 2015-09-21  Michael Catanzaro  <mcatanzaro@igalia.com>
2495
2496         [GTK] REGRESSION(188031): ASSERTION FAILED: menu
2497         https://bugs.webkit.org/show_bug.cgi?id=149379
2498
2499         Reviewed by Carlos Garcia Campos.
2500
2501         Remove assert that no longer makes sense.
2502
2503         * platform/gtk/ContextMenuGtk.cpp:
2504         (WebCore::ContextMenu::setPlatformDescription): Deleted.
2505
2506 2015-09-20  Chris Dumez  <cdumez@apple.com>
2507
2508         Unreviewed attempt to fix GTK build after r190030.
2509
2510         * bindings/gobject/WebKitDOMCustom.cpp:
2511         (webkit_dom_html_link_element_set_sizes):
2512
2513 2015-09-20  Chris Dumez  <cdumez@apple.com>
2514
2515         Unreviewed, another GTK build fix after r190017.
2516
2517         * bindings/scripts/CodeGeneratorGObject.pm:
2518         (IsPropertyWriteable):
2519         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2520         (webkit_dom_test_obj_class_init):
2521         (webkit_dom_test_obj_set_property): Deleted.
2522
2523 2015-09-20  Chris Dumez  <cdumez@apple.com>
2524
2525         Unreviewed attempt to fix the GTK build after r190017.
2526
2527         * bindings/scripts/CodeGeneratorGObject.pm:
2528         (SkipFunction):
2529
2530 2015-09-20  Chris Dumez  <cdumez@apple.com>
2531
2532         Pass JSC::ExecState to the custom bindings by reference
2533         https://bugs.webkit.org/show_bug.cgi?id=149393
2534
2535         Reviewed by Sam Weinig.
2536
2537         Pass JSC::ExecState to the custom bindings by reference instead of by
2538         pointer as it is expected to be non-null.
2539
2540 2015-09-20  Chris Dumez  <cdumez@apple.com>
2541
2542         Regression(r190023): fast/dom/navigation-with-sideeffects-crash.html is crashing
2543         https://bugs.webkit.org/show_bug.cgi?id=149392
2544
2545         Reviewed by Alexey Proskuryakov.
2546
2547         In the generated code for [PutForwards=xxx], make sure the forwarded
2548         implementation object is ref'd before calling toString() as toString()
2549         can be overridden by JS and cause the object to get deref'd / destroyed.
2550
2551         No new tests, already covered by existing test.
2552
2553         * bindings/scripts/CodeGeneratorJS.pm:
2554         (GenerateImplementation):
2555         * bindings/scripts/test/JS/JSTestObj.cpp:
2556         (WebCore::setJSTestObjPutForwardsAttribute):
2557         (WebCore::setJSTestObjPutForwardsNullableAttribute):
2558
2559 2015-09-19  Chris Dumez  <cdumez@apple.com>
2560
2561         Get rid of custom bindings for HTMLLinkElement.sizes setter
2562         https://bugs.webkit.org/show_bug.cgi?id=149382
2563
2564         Reviewed by Sam Weinig.
2565
2566         Get rid of custom bindings for HTMLLinkElement.sizes setter by leveraging
2567         the new [PutForwards=xxx] Web IDL extended attribute, as per the HTML
2568         specification:
2569         - https://html.spec.whatwg.org/#htmllinkelement
2570
2571         Also add FIXME comments in our IDL for various attributes that should be
2572         using [PutForwards=xxx] according to the HTML specification but are not
2573         currently. Those were not updated in this patch because it will subtly
2574         change their web-exposed behavior.
2575
2576         No new tests, no intended web-exposed behavior change. However, one side
2577         effect of the change is that the attribtue has moved to the prototype.
2578         Our bindings generator was keeping this attribute on the instance because
2579         it has a custom setter.
2580         Bindings tests coverage was extended.
2581
2582         * CMakeLists.txt:
2583         * WebCore.vcxproj/WebCore.vcxproj:
2584         * WebCore.vcxproj/WebCore.vcxproj.filters:
2585         * WebCore.xcodeproj/project.pbxproj:
2586         * bindings/js/JSBindingsAllInOne.cpp:
2587         * bindings/js/JSHTMLLinkElementCustom.cpp: Removed.
2588         Drop custom bindings for HTMLLinkElement.sizes setter.
2589
2590         * bindings/scripts/CodeGeneratorJS.pm:
2591         (GenerateImplementation):
2592         - Stop passing an extra isNull argument to getters of nullable attributes
2593           that have a wrapper type. These can return a null pointer so there is
2594           no need for an extra argument.
2595         - When [PutForwards=xxx] is used, only do the null-check on the attribute
2596           getter if the attribute is marked as nullable. If the attribute is not
2597           marked as nullable, the implementation is expected to return a C++
2598           reference, otherwise a raw pointer. This was needed because
2599           HTMLLinkElement::sizes() returns a reference as it can never return
2600           null.
2601
2602         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2603         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2604         * bindings/scripts/test/JS/JSTestObj.cpp:
2605         * bindings/scripts/test/ObjC/DOMTestObj.h:
2606         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2607         * bindings/scripts/test/TestObj.idl:
2608         Add bindings tests coverage for using [PutForwards=xxx] on a
2609         nullable attribute.
2610
2611         * dom/Document.idl:
2612         Mark Document.location as nullable as per the specification. The
2613         implementation returns a raw pointer and can return null. The
2614         bindings generator expects a raw pointer and will do a null check
2615         on it.
2616
2617         * html/HTMLAnchorElement.idl:
2618         * html/HTMLAreaElement.idl:
2619         * html/HTMLElement.idl:
2620         * html/HTMLIFrameElement.idl:
2621         * html/HTMLOutputElement.idl:
2622         * html/HTMLTableCellElement.idl:
2623         Add FIXME comments for attributes that are supposed to use
2624         [PutForwards=xxx] as per the HTML specification but currently don't.
2625
2626         * html/HTMLLinkElement.idl:
2627         Use [PutForwards=value] for the 'sizes' attribute, as per the
2628         specification and stop using a custom setter.
2629
2630 2015-09-20  Chris Dumez  <cdumez@apple.com>
2631
2632         [CallWith=ScriptState] should pass ExecState to the implementation by reference
2633         https://bugs.webkit.org/show_bug.cgi?id=149378
2634
2635         Reviewed by Sam Weinig.
2636
2637         [CallWith=ScriptState] should pass ExecState to the implementation by
2638         reference instead of pointer, as it is expected to be non-null.
2639
2640         Also rename the ExecState variables from 'exec' to 'state' in the
2641         bindings as this is the preferred naming convention.
2642
2643         * Modules/indexeddb/IDBCursor.h:
2644         * Modules/indexeddb/IDBObjectStore.h:
2645         * Modules/indexeddb/legacy/LegacyCursor.cpp:
2646         (WebCore::LegacyCursor::update):
2647         * Modules/indexeddb/legacy/LegacyCursor.h:
2648         * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
2649         (WebCore::LegacyObjectStore::add):
2650         (WebCore::LegacyObjectStore::put):
2651         * Modules/indexeddb/legacy/LegacyObjectStore.h:
2652         * Modules/mediastream/CapabilityRange.cpp:
2653         (WebCore::scriptValue):
2654         (WebCore::CapabilityRange::min):
2655         (WebCore::CapabilityRange::max):
2656         * Modules/mediastream/CapabilityRange.h:
2657         * Modules/streams/ReadableStreamController.h:
2658         (WebCore::ReadableStreamController::error):
2659         (WebCore::ReadableStreamController::enqueue):
2660         * bindings/scripts/CodeGeneratorJS.pm:
2661         (GenerateEventListenerCall):
2662         (GenerateGetOwnPropertySlotBody):
2663         (GenerateHeader):
2664         (GenerateOverloadedFunction):
2665         (GetIndexedGetterExpression):
2666         (GenerateImplementation):
2667         (GenerateFunctionCastedThis):
2668         (GenerateCallWith):
2669         (GenerateArgumentsCountCheck):
2670         (GenerateParametersCheck):
2671         (GenerateReturnParameters):
2672         (GenerateCallbackHeader):
2673         (GenerateCallbackImplementation):
2674         (GenerateImplementationFunctionCall):
2675         (JSValueToNative):
2676         (NativeToJSValue):
2677         (GenerateOverloadedConstructorDefinition):
2678         (GenerateConstructorDefinition):
2679
2680 2015-09-20  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2681
2682         Remove XHR_TIMEOUT compilation guard
2683         https://bugs.webkit.org/show_bug.cgi?id=149260
2684
2685         Reviewed by Benjamin Poulain.
2686
2687         Covered by existing tests.
2688
2689         * Configurations/FeatureDefines.xcconfig:
2690         * xml/XMLHttpRequest.cpp:
2691         (WebCore::XMLHttpRequest::XMLHttpRequest):
2692         (WebCore::XMLHttpRequest::didFail):
2693         (WebCore::XMLHttpRequest::didReachTimeout):
2694         (WebCore::XMLHttpRequest::setTimeout):
2695         (WebCore::XMLHttpRequest::setResponseType):
2696         (WebCore::XMLHttpRequest::open):
2697         (WebCore::XMLHttpRequest::createRequest):
2698         (WebCore::XMLHttpRequest::internalAbort):
2699         (WebCore::XMLHttpRequest::didFailRedirectCheck):
2700         (WebCore::XMLHttpRequest::didSendData):
2701         (WebCore::XMLHttpRequest::suspend):
2702         * xml/XMLHttpRequest.h:
2703         * xml/XMLHttpRequest.idl:
2704
2705 2015-09-20  Tim Horton  <timothy_horton@apple.com>
2706
2707         Add two missing files to the Xcode project
2708
2709         * WebCore.xcodeproj/project.pbxproj:
2710         These are imported by files that are built for Mac, but missing from the project.
2711
2712 2015-09-19  Chris Dumez  <cdumez@apple.com>
2713
2714         [Web IDL] Add support for [PutForwards=XXX] IDL extended attribute
2715         https://bugs.webkit.org/show_bug.cgi?id=149376
2716
2717         Reviewed by Darin Adler.
2718
2719         [Web IDL] Add support for [PutForwards=XXX] IDL extended attribute:
2720         https://heycam.github.io/webidl/#PutForwards
2721
2722         As an initial proof of concept, use it for Document.location as per the
2723         HTML specification, instead of using custom bindings:
2724         https://html.spec.whatwg.org/multipage/dom.html#the-document-object
2725
2726         More attributes can be ported later.
2727
2728         No new tests, no web-exposed behavior change intended. Bindings tests
2729         coverage was added.
2730
2731         * bindings/js/JSDocumentCustom.cpp:
2732         Drop custom bindings for the location attribute setter.
2733
2734         * bindings/scripts/CodeGenerator.pm:
2735         (GetAttributeFromInterface):
2736         Add convenience function that returned an attribute from another
2737         interface. This is used by [PutForwards] to retrieve the forwarded
2738         attribute.
2739
2740         * bindings/scripts/CodeGeneratorJS.pm:
2741         (IsReadonly):
2742         (GenerateImplementation):
2743         * bindings/scripts/IDLAttributes.txt:
2744         Add support for [PutForwards=XXX] IDL extended attribute.
2745
2746         * bindings/scripts/test/GObject/WebKitDOMTestNode.cpp:
2747         * bindings/scripts/test/GObject/WebKitDOMTestNode.h:
2748         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2749         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2750         * bindings/scripts/test/JS/JSTestNode.cpp:
2751         * bindings/scripts/test/JS/JSTestObj.cpp:
2752         * bindings/scripts/test/ObjC/DOMTestNode.h:
2753         * bindings/scripts/test/ObjC/DOMTestNode.mm:
2754         * bindings/scripts/test/ObjC/DOMTestObj.h:
2755         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2756         Add binding tests coverage for [PutForwards=XXX] IDL extended
2757         attribute.
2758
2759         * dom/Document.idl:
2760         Use [PutForwards=href] for Document.location attribute, as per the HTML
2761         specification and stop using custom bindings for the setter. Also mark
2762         the attribute as readonly as all attributes using [PutForwards] must be
2763         marked as readonly as per the Web IDL specification.
2764
2765 2015-09-19  Chris Dumez  <cdumez@apple.com>
2766
2767         [WebIDL] Specify default parameter values where it is useful
2768         https://bugs.webkit.org/show_bug.cgi?id=149331
2769         <rdar://problem/22545600>
2770
2771         Reviewed by Darin Adler.
2772
2773         Specify default parameter values where it is useful in our IDL, that is
2774         to say where undefined would be converted to something else than the
2775         default value otherwise. This patch focuses on the HTML API.
2776
2777         This patch also adds support for default values for optional parameters
2778         of string enumeration type as this was needed by the
2779         CanvasRenderingContext2D API.
2780
2781         Test: fast/html/undefined-parameter-default-value.html
2782
2783         * bindings/scripts/CodeGeneratorJS.pm:
2784         (GenerateParametersCheck):
2785         Add support default values for optional parameters of string enumeration
2786         type as this was needed by the CanvasRenderingContext2D API.
2787
2788         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2789         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2790         * bindings/scripts/test/JS/JSTestObj.cpp:
2791         * bindings/scripts/test/ObjC/DOMTestObj.h:
2792         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2793         * bindings/scripts/test/TestObj.idl:
2794         Add bindings tests coverage for optional parameters of string enumeration
2795         type and that have a default value.
2796
2797         * html/HTMLInputElement.idl:
2798         Specify default parameter value for stepUp() / stepDown(). Without this,
2799         stepUp(undefined) would be equivalent to calling stepUp(0) even though
2800         it is supposed to be equivalent to calling stepUp(1).
2801
2802         * html/HTMLTableElement.idl:
2803         * html/HTMLTableSectionElement.idl:
2804         Specify default parameter value for insertRow(). Without this,
2805         insertRow(undefined) would be equivalent to insertRow(0) instead of
2806         insertRow(-1). This would prepend the row instead of appending it:
2807         - https://html.spec.whatwg.org/#htmltableelement
2808         - https://html.spec.whatwg.org/#htmltablesectionelement
2809
2810         * html/HTMLTableRowElement.idl:
2811         Specify default parameter value for insertCell(). Without this,
2812         insertCell(undefined) would be equivalent to insertCell(0) instead of
2813         insertCell(-1). This would prepend the cell instead of appending it:
2814         - https://html.spec.whatwg.org/#htmltablerowelement
2815
2816         * html/canvas/CanvasRenderingContext2D.idl:
2817         Specify default value for CanvasWindingRule parameters so that calling
2818         this with undefined will use the default enum value instead of using the
2819         "undefined" string and then throwing because it is not a valid enum value:
2820         - https://html.spec.whatwg.org/#canvasrenderingcontext2d
2821
2822 2015-09-19  Eric Carlson  <eric.carlson@apple.com>
2823
2824         Cleanup code that finds and loads a media engine
2825         https://bugs.webkit.org/show_bug.cgi?id=149371
2826
2827         Reviewed by Darin Adler.
2828
2829         No new tests, no functional change.
2830
2831         * Modules/mediastream/MediaStream.cpp:
2832         (WebCore::MediaStream::setRegistry): New, set the registry.
2833         (WebCore::MediaStream::lookup): New, lookup a url in the registry.
2834         * Modules/mediastream/MediaStream.h:
2835
2836         * html/HTMLMediaElement.cpp:
2837         (WebCore::HTMLMediaElement::loadResource): Restructure and simplify the code that tries the 
2838           different types of media engine so the code is easier to understand and modify.
2839         (WebCore::HTMLMediaElement::createMediaPlayer): Clear m_mediaStreamSrcObject.
2840
2841         * platform/graphics/MediaPlayer.cpp:
2842         (WebCore::buildMediaEnginesVector): Add some whitespace to make it easier to read.
2843         (WebCore::bestMediaEngineForSupportParameters): Also process mediastream and mediasource urls.
2844         (WebCore::MediaPlayer::load): ASSERT if called when the reload timer is active.
2845         (WebCore::MediaPlayer::loadWithNextMediaEngine): Also process mediastream and mediasource urls.
2846
2847         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2848         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Don't test empty/null urls.
2849
2850         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2851         (WebCore::MockMediaPlayerMediaSource::supportsType): Ditto.
2852
2853 2015-09-19  Chris Dumez  <cdumez@apple.com>
2854
2855         Get rid of most custom bindings for Location.idl
2856         https://bugs.webkit.org/show_bug.cgi?id=149370
2857
2858         Reviewed by Darin Adler.
2859
2860         Get rid of most custom bindings for Location.idl by extending support
2861         for the [CallWith=XXX] IDL extended attribute to support 2 additional
2862         values: ActiveWindow and FirstWindow. Also introduce a
2863         [SetterCallWith=XXX] alternative that passes the extra arguments to
2864         the attribute setter only, as is needed by the Location attributes.
2865
2866         No new tests, no intended web-exposed behavior change.
2867
2868         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2869         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2870         * bindings/scripts/test/JS/JSTestObj.cpp:
2871         * bindings/scripts/test/ObjC/DOMTestObj.h:
2872         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2873         * bindings/scripts/test/TestObj.idl:
2874         Add bindings tests coverage for [SetterCallWith=XXX].
2875
2876         * page/Location.idl:
2877         Also drop [DoNotCheckSecurityOnSetter] on href attribute. It has
2878         no effet as the interface does not have [CheckSecurity].
2879
2880 2015-09-19  Chris Dumez  <cdumez@apple.com>
2881
2882         Get rid of custom bindings for Document.location getter
2883         https://bugs.webkit.org/show_bug.cgi?id=149369
2884
2885         Reviewed by Andreas Kling.
2886
2887         Get rid of custom bindings for Document.location getter by defining
2888         a location getter on Document that calls the one on the document's
2889         DOMWindow. The DOMWindow location getter already has an
2890         isCurrentlyDisplayedInFrame() check so the document does not need
2891         to do a null check on the frame.
2892
2893         No new tests, no web-exposed behavior change intended.
2894
2895         * bindings/js/JSDocumentCustom.cpp:
2896         (WebCore::JSDocument::location): Deleted.
2897         * dom/Document.cpp:
2898         (WebCore::Document::location):
2899         * dom/Document.h:
2900         * dom/Document.idl:
2901         * page/DOMWindow.cpp:
2902         (WebCore::DOMWindow::location):
2903
2904 2015-09-18  Dean Jackson  <dino@apple.com>
2905
2906         Null dereference loading Blink layout test svg/filters/feImage-failed-load-crash.html
2907         https://bugs.webkit.org/show_bug.cgi?id=149316
2908         <rdar://problem/22749532>
2909
2910         Reviewed by Tim Horton.
2911
2912         If an feImage triggered loading a resource, and then was removed from the document,
2913         we'd still try to notify its parent when the resource arrived (or failed).
2914
2915         Merge Blink commit:
2916         https://chromium.googlesource.com/chromium/blink/+/9cbcfd7866bbaff0c4b3c4c8508b7c97b46d6e6a
2917
2918         Test: svg/filters/feImage-failed-load-crash.html
2919
2920         * svg/SVGFEImageElement.cpp:
2921         (WebCore::SVGFEImageElement::notifyFinished): Add a null check to the parent element
2922         before sending the notification.
2923
2924 2015-09-18  Dean Jackson  <dino@apple.com>
2925
2926         Null dereference loading Blink layout test svg/custom/use-href-attr-removal-crash.html
2927         https://bugs.webkit.org/show_bug.cgi?id=149315
2928         <rdar://problem/22749358>
2929
2930         Reviewed by Tim Horton.
2931
2932         We were not checking if the corresponding element referenced from
2933         the SVG <use> actually existed before trying to set attributes on it.
2934         The original Blink change is a little more detailed:
2935         https://chromium.googlesource.com/chromium/blink/+/e2f1087f32bb088160ab7d59a715a1403ef267c7
2936         However, we've significantly diverged at this point.
2937
2938         Tests: svg/custom/use-href-attr-removal-crash.html
2939                svg/custom/use-href-attr-removal-crash2.svg
2940                svg/custom/use-href-change-local-to-invalid-remote.html
2941
2942         * svg/SVGUseElement.cpp:
2943         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
2944
2945 2015-09-18  Commit Queue  <commit-queue@webkit.org>
2946
2947         Unreviewed, rolling out r189908.
2948         https://bugs.webkit.org/show_bug.cgi?id=149368
2949
2950         Broke run-webkit-tests --pixel (Requested by ap on #webkit).
2951
2952         Reverted changeset:
2953
2954         "printing does not use minimum page zoom factor"
2955         https://bugs.webkit.org/show_bug.cgi?id=108507
2956         http://trac.webkit.org/changeset/189908
2957
2958 2015-09-18  Ryosuke Niwa  <rniwa@webkit.org>
2959
2960         Inserting or removing slot elements can cause a crash
2961         https://bugs.webkit.org/show_bug.cgi?id=149365
2962
2963         Reviewed by Antti Koivisto.
2964
2965         HTMLSlotElement::insertedInto and removedFrom were doing completely non-sensical.
2966
2967         Since insertedInto and removedFrom are called on an element whenever it or its ancestor is inserted into
2968         or removed from a container node, we can't always call addSlotElementByName removeSlotElementByName when
2969         those functions are called. Instead, we need to check whether this slot has been inserted into or removed
2970         from a container node that resides inside a shadow root.
2971
2972         Also reverted r189906 since the change was made upon a bogus assumption I had made.
2973
2974         Test: fast/shadow-dom/slot-removal-crash.html
2975
2976         * dom/Element.cpp:
2977         (WebCore::Element::insertedInto): Added comments.
2978         (WebCore::Element::removedFrom): Ditto.
2979         (WebCore::Element::addShadowRoot): Reverted r189906.
2980         (WebCore::Element::removeShadowRoot): Ditto.
2981
2982         * html/HTMLSlotElement.cpp:
2983         (WebCore::HTMLSlotElement::insertedInto): When the insertion point's tree scope is different from ours,
2984         the insertion happened to our shadow host or its ancestor. There is nothing to be done in that case since
2985         the shadow tree was not modified (in particular, our relationship with our shadow root never changed).
2986         We also don't do anything if we got inserted into a parent which is not inside a shadow tree.
2987
2988         (WebCore::HTMLSlotElement::removedFrom): Since Container::removeBetween sets the tree scope before this
2989         function is getting called, we can't compare this element's treeScope with that of the "insertion" point.
2990         They're always different regardless of whether the insertion point was in the same shadow tree to which
2991         we belong or its shadow host's. However, since a node removed from a shadow tree is put into document's
2992         tree scope before this function is called and InShadowTree flag is unset in Node::removedFrom at the end
2993         of this function, this slot element is definitely being removed from its shadow root when isInShadowTree()
2994         is true and the newly set tree scope is of the document. So call removeSlotElementByName if and only if
2995         that condition holds.
2996
2997         (WebCore::HTMLSlotElement::getDistributedNodes): Explicitly check that we're inside a shadow root.
2998
2999 2015-09-18  Ryosuke Niwa  <rniwa@webkit.org>
3000
3001         REGRESSION(r150187): updateIdForTreeScope may not be called inside shadow trees
3002         https://bugs.webkit.org/show_bug.cgi?id=149364
3003
3004         Reviewed by Antti Koivisto.
3005
3006         Since the tree scope is set to that of Document's inside removeBetween when a node is removed from a shadow tree,
3007         oldScope != &treeScope() was already true inside Element::removedFrom. This can introduce an inconsistency in
3008         DocumentOrderedMap which could result in a crash. Fixed the bug by checking it against document(), which is the
3009         behavior we had prior to r150187.
3010
3011         Also added a consistency check in DocumentOrderedMap to catch bugs like this.
3012
3013         No new tests. New assertions fail in existing tests without this fix.
3014
3015         * dom/DocumentOrderedMap.cpp:
3016         (WebCore::DocumentOrderedMap::add):
3017         (WebCore::DocumentOrderedMap::remove):
3018         (WebCore::DocumentOrderedMap::get):
3019         * dom/DocumentOrderedMap.h:
3020         * dom/Element.cpp:
3021         (WebCore::Element::removedFrom):
3022
3023 2015-09-18  Antti Koivisto  <antti@apple.com>
3024
3025         Don't create renderers for children of shadow host
3026         https://bugs.webkit.org/show_bug.cgi?id=149363
3027
3028         Reviewed by Ryosuke Niwa.
3029
3030         Test: fast/shadow-dom/css-scoping-shadow-root-hides-children.html
3031
3032         * dom/ShadowRoot.h:
3033         * style/StyleResolveTree.cpp:
3034         (WebCore::Style::attachRenderTree):
3035         (WebCore::Style::resolveShadowTree):
3036         (WebCore::Style::resolveChildren):
3037         (WebCore::Style::resolveTree):
3038
3039 2015-09-08  Darin Adler  <darin@apple.com>
3040
3041         Refine and simplify some color-related code
3042         https://bugs.webkit.org/show_bug.cgi?id=148961
3043
3044         Reviewed by Anders Carlsson.
3045
3046         Refactoring code that seems to be covered by existing tests.
3047
3048         * css/CSSParser.cpp:
3049         (WebCore::CSSParser::parseColor): Handle the empty string efficiently so that
3050         callers don't need to do that.
3051
3052         * platform/graphics/Color.h: Started adding comments about deprecation.
3053         Added RGBA class for future use whenever we need an RGBA quadruplet rather than
3054         a color with a color space. Added FIXME about future evoluation of the classes here.
3055         Added OptionalColor so we can start removing the "invalid color" feature from Color.
3056         Added roundAndClampColorChannel function.
3057
3058         * svg/ColorDistance.cpp: Removed.
3059         * svg/ColorDistance.h: Removed.
3060
3061         * CMakeLists.txt: Removed ColorDistance.
3062         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
3063         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
3064         * WebCore.xcodeproj/project.pbxproj: Ditto.
3065         * svg/SVGAllInOne.cpp: Ditto.
3066
3067         * svg/SVGAnimatedColor.cpp:
3068         (WebCore::SVGAnimatedColorAnimator::SVGAnimatedColorAnimator): Changed to take
3069         a reference instead of a pointer.
3070         (WebCore::SVGAnimatedColorAnimator::constructFromString): Simplified since the
3071         SVGColor::colorFromRGBColorString will handle the empty string.
3072         (WebCore::SVGAnimatedColorAnimator::addAnimatedTypes): Moved the code to add the
3073         RGB channels of two colors here from ColorDistance::addColors since this is the
3074         only place it was used.
3075         (WebCore::currentColor): Refactored adjustForCurrentColor function into this.
3076         Helper for the code below.
3077         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue): Refactored to use
3078         the new currentColor function and replaced the use of the ColorDistance::clampColor
3079         function here with a bit of code here in the one place it was used.
3080         (WebCore::SVGAnimatedColorAnimator::calculateDistance): Moved the distance algorithm
3081         here from ColorDistance::distance.
3082
3083         * svg/SVGAnimatedColor.h: Removed unneeded forward declaration, changed constructor
3084         to take references instead of pointers, and made all class member functions private.
3085
3086         * svg/SVGAnimatedType.cpp:
3087         (WebCore::SVGAnimatedType::setValueAsString): Removed special case for empty string,
3088         since SVGColor::colorFromRGBColorString does the same thing.
3089
3090         * svg/SVGAnimatorFactory.h:
3091         (WebCore::SVGAnimatorFactory::create): Pass references rather tha pointers to the
3092         SVGAnimatedColorAnimator constructor.
3093
3094         * svg/SVGColor.cpp:
3095         (WebCore::SVGColor::colorFromRGBColorString): Added more FIXMEs about the future of
3096         this function.
3097         (WebCore::SVGColor::setRGBColor): Fixed confusing verb tense.
3098         (WebCore::SVGColor::customCSSText): Use ASCII literal for an ASCII literal.
3099
3100 2015-09-18  Eric Carlson  <eric.carlson@apple.com>
3101
3102         UserMediaClientMock leaks every test run
3103         https://bugs.webkit.org/show_bug.cgi?id=149358
3104
3105         Reviewed by Tim Horton.
3106
3107         * platform/mock/UserMediaClientMock.h: Implement pageDestroyed.
3108
3109 2015-09-18  Alex Christensen  <achristensen@webkit.org>
3110
3111         190,000!
3112
3113 2015-09-18  Nan Wang  <n_wang@apple.com>
3114
3115         AX: Implement ARIA 1.1 @aria-current on iOS
3116         https://bugs.webkit.org/show_bug.cgi?id=149297
3117
3118         Reviewed by Chris Fleizach.
3119
3120         Added support for iOS to query for aria-current status.
3121         Also, enabled aria-current.html test on iOS.
3122
3123         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3124         (-[WebAccessibilityObjectWrapper accessibilityInvalidStatus]):
3125         (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]):
3126         (-[WebAccessibilityObjectWrapper accessibilityMathRootIndexObject]):
3127
3128 2015-09-18  Alex Christensen  <achristensen@webkit.org>
3129
3130         Fix Windows tests after switch to CMake.
3131
3132         * testing/js/WebCoreTestSupportPrefix.h:
3133         Include cmakeconfig.h before wtf/Platform.h like we do in all the other precompiled headers
3134         to have consistent features defined.
3135
3136 2015-09-18  Alexey Proskuryakov  <ap@apple.com>
3137
3138         REGRESSION (r189526): Nightlies don't work on Mavericks
3139         https://bugs.webkit.org/show_bug.cgi?id=149215
3140
3141         Reviewed by Daniel Bates.
3142
3143         * platform/sql/SQLiteDatabase.cpp:
3144         (WebCore::SQLiteDatabase::SQLiteDatabase): Fixed the check to work when cross-compiling
3145         for 10.9 with 10.10 SDK.
3146         (WebCore::SQLiteDatabase::disableThreadingChecks): Removed an obsolete version check -
3147         WebCore has an #error elsewhere making sure that the version is higher than that.
3148         (WebCore::SQLiteDatabase::authorizerFunction): Ditto.
3149
3150 2015-09-18  Alex Christensen  <achristensen@webkit.org>
3151
3152         CMake clean build fix after r189971.
3153
3154         * CMakeLists.txt:
3155         Remove Entity.idl.
3156
3157 2015-09-18  Antti Koivisto  <antti@apple.com>
3158
3159         Support style isolation in shadow trees
3160         https://bugs.webkit.org/show_bug.cgi?id=149353
3161
3162         Reviewed by Ryosuke Niwa.
3163
3164         Allow ShadowRoots to have their own StyleResolvers.
3165
3166         This patch just adds the mechanism, all shadow roots still use the document resolver.
3167
3168         * css/StyleResolver.h:
3169         (WebCore::StyleResolverParentPusher::push):
3170         (WebCore::StyleResolverParentPusher::~StyleResolverParentPusher):
3171         * dom/Element.cpp:
3172         (WebCore::Element::absoluteLinkURL):
3173         (WebCore::Element::styleResolver):
3174
3175             Helper function for getting the right StyleResolver for the element.
3176
3177         (WebCore::Element::resolveStyle):
3178
3179             Helper function for resolving element style.
3180
3181         * dom/Element.h:
3182         * dom/ShadowRoot.cpp:
3183         (WebCore::ShadowRoot::~ShadowRoot):
3184         (WebCore::ShadowRoot::styleResolver):
3185         (WebCore::ShadowRoot::cloneNode):
3186         * dom/ShadowRoot.h:
3187         (WebCore::ShadowRoot::resetStyleInheritance):
3188         * editing/EditingStyle.cpp:
3189         (WebCore::styleFromMatchedRulesForElement):
3190         * html/HTMLTitleElement.cpp:
3191         (WebCore::HTMLTitleElement::computedTextWithDirection):
3192         * html/canvas/CanvasRenderingContext2D.cpp:
3193         (WebCore::CanvasRenderingContext2D::setFont):
3194         * inspector/InspectorCSSAgent.cpp:
3195         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
3196         * page/animation/KeyframeAnimation.cpp:
3197         (WebCore::KeyframeAnimation::KeyframeAnimation):
3198         * rendering/RenderElement.cpp:
3199         (WebCore::RenderElement::getUncachedPseudoStyle):
3200         (WebCore::RenderElement::containingBlockForFixedPosition):
3201         * rendering/RenderNamedFlowFragment.cpp:
3202         (WebCore::RenderNamedFlowFragment::checkRegionStyle):
3203         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
3204         * style/StyleResolveTree.cpp:
3205         (WebCore::Style::styleForElement):
3206         * svg/SVGElement.cpp:
3207         (WebCore::SVGElement::customStyleForRenderer):
3208         (WebCore::SVGElement::animatedSMILStyleProperties):
3209         * svg/SVGElementRareData.h:
3210         (WebCore::SVGElementRareData::overrideComputedStyle):
3211
3212 2015-09-18  Alex Christensen  <achristensen@webkit.org>
3213
3214         [Win] Fix bindings tests after r189934.
3215
3216         Reviewed by Brent Fulgham.
3217
3218         * bindings/scripts/preprocessor.pm:
3219         (applyPreprocessor):
3220         Bindings tests use /usr/bin/gcc from cygwin, which requires different flags.
3221         If we're using gcc to preprocess, use it like we did before r189934.
3222
3223 2015-09-18  Eric Carlson  <eric.carlson@apple.com>
3224
3225         [MediaStream] Finish implementing MediaDevices.enumerateDevices
3226         https://bugs.webkit.org/show_bug.cgi?id=149322
3227         <rdar://problem/22750866>
3228
3229         Reviewed by Brent Fulgham.
3230
3231         Test: fast/mediastream/MediaDevices-enumerateDevices.html
3232
3233         * CMakeLists.txt: Add MediaDevicesRequest.cpp
3234
3235         * Modules/mediastream/MediaDeviceInfo.h: Add MediaDeviceInfoVector typedef.
3236
3237         * Modules/mediastream/MediaDevices.cpp:
3238         (WebCore::MediaDevices::enumerateDevices): Use MediaDevicesRequest.
3239         * Modules/mediastream/MediaDevices.h: EnumerateDevicePromise -> EnumerateDevicesPromise.
3240         * Modules/mediastream/MediaDevices.idl:
3241
3242         * Modules/mediastream/MediaDevicesRequest.cpp: Added.
3243         (WebCore::MediaDevicesRequest::create):
3244         (WebCore::MediaDevicesRequest::MediaDevicesRequest):
3245         (WebCore::MediaDevicesRequest::~MediaDevicesRequest):
3246         (WebCore::MediaDevicesRequest::securityOrigin):
3247         (WebCore::MediaDevicesRequest::contextDestroyed):
3248         (WebCore::MediaDevicesRequest::start):
3249         (WebCore::MediaDevicesRequest::didCompleteRequest):
3250         (WebCore::MediaDevicesRequest::requestOrigin):
3251         * Modules/mediastream/MediaDevicesRequest.h: Added.
3252
3253         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
3254         (WebCore::MediaStreamTrackSourcesRequest::MediaStreamTrackSourcesRequest):
3255         (WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
3256         * Modules/mediastream/MediaStreamTrackSourcesRequest.h:
3257
3258         * Modules/mediastream/UserMediaRequest.cpp:
3259         (WebCore::UserMediaRequest::enumerateDevices): Deleted.
3260         * Modules/mediastream/UserMediaRequest.h:
3261
3262         * WebCore.xcodeproj/project.pbxproj: Add MediaDevicesRequest.cpp
3263
3264         * platform/mediastream/MediaDevicesPrivate.cpp: Removed.
3265         * platform/mediastream/MediaDevicesPrivate.h: Removed.
3266
3267         * platform/mediastream/MediaStreamCreationClient.h:
3268         * platform/mediastream/MediaStreamTrackSourcesRequestClient.h:
3269         (WebCore::MediaStreamTrackSourcesRequestClient::~MediaStreamTrackSourcesRequestClient):
3270
3271         * platform/mediastream/mac/AVCaptureDeviceManager.h:
3272         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3273         (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Optionally take an
3274           AVCaptureSession instead of always allocating one.
3275         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): Pass the AVCaptureSession
3276           to verifyConstraintsForMediaType.
3277
3278         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3279         (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources):
3280
3281         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3282         (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources):
3283
3284 2015-09-18  Chris Dumez  <cdumez@apple.com>
3285
3286         WebContent crash in WebCore::MemoryPressureHandler::releaseCriticalMemory() with GuardMalloc when preparing to suspend
3287         https://bugs.webkit.org/show_bug.cgi?id=149350
3288
3289         Reviewed by Antti Koivisto.
3290
3291         in MemoryPressureHandler::releaseCriticalMemory(), iterate over a copy of
3292         Document::allDocuments() instead of iterating over allDocuments() directly.
3293         Also make sure the Documents are ref'd inside the copy.
3294
3295         This is needed because clearing the StyleResolver of a Document may cause
3296         Documents to be unref'd and removed from the allDocument() HashSet.
3297
3298         No new tests, already covered by existing tests.
3299
3300         * platform/MemoryPressureHandler.cpp:
3301         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
3302
3303 2015-09-18  Brent Fulgham  <bfulgham@apple.com>
3304
3305         [Win] Unreviewed build fix.
3306
3307         Non-cmake build does not include quotes in the file path, so a search
3308         operation always failed.
3309
3310         * bindings/scripts/preprocessor.pm:
3311         (applyPreprocessor):
3312
3313 2015-09-18  Chris Dumez  <cdumez@apple.com>
3314
3315         REGRESSION (r182449, Mavericks ONLY): Pages re-open empty after swiping back and scrolling on them
3316         https://bugs.webkit.org/show_bug.cgi?id=149317
3317         <rdar://problem/22521514>
3318
3319         Reviewed by Tim Horton.
3320
3321         Disable on Mavericks a PageCache optimization from r182449 which lets
3322         into PageCache pages that only have certain types of pending loads
3323         (images and XHR). This is because it has been determined via bisection
3324         that this change is the one that introduced the bug on Mavericks.
3325
3326         * loader/DocumentLoader.cpp:
3327         (WebCore::areAllLoadersPageCacheAcceptable):
3328
3329 2015-09-18  Brent Fulgham  <bfulgham@apple.com>
3330
3331         [Win] Use tiled drawing for main background layer
3332         https://bugs.webkit.org/show_bug.cgi?id=149347
3333         <rdar://problem/22759632>
3334
3335         Reviewed by Alex Christensen.
3336
3337         Turn on tiled drawing for the root layer when using
3338         accelerated compositing on Windows. 
3339
3340         * page/Frame.h: Export the 'isMainFrame' method so that
3341         it can be used by WebKit.dll.
3342         * platform/graphics/ca/GraphicsLayerCA.cpp:
3343         (WebCore::GraphicsLayerCA::getDebugBorderInfo): Use a full
3344         pixel width on Windows, since it doesn't support High DPI (yet).
3345         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3346         (PlatformCALayerWin::create): Use nullptr.
3347         (toCACFFilterType): Ditto.
3348         (layerTreeHostForLayer): Ditto.
3349         (PlatformCALayer::platformCALayer): Ditto.
3350          (PlatformCALayerWin::PlatformCALayerWin): Use the correct contents scaling
3351         factor for new layers.
3352         (PlatformCALayerWin::animationForKey): Use nullptr.
3353         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
3354         (WebTiledBackingLayerWin::displayCallback): Update assertion to
3355         recognize LayerTypePageTiledBackingLayer as a valid layer to be used
3356         in this display routine.
3357
3358 2015-09-18  Chris Dumez  <cdumez@apple.com>
3359
3360         Drop support for Entity Node type
3361         https://bugs.webkit.org/show_bug.cgi?id=149239
3362
3363         Reviewed by Darin Adler.
3364
3365         Drop support for Entity DOM type. This legacy type has been dropped in
3366         DOM4:
3367         - https://dom.spec.whatwg.org/#dom-core-changes
3368
3369         Chrome [1] and Firefox [2] already dropped it. There is currently no
3370         way to construct an Entity Node in WebKit.
3371
3372         [1] https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/k3tZGP2EANc
3373         [2] https://developer.mozilla.org/en-US/docs/Web/API/Entity
3374
3375         No new tests, already covered by existing W3C test.
3376
3377         * DerivedSources.cpp:
3378         * WebCore.xcodeproj/project.pbxproj:
3379         * bindings/gobject/WebKitDOMPrivate.cpp:
3380         (WebKit::wrap): Deleted.
3381         * bindings/js/JSNodeCustom.cpp:
3382         (WebCore::createWrapperInline): Deleted.
3383         * bindings/objc/DOM.mm:
3384         (kitClass): Deleted.
3385         * dom/Document.cpp:
3386         (WebCore::Document::importNode): Deleted.
3387         (WebCore::Document::adoptNode): Deleted.
3388         (WebCore::Document::childTypeAllowed): Deleted.
3389         (WebCore::Document::canAcceptChild): Deleted.
3390         * dom/Entity.h:
3391         * dom/Entity.idl:
3392         * dom/Node.cpp:
3393         (WebCore::Node::isDefaultNamespace): Deleted.
3394         (WebCore::Node::lookupPrefix): Deleted.
3395         (WebCore::Node::lookupNamespaceURI): Deleted.
3396         (WebCore::appendTextContent): Deleted.
3397         (WebCore::Node::setTextContent): Deleted.
3398         * dom/Node.h:
3399         * dom/Range.cpp:
3400         (WebCore::lengthOfContentsInNode): Deleted.
3401         (WebCore::Range::processContentsBetweenOffsets): Deleted.
3402         (WebCore::Range::insertNode): Deleted.
3403         (WebCore::Range::checkNodeWOffset): Deleted.
3404         (WebCore::Range::checkNodeBA): Deleted.
3405         (WebCore::Range::selectNode): Deleted.
3406         (WebCore::Range::selectNodeContents): Deleted.
3407         (WebCore::Range::surroundContents): Deleted.
3408         * editing/MarkupAccumulator.cpp:
3409         (WebCore::MarkupAccumulator::appendStartMarkup): Deleted.
3410         * xml/XPathUtil.cpp:
3411         (WebCore::XPath::isValidContextNode): Deleted.
3412
3413 2015-09-17  Brian Burg  <bburg@apple.com>
3414
3415         ASSERT(!m_frontendRouter->hasLocalFrontend()) when running Web Inspector tests
3416         https://bugs.webkit.org/show_bug.cgi?id=149006
3417
3418         Reviewed by Joseph Pecoraro.
3419
3420         The patch fixes two defects:
3421
3422             (1) the stub inspector frontend is not closed reliably when a test times out
3423             (2) frontend clients and channels are sometimes connected to the wrong controllers
3424
3425         When an inspector test times out, the test runner requests (via the inspected page's controller)
3426         that the inspector close. But, the stub frontend works independently of InspectorClient,
3427         so the inspected page's InspectorController cannot close the stub frontend. The assertion
3428         failed because the stub frontend's channel was still connected to the inspe