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