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