Move document.defineElement to customElements.define
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-08-10  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Move document.defineElement to customElements.define
4         https://bugs.webkit.org/show_bug.cgi?id=160731
5
6         Reviewed by Chris Dumez.
7
8         Replaced Document.prototype.defineElement by CustomElementsRegistry.prototype.define to match
9         the latest HTML specification: https://html.spec.whatwg.org/#custom-elements-api 
10
11         This patch renames the existing CustomElementDefinitions to CustomElementsRegistry and exposes
12         it on window.customElements. CustomElementDefinitions is now owned by DOMWindow instead of
13         Document to match the spec's new semantics.
14
15         No new tests. The existing tests have been updated to reflect the change.
16
17         * DerivedSources.cpp:
18         * DerivedSources.make:
19         * WebCore.xcodeproj/project.pbxproj:
20         * bindings/js/JSCustomElementsRegistryCustom.cpp: Added.
21         (WebCore::JSCustomElementsRegistry::define): Moved from JSDocumentCustom. Removed the check for
22         the existence of DOMWindow since CustomElementsRegistry is an attribute on DOMWindow itself.
23         * bindings/js/JSDocumentCustom.cpp:
24         (WebCore::JSDocument::defineElement): Deleted.
25         * bindings/js/JSHTMLElementCustom.cpp: Added the code to check the existence of DOMWindow since
26         the registry is associated with DOMWindow, not Document.
27         (WebCore::constructJSHTMLElement):
28         * dom/CustomElementsRegistry.cpp: Renamed from Source/WebCore/dom/CustomElementDefinitions.cpp.
29         (WebCore::CustomElementsRegistry::create): Added.
30         (WebCore::CustomElementsRegistry::CustomElementsRegistry): Added.
31         (WebCore::CustomElementsRegistry::~CustomElementsRegistry): Added.
32         (WebCore::CustomElementsRegistry::addElementDefinition): Moved from CustomElementDefinitions.
33         (WebCore::CustomElementsRegistry::addUpgradeCandidate): Ditto.
34         (WebCore::CustomElementsRegistry::findInterface): Ditto.
35         (WebCore::CustomElementsRegistry::containsConstructor): Ditto.
36         * dom/CustomElementsRegistry.h: Renamed from Source/WebCore/dom/CustomElementDefinitions.h.
37         * dom/CustomElementsRegistry.idl: Added.
38         * dom/Document.cpp:
39         (WebCore::createUpgradeCandidateElement): Extracted out of createHTMLElementWithNameValidation
40         and createFallbackHTMLElement to share code.
41         (WebCore::createHTMLElementWithNameValidation):
42         (WebCore::createFallbackHTMLElement): This function was missing a check for the runtime flag.
43         Sharing code with createHTMLElementWithNameValidation via createUpgradeCandidateElement fixes it.
44         (WebCore::Document::ensureCustomElementDefinitions): Deleted.
45         * dom/Document.h:
46         (WebCore::Document::customElementDefinitions): Deleted.
47         * dom/Document.idl:
48         * dom/Element.cpp:
49         (WebCore::Element::attributeChanged):
50         * html/parser/HTMLConstructionSite.cpp:
51         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
52         * page/DOMWindow.cpp:
53         (WebCore::DOMWindow::ensureCustomElementsRegistry): Added. Moved from Document.
54         * page/DOMWindow.h:
55         * page/DOMWindow.idl: Added customElements on DOMWindow.
56
57 2016-08-10  Alex Christensen  <achristensen@webkit.org>
58
59         Fix WinCairo build after r204327.
60
61         * platform/network/NetworkStorageSessionStub.cpp:
62         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Renamed from create...
63         (WebCore::NetworkStorageSession::createPrivateBrowsingSession): Deleted.
64
65 2016-08-10  Nan Wang  <n_wang@apple.com>
66
67         AX: Media controls timeline should have percentage value description
68         https://bugs.webkit.org/show_bug.cgi?id=160619
69
70         Reviewed by Eric Carlson.
71
72         Added aria-valuetext attribute to the timeline slider and set its value to
73         the percentage format. Also formatted the elapsed/remaining timer's description
74         so that it's more human readable.
75
76         Test: http/tests/media/hls/video-duration-accessibility.html
77
78         * English.lproj/mediaControlsLocalizedStrings.js:
79         * Modules/mediacontrols/mediaControlsApple.js:
80         (Controller.prototype.drawVolumeBackground):
81         (Controller.prototype.formatTimeDescription):
82         (Controller.prototype.formatTime):
83         (Controller.prototype.updateTime):
84         (Controller.prototype.updateControlsWhileScrubbing):
85
86 2016-08-10  Anders Carlsson  <andersca@apple.com>
87
88         Revert back to the old style member function state machine for callbacks
89         https://bugs.webkit.org/show_bug.cgi?id=160756
90
91         Reviewed by Tim Horton.
92
93         This is another step towards merging SQLTransactionBackend and SQLTransaction,
94         and using a single state machine for both sides.
95
96         * Modules/webdatabase/SQLTransaction.cpp:
97         (WebCore::SQLTransaction::SQLTransaction):
98         (WebCore::SQLTransaction::performPendingCallback):
99         (WebCore::SQLTransaction::checkAndHandleClosedDatabase):
100         (WebCore::SQLTransaction::scheduleCallback):
101         (WebCore::SQLTransaction::openTransactionAndPreflight):
102         (WebCore::SQLTransaction::runCurrentStatement):
103         (WebCore::SQLTransaction::handleCurrentStatementError):
104         (WebCore::SQLTransaction::handleTransactionError):
105         (WebCore::SQLTransaction::postflightAndCommit):
106         (WebCore::SQLTransaction::debugStepName):
107         * Modules/webdatabase/SQLTransaction.h:
108
109 2016-08-09  Skachkov Oleksandr  <gskachkov@gmail.com>
110
111         [ES2016] Implement Object.values
112         https://bugs.webkit.org/show_bug.cgi?id=160410
113
114         Reviewed by Saam Barati, Yusuke Suzuki.
115
116         No new tests because all tests are implemented in JavaScriptCore 
117         and there is no behavior change.
118
119         * ForwardingHeaders/runtime/IterationKind.h: Added.
120         * bindings/js/SerializedScriptValue.cpp:
121         (WebCore::CloneSerializer::serialize):
122
123 2016-08-10  Anders Carlsson  <andersca@apple.com>
124
125         Move more functions to from SQLTransactionBackend to SQLTransaction
126         https://bugs.webkit.org/show_bug.cgi?id=160752
127
128         Reviewed by Tim Horton.
129
130         * Modules/webdatabase/SQLTransaction.cpp:
131         (WebCore::SQLTransaction::acquireLock):
132         (WebCore::SQLTransaction::openTransactionAndPreflight):
133         (WebCore::SQLTransaction::runStatements):
134         (WebCore::SQLTransaction::cleanupAndTerminate):
135         (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
136         * Modules/webdatabase/SQLTransaction.h:
137         * Modules/webdatabase/SQLTransactionBackend.cpp:
138         (WebCore::SQLTransactionBackend::acquireLock):
139         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
140         (WebCore::SQLTransactionBackend::runStatements):
141         (WebCore::SQLTransactionBackend::cleanupAndTerminate):
142         (WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):
143
144 2016-08-10  Anders Carlsson  <andersca@apple.com>
145
146         Begin moving member functions from SQLTransactionBackend to SQLTransaction
147         https://bugs.webkit.org/show_bug.cgi?id=160747
148
149         Reviewed by Tim Horton.
150
151         * Modules/webdatabase/Database.cpp:
152         (WebCore::Database::performClose):
153         * Modules/webdatabase/DatabaseTask.cpp:
154         (WebCore::DatabaseTransactionTask::~DatabaseTransactionTask):
155         (WebCore::DatabaseTransactionTask::doPerformTask):
156         * Modules/webdatabase/SQLTransaction.cpp:
157         (WebCore::SQLTransaction::executeSQL):
158         (WebCore::SQLTransaction::lockAcquired):
159         (WebCore::SQLTransaction::performNextStep):
160         (WebCore::SQLTransaction::performPendingCallback):
161         (WebCore::SQLTransaction::notifyDatabaseThreadIsShuttingDown):
162         (WebCore::SQLTransaction::enqueueStatement):
163         (WebCore::SQLTransaction::getNextStatement):
164         (WebCore::SQLTransaction::runCurrentStatement):
165         (WebCore::SQLTransaction::handleCurrentStatementError):
166         (WebCore::SQLTransaction::handleTransactionError):
167         (WebCore::SQLTransaction::postflightAndCommit):
168         (WebCore::SQLTransaction::acquireOriginLock):
169         (WebCore::SQLTransaction::releaseOriginLockIfNeeded):
170         * Modules/webdatabase/SQLTransaction.h:
171         (WebCore::SQLTransaction::backend): Deleted.
172         * Modules/webdatabase/SQLTransactionBackend.cpp:
173         (WebCore::SQLTransactionBackend::doCleanup):
174         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
175         (WebCore::SQLTransactionBackend::runStatements):
176         (WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):
177         (WebCore::SQLTransactionBackend::enqueueStatement): Deleted.
178         (WebCore::SQLTransactionBackend::performNextStep): Deleted.
179         (WebCore::SQLTransactionBackend::executeSQL): Deleted.
180         (WebCore::SQLTransactionBackend::lockAcquired): Deleted.
181         (WebCore::SQLTransactionBackend::getNextStatement): Deleted.
182         (WebCore::SQLTransactionBackend::runCurrentStatement): Deleted.
183         (WebCore::SQLTransactionBackend::handleCurrentStatementError): Deleted.
184         (WebCore::SQLTransactionBackend::handleTransactionError): Deleted.
185         (WebCore::SQLTransactionBackend::postflightAndCommit): Deleted.
186         (WebCore::SQLTransactionBackend::acquireOriginLock): Deleted.
187         (WebCore::SQLTransactionBackend::releaseOriginLockIfNeeded): Deleted.
188         * Modules/webdatabase/SQLTransactionBackend.h:
189         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
190         (WebCore::SQLTransactionCoordinator::processPendingTransactions):
191         (WebCore::SQLTransactionCoordinator::shutdown):
192
193 2016-08-10  Anders Carlsson  <andersca@apple.com>
194
195         Move all SQLTransactionBackend member variables to SQLTransaction
196         https://bugs.webkit.org/show_bug.cgi?id=160745
197
198         Reviewed by Tim Horton.
199
200         * Modules/webdatabase/ChangeVersionWrapper.cpp:
201         (WebCore::ChangeVersionWrapper::performPreflight):
202         (WebCore::ChangeVersionWrapper::performPostflight):
203         (WebCore::ChangeVersionWrapper::handleCommitFailedAfterPostflight):
204         * Modules/webdatabase/ChangeVersionWrapper.h:
205         (WebCore::ChangeVersionWrapper::sqlError): Deleted.
206         * Modules/webdatabase/SQLTransaction.cpp:
207         (WebCore::SQLTransaction::SQLTransaction):
208         (WebCore::SQLTransaction::deliverTransactionErrorCallback):
209         (WebCore::SQLTransaction::deliverStatementCallback):
210         (WebCore::SQLTransaction::deliverQuotaIncreaseCallback):
211         (WebCore::SQLTransaction::hasCallback): Deleted.
212         (WebCore::SQLTransaction::hasSuccessCallback): Deleted.
213         (WebCore::SQLTransaction::hasErrorCallback): Deleted.
214         * Modules/webdatabase/SQLTransaction.h:
215         (WebCore::SQLTransaction::isReadOnly):
216         * Modules/webdatabase/SQLTransactionBackend.cpp:
217         (WebCore::SQLTransactionBackend::SQLTransactionBackend):
218         (WebCore::SQLTransactionBackend::~SQLTransactionBackend):
219         (WebCore::SQLTransactionBackend::doCleanup):
220         (WebCore::SQLTransactionBackend::enqueueStatement):
221         (WebCore::SQLTransactionBackend::computeNextStateAndCleanupIfNeeded):
222         (WebCore::SQLTransactionBackend::executeSQL):
223         (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown):
224         (WebCore::SQLTransactionBackend::acquireLock):
225         (WebCore::SQLTransactionBackend::lockAcquired):
226         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
227         (WebCore::SQLTransactionBackend::runStatements):
228         (WebCore::SQLTransactionBackend::getNextStatement):
229         (WebCore::SQLTransactionBackend::runCurrentStatement):
230         (WebCore::SQLTransactionBackend::handleCurrentStatementError):
231         (WebCore::SQLTransactionBackend::handleTransactionError):
232         (WebCore::SQLTransactionBackend::postflightAndCommit):
233         (WebCore::SQLTransactionBackend::cleanupAndTerminate):
234         (WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):
235         (WebCore::SQLTransactionBackend::requestTransitToState):
236         (WebCore::SQLTransactionBackend::acquireOriginLock):
237         (WebCore::SQLTransactionBackend::releaseOriginLockIfNeeded):
238         (WebCore::SQLTransactionBackend::currentStatement): Deleted.
239         (WebCore::SQLTransactionBackend::transactionError): Deleted.
240         (WebCore::SQLTransactionBackend::setShouldRetryCurrentStatement): Deleted.
241         (WebCore::SQLTransactionBackend::enqueueStatementBackend): Deleted.
242         * Modules/webdatabase/SQLTransactionBackend.h:
243         (WebCore::SQLTransactionBackend::database): Deleted.
244         (WebCore::SQLTransactionBackend::isReadOnly): Deleted.
245         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
246         (WebCore::SQLTransactionCoordinator::processPendingTransactions):
247         (WebCore::SQLTransactionCoordinator::releaseLock):
248
249 2016-08-10  Simon Fraser  <simon.fraser@apple.com>
250
251         Sort the project file.
252
253         * WebCore.xcodeproj/project.pbxproj:
254
255 2016-08-10  Simon Fraser  <simon.fraser@apple.com>
256
257         Sort the feature flags in the FEATURE_DEFINES lines
258         https://bugs.webkit.org/show_bug.cgi?id=160742
259
260         Reviewed by Anders Carlsson.
261
262         * Configurations/FeatureDefines.xcconfig:
263
264 2016-08-10  Anders Carlsson  <andersca@apple.com>
265
266         Make SQLTransactionBackend a member of SQLTransaction
267         https://bugs.webkit.org/show_bug.cgi?id=160741
268
269         Reviewed by Tim Horton.
270
271         This is another step towards merging SQLTransaction and SQLTransactionBackend.
272
273         * Modules/webdatabase/Database.cpp:
274         (WebCore::Database::performClose):
275         (WebCore::Database::scheduleTransaction):
276         (WebCore::Database::scheduleTransactionStep):
277         (WebCore::Database::runTransaction):
278         * Modules/webdatabase/Database.h:
279         * Modules/webdatabase/DatabaseTask.cpp:
280         (WebCore::DatabaseTransactionTask::DatabaseTransactionTask):
281         (WebCore::DatabaseTransactionTask::~DatabaseTransactionTask):
282         (WebCore::DatabaseTransactionTask::doPerformTask):
283         * Modules/webdatabase/DatabaseTask.h:
284         (WebCore::DatabaseTransactionTask::transaction):
285         * Modules/webdatabase/DatabaseThread.cpp:
286         * Modules/webdatabase/SQLTransaction.cpp:
287         (WebCore::SQLTransaction::SQLTransaction):
288         (WebCore::SQLTransaction::deliverTransactionCallback):
289         (WebCore::SQLTransaction::deliverTransactionErrorCallback):
290         (WebCore::SQLTransaction::deliverStatementCallback):
291         (WebCore::SQLTransaction::deliverQuotaIncreaseCallback):
292         (WebCore::SQLTransaction::deliverSuccessCallback):
293         (WebCore::SQLTransaction::executeSQL):
294         (WebCore::SQLTransaction::computeNextStateAndCleanupIfNeeded):
295         (WebCore::SQLTransaction::setBackend): Deleted.
296         * Modules/webdatabase/SQLTransaction.h:
297         (WebCore::SQLTransaction::backend):
298         * Modules/webdatabase/SQLTransactionBackend.cpp:
299         (WebCore::SQLTransactionBackend::SQLTransactionBackend):
300         (WebCore::SQLTransactionBackend::doCleanup):
301         (WebCore::SQLTransactionBackend::computeNextStateAndCleanupIfNeeded):
302         (WebCore::SQLTransactionBackend::acquireLock):
303         (WebCore::SQLTransactionBackend::lockAcquired):
304         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
305         (WebCore::SQLTransactionBackend::runCurrentStatement):
306         (WebCore::SQLTransactionBackend::handleCurrentStatementError):
307         (WebCore::SQLTransactionBackend::handleTransactionError):
308         (WebCore::SQLTransactionBackend::postflightAndCommit):
309         (WebCore::SQLTransactionBackend::requestTransitToState):
310         (WebCore::SQLTransactionBackend::create): Deleted.
311         * Modules/webdatabase/SQLTransactionBackend.h:
312         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
313         (WebCore::getDatabaseIdentifier):
314         (WebCore::SQLTransactionCoordinator::processPendingTransactions):
315         (WebCore::SQLTransactionCoordinator::acquireLock):
316         (WebCore::SQLTransactionCoordinator::releaseLock):
317         (WebCore::SQLTransactionCoordinator::shutdown):
318         * Modules/webdatabase/SQLTransactionCoordinator.h:
319
320 2016-08-08  Simon Fraser  <simon.fraser@apple.com>
321
322         child-transform-with-anchor-point-expected.html renders incorrectly
323         https://bugs.webkit.org/show_bug.cgi?id=160616
324
325         Reviewed by Zalan Bujtas.
326         
327         If a layer has perspective, we need to ensure that its bounds don't collapse to 0x0 when clipped out,
328         otherwise the sublayerTransform geometry gets messed up.
329
330         Test: compositing/geometry/clipped-out-perspective.html
331
332         * rendering/RenderLayerBacking.cpp:
333         (WebCore::RenderLayerBacking::updateCompositedBounds):
334
335 2016-08-09  Sam Weinig  <sam@webkit.org>
336
337         Remove support for array types in IDLs
338         https://bugs.webkit.org/show_bug.cgi?id=160729
339
340         Reviewed by Anders Carlsson.
341
342         Array types have been removed from WebIDL in favor of sequence<> and FrozenArray<>.
343
344         - Replace all current uses of Array types with sequences. This causes
345           no functional change.
346
347         * bindings/scripts/CodeGenerator.pm:
348         * bindings/scripts/CodeGeneratorGObject.pm:
349         * bindings/scripts/CodeGeneratorJS.pm:
350         * bindings/scripts/IDLParser.pm:
351         Remove array support from the generators.
352
353         * Modules/gamepad/Gamepad.idl:
354         * Modules/gamepad/NavigatorGamepad.idl:
355         * Modules/gamepad/deprecated/Gamepad.idl:
356         * Modules/mediacontrols/MediaControlsHost.idl:
357         * Modules/mediastream/MediaStream.idl:
358         * Modules/mediastream/MediaTrackConstraints.idl:
359         * Modules/mediastream/RTCConfiguration.idl:
360         * Modules/mediastream/RTCIceServer.idl:
361         * Modules/mediastream/RTCTrackEvent.idl:
362         * crypto/CryptoKey.idl:
363         * dom/MessageEvent.idl:
364         * testing/Internals.idl:
365         Switch from array to sequence.
366
367 2016-08-10  Alex Christensen  <achristensen@webkit.org>
368
369         Use unsigned for locations in URL
370         https://bugs.webkit.org/show_bug.cgi?id=160706
371
372         Reviewed by Sam Weinig.
373
374         No change in behavior.
375
376         * platform/URL.cpp:
377         (WebCore::isSchemeFirstChar):
378         (WebCore::findFirstOf):
379         (WebCore::checkEncodedString):
380         (WebCore::URL::host):
381         (WebCore::URL::protocolIs):
382         (WebCore::URL::setPort):
383         (WebCore::URL::setUser):
384         (WebCore::URL::setPass):
385         (WebCore::escapeAndAppendNonHierarchicalPart):
386         (WebCore::copyPathRemovingDots):
387         (WebCore::URL::serialize):
388         (WebCore::isDefaultPortForScheme):
389         (WebCore::hostPortIsEmptyButCredentialsArePresent):
390         (WebCore::URL::parse):
391         (WebCore::protocolHostAndPortAreEqual):
392         (WebCore::hostsAreEqual):
393         (WebCore::protocolIs):
394         (WebCore::findHostnamesInMailToURL):
395         (WebCore::findHostnameInHierarchicalURL):
396         (WebCore::encodeHostnames):
397         (WebCore::encodeRelativeString):
398         * platform/URL.h:
399
400 2016-08-09  Anders Carlsson  <andersca@apple.com>
401
402         Move SQLTransactionBackend construction inside SQLTransaction
403         https://bugs.webkit.org/show_bug.cgi?id=160726
404
405         Reviewed by Tim Horton.
406
407         This is the first step towards re-merging SQLTransactionBackend and SQLTransaction and clean up the code.
408
409         * Modules/webdatabase/ChangeVersionWrapper.cpp:
410         * Modules/webdatabase/ChangeVersionWrapper.h:
411         * Modules/webdatabase/Database.cpp:
412         (WebCore::Database::performClose):
413         (WebCore::Database::scheduleTransactionStep):
414         (WebCore::Database::changeVersion):
415         (WebCore::Database::transaction):
416         (WebCore::Database::readTransaction):
417         (WebCore::Database::runTransaction):
418         * Modules/webdatabase/Database.h:
419         * Modules/webdatabase/DatabaseTask.cpp:
420         * Modules/webdatabase/SQLTransaction.cpp:
421         (WebCore::SQLTransaction::create):
422         (WebCore::SQLTransaction::SQLTransaction):
423         * Modules/webdatabase/SQLTransaction.h:
424         (WebCore::SQLTransactionWrapper::~SQLTransactionWrapper):
425         (WebCore::SQLTransaction::backend):
426         * Modules/webdatabase/SQLTransactionBackend.cpp:
427         (WebCore::SQLTransactionBackend::lockAcquired):
428         (WebCore::SQLTransactionBackend::requestTransitToState):
429         * Modules/webdatabase/SQLTransactionBackend.h:
430         (WebCore::SQLTransactionWrapper::~SQLTransactionWrapper): Deleted.
431
432 2016-08-10  Chris Dumez  <cdumez@apple.com>
433
434         It should be possible to re-initialize a MutationEvent after it's been dispatched
435         https://bugs.webkit.org/show_bug.cgi?id=160703
436
437         Reviewed by Sam Weinig.
438
439         It should be possible to re-initialize a MutationEvent after it's been dispatched,
440         similarly to Event:
441         - https://www.w3.org/TR/2015/WD-uievents-20151215/#widl-MutationEvent-initMutationEvent
442
443         Test: fast/events/initMutationEvent-after-dispatch.html
444
445         * dom/MutationEvent.cpp:
446         (WebCore::MutationEvent::initMutationEvent):
447
448 2016-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
449
450         [ES6] Add ModuleLoaderPrototype and move methods to it
451         https://bugs.webkit.org/show_bug.cgi?id=160633
452
453         Reviewed by Saam Barati.
454
455         No behavior change.
456
457         * ForwardingHeaders/runtime/JSModuleLoader.h: Added.
458         * bindings/js/JSDOMWindowBase.cpp:
459         (WebCore::JSDOMWindowBase::moduleLoaderResolve):
460         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
461         (WebCore::JSDOMWindowBase::moduleLoaderEvaluate):
462         * bindings/js/JSDOMWindowBase.h:
463         * bindings/js/JSModuleLoader.cpp:
464         (WebCore::JSModuleLoader::resolve):
465         (WebCore::JSModuleLoader::fetch):
466         (WebCore::JSModuleLoader::evaluate):
467         * bindings/js/JSModuleLoader.h:
468
469 2016-08-10  Per Arne Vollan  <pvollan@apple.com>
470
471         [Win] Warning fix.
472         https://bugs.webkit.org/show_bug.cgi?id=160687
473
474         Reviewed by Sam Weinig.
475
476         Avoid forward declarations with different dll linkage.
477
478         * platform/spi/cf/CFNetworkSPI.h:
479
480 2016-08-10  Per Arne Vollan  <pvollan@apple.com>
481
482         [Win] Warning fix.
483         https://bugs.webkit.org/show_bug.cgi?id=160690
484
485         Reviewed by Sam Weinig.
486
487         Use static cast to convert from enum to unsigned.
488
489         * platform/network/ProtectionSpaceHash.h:
490         (WebCore::ProtectionSpaceHash::hash):
491
492 2016-08-09  Alex Christensen  <achristensen@webkit.org>
493
494         Move NetworkStorageSession management to WebCore
495         https://bugs.webkit.org/show_bug.cgi?id=160173
496
497         Reviewed by Brady Eidson.
498
499         No new tests.  No change in behaviour.
500         Just moving the mapping from SessionID to NetworkStorageSession so we can use it from WebCore.
501         I need this so we can get to the NetworkStorageSession from SocketStreamHandle without requiring a NetworkingContext.
502
503         * CMakeLists.txt:
504         * WebCore.xcodeproj/project.pbxproj:
505         * loader/CookieJar.cpp:
506         * platform/network/NetworkStorageSession.cpp: Added.
507         (WebCore::globalSessionMap):
508         (WebCore::NetworkStorageSession::storageSession):
509         (WebCore::NetworkStorageSession::destroySession):
510         (WebCore::NetworkStorageSession::forEach):
511         Moved from forEachNetworkStorageSession and fixed the FIXME.  This function now includes the default NetworkStorageSession.
512         * platform/network/NetworkStorageSession.h:
513         * platform/network/NetworkingContext.h:
514         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
515         (WebCore::NetworkStorageSession::defaultStorageSession):
516         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
517         (WebCore::NetworkStorageSession::cookieStorage):
518         (WebCore::NetworkStorageSession::createPrivateBrowsingSession): Deleted.
519         * platform/network/cf/SocketStreamHandleCFNet.cpp:
520         * platform/network/soup/CookieJarSoup.cpp:
521         * platform/network/soup/NetworkStorageSessionSoup.cpp:
522         (WebCore::NetworkStorageSession::defaultStorageSession):
523         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
524         (WebCore::NetworkStorageSession::switchToNewTestingSession):
525         (WebCore::NetworkStorageSession::createPrivateBrowsingSession): Deleted.
526         * platform/network/soup/ResourceHandleSoup.cpp:
527
528 2016-08-09  Chris Dumez  <cdumez@apple.com>
529
530         Optimization in Node.replaceChild() is not spec-compliant
531         https://bugs.webkit.org/show_bug.cgi?id=160730
532
533         Reviewed by Ryosuke Niwa.
534
535         We have an optimization in Node.replaceChild() to avoid doing any work
536         when the reference child and the new child are the same node. This
537         optimization is not spec-compliant:
538         - https://dom.spec.whatwg.org/#concept-node-replace
539
540         This is an issue because it is observable via Mutation observers /
541         listeners or DOM ranges.
542
543         To address the issue, this patch drops the optimization. This is
544         probably not common enough to be worth optimizing for. However,
545         if it turns out to regress performance of things we care about,
546         we can fall back to do the optimization only in cases where it
547         is not observable.
548
549         No new tests, rebaselined existing tests.
550
551         * dom/ContainerNode.cpp:
552         (WebCore::ContainerNode::replaceChild):
553         1. Drop the oldChild == newChild optimization which is not in the
554            specification.
555         2. Add a null check for oldChild.parentNode() before trying to
556            remove it from its parent, as per step 12 of the specification.
557            oldChild.parentNode() is null when oldChild is newChild.
558         3. Make sure we enqueue separate mutation records for the adoption
559            of newNode into parent's node document and for the removal of
560            oldChild / insertion of newChild. This is mandated by the
561            specification (steps 10 and 15). Without this change, the
562            following test would still not pass after dropping the
563            optimization:
564            imported/w3c/web-platform-tests/dom/nodes/MutationObserver-childList.html
565
566 2016-08-09  Chris Dumez  <cdumez@apple.com>
567
568         Optimization in Node::appendChild() is not spec-compliant
569         https://bugs.webkit.org/show_bug.cgi?id=160728
570
571         Reviewed by Ryosuke Niwa.
572
573         We have an optimization in Node::appendChild() that avoid doing any work
574         if the node to be appended is already the last child. This optimization
575         is not spec-compliant:
576         - https://dom.spec.whatwg.org/#dom-node-appendchild
577
578         The issue is that this is observable via DOM Mutation observers / listeners
579         or DOM ranges.
580
581         To address the issue, this patch drops the optimization in appendChild().
582         This seems like an odd case to optimize for as I am not convinced it is
583         common to call parent.appendChild(parent.lastChild). If it turns out to
584         regress the performance of things we care about though, we could fall
585         back to do the optimization only when it is not observable.
586
587         Test: fast/dom/Node/appendChild-no-op-mutationobserver.html
588
589         * dom/ContainerNode.cpp:
590         (WebCore::ContainerNode::appendChild): Deleted.
591
592 2016-08-09  Anders Carlsson  <andersca@apple.com>
593
594         Instantiate WebKit plug-ins at layout time, instead of at style resolution time
595         https://bugs.webkit.org/show_bug.cgi?id=160715
596
597         Reviewed by Tim Horton.
598
599         This gets rid of the differentiation of WebKit plug-ins and Netscape plug-ins, and
600         always instantiates plug-ins at layout time.
601         
602         Initially, plug-ins were always instantiated after style recalc, but that lead to bugs
603         where plug-ins wouldn't be instantiated with their correct size. Fixing that bug lead
604         to a regression in the Web Clip widget which is why the special casing was introduced.
605         
606         The Web Clip widget has now been fixed, so we can get rid of the special case.
607
608         * html/HTMLAppletElement.cpp:
609         (WebCore::HTMLAppletElement::updateWidget):
610         * html/HTMLAppletElement.h:
611         * html/HTMLEmbedElement.cpp:
612         (WebCore::HTMLEmbedElement::updateWidget):
613         * html/HTMLEmbedElement.h:
614         * html/HTMLObjectElement.cpp:
615         (WebCore::HTMLObjectElement::updateWidget):
616         * html/HTMLObjectElement.h:
617         * html/HTMLPlugInImageElement.cpp:
618         (WebCore::HTMLPlugInImageElement::isImageType):
619         (WebCore::HTMLPlugInImageElement::wouldLoadAsPlugIn):
620         (WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary):
621         (WebCore::HTMLPlugInImageElement::wouldLoadAsNetscapePlugin): Deleted.
622         * html/HTMLPlugInImageElement.h:
623         * loader/EmptyClients.h:
624         * loader/FrameLoaderTypes.h:
625         * loader/SubframeLoader.cpp:
626         (WebCore::SubframeLoader::shouldUsePlugin):
627         * page/FrameView.cpp:
628         (WebCore::FrameView::updateEmbeddedObject):
629
630 2016-08-09  Chris Dumez  <cdumez@apple.com>
631
632         Unreviewed, fix assertions after r204311.
633
634         Range::textNodeSplit() can now get called with a node that
635         does not have a nextSibling(), in the case where this node
636         does not have a parent.
637
638         * dom/Range.cpp:
639         (WebCore::Range::textNodeSplit):
640
641 2016-08-09  Chris Dumez  <cdumez@apple.com>
642
643         CharacterData.data setter optimization is not spec-compliant and is observable
644         https://bugs.webkit.org/show_bug.cgi?id=160712
645
646         Reviewed by Ryosuke Niwa.
647
648         We have an optimization in CharacterData.setData() that avoid doing any
649         work if the new data is identical to the old data. However, this
650         optimization is not spec-compliant:
651         - https://dom.spec.whatwg.org/#dom-characterdata-data
652
653         This is an issue because this is observable using DOM mutation observer
654         or ranges.
655
656         To address the issue, we now:
657         1. Only use the optimization if there are not DOM mutation observers /
658            listeners on the page.
659         2. We now update the associated range when we use the fast path as well.
660
661         Test: fast/dom/Text/setData-no-op-mutation.html
662
663         * dom/CharacterData.cpp:
664         (WebCore::canUseSetDataOptimization):
665         (WebCore::CharacterData::setData):
666
667 2016-08-09  George Ruan  <gruan@apple.com>
668
669         Implement functionality of media capture on iOS
670         https://bugs.webkit.org/show_bug.cgi?id=158945
671         <rdar://problem/26893343>
672
673         Reviewed by Tim Horton.
674
675         No new tests, feature requires user gesture which we are unable to
676         test currently.
677
678         * Configurations/FeatureDefines.xcconfig: Enable Media Capture feature
679         for iOS.
680         * html/FileInputType.cpp:
681         (WebCore::FileInputType::handleDOMActivateEvent): Modified call for
682         mediaCaptureType property.
683         * html/HTMLInputElement.cpp:
684         (WebCore::HTMLInputElement::mediaCaptureType): Returns
685         MediaCaptureType according to the value of the capture attribute on
686         the HTMLInputElement.
687         (WebCore::HTMLInputElement::shouldUseMediaCapture): Deleted.
688         * html/HTMLInputElement.h:
689         * html/HTMLInputElement.idl: As the capture attribute is specified as
690         a boolean attribute in the Media Capture spec, this is a non-standard
691         web-facing change with accordance to the proposal #1102. We would like
692         to be able to specify a capture device to pull up upon interaction
693         with the input type file element. In favor of not introducing a new
694         attribute to specify the capture device, we reuse the capture
695         attribute with a set of enumerated values (user, environment, none) to
696         specify the desired media capture behavior.
697         * platform/FileChooser.h: Created enum MediaCaptureType representing
698         whether the front or rear camera shoul dbe shown when the capture
699         attribute is specified.
700
701 2016-08-09  Chris Dumez  <cdumez@apple.com>
702
703         Calling splitText() on a parent-less Text node should update associated ranges
704         https://bugs.webkit.org/show_bug.cgi?id=160710
705
706         Reviewed by Ryosuke Niwa.
707
708         Calling splitText() on a parent-less Text node should update associated ranges:
709         - https://dom.spec.whatwg.org/#concept-text-split (Step 9)
710
711         Previously, we would only update ranges for Text nodes that have a parent.
712
713         No new tests, rebaselined existing test.
714
715         * dom/Range.cpp:
716         (WebCore::boundaryTextNodesSplit):
717         (WebCore::Range::textNodeSplit): Deleted.
718         * dom/Text.cpp:
719         (WebCore::Text::splitText):
720
721 2016-08-09  Chris Dumez  <cdumez@apple.com>
722
723         Drop unused NodeListsNodeData::isEmpty()
724         https://bugs.webkit.org/show_bug.cgi?id=160704
725
726         Reviewed by Ryosuke Niwa.
727
728         Drop unused NodeListsNodeData::isEmpty(). Its implementation is incorrect
729         anyway because it fails to check if the m_childNodeList / m_emptyChildNodeList
730         members are null.
731
732         * dom/NodeRareData.h:
733         (WebCore::NodeListsNodeData::isEmpty): Deleted.
734
735 2016-08-06  Sam Weinig  <sam@webkit.org>
736
737         Replace NodeOrString with std::variant<Ref<Node>, String>
738         https://bugs.webkit.org/show_bug.cgi?id=160638
739
740         Reviewed by Anders Carlsson.
741
742         * WebCore.xcodeproj/project.pbxproj:
743         Remove NodeOrString.h/cpp
744
745         * bindings/js/JSNodeOrString.cpp:
746         * bindings/js/JSNodeOrString.h:
747         * dom/ContainerNode.cpp:
748         (WebCore::ContainerNode::append):
749         (WebCore::ContainerNode::prepend):
750         * dom/ContainerNode.h:
751         * dom/Node.cpp:
752         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
753         (WebCore::firstFollowingSiblingNotInNodeSet):
754         (WebCore::Node::convertNodesOrStringsIntoNode):
755         (WebCore::Node::before):
756         (WebCore::Node::after):
757         (WebCore::Node::replaceWith):
758         * dom/Node.h:
759         Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode
760         into Node.
761
762         * dom/NodeOrString.cpp: Removed.
763         * dom/NodeOrString.h: Removed.
764
765 2016-08-09  Chris Dumez  <cdumez@apple.com>
766
767         It should be possible to re-initialize a CustomEvent after it's been dispatched
768         https://bugs.webkit.org/show_bug.cgi?id=160664
769
770         Reviewed by Darin Adler.
771
772         It should be possible to re-initialize a CustomEvent after it's been dispatched:
773         - https://dom.spec.whatwg.org/#dom-customevent-initcustomevent
774
775         Test: fast/events/initCustomEvent-after-dispatch.html
776
777         * dom/CustomEvent.cpp:
778         (WebCore::CustomEvent::initCustomEvent):
779
780 2016-08-09  Anders Carlsson  <andersca@apple.com>
781
782         Get rid of PluginStrategy
783         https://bugs.webkit.org/show_bug.cgi?id=160696
784
785         Reviewed by Dan Bernstein.
786
787         * WebCore.xcodeproj/project.pbxproj:
788         * loader/EmptyClients.cpp:
789         * platform/PlatformStrategies.h:
790         (WebCore::PlatformStrategies::pluginStrategy): Deleted.
791         * plugins/PluginInfoProvider.h:
792         * plugins/PluginStrategy.h: Removed.
793         (WebCore::PluginStrategy::~PluginStrategy): Deleted.
794
795 2016-08-08  Myles C. Maxfield  <mmaxfield@apple.com>
796
797         Ensure StringView lifetime is correct inside InlineTextBox
798         https://bugs.webkit.org/show_bug.cgi?id=160584
799
800         Reviewed by Darin Adler.
801
802         A TextRun contains a StringView. Previously, we had a helper function which
803         could possibly create a new string, and then create a TextRun whose StringView
804         pointed inside this new string. Then, the string would be destroyed because it
805         was on the stack.
806
807         Luckily, this is benign because this new string would always share a
808         StringImpl with the string passed into the function (and the StringView
809         would point into this StringImpl). However, relying on this is dangerous
810         and we are trying to enforce StringView lifetime checks in
811         https://bugs.webkit.org/show_bug.cgi?id=160384.
812
813         The solution is to make a helper function which returns this built string
814         so that the caller can own this built string, thereby extending its lifetime.
815         Unfortunately, this built string can't be a StringView because the same
816         mechanism must be used for text-combine, which returns originalText(), which
817         may return a built string if it is a RenderCounter. Perhaps it would be
818         valuable to migrate RenderCounter::originalText() to something else, or to
819         divorce text-combine from originalText(), but that is out of scope for this
820         patch. Similarly, hyphenation uses this same mechanism, but because the
821         hyphenated string needs to be created, we must own the string storage (so
822         StringView is incorrect here).
823
824         Another reason is for performance: StringView::substring() is faster to use
825         than String::substringSharingImpl(), since it does not allocate and destroy a
826         StringImpl on the heap. This patch migrates away from
827         String::substringSharingImpl() and onto StringView::substring().
828
829         No new tests because there is no behavior change.
830
831         * rendering/InlineTextBox.cpp:
832         (WebCore::InlineTextBox::localSelectionRect):
833         (WebCore::InlineTextBox::paint):
834         (WebCore::InlineTextBox::selectionStartEnd):
835         (WebCore::InlineTextBox::paintSelection):
836         (WebCore::InlineTextBox::hyphenatedStringForTextRun):
837         (WebCore::InlineTextBox::constructTextRun):
838         * rendering/InlineTextBox.h:
839         * rendering/RenderCombineText.cpp:
840         (WebCore::RenderCombineText::maybeGetCombinedStringForRendering):
841         (WebCore::RenderCombineText::getStringToRender): Deleted.
842         * rendering/RenderCombineText.h:
843
844 2016-08-08  Jeremy Jones  <jeremyj@apple.com>
845
846         Clear fullscreen mode state after exiting fullscreen mode to keep state in sync.
847         https://bugs.webkit.org/show_bug.cgi?id=160668
848
849         Reviewed by Jon Lee.
850
851         When exiting fullscreen while in auto picture in picture mode, fullscreen mode gets
852         out of sync, causing exit fullscreen to fail. This change updates the state 
853         to keep it correct.
854
855         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
856         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
857
858 2016-08-08  Chris Dumez  <cdumez@apple.com>
859
860         [Web IDL] We should resolve typedefs for dictionary members
861         https://bugs.webkit.org/show_bug.cgi?id=160675
862
863         Reviewed by Sam Weinig.
864
865         Resolve typedefs for dictionary member types.
866
867         Added bindings test coverage.
868
869         * bindings/scripts/IDLParser.pm:
870         (applyTypedefs):
871         * bindings/scripts/test/JS/JSTestObj.cpp:
872         (WebCore::convert<TestObj::Dictionary>):
873         * bindings/scripts/test/TestObj.idl:
874
875 2016-08-08  Anders Carlsson  <andersca@apple.com>
876
877         Fix the Windows build.
878
879         * plugins/PluginInfoProvider.h:
880
881 2016-08-08  Anders Carlsson  <andersca@apple.com>
882
883         Add a new PluginInfoProvider class, to replace PluginStrategy
884         https://bugs.webkit.org/show_bug.cgi?id=160670
885
886         Reviewed by Sam Weinig.
887
888         Add a per page PluginInfoProvider class that's going to ultimately replace the plug-in strategy.
889
890         * WebCore.xcodeproj/project.pbxproj:
891         * loader/EmptyClients.cpp:
892         (WebCore::fillWithEmptyClients):
893         * page/Page.cpp:
894         (WebCore::Page::Page):
895         (WebCore::Page::~Page):
896         (WebCore::Page::refreshPlugins):
897         (WebCore::Page::pluginData):
898         (WebCore::Page::pluginInfoProvider):
899         * page/Page.h:
900         * page/PageConfiguration.cpp:
901         * page/PageConfiguration.h:
902         * plugins/DOMPluginArray.cpp:
903         (WebCore::DOMPluginArray::refresh):
904         * plugins/DOMPluginArray.h:
905         * plugins/PluginData.cpp:
906         (WebCore::PluginData::PluginData):
907         (WebCore::PluginData::webVisiblePlugins):
908         (WebCore::PluginData::publiclyVisiblePlugins):
909         (WebCore::PluginData::initPlugins):
910         (WebCore::PluginData::refresh): Deleted.
911         * plugins/PluginData.h:
912         (WebCore::PluginData::create):
913         (WebCore::PluginData::PluginData): Deleted.
914         * plugins/PluginInfoProvider.cpp: Added.
915         (WebCore::PluginInfoProvider::~PluginInfoProvider):
916         (WebCore::PluginInfoProvider::addPage):
917         (WebCore::PluginInfoProvider::removePage):
918         * plugins/PluginInfoProvider.h: Added.
919         * replay/SerializationMethods.cpp:
920         (JSC::EncodingTraits<PluginData>::decodeValue):
921         (JSC::DeserializedPluginData::DeserializedPluginData): Deleted.
922
923 2016-08-08  John Wilander  <wilander@apple.com>
924
925         Popups opened from a sandboxed iframe should themselves be sandboxed
926         https://bugs.webkit.org/show_bug.cgi?id=134850
927         <rdar://problem/27375388>
928
929         Reviewed by Brent Fulgham.
930
931         Test: http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox.html
932
933         * loader/FrameLoader.cpp:
934         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
935             Now copies the opener's frame loader effective sandbox flags to the
936             new frame loader.
937
938 2016-08-08  Chris Dumez  <cdumez@apple.com>
939
940         Align Selection API with the specification
941         https://bugs.webkit.org/show_bug.cgi?id=160663
942
943         Reviewed by Ryosuke Niwa.
944
945         Align Selection API with the specification:
946         - https://www.w3.org/TR/selection-api/#idl-def-Selection
947
948         In particular, the following changes were made:
949         - Mark parameters as non-nullable when they should be.
950         - Mark parameters as mandatory when they should be.
951         - Use "unsigned long" type for offsets instead of "long".
952
953         This aligns our behavior with Firefox and Chrome.
954
955         Note that the Node parameters to setBaseAndExtent() operation were kept
956         nullable, which does not match the specification. This is intentional
957         as I worry about compatibility risk, especially considering they are
958         still nullable in Chrome. Only Firefox marks them as non-nullable.
959
960         Test: editing/selection/bad-input.html
961
962         * dom/Position.h:
963         (WebCore::Position::LegacyEditingOffset::value):
964         (WebCore::Position::LegacyEditingOffset::LegacyEditingOffset):
965         (WebCore::createLegacyEditingPosition):
966         * page/DOMSelection.cpp:
967         (WebCore::DOMSelection::anchorOffset):
968         (WebCore::DOMSelection::focusOffset):
969         (WebCore::DOMSelection::baseOffset):
970         (WebCore::DOMSelection::extentOffset):
971         (WebCore::DOMSelection::rangeCount):
972         (WebCore::DOMSelection::collapse):
973         (WebCore::DOMSelection::setBaseAndExtent):
974         (WebCore::DOMSelection::setPosition):
975         (WebCore::DOMSelection::extend):
976         (WebCore::DOMSelection::getRangeAt):
977         (WebCore::DOMSelection::addRange):
978         (WebCore::DOMSelection::deleteFromDocument):
979         (WebCore::DOMSelection::containsNode):
980         (WebCore::DOMSelection::selectAllChildren):
981         (WebCore::DOMSelection::shadowAdjustedOffset):
982         (WebCore::DOMSelection::modify): Deleted.
983         (WebCore::DOMSelection::shadowAdjustedNode): Deleted.
984         (WebCore::DOMSelection::isValidForPosition): Deleted.
985         * page/DOMSelection.h:
986         * page/DOMSelection.idl:
987
988 2016-08-08  Chris Dumez  <cdumez@apple.com>
989
990         Regression(r204239): Caused flaky crashes under ~Database()
991         https://bugs.webkit.org/show_bug.cgi?id=160665
992         <rdar://problem/27748065>
993
994         Reviewed by Brady Eidson.
995
996         Make sure the scriptExecution context only gets ref'd / deref'd
997         on the context thread. Document / WorkerGlobalScope are not
998         ThreadSafeRefCounted.
999
1000         No new tests, already covered by:
1001         storage/websql/open-database-creation-callback.html
1002
1003         * Modules/webdatabase/Database.cpp:
1004         (WebCore::Database::~Database):
1005
1006 2016-08-08  John Wilander  <wilander@apple.com>
1007
1008         Don't set document.domain to an IP address fragment
1009         https://bugs.webkit.org/show_bug.cgi?id=126045
1010         <rdar://problem/27331794>
1011
1012         Reviewed by Daniel Bates.
1013
1014         This patch matches the following Blink one:
1015         https://chromium.googlesource.com/chromium/blink//b19a57fdb323d5a80d3a1cb0a6b343558c4237b0
1016
1017         IP address octets should not be treated as subdomains when setting
1018         document.domain. The specs say:
1019         'The domain attribute's setter must run these steps: ...
1020         7. If host is not equal to effectiveDomain, then run these substeps:
1021             1. If host or effectiveDomain is not a domain, then throw a
1022             "SecurityError" DOMException.'
1023         https://html.spec.whatwg.org/multipage/browsers.html#relaxing-the-same-origin-restriction
1024         Last Updated 5 August 2016
1025
1026         'A host is a domain, an IPv4 address, or an IPv6 address.'
1027         https://url.spec.whatwg.org/#concept-domain
1028         Last Updated 28 July 2016
1029
1030         Test: http/tests/security/set-domain-remove-subdomain-for-ip-address.html
1031
1032         * dom/Document.cpp:
1033         (WebCore::Document::setDomain):
1034             Now checks whether the security origin is allowed to remove
1035             subdomains. If not, it throws a security error.
1036         * page/OriginAccessEntry.cpp:
1037         (WebCore::OriginAccessEntry::OriginAccessEntry):
1038             Constructor now expects an IP address setting.
1039         (WebCore::OriginAccessEntry::matchesOrigin):
1040             Now also checks whether the host in an IP address and returns
1041             false if IP addresses aren't configured to be treated as domains.
1042         * page/OriginAccessEntry.h:
1043             Introduced new enum for IP address setting.
1044             Constructor now expects an IP address setting.
1045         (WebCore::OriginAccessEntry::ipAddressSettings):
1046             New getter.
1047         (WebCore::operator==):
1048             Now also requires IP address settings to match.
1049         * page/SecurityPolicy.cpp:
1050         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
1051             Changes to match OriginAccessEntry's new constructor.
1052         (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
1053             Changes to match OriginAccessEntry's new constructor.
1054         * page/Settings.in:
1055             Added a setting to allow IP address octets to be treated as
1056             subdomains. This way our existing tests setting document.domain
1057             still work.
1058
1059 2016-08-04  Anders Carlsson  <andersca@apple.com>
1060
1061         Remove more unused bindings code
1062         https://bugs.webkit.org/show_bug.cgi?id=160568
1063
1064         Reviewed by Sam Weinig.
1065
1066         * CMakeLists.txt:
1067         * DerivedSources.make:
1068         * WebCore.xcodeproj/project.pbxproj:
1069         * bindings/objc/DOMDocument.mm:
1070         (-[DOMDocument execCommand:userInterface:]):
1071         (-[DOMDocument execCommand:]):
1072         (-[DOMDocument getMatchedCSSRules:pseudoElement:]):
1073         * bindings/objc/DOMHTMLBaseFontElement.mm:
1074         * bindings/objc/DOMHTMLCollection.mm:
1075         (-[DOMHTMLCollection tags:]):
1076         * bindings/objc/DOMWheelEvent.mm:
1077         (-[DOMWheelEvent isHorizontal]):
1078         * css/RGBColor.idl:
1079         * dom/Attr.idl:
1080         * dom/DOMImplementation.idl:
1081         * dom/Document.h:
1082         * dom/Document.idl:
1083         * dom/Element.idl:
1084         * dom/EventException.h: Removed.
1085         (WebCore::EventException::EventException): Deleted.
1086         * dom/EventException.idl: Removed.
1087         * dom/KeyboardEvent.idl:
1088         * dom/MessageEvent.cpp:
1089         (WebCore::MessageEvent::messagePort): Deleted.
1090         (WebCore::MessageEvent::initMessageEvent): Deleted.
1091         * dom/MessageEvent.h:
1092         * dom/MessagePort.cpp:
1093         (WebCore::MessagePort::postMessage): Deleted.
1094         * dom/MessagePort.h:
1095         * dom/Node.idl:
1096         * dom/NodeFilter.idl:
1097         * dom/OverflowEvent.idl:
1098         * dom/WheelEvent.h:
1099         * dom/WheelEvent.idl:
1100         * html/HTMLAllCollection.cpp:
1101         (WebCore::HTMLAllCollection::tags):
1102         * html/HTMLAllCollection.h:
1103         * html/HTMLAnchorElement.idl:
1104         * html/HTMLAreaElement.idl:
1105         * html/HTMLBaseFontElement.cpp: Removed.
1106         (WebCore::HTMLBaseFontElement::HTMLBaseFontElement): Deleted.
1107         * html/HTMLBaseFontElement.h: Removed.
1108         * html/HTMLBaseFontElement.idl: Removed.
1109         * html/HTMLButtonElement.idl:
1110         * html/HTMLCanvasElement.idl:
1111         * html/HTMLCollection.cpp:
1112         (WebCore::HTMLCollection::tags): Deleted.
1113         * html/HTMLCollection.h:
1114         * html/HTMLCollection.idl:
1115         * html/HTMLElement.idl:
1116         * html/HTMLFieldSetElement.idl:
1117         * html/HTMLFormElement.idl:
1118         * html/HTMLHyperlinkElementUtils.idl:
1119         * html/HTMLIFrameElement.idl:
1120         * html/HTMLImageElement.idl:
1121         * html/HTMLInputElement.idl:
1122         * html/HTMLLabelElement.idl:
1123         * html/HTMLLegendElement.idl:
1124         * html/HTMLLinkElement.idl:
1125         * html/HTMLMediaElement.idl:
1126         * html/HTMLObjectElement.idl:
1127         * html/HTMLOptionsCollection.idl:
1128         * html/HTMLSelectElement.idl:
1129         * html/HTMLTableCellElement.idl:
1130         * html/HTMLTextAreaElement.idl:
1131         * page/DOMWindow.cpp:
1132         (WebCore::DOMWindow::postMessage): Deleted.
1133         * page/DOMWindow.h:
1134         * workers/DedicatedWorkerGlobalScope.cpp:
1135         (WebCore::DedicatedWorkerGlobalScope::postMessage): Deleted.
1136         * workers/DedicatedWorkerGlobalScope.h:
1137         * workers/Worker.cpp:
1138         (WebCore::Worker::postMessage): Deleted.
1139         * workers/Worker.h:
1140
1141 2016-08-08  Brady Eidson  <beidson@apple.com>
1142
1143         Addressing late review feedback in bug 160605
1144         https://bugs.webkit.org/show_bug.cgi?id=160605
1145
1146         Reviewed by Darin's suggestions.
1147
1148         * Modules/gamepad/GamepadManager.cpp:
1149         (WebCore::GamepadManager::maybeStartMonitoringGamepads):
1150         (WebCore::GamepadManager::maybeStopMonitoringGamepads):
1151         
1152         * platform/gamepad/EmptyGamepadProvider.cpp:
1153         (WebCore::EmptyGamepadProvider::startMonitoringGamepads):
1154         (WebCore::EmptyGamepadProvider::stopMonitoringGamepads):
1155         * platform/gamepad/EmptyGamepadProvider.h:
1156         
1157         * platform/gamepad/GamepadProvider.h:
1158         
1159         * platform/gamepad/mac/HIDGamepadProvider.cpp:
1160         (WebCore::HIDGamepadProvider::startMonitoringGamepads):
1161         (WebCore::HIDGamepadProvider::stopMonitoringGamepads):
1162         * platform/gamepad/mac/HIDGamepadProvider.h:
1163         (WebCore::HIDGamepadProvider::platformGamepads): Deleted.
1164
1165 2016-08-08  Chris Dumez  <cdumez@apple.com>
1166
1167         It should be possible to re-initialize an Event after it's been dispatched
1168         https://bugs.webkit.org/show_bug.cgi?id=160651
1169
1170         Reviewed by Darin Adler.
1171
1172         Allow re-initialization of an Event that's already been dispatched, as
1173         per the latest DOM specification:
1174         - https://dom.spec.whatwg.org/#dom-event-initevent
1175
1176         Firefox already follows the specification here.
1177
1178         No new tests, rebaselined existing test.
1179
1180         Test: fast/events/initEvent-after-dispatch.html
1181
1182         * dom/Event.cpp:
1183         (WebCore::Event::initEvent):
1184         - Replace dispatched() check with isBeingDispatched() in order to
1185           allow initialization of an already dispatched event but prevent
1186           initialization of an event that is currently being dispatched
1187           as per:
1188           https://dom.spec.whatwg.org/#dom-event-initevent (step 1)
1189         - Reset target to null as per:
1190           https://dom.spec.whatwg.org/#concept-event-initialize (step 4)
1191
1192 2016-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1193
1194         Unreviewed. Fix GObject DOM bindings API break after r204236.
1195
1196         Text.replaceWholeText was removed from DOM API.
1197
1198         * bindings/gobject/WebKitDOMDeprecated.cpp:
1199         (webkit_dom_text_replace_whole_text):
1200         * bindings/gobject/WebKitDOMDeprecated.h:
1201         * bindings/gobject/WebKitDOMDeprecated.symbols:
1202
1203 2016-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1204
1205         Unreviewed. Fix GObject DOM bindings API break after r204113.
1206
1207         Document.defaultCharset was removed from DOM API.
1208
1209         * bindings/gobject/WebKitDOMDeprecated.cpp:
1210         (webkit_dom_document_get_default_charset):
1211         * bindings/gobject/WebKitDOMDeprecated.h:
1212         * bindings/gobject/WebKitDOMDeprecated.symbols:
1213
1214 2016-08-07  Chris Dumez  <cdumez@apple.com>
1215
1216         Node.baseURI should not be nullable
1217         https://bugs.webkit.org/show_bug.cgi?id=160649
1218
1219         Reviewed by Darin Adler.
1220
1221         Node.baseURI should not be nullable as per the latest DOM specification:
1222         - https://dom.spec.whatwg.org/#dom-node-baseuri
1223
1224         It is not nullable in Firefox. It is supposed to fallback to using the
1225         document's URL. The document's URL is "about:blank" by default so
1226         baseURI() now returns "about:blank" in the internal URL is null,
1227         similarly to what we do for Document.URL (c.g. urlForBindings()).
1228
1229         No new tests, rebaselined existing test.
1230
1231         * dom/Node.cpp:
1232         (WebCore::Node::baseURI):
1233         * dom/Node.h:
1234         * dom/Node.idl:
1235
1236 2016-08-07  Chris Dumez  <cdumez@apple.com>
1237
1238         Drop SVGDocument as per the SVG2 specification
1239         https://bugs.webkit.org/show_bug.cgi?id=160361
1240
1241         Reviewed by Darin Adler.
1242
1243         Drop SVGDocument as per the SVG2 specification:
1244         - https://www.w3.org/TR/SVG2/struct.html#InterfaceDocumentExtensions
1245
1246         SVGDocument has been merged into Document.
1247
1248         Chrome and Edge have dropped SVGDocument already, Firefox has not.
1249
1250         No new tests, rebaselined existing test.
1251
1252         * accessibility/AccessibilityRenderObject.cpp:
1253         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
1254         * bindings/js/JSDocumentCustom.cpp:
1255         (WebCore::createNewDocumentWrapper): Deleted.
1256         * bindings/js/JSXMLDocumentCustom.cpp:
1257         (WebCore::toJSNewlyCreated):
1258         (WebCore::toJS): Deleted.
1259         * page/DOMWindow.idl:
1260         * page/FrameView.cpp:
1261         (WebCore::FrameView::scrollToAnchor):
1262         * svg/SVGDocument.cpp:
1263         (WebCore::SVGDocument::rootElement):
1264         (WebCore::SVGDocument::zoomAndPanEnabled):
1265         (WebCore::SVGDocument::startPan):
1266         (WebCore::SVGDocument::updatePan):
1267         * svg/SVGDocument.h:
1268         * svg/SVGDocument.idl:
1269         * svg/graphics/SVGImage.cpp:
1270         (WebCore::SVGImage::rootElement):
1271
1272 2016-08-07  Chris Dumez  <cdumez@apple.com>
1273
1274         Un-expose DOMSettableTokenList
1275         https://bugs.webkit.org/show_bug.cgi?id=160643
1276
1277         Reviewed by Darin Adler.
1278
1279         Un-expose DOMSettableTokenList. We merged DOMSettableTokenList into
1280         DOMTokenList a while back, as per the specification. At the time, we
1281         kept DOMSettableTokenList on Window, as an alias to DOMTokenList.
1282         However, Firefox and Chrome dropped DOMSettableTokenList completely.
1283         We now do the same as other browsers.
1284
1285         No new tests, rebaselined existing test.
1286
1287         * page/DOMWindow.idl:
1288
1289 2016-08-07  Andreas Kling  <akling@apple.com>
1290
1291         DocumentRuleSets::collectFeatures() should shrink-to-fit.
1292         <https://webkit.org/b/160646>
1293
1294         Reviewed by Darin Adler.
1295
1296         We forgot to shrink-wrap the RuleFeatureSet in DocumentRuleSets
1297         after collecting the document-wide features.
1298
1299         * css/DocumentRuleSets.cpp:
1300         (WebCore::DocumentRuleSets::collectFeatures):
1301
1302 2016-08-06  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1303
1304         Purge all uses of PassRefPtr in WebCore/Modules
1305         https://bugs.webkit.org/show_bug.cgi?id=159965
1306
1307         Reviewed by Chris Dumez.
1308
1309         Final clean up in Modules directory.
1310
1311         No new tests, no behavior changes.
1312
1313         * Modules/gamepad/deprecated/GamepadList.cpp:
1314         (WebCore::GamepadList::set):
1315         * Modules/gamepad/deprecated/GamepadList.h:
1316         * Modules/indexeddb/IDBGetResult.h:
1317         (WebCore::IDBGetResult::IDBGetResult):
1318         * Modules/indieui/UIRequestEvent.cpp:
1319         (WebCore::UIRequestEvent::create):
1320         (WebCore::UIRequestEvent::UIRequestEvent):
1321         * Modules/indieui/UIRequestEvent.h:
1322         (WebCore::UIRequestEvent::receiver):
1323         * Modules/mediasource/MediaSourceRegistry.h:
1324         * Modules/mediasource/SampleMap.cpp:
1325         (WebCore::SampleMap::addSample):
1326         * Modules/mediasource/SampleMap.h:
1327         (WebCore::SampleMap::addRange):
1328         * Modules/mediasource/SourceBuffer.cpp:
1329         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1330         (WebCore::SourceBuffer::textTrackAddCue):
1331         (WebCore::SourceBuffer::textTrackRemoveCue):
1332         * Modules/mediasource/SourceBuffer.h:
1333         * Modules/mediastream/CaptureDeviceManager.cpp:
1334         (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
1335         * Modules/mediastream/CaptureDeviceManager.h:
1336         * Modules/mediastream/MediaDevicesRequest.h:
1337         * Modules/mediastream/MediaStream.cpp:
1338         (WebCore::MediaStream::internalAddTrack):
1339         (WebCore::MediaStream::internalRemoveTrack):
1340         * Modules/mediastream/MediaStreamRegistry.h:
1341         * Modules/mediastream/MediaStreamTrackEvent.cpp:
1342         (WebCore::MediaStreamTrackEvent::create):
1343         (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
1344         (WebCore::MediaStreamTrackEvent::track):
1345         * Modules/mediastream/MediaStreamTrackEvent.h:
1346         * Modules/mediastream/MediaTrackConstraints.cpp:
1347         (WebCore::MediaTrackConstraints::create):
1348         (WebCore::MediaTrackConstraints::MediaTrackConstraints):
1349         (WebCore::MediaTrackConstraints::optional):
1350         * Modules/mediastream/MediaTrackConstraints.h:
1351         * Modules/mediastream/RTCDTMFSender.cpp:
1352         (WebCore::RTCDTMFSender::create):
1353         (WebCore::RTCDTMFSender::RTCDTMFSender):
1354         * Modules/mediastream/RTCDTMFSender.h:
1355         * Modules/mediastream/RTCDataChannelEvent.cpp:
1356         (WebCore::RTCDataChannelEvent::create):
1357         (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
1358         (WebCore::RTCDataChannelEvent::channel):
1359         * Modules/mediastream/RTCDataChannelEvent.h:
1360         * Modules/mediastream/RTCIceServer.h:
1361         * Modules/mediastream/RTCStatsReport.h:
1362         * Modules/mediastream/SourceInfo.cpp:
1363         (WebCore::SourceInfo::create):
1364         (WebCore::SourceInfo::SourceInfo):
1365         * Modules/mediastream/SourceInfo.h:
1366         * Modules/mediastream/UserMediaClient.h:
1367         * Modules/mediastream/UserMediaRequest.cpp:
1368         (WebCore::UserMediaRequest::UserMediaRequest):
1369         (WebCore::UserMediaRequest::didCreateStream):
1370         * Modules/mediastream/UserMediaRequest.h:
1371         * Modules/webdatabase/Database.cpp:
1372         (WebCore::Database::~Database):
1373         * html/HTMLMediaElement.cpp:
1374         (WebCore::HTMLMediaElement::textTrackAddCue):
1375         (WebCore::HTMLMediaElement::textTrackRemoveCue):
1376         * html/HTMLMediaElement.h:
1377         * html/HTMLTrackElement.cpp:
1378         (WebCore::HTMLTrackElement::textTrackAddCue):
1379         (WebCore::HTMLTrackElement::textTrackRemoveCue):
1380         * html/HTMLTrackElement.h:
1381         * html/track/TextTrack.h:
1382         * platform/graphics/SourceBufferPrivateClient.h:
1383         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1384         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
1385         * platform/mediastream/MediaStreamCreationClient.h:
1386         * platform/mediastream/mac/AVCaptureDeviceManager.h:
1387         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1388         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints):
1389         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1390         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
1391         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1392         (WebCore::MockSourceBufferPrivate::didReceiveSample):
1393
1394 2016-08-06  Chris Dumez  <cdumez@apple.com>
1395
1396         a.replaceChild(a, a) should throw a HierarchyRequestError
1397         https://bugs.webkit.org/show_bug.cgi?id=160640
1398
1399         Reviewed by Darin Adler.
1400
1401         a.replaceChild(a, a) should throw a HierarchyRequestError, because 'a'
1402         is a host-including inclusive ancestor of 'a':
1403         - https://dom.spec.whatwg.org/#concept-node-replace
1404
1405         However, the call is merely ignored in WebKit.
1406
1407         No new tests, rebaselined existing test.
1408
1409         * dom/ContainerNode.cpp:
1410         (WebCore::ContainerNode::replaceChild):
1411
1412 2016-08-06  Chris Dumez  <cdumez@apple.com>
1413
1414         Drop legacy Text.replaceWholeText() API
1415         https://bugs.webkit.org/show_bug.cgi?id=160641
1416
1417         Reviewed by Darin Adler.
1418
1419         Drop legacy Text.replaceWholeText() API, which is no longer in the
1420         specification:
1421         - https://dom.spec.whatwg.org/#interface-text
1422
1423         Firefox and Chrome already dropped support for it.
1424
1425         No new tests, rebaselined existing test.
1426
1427         * dom/Text.idl:
1428
1429 2016-08-06  Chris Dumez  <cdumez@apple.com>
1430
1431         Align Range.createContextualFragment() input validation with the specification
1432         https://bugs.webkit.org/show_bug.cgi?id=160634
1433
1434         Reviewed by Darin Adler.
1435
1436         Align Range.createContextualFragment() input validation with the specification:
1437         - https://w3c.github.io/DOM-Parsing/#idl-def-range-createcontextualfragment(domstring) (Step 2)
1438
1439         In particular, we were throwing a NOT_SUPPORTED_ERR when element had localname
1440         "html" but was not in the HTML namespace. We should not throw in this case.
1441
1442         Firefox complies with the specification here.
1443
1444         No new tests, rebaselined existing test.
1445
1446         * dom/Range.cpp:
1447         (WebCore::Range::createContextualFragment): Deleted.
1448
1449 2016-08-06  Chris Dumez  <cdumez@apple.com>
1450
1451         [Web IDL] Add support for [Unscopable] extended attribute
1452         https://bugs.webkit.org/show_bug.cgi?id=160637
1453
1454         Reviewed by Darin Adler.
1455
1456         Add support for [Unscopable] extended attribute:
1457         - http://heycam.github.io/webidl/#Unscopable
1458
1459         No new tests, rebaselined existing test.
1460
1461         * bindings/scripts/CodeGeneratorJS.pm:
1462         (addUnscopableProperties):
1463         (GenerateImplementation):
1464         * bindings/scripts/IDLAttributes.txt:
1465         * bindings/scripts/test/JS/JSTestObj.cpp:
1466         (WebCore::JSTestObjPrototype::finishCreation):
1467         * bindings/scripts/test/TestObj.idl:
1468         * dom/ChildNode.idl:
1469         * dom/ParentNode.idl:
1470
1471 2016-08-06  Darin Adler  <darin@apple.com>
1472
1473         Simplify valueToUSVString
1474         https://bugs.webkit.org/show_bug.cgi?id=160628
1475
1476         Reviewed by Sam Weinig.
1477
1478         * bindings/js/JSDOMBinding.cpp:
1479         (WebCore::isUnmatchedSurrogatePair): Deleted. This function was incorrectly named,
1480         since it actually returned true if any surrogate code unit was passed.
1481         (WebCore::valueToUSVString): Added a fast path for 8-bit characters that doesn't
1482         bother iterating the string at all. Changed the fast path to actually check for
1483         surrogate pairs. Use StringView::codePoints rather than writing our own loop that
1484         does the same thing. In the slow path, use StringView::codePoints to make the logic
1485         clear rather than writing out exactly what the specification says. This gets rid of
1486         all the many constants the old version of the function contained.
1487
1488 2016-08-06  Youenn Fablet  <youenn@apple.com>
1489
1490         [Fetch API] Fetching with a FormData body should reject until it is implemented
1491         https://bugs.webkit.org/show_bug.cgi?id=160595
1492
1493         Reviewed by Alex Christensen.
1494
1495         Covered by updated tests.
1496
1497         This patch ensures that fetch will throw if trying to upload something that is not supported.
1498         This is the case of BufferSource (FetchBody does not yet extract it) and FormData (no upload support yet).
1499
1500         * Modules/fetch/FetchBody.cpp:
1501         (WebCore::FetchBody::extract): Added a FIXME.
1502         * Modules/fetch/FetchBodyOwner.h:
1503         (WebCore::FetchBodyOwner::bodyType): Getter used by FetchResponse.
1504         * Modules/fetch/FetchRequest.cpp:
1505         (WebCore::FetchRequest::setBody): Throwing if given body parameter cannot be extracted by FetchBody.
1506         This ensures that a fetch with a body that cannot be uploaded will fail.
1507         This is the case of BufferSource which is not yet supported.
1508         * Modules/fetch/FetchResponse.cpp:
1509         (WebCore::FetchResponse::fetch): Rejecting fetch promise if trying to upload a FormData as it is not implemented.
1510
1511 2016-08-06  Youenn Fablet  <youenn@apple.com>
1512
1513         [Fetch API] Fetch API should strip fragment and credentials from URLs used as referrer
1514         https://bugs.webkit.org/show_bug.cgi?id=160593
1515
1516         Reviewed by Alex Christensen.
1517
1518         Covered by updated tests.
1519
1520         Stripping of referrer value before sending a load request.
1521
1522         Fixing bug in workers as referrer value was overwritten by WorkerThreadableLoader.
1523         The current handling of referrer values as HTTP header is not great as this may trigger unnecessary preflighting.
1524         Refactoring should allow passing it as a separate parameter and setting it after preflighting as per
1525         https://fetch.spec.whatwg.org/#http-network-or-cache-fetch.
1526
1527         Also a newly added test is failing, as SubresourceLoader is removing the referer header in case of a cross-origin redirection.
1528         But none is added back.
1529
1530         * Modules/fetch/FetchRequest.cpp:
1531         (WebCore::FetchRequest::internalRequest): Stripping referrer value.
1532         * loader/WorkerThreadableLoader.cpp:
1533         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Do not override referrer value if one is defined.
1534         * page/SecurityPolicy.cpp:
1535         (WebCore::SecurityPolicy::generateReferrerHeader): Adding assertion to ensure referrer value does not contain
1536         credentials and/or fragment identifiers.
1537
1538 2016-08-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1539
1540         [ES6] Add ScriptElement::determineScriptType
1541         https://bugs.webkit.org/show_bug.cgi?id=149576
1542
1543         Reviewed by Ryosuke Niwa.
1544
1545         Change ScriptElement::isScriptTypeSupported to ScriptElement::determineScriptType.
1546         And introduce ScriptType, which is either "classic" or "module".
1547         And support "module" type in ScriptElement[1, 2].
1548         But this patch does not contain any module tag support code.
1549         This will be implemented in the subsequent patch.
1550
1551         [1]: https://html.spec.whatwg.org/multipage/webappapis.html#integration-with-the-javascript-module-system
1552         [2]: https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type
1553
1554         * dom/ScriptElement.cpp:
1555         (WebCore::ScriptElement::determineScriptType):
1556         (WebCore::ScriptElement::prepareScript):
1557         (WebCore::ScriptElement::isScriptTypeSupported): Deleted.
1558         * dom/ScriptElement.h:
1559
1560 2016-08-05  Jonathan Bedard  <jbedard@apple.com>
1561
1562         NULL Reference Error in ElementRuleCollector
1563         https://bugs.webkit.org/show_bug.cgi?id=160362
1564
1565         Reviewed by Darin Adler.
1566
1567         No new tests, existing CSS tests cover this change.
1568
1569         Undefined behavior sanitizer found a reference bound to a NULL pointer.
1570         The root cause of this issue was a discrepancy between whether an author style needed to be defined.  In some logic, an undefined author style was considered acceptable, but in other logic, author style was always assumed to be defined.  To fix this, a variable was added so that while author style is always defined, there is a flag indicating if this definition occurred in the constructor for use by functions which allow an undefined author style.
1571
1572         * css/DocumentRuleSets.cpp:
1573         (WebCore::DocumentRuleSets::DocumentRuleSets): Define author style by default.
1574         (WebCore::DocumentRuleSets::resetAuthorStyle): Switch author style flag.
1575         * css/DocumentRuleSets.h: Added author style flag, changed authorStyle accessor to reference from pointer.
1576         * css/ElementRuleCollector.cpp:
1577         (WebCore::ElementRuleCollector::ElementRuleCollector): Original location of undefined behavior.
1578         (WebCore::ElementRuleCollector::matchHostPseudoClassRules): Changed pointer to reference.
1579         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules): Changed pointer to reference.
1580         * css/PageRuleCollector.cpp:
1581         (WebCore::PageRuleCollector::matchAllPageRules): Check new flag, changed pointer to reference.
1582
1583         * css/StyleResolver.cpp: Changed pointer to reference.
1584         * dom/Document.cpp: Dito.
1585         * style/AttributeChangeInvalidation.cpp: Dito.
1586         * style/ClassChangeInvalidation.cpp: Dito.
1587         * style/IdChangeInvalidation.cpp: Dito.
1588         * style/StyleSharingResolver.cpp: Dito.
1589
1590 2016-08-05  Chris Dumez  <cdumez@apple.com>
1591
1592         DOMException should be constructible
1593         https://bugs.webkit.org/show_bug.cgi?id=160626
1594
1595         Reviewed by Darin Adler.
1596
1597         DOMException should be constructible:
1598         - http://heycam.github.io/webidl/#dfn-DOMException
1599         - http://heycam.github.io/webidl/#es-DOMException-constructor-object
1600
1601         DOMException already has a constructor in Firefox and Chrome so this
1602         aligns our behavior with other browsers.
1603
1604         Test: imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor.html
1605
1606         * dom/DOMCoreException.cpp:
1607         (WebCore::errorCodeFromName):
1608         (WebCore::DOMCoreException::create):
1609         (WebCore::DOMCoreException::DOMCoreException):
1610         * dom/DOMCoreException.h:
1611         * dom/DOMCoreException.idl:
1612         * dom/ExceptionBase.cpp:
1613         (WebCore::ExceptionBase::ExceptionBase):
1614         * dom/ExceptionBase.h:
1615
1616 2016-08-05  Chris Dumez  <cdumez@apple.com>
1617
1618         Align Range.insertNode() input validation with the specification
1619         https://bugs.webkit.org/show_bug.cgi?id=160624
1620
1621         Reviewed by Sam Weinig.
1622
1623         Align Range.insertNode() input validation with the specification:
1624         - https://dom.spec.whatwg.org/#dom-range-insertnode
1625         - https://dom.spec.whatwg.org/#concept-range-insert (step 1)
1626
1627         In particular, if range’s start node is a ProcessingInstruction or
1628         Comment node, is a Text node whose parent is null, or is node, then
1629         we should throw a HierarchyRequestError.
1630
1631         Chrome behaves according to the specification.
1632
1633         No new tests, rebaselined existing test.
1634
1635         * dom/Range.cpp:
1636         (WebCore::Range::insertNode):
1637
1638 2016-08-05  Chris Dumez  <cdumez@apple.com>
1639
1640         [Web IDL] Add support for 'any' type in dictionaries
1641         https://bugs.webkit.org/show_bug.cgi?id=160511
1642
1643         Reviewed by Sam Weinig.
1644
1645         Add support for 'any' type in dictionaries. It will pass the value as
1646         a JSValue to the implementation. If the member is not present, it will
1647         pass jsUndefined() to the implementation.
1648
1649         Having 'any' support in dictionaries is a convenient workaround for
1650         types we don't support yet (e.g. union types).
1651
1652         No new tests, updated bindings tests.
1653
1654         * bindings/js/JSDOMConvert.h:
1655         (WebCore::Converter<JSC::JSValue>::convert):
1656         * bindings/scripts/test/JS/JSTestObj.cpp:
1657         (WebCore::convert<TestObj::Dictionary>):
1658         * bindings/scripts/test/TestObj.idl:
1659
1660 2016-08-05  Chris Dumez  <cdumez@apple.com>
1661
1662         [Web IDL] Add support for USVString type
1663         https://bugs.webkit.org/show_bug.cgi?id=160608
1664
1665         Reviewed by Sam Weinig.
1666
1667         Add support for USVString type in our bindings generator:
1668         - http://heycam.github.io/webidl/#idl-USVString
1669
1670         Also start using USVString instead of DOMString when suitable as per
1671         the following specifications:
1672         - http://dom.spec.whatwg.org
1673         - http://html.spec.whatwg.org
1674         - http://url.spec.whatwg.org
1675
1676         Test: js/dom/webidl-type-mapping.html
1677
1678         * Modules/websockets/CloseEvent.idl:
1679         * Modules/websockets/WebSocket.idl:
1680         * bindings/js/JSDOMBinding.cpp:
1681         (WebCore::isUnmatchedSurrogatePair):
1682         (WebCore::valueToUSVString):
1683         (WebCore::valueToUSVStringTreatingNullAsEmptyString):
1684         (WebCore::valueToUSVStringWithUndefinedOrNullCheck):
1685         * bindings/js/JSDOMBinding.h:
1686         * bindings/js/JSDOMWindowCustom.cpp:
1687         (WebCore::JSDOMWindow::open):
1688         (WebCore::handlePostMessage):
1689         * bindings/js/JSHistoryCustom.cpp:
1690         (WebCore::JSHistory::pushState):
1691         (WebCore::JSHistory::replaceState):
1692         * bindings/js/JSMessageEventCustom.cpp:
1693         (WebCore::handleInitMessageEvent):
1694         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
1695         (WebCore::JSWorkerGlobalScope::importScripts):
1696         * bindings/scripts/CodeGenerator.pm:
1697         (SkipIncludeHeader):
1698         (IsStringOrEnumType):
1699         (IsStringType):
1700         (IsRefPtrType):
1701         * bindings/scripts/CodeGeneratorJS.pm:
1702         (GenerateParametersCheck):
1703         (JSValueToNative):
1704         (NativeToJSValue):
1705         * bindings/scripts/IDLParser.pm:
1706         (parseNonAnyType):
1707         * dom/Document.idl:
1708         * dom/ErrorEvent.idl:
1709         * dom/HashChangeEvent.idl:
1710         * dom/MessageEvent.idl:
1711         * dom/Node.idl:
1712         * html/DOMFormData.idl:
1713         * html/DOMURL.idl:
1714         * html/HTMLAnchorElement.idl:
1715         * html/HTMLAppletElement.idl:
1716         * html/HTMLAreaElement.idl:
1717         * html/HTMLBaseElement.idl:
1718         * html/HTMLButtonElement.idl:
1719         * html/HTMLEmbedElement.idl:
1720         * html/HTMLFormElement.idl:
1721         * html/HTMLFrameElement.idl:
1722         * html/HTMLHyperlinkElementUtils.idl:
1723         * html/HTMLIFrameElement.idl:
1724         * html/HTMLImageElement.idl:
1725         * html/HTMLInputElement.idl:
1726         * html/HTMLLinkElement.idl:
1727         * html/HTMLMediaElement.idl:
1728         * html/HTMLModElement.idl:
1729         * html/HTMLObjectElement.idl:
1730         * html/HTMLQuoteElement.idl:
1731         * html/HTMLScriptElement.idl:
1732         * html/HTMLSourceElement.idl:
1733         * html/HTMLTrackElement.idl:
1734         * html/HTMLVideoElement.idl:
1735         * html/URLUtils.idl:
1736         * page/DOMWindow.idl:
1737         * page/EventSource.idl:
1738         * page/History.idl:
1739         * page/Location.idl:
1740         * storage/StorageEvent.idl:
1741         * testing/TypeConversions.h:
1742         (WebCore::TypeConversions::testString):
1743         (WebCore::TypeConversions::setTestString):
1744         (WebCore::TypeConversions::testUSVString):
1745         (WebCore::TypeConversions::setTestUSVString):
1746         * testing/TypeConversions.idl:
1747         * workers/Worker.idl:
1748         * workers/WorkerGlobalScope.idl:
1749
1750 2016-08-05  Jeremy Jones  <jeremyj@apple.com>
1751
1752         revert r202466 r202546 this causes regressions in media loading with temporary redirects.
1753         https://bugs.webkit.org/show_bug.cgi?id=160613
1754
1755         Reviewed by Jon Lee.
1756
1757         No new tests. Skipping two tests.
1758
1759         This reverts a change that attempted to fix temporary redirects with media loading.
1760         The change introduced problems. Reverting this to require media stack to properly
1761         handle redirects.
1762
1763         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1764         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin):
1765         * platform/network/cocoa/WebCoreNSURLSession.h:
1766         * platform/network/cocoa/WebCoreNSURLSession.mm:
1767         (-[WebCoreNSURLSession initWithResourceLoader:delegate:delegateQueue:]): Deleted.
1768         (-[WebCoreNSURLSession updateHasSingleSecurityOrigin:]): Deleted.
1769         (-[WebCoreNSURLSession dataTaskWithRequest:]): Deleted.
1770         (-[WebCoreNSURLSession dataTaskWithURL:]): Deleted.
1771         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
1772         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]): Deleted.
1773
1774 2016-08-05  Simon Fraser  <simon.fraser@apple.com>
1775
1776         Add a tiny bit more image logging
1777         https://bugs.webkit.org/show_bug.cgi?id=160621
1778
1779         Reviewed by Tim Horton.
1780
1781         Add logging related to image subsampling.
1782
1783         * platform/graphics/BitmapImage.cpp:
1784         (WebCore::BitmapImage::frameImageAtIndex):
1785
1786 2016-08-05  Nan Wang  <n_wang@apple.com>
1787
1788         AX: Asking for group members of radio button that has no name attribute will cause crash
1789         https://bugs.webkit.org/show_bug.cgi?id=160583
1790
1791         Reviewed by Chris Fleizach.
1792
1793         The NameToGroupMap is null when there's no name attribute on the radio buttons. Added a 
1794         check so that we don't try to get a value from a null HashSet.
1795
1796         Test: accessibility/mac/radio-button-no-name-crash.html
1797
1798         * dom/RadioButtonGroups.cpp:
1799         (WebCore::RadioButtonGroups::groupMembers):
1800
1801 2016-08-05  Brent Fulgham  <bfulgham@apple.com>
1802
1803         ASSERTION FAILED: observer in WebCore::BitmapImage::drawPattern
1804         https://bugs.webkit.org/show_bug.cgi?id=141637
1805         <rdar://problem/27709864>
1806
1807         Reviewed by Tim Horton.
1808
1809         Test: fast/images/image-source-assert.html
1810
1811         * platform/graphics/BitmapImage.cpp:
1812         (WebCore::BitmapImage::drawPattern): Remove invalid assertion.
1813
1814 2016-08-05  Simon Fraser  <simon.fraser@apple.com>
1815
1816         marquee with "truespeed" animates at > 60fps, hogging CPU
1817         https://bugs.webkit.org/show_bug.cgi?id=160609
1818
1819         Reviewed by David Hyatt.
1820         
1821         A <marquee truespeed="" scrollDelay="0"> would fire a zero-delay timer and also
1822         fail to animate, hogging CPU.
1823         
1824         Fix to cap the timer at 16ms intervals. We don't believe it's necessary to
1825         maintain web compatibility here.
1826
1827         Tested by existing tests.
1828
1829         * html/HTMLMarqueeElement.cpp:
1830         (WebCore::HTMLMarqueeElement::minimumDelay):
1831         * html/HTMLMarqueeElement.h:
1832
1833 2016-08-05  Ryan Haddad  <ryanhaddad@apple.com>
1834
1835         Unreviewed, rolling out r204181.
1836
1837         This change caused an existing LayoutTest to fail on WK1
1838
1839         Reverted changeset:
1840
1841         "Don't set document.domain to an IP address fragment"
1842         https://bugs.webkit.org/show_bug.cgi?id=126045
1843         http://trac.webkit.org/changeset/204181
1844
1845 2016-08-05  Commit Queue  <commit-queue@webkit.org>
1846
1847         Unreviewed, rolling out r204128.
1848         https://bugs.webkit.org/show_bug.cgi?id=160607
1849
1850         Solve the issue by removing the workaround for static files
1851         (Requested by jonlee_ on #webkit).
1852
1853         Reverted changeset:
1854
1855         "Temporary redirected m3u8 streaming stopped working."
1856         https://bugs.webkit.org/show_bug.cgi?id=160472
1857         http://trac.webkit.org/changeset/204128
1858
1859 2016-08-05  Brent Fulgham  <bfulgham@apple.com>
1860
1861         validity assertion fails after removing a child of an <optgroup> element
1862         https://bugs.webkit.org/show_bug.cgi?id=155720
1863         <rdar://problem/27720746>
1864
1865         Reviewed by Brent Fulgham.
1866
1867         All calls to HTMLSelectElement::setRecalcListItems also need to call HTMLSelectElement::updateValidity.
1868
1869         Test: fast/dom/HTMLSelectElement/select-remove-from-optgroup.html
1870
1871         * html/HTMLOptGroupElement.cpp:
1872         (WebCore::HTMLOptGroupElement::recalcSelectOptions): Call 'updateValidity' after 'setRecalcListItems'.
1873         * html/HTMLOptionElement.cpp:
1874         (WebCore::HTMLOptionElement::insertedInto): Ditto.
1875         * html/HTMLSelectElement.cpp:
1876         (WebCore::HTMLSelectElement::parseAttribute): Ditto.
1877
1878 2016-08-05  Ryan Haddad  <ryanhaddad@apple.com>
1879
1880         Unreviewed, rolling out r204174.
1881
1882         The test for this change is failing on WK1
1883
1884         Reverted changeset:
1885
1886         "Popups opened from a sandboxed iframe should themselves be
1887         sandboxed"
1888         https://bugs.webkit.org/show_bug.cgi?id=134850
1889         http://trac.webkit.org/changeset/204174
1890
1891 2016-08-05  John Wilander  <wilander@apple.com>
1892
1893         Don't set document.domain to an IP address fragment
1894         https://bugs.webkit.org/show_bug.cgi?id=126045
1895         <rdar://problem/27331794>
1896
1897         Reviewed by Daniel Bates.
1898
1899         This patch matches the following Blink one:
1900         https://chromium.googlesource.com/chromium/blink/+/b19a57fdb323d5a80d3a1cb0a6b343558c4237b0
1901
1902         IP address octets should not be treated as subdomains when setting
1903         document.domain. The specs say:
1904         'The domain attribute's setter must run these steps: ...
1905         7. If host is not equal to effectiveDomain, then run these substeps:
1906             1. If host or effectiveDomain is not a domain, then throw a
1907             "SecurityError" DOMException.'
1908         https://html.spec.whatwg.org/multipage/browsers.html#relaxing-the-same-origin-restriction
1909         Last Updated 5 August 2016
1910
1911         'A host is a domain, an IPv4 address, or an IPv6 address.'
1912         https://url.spec.whatwg.org/#concept-domain
1913         Last Updated 28 July 2016
1914
1915         Test: http/tests/security/set-domain-remove-subdomain-for-ip-address.html
1916
1917         * dom/Document.cpp:
1918         (WebCore::Document::setDomain):
1919             Now checks whether the security origin is allowed to remove
1920             subdomains. If not, it throws a security error.
1921         * page/OriginAccessEntry.cpp:
1922         (WebCore::OriginAccessEntry::OriginAccessEntry):
1923             Constructor now expects an IP address setting.
1924         (WebCore::OriginAccessEntry::matchesOrigin):
1925             Now also checks whether the host in an IP address and returns
1926             false if IP addresses aren't configured to be treated as domains.
1927         * page/OriginAccessEntry.h:
1928             Introduced new enum for IP address setting.
1929             Constructor now expects an IP address setting.
1930         (WebCore::OriginAccessEntry::ipAddressSettings):
1931             New getter.
1932         (WebCore::operator==):
1933             Now also requires IP address settings to match.
1934         * page/SecurityPolicy.cpp:
1935         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
1936             Changes to match OriginAccessEntry's new constructor.
1937         (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
1938             Changes to match OriginAccessEntry's new constructor.
1939         * page/Settings.in:
1940             Added a setting to allow IP address octets to be treated as
1941             subdomains. This way our existing tests setting document.domain
1942             still work.
1943
1944 2016-08-05  Chris Dumez  <cdumez@apple.com>
1945
1946         Window's named properties should be exposed on a WindowProperties object in its prototype
1947         https://bugs.webkit.org/show_bug.cgi?id=160354
1948
1949         Reviewed by Gavin Barraclough.
1950
1951         Window's named properties should be exposed on a WindowProperties object
1952         in its prototype:
1953         - http://heycam.github.io/webidl/#named-properties-object
1954
1955         Firefox and Chrome both comply with the specification. However, WebKit
1956         had no "WindowProperties" object in the Window prototype chain and the
1957         named properties are exposed on the Window object itself.
1958
1959         No new tests, rebaselined existing tests.
1960
1961         * CMakeLists.txt:
1962         * WebCore.xcodeproj/project.pbxproj:
1963         * bindings/js/JSBindingsAllInOne.cpp:
1964         * bindings/js/JSDOMWindowCustom.cpp:
1965         (WebCore::JSDOMWindow::getOwnPropertySlot):
1966         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1967         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): Deleted.
1968         (WebCore::JSDOMWindow::put): Deleted.
1969         (WebCore::JSDOMWindow::putByIndex): Deleted.
1970         (WebCore::JSDOMWindow::getEnumerableLength): Deleted.
1971         * bindings/js/JSDOMWindowProperties.cpp: Added.
1972         (WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter):
1973         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
1974         (WebCore::JSDOMWindowProperties::getOwnPropertySlotByIndex):
1975         * bindings/js/JSDOMWindowProperties.h: Added.
1976         (WebCore::JSDOMWindowProperties::create):
1977         (WebCore::JSDOMWindowProperties::createStructure):
1978         (WebCore::JSDOMWindowProperties::JSDOMWindowProperties):
1979         * bindings/js/JSDOMWindowShell.cpp:
1980         (WebCore::JSDOMWindowShell::setWindow):
1981
1982 2016-08-05  Brady Eidson  <beidson@apple.com>
1983
1984         Create platform/gamepad directory, and make GamepadProvider pure virtual (with a default empty implementation).
1985         https://bugs.webkit.org/show_bug.cgi?id=160599
1986
1987         Reviewed by Alex Christensen.
1988
1989         No new tests (No behavior change).
1990
1991         Except for the GamepadProvider/EmptyGamepadProvider split, this is just moving files around.
1992
1993         * CMakeLists.txt:
1994         * PlatformEfl.cmake:
1995         * PlatformGTK.cmake:
1996         * WebCore.xcodeproj/project.pbxproj:
1997         * platform/Linux.cmake:
1998
1999         * platform/gamepad.h: Removed.
2000         
2001         * platform/gamepad/EmptyGamepadProvider.cpp: 
2002         (WebCore::EmptyGamepadProvider::startMonitoringGamepads):
2003         (WebCore::EmptyGamepadProvider::stopMonitoringGamepads):
2004         (WebCore::EmptyGamepadProvider::platformGamepads):
2005         * platform/gamepad/EmptyGamepadProvider.h:
2006         
2007         * platform/gamepad/GamepadProvider.cpp: Renamed from Source/WebCore/platform/GamepadProvider.cpp.
2008         (WebCore::GamepadProvider::singleton):
2009         (WebCore::GamepadProvider::setSharedProvider):
2010         * platform/gamepad/GamepadProvider.h: Renamed from Source/WebCore/platform/GamepadProvider.h.
2011         (WebCore::GamepadProvider::~GamepadProvider):
2012         
2013         * platform/gamepad/GamepadProviderClient.h: Renamed from Source/WebCore/platform/GamepadProviderClient.h.
2014         (WebCore::GamepadProviderClient::~GamepadProviderClient):
2015         
2016         * platform/gamepad/PlatformGamepad.h: Renamed from Source/WebCore/platform/PlatformGamepad.h.
2017         (WebCore::PlatformGamepad::~PlatformGamepad):
2018         (WebCore::PlatformGamepad::id):
2019         (WebCore::PlatformGamepad::index):
2020         (WebCore::PlatformGamepad::lastUpdateTime):
2021         (WebCore::PlatformGamepad::connectTime):
2022         (WebCore::PlatformGamepad::PlatformGamepad):
2023
2024         * platform/gamepad/deprecated/Gamepads.h: Renamed from Source/WebCore/platform/Gamepads.h.
2025
2026         * platform/gamepad/efl/GamepadsEfl.cpp: Renamed from Source/WebCore/platform/efl/GamepadsEfl.cpp.
2027         (WebCore::GamepadDeviceEfl::resetFdHandler):
2028         (WebCore::GamepadDeviceEfl::deviceFile):
2029         (WebCore::GamepadDeviceEfl::GamepadDeviceEfl):
2030         (WebCore::GamepadDeviceEfl::~GamepadDeviceEfl):
2031         (WebCore::GamepadDeviceEfl::readCallback):
2032         (WebCore::GamepadsEfl::onGamePadChange):
2033         (WebCore::GamepadsEfl::GamepadsEfl):
2034         (WebCore::GamepadsEfl::~GamepadsEfl):
2035         (WebCore::GamepadsEfl::registerDevice):
2036         (WebCore::GamepadsEfl::unregisterDevice):
2037         (WebCore::GamepadsEfl::updateGamepadList):
2038         (WebCore::sampleGamepads):
2039         
2040         * platform/gamepad/glib/GamepadsGlib.cpp: Renamed from Source/WebCore/platform/glib/GamepadsGlib.cpp.
2041         (WebCore::GamepadDeviceGlib::GamepadDeviceGlib):
2042         (WebCore::GamepadDeviceGlib::~GamepadDeviceGlib):
2043         (WebCore::GamepadDeviceGlib::readCallback):
2044         (WebCore::GamepadsGlib::GamepadsGlib):
2045         (WebCore::GamepadsGlib::~GamepadsGlib):
2046         (WebCore::GamepadsGlib::registerDevice):
2047         (WebCore::GamepadsGlib::unregisterDevice):
2048         (WebCore::GamepadsGlib::updateGamepadList):
2049         (WebCore::GamepadsGlib::onUEventCallback):
2050         (WebCore::GamepadsGlib::isGamepadDevice):
2051         (WebCore::sampleGamepads):
2052         
2053         * platform/gamepad/linux/GamepadDeviceLinux.cpp: Renamed from Source/WebCore/platform/linux/GamepadDeviceLinux.cpp.
2054         (WebCore::GamepadDeviceLinux::GamepadDeviceLinux):
2055         (WebCore::GamepadDeviceLinux::~GamepadDeviceLinux):
2056         (WebCore::GamepadDeviceLinux::updateForEvent):
2057         (WebCore::GamepadDeviceLinux::normalizeAxisValue):
2058         (WebCore::GamepadDeviceLinux::normalizeButtonValue):
2059         * platform/gamepad/linux/GamepadDeviceLinux.h: Renamed from Source/WebCore/platform/linux/GamepadDeviceLinux.h.
2060         (WebCore::GamepadDeviceLinux::connected):
2061         (WebCore::GamepadDeviceLinux::id):
2062         (WebCore::GamepadDeviceLinux::timestamp):
2063         (WebCore::GamepadDeviceLinux::axesCount):
2064         (WebCore::GamepadDeviceLinux::axesData):
2065         (WebCore::GamepadDeviceLinux::buttonsCount):
2066         (WebCore::GamepadDeviceLinux::buttonsData):
2067         
2068         * platform/gamepad/mac/HIDGamepad.cpp: Renamed from Source/WebCore/platform/mac/HIDGamepad.cpp.
2069         (WebCore::HIDGamepad::HIDGamepad):
2070         (WebCore::HIDGamepad::getCurrentValueForElement):
2071         (WebCore::HIDGamepad::initElements):
2072         (WebCore::HIDGamepad::initElementsFromArray):
2073         (WebCore::HIDGamepad::maybeAddButton):
2074         (WebCore::HIDGamepad::maybeAddAxis):
2075         (WebCore::HIDGamepad::valueChanged):
2076         * platform/gamepad/mac/HIDGamepad.h: Renamed from Source/WebCore/platform/mac/HIDGamepad.h.
2077         (WebCore::HIDGamepadElement::HIDGamepadElement):
2078         (WebCore::HIDGamepadElement::~HIDGamepadElement):
2079         (WebCore::HIDGamepadElement::isButton):
2080         (WebCore::HIDGamepadElement::isAxis):
2081         (WebCore::HIDGamepadButton::HIDGamepadButton):
2082         (WebCore::HIDGamepadAxis::HIDGamepadAxis):
2083         (WebCore::HIDGamepad::hidDevice):
2084         
2085         * platform/gamepad/mac/HIDGamepadProvider.cpp: Renamed from Source/WebCore/platform/mac/HIDGamepadProvider.cpp.
2086         (WebCore::deviceMatchingDictionary):
2087         (WebCore::deviceAddedCallback):
2088         (WebCore::deviceRemovedCallback):
2089         (WebCore::deviceValuesChangedCallback):
2090         (WebCore::HIDGamepadProvider::singleton):
2091         (WebCore::HIDGamepadProvider::HIDGamepadProvider):
2092         (WebCore::HIDGamepadProvider::indexForNewlyConnectedDevice):
2093         (WebCore::HIDGamepadProvider::connectionDelayTimerFired):
2094         (WebCore::HIDGamepadProvider::openAndScheduleManager):
2095         (WebCore::HIDGamepadProvider::closeAndUnscheduleManager):
2096         (WebCore::HIDGamepadProvider::startMonitoringGamepads):
2097         (WebCore::HIDGamepadProvider::stopMonitoringGamepads):
2098         (WebCore::HIDGamepadProvider::deviceAdded):
2099         (WebCore::HIDGamepadProvider::deviceRemoved):
2100         (WebCore::HIDGamepadProvider::valuesChanged):
2101         (WebCore::HIDGamepadProvider::inputNotificationTimerFired):
2102         (WebCore::HIDGamepadProvider::removeGamepadForDevice):
2103         * platform/gamepad/mac/HIDGamepadProvider.h: Renamed from Source/WebCore/platform/mac/HIDGamepadProvider.h.
2104         (WebCore::HIDGamepadProvider::platformGamepads):
2105
2106 2016-08-05  Commit Queue  <commit-queue@webkit.org>
2107
2108         Unreviewed, rolling out r204147.
2109         https://bugs.webkit.org/show_bug.cgi?id=160602
2110
2111         Considering another implementation (Requested by eric_carlson
2112         on #webkit).
2113
2114         Reverted changeset:
2115
2116         "Add long, boolean, double, and String Media Constraint
2117         classes"
2118         https://bugs.webkit.org/show_bug.cgi?id=160524
2119         http://trac.webkit.org/changeset/204147
2120
2121 2016-08-05  John Wilander  <wilander@apple.com>
2122
2123         Popups opened from a sandboxed iframe should themselves be sandboxed
2124         https://bugs.webkit.org/show_bug.cgi?id=134850
2125         <rdar://problem/27375388>
2126
2127         Reviewed by Brent Fulgham.
2128
2129         This replicates the behavior in Chrome, Firefox, and according to the reporter
2130         also in Internet Explorer. See the Mozilla bug report:
2131         https://bugzilla.mozilla.org/show_bug.cgi?id=1037381#c1
2132
2133         Test: http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox.html
2134
2135         * page/Chrome.cpp:
2136         (WebCore::Chrome::createWindow):
2137             Now copies the opener's frame loader effective sandbox flags to the new
2138             frame loader.
2139
2140 2016-08-05  Darin Adler  <darin@apple.com>
2141
2142         * DerivedSources.make: Fix all places that were using tabs instead of spaces outside
2143         the actual make rules, where tabs are required as part of make syntax.
2144
2145 2016-08-05  Youenn Fablet  <youenn@apple.com>
2146
2147         [Fetch API] SubresourceLoader::checkRedirectionCrossOriginAccessControl should not always assert in SameOrigin mode
2148         https://bugs.webkit.org/show_bug.cgi?id=160594
2149
2150         Reviewed by Alex Christensen.
2151
2152         Covered by rebased tests.
2153
2154         * loader/SubresourceLoader.cpp:
2155         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
2156         It should not throw is mode is SameOrigin and resource is same origin.
2157
2158 2016-08-05  Youenn Fablet  <youenn@apple.com>
2159
2160         [Fetch API] Response.blob should not assert in case the created blob is empty
2161         https://bugs.webkit.org/show_bug.cgi?id=160592
2162
2163         Reviewed by Alex Christensen.
2164
2165         Covered bu updated test.
2166
2167         * Modules/fetch/FetchBodyConsumer.cpp:
2168         (WebCore::FetchBodyConsumer::takeAsBlob): Removing assertion as a response may have a body but with no data in it.
2169
2170 2016-08-05  Commit Queue  <commit-queue@webkit.org>
2171
2172         Unreviewed, rolling out r203935.
2173         https://bugs.webkit.org/show_bug.cgi?id=160596
2174
2175         looks like a 1-2% PLUM regression on iPhone 6s (Requested by
2176         kling_ on #webkit).
2177
2178         Reverted changeset:
2179
2180         "Window's named properties should be exposed on a
2181         WindowProperties object in its prototype"
2182         https://bugs.webkit.org/show_bug.cgi?id=160354
2183         http://trac.webkit.org/changeset/203935
2184
2185 2016-08-05  Youenn Fablet  <youenn@apple.com>
2186
2187         [Fetch API] Activate CSP checks
2188         https://bugs.webkit.org/show_bug.cgi?id=160445
2189
2190         Reviewed by Daniel Bates.
2191
2192         Tests: http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-fetch-in-main-frame.html
2193                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-fetch-in-worker.html
2194
2195         * Modules/fetch/FetchLoader.cpp:
2196         (WebCore::FetchLoader::start): Adding CSP and URL upgrade checks.
2197
2198 2016-08-05  Youenn Fablet  <youenn@apple.com>
2199
2200         DocumentThreadableLoader should report an error when getting a null CachedResource
2201         https://bugs.webkit.org/show_bug.cgi?id=160444
2202
2203         Reviewed by Alex Christensen.
2204
2205         Covered by existing and rebased tests.
2206
2207         * loader/DocumentThreadableLoader.cpp:
2208         (WebCore::DocumentThreadableLoader::loadRequest): Calling didFail with an AccessControl error if unable to have a CachedResource.
2209         The resource error type AccessControl is important as it indicates to some clients that they should not retry loading the same resource (EventSource notably).
2210         * xml/XMLHttpRequest.cpp:
2211         (WebCore::XMLHttpRequest::createRequest): Removed handling of ThreadableLoader::create returning null.
2212         This should be handled in didFail callback. This allows aligning behavior of
2213         WorkerThreadableLoaderi::MainThreadBridge and XMLHttpRequest as ThreadableLoader clients.
2214         (WebCore::XMLHttpRequest::didFail): Handle the case of didFail being called synchronously from ThreadableLoader::create.
2215         In that case, use a timer to dispatch network events asynchronously.
2216
2217 2016-08-04  Chris Dumez  <cdumez@apple.com>
2218
2219         Add support for DOMTokenList.replace()
2220         https://bugs.webkit.org/show_bug.cgi?id=160573
2221
2222         Reviewed by Alex Christensen.
2223
2224         Add support for DOMTokenList.replace():
2225         https://dom.spec.whatwg.org/#dom-domtokenlist-replace
2226
2227         No new tests, rebaselined existing tests.
2228
2229         * html/DOMTokenList.cpp:
2230         (WebCore::tokenContainsHTMLSpace):
2231         (WebCore::DOMTokenList::validateToken):
2232         (WebCore::DOMTokenList::replace):
2233         * html/DOMTokenList.h:
2234         * html/DOMTokenList.idl:
2235
2236 2016-08-04  Myles C. Maxfield  <mmaxfield@apple.com>
2237
2238         [iOS] Some videos in iBooks erroneously go fullscreen
2239         https://bugs.webkit.org/show_bug.cgi?id=160582
2240         <rdar://problem/27669831>
2241
2242         Reviewed by Jon Lee.
2243
2244         No new tests because we can't currently mock the iBooks application bundle ID.
2245
2246         * html/MediaElementSession.cpp:
2247         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
2248
2249 2016-08-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2250
2251         [Fontconfig] Segmentation fault in WebCore::FontCache::lastResortFallbackFont
2252         https://bugs.webkit.org/show_bug.cgi?id=141432
2253
2254         Reviewed by Myles C. Maxfield.
2255
2256         Crash more cleanly when we can't find any last resort fallback font.
2257
2258         * platform/graphics/freetype/FontCacheFreeType.cpp:
2259         (WebCore::FontCache::lastResortFallbackFont):
2260
2261 2016-08-04  Chris Dumez  <cdumez@apple.com>
2262
2263         Move insertAdjacent*() API from HTMLElement to Element
2264         https://bugs.webkit.org/show_bug.cgi?id=160567
2265
2266         Reviewed by Sam Weinig.
2267
2268         Move insertAdjacent*() API from HTMLElement to Element:
2269         - https://w3c.github.io/DOM-Parsing/#extensions-to-the-element-interface
2270         - https://dom.spec.whatwg.org/#element
2271
2272         Firefox and Chrome both have insertAdjacentHTML() on Element.
2273         Chrome has insertAdjacentText() / insertAdjacentElement() on Element as
2274         well. Firefox does not have this API at all.
2275
2276         Also align insertAdjacentHTML() with the specification so that we
2277         now throw a NO_MODIFICATION_ALLOWED_ERR if called with "beforebegin" /
2278         "afterend" on a parent-less element. This is as per:
2279         - https://w3c.github.io/DOM-Parsing/#dom-element-insertadjacenthtml
2280
2281         Previously, WebKit would just silently ignore such calls. The new
2282         behavior with consistent with both Firefox and Chrome.
2283
2284         No new tests, rebaselined existing tests.
2285
2286         * dom/Element.cpp:
2287         (WebCore::Element::insertAdjacent):
2288         (WebCore::Element::insertAdjacentElement):
2289         (WebCore::contextElementForInsertion):
2290         (WebCore::Element::insertAdjacentHTML):
2291         (WebCore::Element::insertAdjacentText):
2292         * dom/Element.h:
2293         * dom/Element.idl:
2294         * html/HTMLElement.cpp:
2295         (WebCore::HTMLElement::insertAdjacent): Deleted.
2296         (WebCore::HTMLElement::insertAdjacentElement): Deleted.
2297         (WebCore::contextElementForInsertion): Deleted.
2298         (WebCore::HTMLElement::insertAdjacentHTML): Deleted.
2299         (WebCore::HTMLElement::insertAdjacentText): Deleted.
2300         * html/HTMLElement.h:
2301         * html/HTMLElement.idl:
2302
2303 2016-08-04  Anders Carlsson  <andersca@apple.com>
2304
2305         Another build fix attempt.
2306
2307         * bindings/gobject/WebKitDOMDeprecated.cpp:
2308
2309 2016-08-04  George Ruan  <gruan@apple.com>
2310
2311         Add long, boolean, double, and String Media Constraint classes
2312         https://bugs.webkit.org/show_bug.cgi?id=160524
2313         <rdar://problem/27685132>
2314
2315         Reviewed by Eric Carlson.
2316
2317         No new tests. The current patch is untestable, but functionality
2318         will be tested in a future patch.
2319
2320         * WebCore.xcodeproj/project.pbxproj:
2321         * platform/mediastream/MediaConstraints.cpp: Added.
2322         (WebCore::BaseConstraint::create): Initializes min, max, exact, ideal
2323         value of constraint with dictionary.
2324         (WebCore::BaseConstraint::createEmptyDerivedConstraint): Factory 
2325         for all derived constraints.
2326         (WebCore::LongConstraint::create): Creates LongConstraint with name.
2327         (WebCore::LongConstraint::setMin): Sets mandatory min constraint value.
2328         (WebCore::LongConstraint::setMax): Sets mandatory max constraint value.
2329         (WebCore::LongConstraint::setExact): Sets mandatory exact constraint
2330         value.
2331         (WebCore::LongConstraint::setIdeal): Sets optional ideal constraint
2332         value.
2333         (WebCore::LongConstraint::initializeWithDictionary): Parses user input
2334         and sets min, max, exact, ideal values.
2335         (WebCore::DoubleConstraint::create): Ditto.
2336         (WebCore::DoubleConstraint::setMin): Ditto.
2337         (WebCore::DoubleConstraint::setMax): Ditto.
2338         (WebCore::DoubleConstraint::setExact): Ditto.
2339         (WebCore::DoubleConstraint::setIdeal): Ditto.
2340         (WebCore::DoubleConstraint::initializeWithDictionary): Ditto.
2341         (WebCore::BooleanConstraint::create): Ditto.
2342         (WebCore::BooleanConstraint::setExact): Ditto.
2343         (WebCore::BooleanConstraint::setIdeal): Ditto.
2344         (WebCore::BooleanConstraint::initializeWithDictionary): Ditto.
2345         (WebCore::StringConstraint::create): Ditto.
2346         (WebCore::StringConstraint::setExact): Ditto.
2347         (WebCore::StringConstraint::setIdeal): Ditto.
2348         (WebCore::StringConstraint::initializeWithDictionary): Ditto.
2349         * platform/mediastream/MediaConstraints.h: Add abstract classes
2350         BaseConstraint and NumericConstraint, and final classes
2351         DoubleConstraint, LongConstraint, BooleanConstraint, and
2352         StringConstraint.
2353         (WebCore::BaseConstraint::~BaseConstraint):
2354         (WebCore::BaseConstraint::name): Name of constraint associated with.
2355         (WebCore::BaseConstraint::BaseConstraint):
2356         (WebCore::NumericConstraint::setHasMin): Sets min constraint value.
2357         (WebCore::NumericConstraint::setHasMax): Sets max constraint value.
2358         (WebCore::NumericConstraint::setHasExact): Sets exact constraint
2359         value.
2360         (WebCore::NumericConstraint::setHasIdeal): Sets ideal constraint
2361         value.
2362         (WebCore::NumericConstraint::hasMin): Determines whether constraint
2363         has a minimum value.
2364         (WebCore::NumericConstraint::hasMax): Determines whether constraint
2365         has a maximum value.
2366         (WebCore::NumericConstraint::hasExact): Determines whether constraint
2367         has an exact value.
2368         (WebCore::NumericConstraint::NumericConstraint):
2369
2370 2016-08-04  Anders Carlsson  <andersca@apple.com>
2371
2372         Try to fix the GTK+ build.
2373
2374         * bindings/gobject/WebKitDOMDeprecated.cpp:
2375         (webkit_dom_document_get_elements_by_tag_name):
2376         (webkit_dom_document_get_elements_by_tag_name_ns):
2377         (webkit_dom_document_get_elements_by_class_name):
2378         (webkit_dom_element_get_elements_by_tag_name):
2379         (webkit_dom_element_get_elements_by_tag_name_ns):
2380         (webkit_dom_element_get_elements_by_class_name):
2381
2382 2016-08-04  Chris Dumez  <cdumez@apple.com>
2383
2384         Add support for wrapper types in dictionaries
2385         https://bugs.webkit.org/show_bug.cgi?id=160487
2386
2387         Reviewed by Sam Weinig.
2388
2389         Add support for nullable wrapper types in dictionaries.
2390         A TypeError is thrown if the conversion fails.
2391
2392         No new tests, updated bindings tests.
2393
2394         * bindings/js/JSDOMConvert.h:
2395         (WebCore::convertWrapperType):
2396         * bindings/scripts/CodeGeneratorJS.pm:
2397         (GenerateDictionaryImplementationContent):
2398         * bindings/scripts/IDLParser.pm:
2399         (parseDictionaryMember):
2400         * bindings/scripts/test/JS/JSTestObj.cpp:
2401         (WebCore::convert<TestObj::Dictionary>):
2402         * bindings/scripts/test/TestObj.idl:
2403
2404 2016-08-04  Csaba Osztrogonác  <ossy@webkit.org>
2405
2406         [Mac][cmake] Fix the build after Objective-C bindings generator removal
2407         https://bugs.webkit.org/show_bug.cgi?id=160545
2408
2409         Reviewed by Alex Christensen.
2410
2411         * CMakeLists.txt:
2412         * PlatformMac.cmake:
2413
2414 2016-08-04  Ryan Haddad  <ryanhaddad@apple.com>
2415
2416         Attempt to fix Windows build after r204134.
2417
2418         Unreviewed build fix.
2419
2420         * dom/DOMAllInOne.cpp:
2421
2422 2016-08-04  Anders Carlsson  <andersca@apple.com>
2423
2424         Remove more Objective-C specific bindings code
2425         https://bugs.webkit.org/show_bug.cgi?id=160564
2426
2427         Reviewed by Sam Weinig.
2428
2429         * CMakeLists.txt:
2430         * DerivedSources.make:
2431         * WebCore.xcodeproj/project.pbxproj:
2432         * bindings/js/JSNodeCustom.cpp:
2433         * bindings/objc/DOMDocument.mm:
2434         * bindings/objc/DOMEntity.mm:
2435         (-[DOMEntity publicId]):
2436         (-[DOMEntity systemId]):
2437         (-[DOMEntity notationName]):
2438         * bindings/objc/DOMEntityReference.mm:
2439         (kit): Deleted.
2440         * bindings/objc/DOMEntityReferenceInternal.h: Removed.
2441         * bindings/objc/DOMNodeIterator.mm:
2442         (-[DOMNodeIterator expandEntityReferences]):
2443         * bindings/objc/DOMTreeWalker.mm:
2444         (-[DOMTreeWalker expandEntityReferences]):
2445         * dom/Document.idl:
2446         * dom/Entity.h: Removed.
2447         (WebCore::Entity::publicId): Deleted.
2448         (WebCore::Entity::systemId): Deleted.
2449         (WebCore::Entity::notationName): Deleted.
2450         (WebCore::Entity::Entity): Deleted.
2451         * dom/Entity.idl: Removed.
2452         * dom/EntityReference.cpp: Removed.
2453         (WebCore::EntityReference::EntityReference): Deleted.
2454         * dom/EntityReference.h: Removed.
2455         * dom/EntityReference.idl: Removed.
2456         * dom/NodeIterator.idl:
2457         * dom/Traversal.h:
2458         (WebCore::NodeIteratorBase::expandEntityReferences): Deleted.
2459         * dom/TreeWalker.idl:
2460
2461 2016-08-04  Chris Dumez  <cdumez@apple.com>
2462
2463         Simplify overloads for HTMLSelectElement.add() / HTMLOptionsCollection.add()
2464         https://bugs.webkit.org/show_bug.cgi?id=160527
2465
2466         Reviewed by Ryosuke Niwa.
2467
2468         Simplify overloads for HTMLSelectElement.add() / HTMLOptionsCollection.add().
2469         We now have 2 overloads instead of 3 while achieving the same web-facing
2470         behavior.
2471
2472         * html/HTMLOptionsCollection.h:
2473         * html/HTMLOptionsCollection.idl:
2474         * html/HTMLSelectElement.h:
2475         (WebCore::HTMLSelectElement::add): Deleted.
2476         * html/HTMLSelectElement.idl:
2477
2478 2016-08-04  Anders Carlsson  <andersca@apple.com>
2479
2480         Move Objective-C bindings specific code into the bindings
2481         https://bugs.webkit.org/show_bug.cgi?id=160561
2482
2483         Reviewed by Tim Horton.
2484
2485         * bindings/objc/DOMDocument.mm:
2486         (-[DOMDocument createEntityReference:]):
2487         (-[DOMDocument getElementsByTagName:]):
2488         (-[DOMDocument getElementsByTagNameNS:localName:]):
2489         (-[DOMDocument getElementsByClassName:]):
2490         * bindings/objc/DOMElement.mm:
2491         (-[DOMElement getElementsByTagName:]):
2492         (-[DOMElement getElementsByTagNameNS:localName:]):
2493         (-[DOMElement getElementsByClassName:]):
2494         * css/CSSCharsetRule.idl:
2495         * dom/ContainerNode.cpp:
2496         (WebCore::ContainerNode::getElementsByTagNameForObjC): Deleted.
2497         (WebCore::ContainerNode::getElementsByTagNameNSForObjC): Deleted.
2498         (WebCore::ContainerNode::getElementsByClassNameForObjC): Deleted.
2499         * dom/ContainerNode.h:
2500         * dom/Document.cpp:
2501         (WebCore::Document::createEntityReference): Deleted.
2502         * dom/Document.h:
2503         * dom/Document.idl:
2504         * dom/Element.idl:
2505
2506 2016-08-04  Anders Carlsson  <andersca@apple.com>
2507
2508         Clean up the deprecated Objective-C binding methods
2509         https://bugs.webkit.org/show_bug.cgi?id=160558
2510
2511         Reviewed by Tim Horton.
2512
2513         Put the deprecated methods in their respective category @implementation, and
2514         simply have them call their non-deprecated counterparts.
2515
2516         * bindings/objc/DOMCSSMediaRule.mm:
2517         (-[DOMCSSMediaRule deleteRule:]):
2518         (-[DOMCSSMediaRule insertRule::]):
2519         * bindings/objc/DOMCSSPrimitiveValue.mm:
2520         (-[DOMCSSPrimitiveValue setFloatValue::]):
2521         (-[DOMCSSPrimitiveValue setStringValue::]):
2522         * bindings/objc/DOMCSSStyleDeclaration.mm:
2523         (-[DOMCSSStyleDeclaration setProperty:::]):
2524         * bindings/objc/DOMCSSStyleSheet.mm:
2525         (-[DOMCSSStyleSheet insertRule::]):
2526         * bindings/objc/DOMCharacterData.mm:
2527         (-[DOMCharacterData deleteData:length:]):
2528         (-[DOMCharacterData replaceData:length:data:]):
2529         (-[DOMCharacterData remove]):
2530         (-[DOMCharacterData substringData::]):
2531         (-[DOMCharacterData insertData::]):
2532         (-[DOMCharacterData deleteData::]):
2533         (-[DOMCharacterData replaceData:::]):
2534         * bindings/objc/DOMDocument.mm:
2535         (-[DOMDocument createProcessingInstruction::]):
2536         (-[DOMDocument importNode::]):
2537         (-[DOMDocument createElementNS::]):
2538         (-[DOMDocument createAttributeNS::]):
2539         (-[DOMDocument getElementsByTagNameNS::]):
2540         (-[DOMDocument createNodeIterator::::]):
2541         (-[DOMDocument createTreeWalker::::]):
2542         (-[DOMDocument getOverrideStyle::]):
2543         (-[DOMDocument createExpression::]):
2544         (-[DOMDocument evaluate:::::]):
2545         (-[DOMDocument getComputedStyle::]):
2546         * bindings/objc/DOMElement.mm:
2547         (-[DOMElement setAttribute::]):
2548         (-[DOMElement getAttributeNS::]):
2549         (-[DOMElement setAttributeNS:::]):
2550         (-[DOMElement removeAttributeNS::]):
2551         (-[DOMElement getElementsByTagNameNS::]):
2552         (-[DOMElement getAttributeNodeNS::]):
2553         (-[DOMElement hasAttributeNS::]):
2554         * bindings/objc/DOMEvent.mm:
2555         (-[DOMEvent stopImmediatePropagation]):
2556         (-[DOMEvent initEvent:::]):
2557         * bindings/objc/DOMHTMLSelectElement.mm:
2558         (-[DOMHTMLSelectElement remove:]):
2559         (-[DOMHTMLSelectElement add::]):
2560         * bindings/objc/DOMMouseEvent.mm:
2561         (-[DOMMouseEvent initMouseEvent:::::::::::::::]):
2562         * bindings/objc/DOMMutationEvent.mm:
2563         (-[DOMMutationEvent initMutationEvent::::::::]):
2564         * bindings/objc/DOMNamedNodeMap.mm:
2565         (-[DOMNamedNodeMap getNamedItemNS::]):
2566         (-[DOMNamedNodeMap removeNamedItemNS::]):
2567         * bindings/objc/DOMNode.mm:
2568         (-[DOMNode insertBefore::]):
2569         (-[DOMNode replaceChild::]):
2570         (-[DOMNode isSupported::]):
2571         * bindings/objc/DOMRange.mm:
2572         (-[DOMRange setStart::]):
2573         (-[DOMRange setEnd::]):
2574         (-[DOMRange compareBoundaryPoints::]):
2575         * bindings/objc/DOMUIEvent.mm:
2576         (-[DOMUIEvent initUIEvent:::::]):
2577         * bindings/objc/DOMXPathExpression.mm:
2578         (-[DOMXPathExpression evaluate:::]):
2579
2580 2016-08-04  Jeremy Jones  <jeremyj@apple.com>
2581
2582         Temporary redirected m3u8 streaming stopped working.
2583         https://bugs.webkit.org/show_bug.cgi?id=160472
2584         rdar://problem/27592694
2585
2586         Reviewed by Alex Christensen.
2587
2588         Test: http/tests/media/hls/hls-redirect.html
2589
2590         The change for https://trac.webkit.org/changeset/202466 hides knowledge of the temporary redirected URL from 
2591         WebCoreNSURLSession clients. MPEG playlists (e.g. .m3u8) can contain paths relative to the redirected URL.
2592
2593         This change exposes the redirected URL for MPEG playlists.
2594
2595         * platform/MIMETypeRegistry.cpp:
2596         (WebCore::initializeMPEGPlaylistMIMETypes): Added.
2597         (WebCore::initializeMIMETypeRegistry):
2598         (WebCore::MIMETypeRegistry::isMPEGPlaylistMIMEType): Added.
2599         * platform/MIMETypeRegistry.h:
2600         * platform/network/cocoa/WebCoreNSURLSession.mm:
2601         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Add MPEG playlist condition.
2602         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]): Add MPEG playlist condition.
2603
2604 2016-08-04  Alex Christensen  <achristensen@webkit.org>
2605
2606         Content Blocker cannot block WebSocket connections
2607         https://bugs.webkit.org/show_bug.cgi?id=160159
2608
2609         Reviewed by Brady Eidson.
2610
2611         Tests: http/tests/websocket/tests/hybi/contentextensions/block-cookies-worker.php
2612                http/tests/websocket/tests/hybi/contentextensions/block-cookies.php
2613                http/tests/websocket/tests/hybi/contentextensions/block-worker.html
2614                http/tests/websocket/tests/hybi/contentextensions/block.html
2615                http/tests/websocket/tests/hybi/contentextensions/display-none-worker.html
2616                http/tests/websocket/tests/hybi/contentextensions/display-none.html
2617                http/tests/websocket/tests/hybi/contentextensions/upgrade-worker.html
2618                http/tests/websocket/tests/hybi/contentextensions/upgrade.html
2619
2620         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
2621         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageError):
2622         (WebCore::ThreadableWebSocketChannelClientWrapper::didUpgradeURL):
2623         (WebCore::ThreadableWebSocketChannelClientWrapper::suspend):
2624         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
2625         * Modules/websockets/WebSocket.cpp:
2626         (WebCore::WebSocket::didClose):
2627         (WebCore::WebSocket::didUpgradeURL):
2628         (WebCore::WebSocket::getFramingOverhead):
2629         * Modules/websockets/WebSocket.h:
2630         
2631         Added didUpgradeURL to WebSocketChannelClient so the WebSocketChannel can tell the WebSocket
2632         that it has upgraded a ws: url to a wss: url.
2633         
2634         * Modules/websockets/WebSocketChannel.cpp:
2635         (WebCore::WebSocketChannel::~WebSocketChannel):
2636         (WebCore::WebSocketChannel::connect):
2637         
2638         If content extensions are being used, run the URL through the content extension and apply its actions
2639         before connecting the WebSocket.  This is done in WebSocketChannel instead of WebSocket like the CSP checks
2640         because we need access to the Document in order to get access to the main document's URL for if-domain and
2641         unless-domain rules, and to apply any display:none css to the Document.
2642         
2643         (WebCore::WebSocketChannel::disconnect):
2644         * Modules/websockets/WebSocketChannelClient.h:
2645         (WebCore::WebSocketChannelClient::~WebSocketChannelClient):
2646         (WebCore::WebSocketChannelClient::WebSocketChannelClient):
2647         (WebCore::WebSocketChannelClient::didConnect):
2648         (WebCore::WebSocketChannelClient::didReceiveMessage):
2649         (WebCore::WebSocketChannelClient::didReceiveBinaryData):
2650         (WebCore::WebSocketChannelClient::didReceiveMessageError):
2651         (WebCore::WebSocketChannelClient::didUpdateBufferedAmount):
2652         (WebCore::WebSocketChannelClient::didStartClosingHandshake):
2653         (WebCore::WebSocketChannelClient::didClose):
2654         
2655         Made WebSocketChannelClient purely virtual to avoid accidentally making an implementation that is missing functionality.
2656         
2657         (WebCore::WebSocketChannelClient::didUpgradeURL): Added.
2658         * Modules/websockets/WebSocketHandshake.cpp:
2659         (WebCore::WebSocketHandshake::getExpectedWebSocketAccept):
2660         (WebCore::WebSocketHandshake::WebSocketHandshake):
2661         (WebCore::WebSocketHandshake::clientOrigin):
2662         (WebCore::WebSocketHandshake::clientLocation):
2663         (WebCore::WebSocketHandshake::clientHandshakeMessage):
2664         
2665         Only put cookies on the WebSocket's handshake if we are allowed to use cookies.
2666         
2667         (WebCore::WebSocketHandshake::clientHandshakeRequest):
2668         
2669         A WebSocketHandshake always has a Document* for its ScriptExecutionContext, so I replaced m_context with 
2670         m_document and removed a suspicious-looking check for is<Document> that turned out to not be suspicious at all.
2671         
2672         (WebCore::WebSocketHandshake::reset):
2673         (WebCore::WebSocketHandshake::clearDocument):
2674         (WebCore::WebSocketHandshake::readServerHandshake):
2675         (WebCore::WebSocketHandshake::clearScriptExecutionContext): Deleted.
2676         * Modules/websockets/WebSocketHandshake.h:
2677         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
2678         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
2679         (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpgradeURL):
2680         (WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
2681         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
2682         * contentextensions/ContentExtensionActions.h:
2683         
2684         Before this change we would pass a ResourceRequest as a parameter to the content extension engine.
2685         The ResourceRequest would be used to get the URL, and it would be modified by possibly disabling cookies
2686         or making the URL https.  Any display:none CSS rules added were put into the Document through the DocumentLoader.
2687         The only information it needed to return was whether the load was blocked.
2688         To make content extensions work with WebSockets, we need to pass a URL as a parameter instead of a ResourceRequest
2689         because there is no ResourceRequest with WebSockets, only a URL.  We can still put CSS rules in through the DocumentLoader,
2690         but the rest of the actions need to be returned through the return value, which is then processed by the callers.
2691         BlockedStatus is now a struct containing a set of actions to apply, and applyBlockedStatusToRequest is a helper function
2692         that applies the actions to the ResourceRequests we have at all previously existing call sites of processContentExtensionRulesForLoad.
2693         
2694         * contentextensions/ContentExtensionsBackend.cpp:
2695         (WebCore::ContentExtensions::ContentExtensionsBackend::globalDisplayNoneStyleSheet):
2696         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
2697         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
2698         (WebCore::ContentExtensions::applyBlockedStatusToRequest):
2699         * contentextensions/ContentExtensionsBackend.h:
2700         * html/HTMLMediaElement.cpp:
2701         (WebCore::HTMLMediaElement::loadResource):
2702         
2703         Here, we also only had a URL.  Before, we were making a ResourceRequest from the URL just for the content extension engine,
2704         but now we can just pass the URL.
2705         
2706         * loader/FrameLoader.cpp:
2707         (WebCore::FrameLoader::loadResourceSynchronously):
2708         * loader/PingLoader.cpp:
2709         (WebCore::processContentExtensionRulesForLoad):
2710         (WebCore::PingLoader::loadImage):
2711         (WebCore::PingLoader::sendPing):
2712         (WebCore::PingLoader::sendViolationReport):
2713         * loader/ResourceLoader.cpp:
2714         (WebCore::ResourceLoader::willSendRequestInternal):
2715         * loader/cache/CachedResourceLoader.cpp:
2716         (WebCore::CachedResourceLoader::requestResource):
2717         * page/UserContentProvider.cpp:
2718         (WebCore::contentExtensionsEnabled):
2719         (WebCore::UserContentProvider::processContentExtensionRulesForLoad):
2720         (WebCore::UserContentProvider::actionsForResourceLoad):
2721         * page/UserContentProvider.h:
2722
2723 2016-08-04  Chris Dumez  <cdumez@apple.com>
2724
2725         [[Prototype]] property of an interface object for a callback interface must be the Object.prototype object
2726         https://bugs.webkit.org/show_bug.cgi?id=160555
2727
2728         Reviewed by Geoffrey Garen.
2729
2730         [[Prototype]] property of an interface object for a callback interface
2731         must be the Object.prototype object:
2732         - http://heycam.github.io/webidl/#interface-object
2733
2734         This impacts NodeFilter, which is a callback interface.
2735
2736         No new tests, rebaselined existing test.
2737
2738         * bindings/scripts/CodeGeneratorJS.pm:
2739         (GenerateConstructorHelperMethods):
2740
2741 2016-08-04  Chris Dumez  <cdumez@apple.com>
2742
2743         Element.insertAdjacent*() should throw a SYNTAX_ERR for invalid "where" parameter
2744         https://bugs.webkit.org/show_bug.cgi?id=160514
2745
2746         Reviewed by Alex Christensen.
2747
2748         Element.insertAdjacent*() should throw a SYNTAX_ERR for invalid "where" parameter:
2749         - https://dom.spec.whatwg.org/#insert-adjacent
2750
2751         We were throwing a NOT_SUPPORTED_ERR instead.
2752
2753         No new tests, rebaselined existing tests.
2754
2755         * html/HTMLElement.cpp:
2756         (WebCore::HTMLElement::insertAdjacent):
2757
2758 2016-08-04  Alejandro G. Castro  <alex@igalia.com>
2759
2760         WebRTC: OWR: Add support for the muted state in the mediaplayer
2761         https://bugs.webkit.org/show_bug.cgi?id=160502
2762
2763         Modified the load, play and stop methods to handle the new
2764         situation where the mediaSource could be empty, until the remote
2765         side sends the information to create the receiver.
2766
2767         Reviewed by Philippe Normand.
2768
2769         No new tests, we need to upstream the owr endpoint to check this
2770         situation.
2771
2772         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
2773         (WebCore::MediaPlayerPrivateGStreamerOwr::play): Check the muted
2774         state of the tracks if required, we do it using the new
2775         maybeHandleChangeMutedState function.
2776         (WebCore::MediaPlayerPrivateGStreamerOwr::load): Add always the
2777         observer of the track to check when it is unmuted, and we delay
2778         enabling/setting the source until the play or the unmute.
2779         (WebCore::MediaPlayerPrivateGStreamerOwr::internalLoad): Removed,
2780         we now do all in the load method.
2781         (WebCore::MediaPlayerPrivateGStreamerOwr::stop): Remove the
2782         mediasource when disabling. Removed the m_stopped state, it was
2783         there because the internalLoad was called multiple times.
2784         (WebCore::MediaPlayerPrivateGStreamerOwr::trackMutedChanged):
2785         Check the muted state and handle it, we use the new method
2786         maybeHandleChangeMutedState.
2787         (WebCore::MediaPlayerPrivateGStreamerOwr::maybeHandleChangeMutedState):
2788         Check if the track is muted or not, in case it is muted disable
2789         the the renderer and remove its mediasource. If it is not muted
2790         enable the renderer and set the mediasource.
2791         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink): Move
2792         the workaround for the renderer to this method when it is created.
2793         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
2794         Removed internalLoad method and the m_stopped attribute used to
2795         call internalLoad multiple times.
2796
2797 2016-08-04  Youenn Fablet  <youenn@apple.com>
2798
2799         DocumentThreadableLoader should pass the fetch mode to underlying loader code
2800         https://bugs.webkit.org/show_bug.cgi?id=160399
2801
2802         Reviewed by Alex Christensen.
2803
2804         Tests: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-origin-worker.html
2805                imported/w3c/web-platform-tests/fetch/api/redirect/redirect-origin.html
2806         Covered by existing and rebased tests.
2807
2808         DocumentThredableLoader was previously loading resources in NoCors mode and doing the cors checks on it own.
2809         This was duplicating code and increasing the risk of being not consistent.
2810         DocumentThreadableLoader is now passing the fetch mode given by client to underlying loader code.
2811         This allows removing some CORS checks in DocumentThreadableLoader code for redirections.
2812
2813         Updated SubresourceLoader redirection CORS checks to be on par with DocumentThreadableLoader.
2814         In particular, aligning the code with https://fetch.spec.whatwg.org/#http-redirect-fetch.
2815
2816         The error logging situation is not perfect as some errors are properly logged in the console while some others are not.
2817         For instance blockedError (due to forbidden port for instance) reason is not logged on the console.
2818
2819         * loader/DocumentThreadableLoader.cpp:
2820         (WebCore::DocumentThreadableLoader::redirectReceived): Updating redirection checking as SubresourceLoader is already doing most of the checks.
2821         (WebCore::DocumentThreadableLoader::didReceiveResponse): Removing temp hack as tainting is now computed by underlying loader code.
2822         (WebCore::DocumentThreadableLoader::loadRequest): Removing fetch mode change.
2823         * loader/SubresourceLoader.cpp:
2824         (WebCore::SubresourceLoader::willSendRequestInternal): Updating cancellation error and improve error logging.
2825         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl): Improved the checks and error reporting.
2826         Tried to align as much as possible to https://fetch.spec.whatwg.org/#http-redirect-fetch.
2827         * loader/SubresourceLoader.h:
2828         * xml/XMLHttpRequest.cpp:
2829         (WebCore::XMLHttpRequest::didFail): Added an error message to the console in case of access control error.
2830
2831 2016-08-03  Chris Dumez  <cdumez@apple.com>
2832
2833         Object.getOwnPropertyNames() on NamedNodeMap fails to return named properties
2834         https://bugs.webkit.org/show_bug.cgi?id=160517
2835
2836         Reviewed by Alex Christensen.
2837
2838         Object.getOwnPropertyNames() on NamedNodeMap should return named
2839         properties' names as per:
2840         - https://dom.spec.whatwg.org/#dom-namednodemap-item
2841
2842         No new tests, rebaselined existing tests.
2843
2844         * dom/NamedNodeMap.cpp:
2845         (WebCore::NamedNodeMap::supportedPropertyNames):
2846         * dom/NamedNodeMap.h:
2847
2848 2016-08-03  Chris Dumez  <cdumez@apple.com>
2849
2850         Drop DocumentType.internalSubset attribute
2851         https://bugs.webkit.org/show_bug.cgi?id=160530
2852
2853         Reviewed by Alex Christensen.
2854
2855         Drop DocumentType.internalSubset attribute.
2856
2857         It is no longer in the DOM specification:
2858         - https://dom.spec.whatwg.org/#documenttype
2859         - https://w3c.github.io/DOM-Parsing/#xml-serializing-a-documenttype-node
2860
2861         Other browsers have already dropped it. In WebKit, it was always null
2862         anyway.
2863
2864         No new tests, rebaselined existing test.
2865
2866         * bindings/objc/DOMDocumentType.mm:
2867         (-[DOMDocumentType internalSubset]):
2868         * dom/DocumentType.h:
2869         * dom/DocumentType.idl:
2870         * dom/Node.cpp:
2871         (WebCore::Node::isEqualNode): Deleted.
2872         * editing/MarkupAccumulator.cpp:
2873         (WebCore::MarkupAccumulator::appendDocumentType): Deleted.
2874         * inspector/InspectorDOMAgent.cpp:
2875         (WebCore::InspectorDOMAgent::buildObjectForNode): Deleted.
2876
2877 2016-08-03  Chris Dumez  <cdumez@apple.com>
2878
2879         Drop legacy Document.defaultCharset attribute
2880         https://bugs.webkit.org/show_bug.cgi?id=160536
2881
2882         Reviewed by Alex Christensen.
2883
2884         Drop legacy Document.defaultCharset attribute.
2885
2886         It is no longer in the specification:
2887         - https://dom.spec.whatwg.org/#interface-document
2888
2889         Firefox and Chrome have already dropped it.
2890
2891         No new tests, rebaselined existing test.
2892
2893         * bindings/objc/DOMDocument.mm:
2894         (-[DOMDocument defaultCharset]):
2895         * dom/Document.cpp:
2896         (WebCore::Document::defaultCharsetForBindings):
2897         * dom/Document.h:
2898         * dom/Document.idl:
2899
2900 2016-08-03  Anders Carlsson  <andersca@apple.com>
2901
2902         Remove some unneeded #ifs now that the Objective-C bindings are frozen
2903         https://bugs.webkit.org/show_bug.cgi?id=160532
2904
2905         Reviewed by Tim Horton.
2906
2907         * DerivedSources.make:
2908         * Modules/mediasession/HTMLMediaElementMediaSession.idl:
2909         * Modules/mediastream/HTMLMediaElementMediaStream.idl:
2910         * WebCore.xcodeproj/project.pbxproj:
2911         * animation/DocumentAnimation.idl:
2912         * dom/ChildNode.idl:
2913         * dom/Document.idl:
2914         * dom/Element.idl:
2915         * dom/Event.idl:
2916         * dom/ParentNode.idl:
2917         * fileapi/Blob.idl:
2918         * fileapi/FileError.idl:
2919         * html/DOMSettableTokenList.h: Removed.
2920         * html/DOMSettableTokenList.idl: Removed.
2921         * html/HTMLCanvasElement.idl:
2922         * html/HTMLEmbedElement.idl:
2923         * html/HTMLFrameElement.idl:
2924         * html/HTMLIFrameElement.idl:
2925         * html/HTMLMediaElement.idl:
2926         * html/HTMLObjectElement.idl:
2927         * html/HTMLOptionsCollection.idl:
2928         * html/HTMLVideoElement.idl:
2929
2930 2016-08-03  Myles C. Maxfield  <mmaxfield@apple.com>
2931
2932         [iOS] SF-Heavy is not accessible from web content
2933         https://bugs.webkit.org/show_bug.cgi?id=160522
2934         <rdar://problem/27685273>
2935
2936         Reviewed by Simon Fraser.
2937
2938         The mappings we were using from CSS font-weight to CoreText font weight were inaccurate.
2939         Instead, these new mappings should be used.
2940
2941         Test: fast/text/system-font-weight.html
2942
2943         * platform/graphics/ios/FontCacheIOS.mm:
2944         (WebCore::systemFontModificationAttributes):
2945
2946 2016-08-03  Anders Carlsson  <andersca@apple.com>
2947
2948         Remove the Objective-C bindings generator
2949         https://bugs.webkit.org/show_bug.cgi?id=160526
2950
2951         Reviewed by Sam Weinig.
2952
2953         * DerivedSources.make:
2954         * WebCore.xcodeproj/project.pbxproj:
2955         * bindings/objc/PublicDOMInterfaces.h: Removed.
2956         * bindings/scripts/CodeGeneratorObjC.pm: Removed.
2957         * bindings/scripts/test/ObjC/DOMFloat64Array.h: Removed.
2958         * bindings/scripts/test/ObjC/DOMFloat64Array.mm: Removed.
2959         * bindings/scripts/test/ObjC/DOMFloat64ArrayInternal.h: Removed.
2960         * bindings/scripts/test/ObjC/DOMInterfaceName.h: Removed.
2961         * bindings/scripts/test/ObjC/DOMInterfaceName.mm: Removed.
2962         * bindings/scripts/test/ObjC/DOMInterfaceNameInternal.h: Removed.
2963         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.h: Removed.
2964         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm: Removed.
2965         * bindings/scripts/test/ObjC/DOMTestActiveDOMObjectInternal.h: Removed.
2966         * bindings/scripts/test/ObjC/DOMTestCallback.h: Removed.
2967         * bindings/scripts/test/ObjC/DOMTestCallback.mm: Removed.
2968         * bindings/scripts/test/ObjC/DOMTestCallbackFunction.h: Removed.
2969         * bindings/scripts/test/ObjC/DOMTestCallbackFunction.mm: Removed.
2970         * bindings/scripts/test/ObjC/DOMTestCallbackFunctionInternal.h: Removed.
2971         * bindings/scripts/test/ObjC/DOMTestCallbackInternal.h: Removed.
2972         * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructor.h: Removed.
2973         * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructor.mm: Removed.
2974         * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorInternal.h: Removed.
2975         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h: Removed.
2976         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm: Removed.
2977         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h: Removed.
2978         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.h: Removed.
2979         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.mm: Removed.
2980         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetterInternal.h: Removed.
2981         * bindings/scripts/test/ObjC/DOMTestEventConstructor.h: Removed.
2982         * bindings/scripts/test/ObjC/DOMTestEventConstructor.mm: Removed.
2983         * bindings/scripts/test/ObjC/DOMTestEventConstructorInternal.h: Removed.
2984         * bindings/scripts/test/ObjC/DOMTestEventTarget.h: Removed.
2985         * bindings/scripts/test/ObjC/DOMTestEventTarget.mm: Removed.
2986         * bindings/scripts/test/ObjC/DOMTestEventTargetInternal.h: Removed.
2987         * bindings/scripts/test/ObjC/DOMTestException.h: Removed.
2988         * bindings/scripts/test/ObjC/DOMTestException.mm: Removed.
2989         * bindings/scripts/test/ObjC/DOMTestExceptionInternal.h: Removed.
2990         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.h: Removed.
2991         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.mm: Removed.
2992         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachableInternal.h: Removed.
2993         * bindings/scripts/test/ObjC/DOMTestGlobalObject.h: Removed.
2994         * bindings/scripts/test/ObjC/DOMTestGlobalObject.mm: Removed.
2995         * bindings/scripts/test/ObjC/DOMTestGlobalObjectInternal.h: Removed.
2996         * bindings/scripts/test/ObjC/DOMTestImplements.cpp: Removed.
2997         * bindings/scripts/test/ObjC/DOMTestImplements.h: Removed.
2998         * bindings/scripts/test/ObjC/DOMTestInterface.h: Removed.
2999         * bindings/scripts/test/ObjC/DOMTestInterface.mm: Removed.
3000         * bindings/scripts/test/ObjC/DOMTestInterfaceInternal.h: Removed.
3001         * bindings/scripts/test/ObjC/DOMTestIterable.h: Removed.
3002         * bindings/scripts/test/ObjC/DOMTestIterable.mm: Removed.
3003         * bindings/scripts/test/ObjC/DOMTestIterableInternal.h: Removed.
3004         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.h: Removed.
3005         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.mm: Removed.
3006         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructorInternal.h: Removed.
3007         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h: Removed.
3008         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm: Removed.
3009         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h: Removed.
3010         * bindings/scripts/test/ObjC/DOMTestNamedConstructor.h: Removed.
3011         * bindings/scripts/test/ObjC/DOMTestNamedConstructor.mm: Removed.
3012         * bindings/scripts/test/ObjC/DOMTestNamedConstructorInternal.h: Removed.
3013         * bindings/scripts/test/ObjC/DOMTestNode.h: Removed.
3014         * bindings/scripts/test/ObjC/DOMTestNode.mm: Removed.
3015         * bindings/scripts/test/ObjC/DOMTestNodeInternal.h: Removed.
3016         * bindings/scripts/test/ObjC/DOMTestNondeterministic.h: Removed.
3017         * bindings/scripts/test/ObjC/DOMTestNondeterministic.mm: Removed.
3018         * bindings/scripts/test/ObjC/DOMTestNondeterministicInternal.h: Removed.
3019         * bindings/scripts/test/ObjC/DOMTestObj.h: Removed.
3020         * bindings/scripts/test/ObjC/DOMTestObj.mm: Removed.
3021         * bindings/scripts/test/ObjC/DOMTestObjInternal.h: Removed.
3022         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.h: Removed.
3023         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.mm: Removed.
3024         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructorsInternal.h: Removed.
3025         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltins.h: Removed.
3026         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltins.mm: Removed.
3027         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltinsInternal.h: Removed.
3028         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h: Removed.
3029         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm: Removed.
3030         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterfaceInternal.h: Removed.
3031         * bindings/scripts/test/ObjC/DOMTestSupplemental.cpp: Removed.
3032         * bindings/scripts/test/ObjC/DOMTestSupplemental.h: Removed.
3033         * bindings/scripts/test/ObjC/DOMTestTypedefs.h: Removed.
3034         * bindings/scripts/test/ObjC/DOMTestTypedefs.mm: Removed.
3035         * bindings/scripts/test/ObjC/DOMTestTypedefsInternal.h: Removed.
3036         * bindings/scripts/test/ObjC/DOMattribute.h: Removed.
3037         * bindings/scripts/test/ObjC/DOMattribute.mm: Removed.
3038         * bindings/scripts/test/ObjC/DOMattributeInternal.h: Removed.
3039         * bindings/scripts/test/ObjC/DOMreadonly.h: Removed.
3040         * bindings/scripts/test/ObjC/DOMreadonly.mm: Removed.
3041         * bindings/scripts/test/ObjC/DOMreadonlyInternal.h: Removed.
3042         * bindings/scripts/test/ObjC/ObjCTestSupplemental.cpp: Removed.
3043         * bindings/scripts/test/ObjC/ObjCTestSupplemental.h: Removed.
3044
3045 2016-08-03  Anders Carlsson  <andersca@apple.com>
3046
3047         Remove dead bindings code
3048         https://bugs.webkit.org/show_bug.cgi?id=160521
3049
3050         Reviewed by Tim Horton.
3051
3052         * WebCore.xcodeproj/project.pbxproj:
3053         * bindings/objc/DOMBlob.mm:
3054         (core): Deleted.
3055         * bindings/objc/DOMBlobInternal.h:
3056         * bindings/objc/DOMCDATASection.mm:
3057         (core): Deleted.
3058         * bindings/objc/DOMCDATASectionInternal.h:
3059         * bindings/objc/DOMCSSCharsetRule.mm:
3060         (core): Deleted.
3061         (kit): Deleted.
3062         * bindings/objc/DOMCSSCharsetRuleInternal.h: Removed.
3063         * bindings/objc/DOMCSSFontFaceRule.mm:
3064         (core): Deleted.
3065         (kit): Deleted.
3066         * bindings/objc/DOMCSSFontFaceRuleInternal.h: Removed.
3067         * bindings/objc/DOMCSSImportRule.mm:
3068         (core): Deleted.
3069         (kit): Deleted.
3070         * bindings/objc/DOMCSSImportRuleInternal.h: Removed.
3071         * bindings/objc/DOMCSSMediaRule.mm:
3072         (core): Deleted.
3073         (kit): Deleted.
3074         * bindings/objc/DOMCSSMediaRuleInternal.h: Removed.
3075         * bindings/objc/DOMCSSPageRule.mm:
3076         (core): Deleted.
3077         (kit): Deleted.
3078         * bindings/objc/DOMCSSPageRuleInternal.h: Removed.
3079         * bindings/objc/DOMCSSPrimitiveValue.mm:
3080         (core): Deleted.
3081         * bindings/objc/DOMCSSPrimitiveValueInternal.h:
3082         * bindings/objc/DOMCSSRule.mm:
3083         (core): Deleted.
3084         * bindings/objc/DOMCSSRuleInternal.h:
3085         * bindings/objc/DOMCSSRuleList.mm:
3086         (core): Deleted.
3087         * bindings/objc/DOMCSSRuleListInternal.h:
3088         * bindings/objc/DOMCSSStyleRule.mm:
3089         (core): Deleted.
3090         (kit): Deleted.
3091         * bindings/objc/DOMCSSStyleRuleInternal.h: Removed.
3092         * bindings/objc/DOMCSSStyleSheet.mm:
3093         (core): Deleted.
3094         * bindings/objc/DOMCSSStyleSheetInternal.h:
3095         * bindings/objc/DOMCSSUnknownRule.mm:
3096         (core): Deleted.
3097         (kit): Deleted.
3098         * bindings/objc/DOMCSSUnknownRuleInternal.h: Removed.
3099         * bindings/objc/DOMCSSValue.mm:
3100         (core): Deleted.
3101         * bindings/objc/DOMCSSValueInternal.h:
3102         * bindings/objc/DOMCSSValueList.mm:
3103         (core): Deleted.
3104         (kit): Deleted.
3105         * bindings/objc/DOMCSSValueListInternal.h: Removed.
3106         * bindings/objc/DOMCharacterData.mm:
3107         (core): Deleted.
3108         (kit): Deleted.
3109         * bindings/objc/DOMCharacterDataInternal.h: Removed.
3110         * bindings/objc/DOMComment.mm:
3111         (core): Deleted.
3112         * bindings/objc/DOMCommentInternal.h:
3113         * bindings/objc/DOMCounter.mm:
3114         (core): Deleted.
3115         * bindings/objc/DOMCounterInternal.h:
3116         * bindings/objc/DOMDOMImplementation.mm:
3117         (core): Deleted.
3118         * bindings/objc/DOMDOMImplementationInternal.h:
3119         * bindings/objc/DOMDOMTokenList.mm:
3120         (core): Deleted.
3121         * bindings/objc/DOMDOMTokenListInternal.h:
3122         * bindings/objc/DOMEntity.mm:
3123         (core): Deleted.
3124         (kit): Deleted.
3125         * bindings/objc/DOMEntityInternal.h: Removed.
3126         * bindings/objc/DOMEntityReference.mm:
3127         (core): Deleted.
3128         * bindings/objc/DOMEntityReferenceInternal.h:
3129         * bindings/objc/DOMFile.mm:
3130         (core): Deleted.
3131         * bindings/objc/DOMFileInternal.h:
3132         * bindings/objc/DOMHTMLAnchorElement.mm:
3133         (core): Deleted.
3134         (kit): Deleted.
3135         * bindings/objc/DOMHTMLAnchorElementInternal.h: Removed.
3136         * bindings/objc/DOMHTMLAppletElement.mm:
3137         (core): Deleted.
3138         (kit): Deleted.
3139         * bindings/objc/DOMHTMLAppletElementInternal.h: Removed.
3140         * bindings/objc/DOMHTMLAreaElement.mm:
3141         (kit): Deleted.
3142         * bindings/objc/DOMHTMLAreaElementInternal.h:
3143         * bindings/objc/DOMHTMLBRElement.mm:
3144         (core): Deleted.
3145         (kit): Deleted.
3146         * bindings/objc/DOMHTMLBRElementInternal.h: Removed.
3147         * bindings/objc/DOMHTMLBaseElement.mm:
3148         (core): Deleted.
3149         (kit): Deleted.
3150         * bindings/objc/DOMHTMLBaseElementInternal.h: Removed.
3151         * bindings/objc/DOMHTMLBaseFontElement.mm:
3152         (core): Deleted.
3153         (kit): Deleted.
3154         * bindings/objc/DOMHTMLBaseFontElementInternal.h: Removed.
3155         * bindings/objc/DOMHTMLBodyElement.mm:
3156         (core): Deleted.
3157         (kit): Deleted.
3158         * bindings/objc/DOMHTMLBodyElementInternal.h: Removed.
3159         * bindings/objc/DOMHTMLButtonElement.mm:
3160         (core): Deleted.
3161         (kit): Deleted.
3162         * bindings/objc/DOMHTMLButtonElementInternal.h: Removed.
3163         * bindings/objc/DOMHTMLCanvasElement.mm:
3164         (core): Deleted.
3165         (kit): Deleted.
3166         * bindings/objc/DOMHTMLCanvasElementInternal.h: Removed.
3167         * bindings/objc/DOMHTMLCollection.mm:
3168         (core): Deleted.
3169         * bindings/objc/DOMHTMLCollectionInternal.h:
3170         * bindings/objc/DOMHTMLDListElement.mm:
3171         (core): Deleted.
3172         (kit): Deleted.
3173         * bindings/objc/DOMHTMLDListElementInternal.h: Removed.
3174         * bindings/objc/DOMHTMLDirectoryElement.mm:
3175         (core): Deleted.
3176         (kit): Deleted.
3177         * bindings/objc/DOMHTMLDirectoryElementInternal.h: Removed.
3178         * bindings/objc/DOMHTMLDivElement.mm:
3179         (core): Deleted.
3180         (kit): Deleted.
3181         * bindings/objc/DOMHTMLDivElementInternal.h: Removed.
3182         * bindings/objc/DOMHTMLEmbedElement.mm:
3183         (core): Deleted.
3184         (kit): Deleted.
3185         * bindings/objc/DOMHTMLEmbedElementInternal.h: Removed.
3186         * bindings/objc/DOMHTMLFieldSetElement.mm:
3187         (core): Deleted.
3188         (kit): Deleted.
3189         * bindings/objc/DOMHTMLFieldSetElementInternal.h: Removed.
3190         * bindings/objc/DOMHTMLFontElement.mm:
3191         (core): Deleted.
3192         (kit): Deleted.
3193         * bindings/objc/DOMHTMLFontElementInternal.h: Removed.
3194         * bindings/objc/DOMHTMLFormElement.mm:
3195         (core): Deleted.
3196         * bindings/objc/DOMHTMLFormElementInternal.h:
3197         * bindings/objc/DOMHTMLFrameElement.mm:
3198         (core): Deleted.
3199         (kit): Deleted.
3200         * bindings/objc/DOMHTMLFrameElementInternal.h: Removed.
3201         * bindings/objc/DOMHTMLFrameSetElement.mm:
3202         (core): Deleted.
3203         (kit): Deleted.
3204         * bindings/objc/DOMHTMLFrameSetElementInternal.h: Removed.
3205         * bindings/objc/DOMHTMLHRElement.mm:
3206         (core): Deleted.
3207         (kit): Deleted.
3208         * bindings/objc/DOMHTMLHRElementInternal.h: Removed.
3209         * bindings/objc/DOMHTMLHeadElement.mm:
3210         (core): Deleted.
3211         * bindings/objc/DOMHTMLHeadElementInternal.h:
3212         * bindings/objc/DOMHTMLHeadingElement.mm:
3213         (core): Deleted.
3214         (kit): Deleted.
3215         * bindings/objc/DOMHTMLHeadingElementInternal.h: Removed.
3216         * bindings/objc/DOMHTMLHtmlElement.mm:
3217         (core): Deleted.
3218         (kit): Deleted.
3219         * bindings/objc/DOMHTMLHtmlElementInternal.h: Removed.
3220         * bindings/objc/DOMHTMLIFrameElement.mm:
3221         (core): Deleted.
3222         (kit): Deleted.
3223         * bindings/objc/DOMHTMLIFrameElementInternal.h: Removed.
3224         * bindings/objc/DOMHTMLImageElement.mm:
3225         (kit): Deleted.
3226         * bindings/objc/DOMHTMLImageElementInternal.h:
3227         * bindings/objc/DOMHTMLLIElement.mm:
3228         (core): Deleted.
3229         (kit): Deleted.
3230         * bindings/objc/DOMHTMLLIElementInternal.h: Removed.
3231         * bindings/objc/DOMHTMLLabelElement.mm:
3232         (core): Deleted.
3233         (kit): Deleted.
3234         * bindings/objc/DOMHTMLLabelElementInternal.h: Removed.
3235         * bindings/objc/DOMHTMLLegendElement.mm:
3236         (core): Deleted.
3237         (kit): Deleted.
3238         * bindings/objc/DOMHTMLLegendElementInternal.h: Removed.
3239         * bindings/objc/DOMHTMLLinkElement.mm:
3240         (kit): Deleted.
3241         * bindings/objc/DOMHTMLLinkElementInternal.h:
3242         * bindings/objc/DOMHTMLMapElement.mm:
3243         (core): Deleted.
3244         (kit): Deleted.
3245         * bindings/objc/DOMHTMLMapElementInternal.h: Removed.
3246         * bindings/objc/DOMHTMLMarqueeElement.mm:
3247         (core): Deleted.
3248         (kit): Deleted.
3249         * bindings/objc/DOMHTMLMarqueeElementInternal.h: Removed.
3250         * bindings/objc/DOMHTMLMediaElement.mm:
3251         (core): Deleted.
3252         (kit): Deleted.
3253         * bindings/objc/DOMHTMLMediaElementInternal.h: Removed.
3254         * bindings/objc/DOMHTMLMenuElement.mm:
3255         (core): Deleted.
3256         (kit): Deleted.
3257         * bindings/objc/DOMHTMLMenuElementInternal.h: Removed.
3258         * bindings/objc/DOMHTMLMetaElement.mm:
3259         (core): Deleted.
3260         (kit): Deleted.
3261         * bindings/objc/DOMHTMLMetaElementInternal.h: Removed.
3262         * bindings/objc/DOMHTMLModElement.mm:
3263         (core): Deleted.
3264         (kit): Deleted.
3265         * bindings/objc/DOMHTMLModElementInternal.h: Removed.
3266         * bindings/objc/DOMHTMLOListElement.mm:
3267         (core): Deleted.
3268         (kit): Deleted.
3269         * bindings/objc/DOMHTMLOListElementInternal.h: Removed.
3270         * bindings/objc/DOMHTMLObjectElement.mm:
3271         (core): Deleted.
3272         (kit): Deleted.
3273         * bindings/objc/DOMHTMLObjectElementInternal.h: Removed.
3274         * bindings/objc/DOMHTMLOptGroupElement.mm:
3275         (core): Deleted.
3276         (kit): Deleted.
3277         * bindings/objc/DOMHTMLOptGroupElementInternal.h: Removed.
3278         * bindings/objc/DOMHTMLOptionsCollection.mm:
3279         (core): Deleted.
3280         * bindings/objc/DOMHTMLOptionsCollectionInternal.h:
3281         * bindings/objc/DOMHTMLParagraphElement.mm:
3282         (core): Deleted.
3283         (kit): Deleted.
3284         * bindings/objc/DOMHTMLParagraphElementInternal.h: Removed.
3285         * bindings/objc/DOMHTMLParamElement.mm:
3286         (core): Deleted.
3287         (kit): Deleted.
3288         * bindings/objc/DOMHTMLParamElementInternal.h: Removed.
3289         * bindings/objc/DOMHTMLPreElement.mm:
3290         (core): Deleted.
3291         (kit): Deleted.
3292         * bindings/objc/DOMHTMLPreElementInternal.h: Removed.
3293         * bindings/objc/DOMHTMLQuoteElement.mm:
3294         (core): Deleted.
3295         (kit): Deleted.
3296         * bindings/objc/DOMHTMLQuoteElementInternal.h: Removed.
3297         * bindings/objc/DOMHTMLScriptElement.mm:
3298         (core): Deleted.
3299         * bindings/objc/DOMHTMLScriptElementInternal.h:
3300         * bindings/objc/DOMHTMLSelectElement.mm:
3301         (kit): Deleted.
3302         * bindings/objc/DOMHTMLSelectElementInternal.h:
3303         * bindings/objc/DOMHTMLStyleElement.mm:
3304         (kit): Deleted.
3305         * bindings/objc/DOMHTMLStyleElementInternal.h:
3306         * bindings/objc/DOMHTMLTableColElement.mm:
3307         (kit): Deleted.
3308         * bindings/objc/DOMHTMLTableColElementInternal.h:
3309         * bindings/objc/DOMHTMLTableElement.mm:
3310         (core): Deleted.
3311         (kit): Deleted.
3312         * bindings/objc/DOMHTMLTableElementInternal.h: Removed.
3313         * bindings/objc/DOMHTMLTableRowElement.mm:
3314         (core): Deleted.
3315         (kit): Deleted.
3316         * bindings/objc/DOMHTMLTableRowElementInternal.h: Removed.
3317         * bindings/objc/DOMHTMLTitleElement.mm:
3318         (core): Deleted.
3319         (kit): Deleted.
3320         * bindings/objc/DOMHTMLTitleElementInternal.h: Removed.
3321         * bindings/objc/DOMHTMLUListElement.mm:
3322         (core): Deleted.
3323         (kit): Deleted.
3324         * bindings/objc/DOMHTMLUListElementInternal.h: Removed.
3325         * bindings/objc/DOMHTMLVideoElement.mm:
3326         (core): Deleted.
3327         (kit): Deleted.
3328         * bindings/objc/DOMHTMLVideoElementInternal.h: Removed.
3329         * bindings/objc/DOMKeyboardEvent.mm:
3330         (core): Deleted.
3331         (kit): Deleted.
3332         * bindings/objc/DOMKeyboardEventInternal.h: Removed.
3333         * bindings/objc/DOMMediaError.mm:
3334         (core): Deleted.
3335         * bindings/objc/DOMMediaErrorInternal.h:
3336         * bindings/objc/DOMMediaList.mm:
3337         (core): Deleted.
3338         * bindings/objc/DOMMediaListInternal.h:
3339         * bindings/objc/DOMMouseEvent.mm:
3340         (core): Deleted.
3341         (kit): Deleted.
3342         * bindings/objc/DOMMouseEventInternal.h: Removed.
3343         * bindings/objc/DOMMutationEvent.mm:
3344         (core): Deleted.
3345         (kit): Deleted.
3346         * bindings/objc/DOMMutationEventInternal.h: Removed.
3347         * bindings/objc/DOMNamedNodeMap.mm:
3348         (core): Deleted.
3349         * bindings/objc/DOMNamedNodeMapInternal.h:
3350         * bindings/objc/DOMNodeIterator.mm:
3351         (core): Deleted.
3352         * bindings/objc/DOMNodeIteratorInternal.h:
3353         * bindings/objc/DOMNodeList.mm:
3354         (core): Deleted.
3355         * bindings/objc/DOMNodeListInternal.h:
3356         * bindings/objc/DOMOverflowEvent.mm:
3357         (core): Deleted.
3358         (kit): Deleted.
3359         * bindings/objc/DOMOverflowEventInternal.h: Removed.
3360         * bindings/objc/DOMProgressEvent.mm:
3361         (core): Deleted.
3362         (kit): Deleted.
3363         * bindings/objc/DOMProgressEventInternal.h: Removed.
3364         * bindings/objc/DOMRGBColor.mm:
3365         (core): Deleted.
3366         * bindings/objc/DOMRGBColorInternal.h:
3367         * bindings/objc/DOMRect.mm:
3368         (core): Deleted.
3369         * bindings/objc/DOMRectInternal.h:
3370         * bindings/objc/DOMStyleSheet.mm:
3371         (core): Deleted.
3372         * bindings/objc/DOMStyleSheetInternal.h:
3373         * bindings/objc/DOMStyleSheetList.mm:
3374         (core): Deleted.
3375         * bindings/objc/DOMStyleSheetListInternal.h:
3376         * bindings/objc/DOMText.mm:
3377         (core): Deleted.
3378         * bindings/objc/DOMTextEvent.mm:
3379         (core): Deleted.
3380         (kit): Deleted.
3381         * bindings/objc/DOMTextEventInternal.h: Removed.
3382         * bindings/objc/DOMTextInternal.h:
3383         * bindings/objc/DOMTimeRanges.mm:
3384         (core): Deleted.
3385         * bindings/objc/DOMTimeRangesInternal.h:
3386         * bindings/objc/DOMTreeWalker.mm:
3387         (core): Deleted.
3388         * bindings/objc/DOMTreeWalkerInternal.h:
3389         * bindings/objc/DOMUIEvent.mm:
3390         (core): Deleted.
3391         (kit): Deleted.
3392         * bindings/objc/DOMUIEventInternal.h: Removed.
3393         * bindings/objc/DOMWheelEvent.mm:
3394         (kit): Deleted.
3395         * bindings/objc/DOMWheelEventInternal.h:
3396         * bindings/objc/DOMXPathExpression.mm:
3397         (core): Deleted.
3398         * bindings/objc/DOMXPathExpressionInternal.h:
3399
3400 2016-08-03  Eric Carlson  <eric.carlson@apple.com>
3401
3402         [Mac] Work around AVPlayer setMuted bug
3403         https://bugs.webkit.org/show_bug.cgi?id=160519
3404         <rdar://problem/27310475>
3405
3406         Reviewed by Dean Jackson.
3407
3408         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: Only override
3409         supportsMuting on iOS.
3410
3411 2016-08-03  Eric Carlson  <eric.carlson@apple.com>
3412
3413         Cleanup HTMLMediaElement track lists.
3414         https://bugs.webkit.org/show_bug.cgi?id=160470
3415
3416         Reviewed by Brent Fulgham.
3417
3418         * html/track/AudioTrack.cpp:
3419         (WebCore::AudioTrack::willRemove): Remove unnecessary ASSERT and NULL check.
3420
3421         * html/track/TextTrackList.cpp:
3422         (TextTrackList::~TextTrackList): Call clearElement so media element and client pointers are
3423         cleared.
3424
3425 2016-08-02  Ada Chan  <adachan@apple.com>
3426
3427         [Mac] media/pip-video-going-into-fullscreen.html is a flaky failure
3428         https://bugs.webkit.org/show_bug.cgi?id=160469
3429
3430         Reviewed by Eric Carlson.
3431
3432         When going from picture-in-picture directly to fullscreen, fix the issue where the
3433         presentation mode unexpectedly changes back to inline after changing to fullscreen.
3434
3435         On Mac, standard fullscreen is not handled by WebVideoFullscreenManager.
3436         When going from picture-in-picture directly to fullscreen, we call
3437         WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode().
3438         We should update m_mode to VideoFullscreenModeStandard there to keep it in sync
3439         with the fullscreen mode in HTMLMediaElement. Otherwise, we'll inadvertently
3440         update the mode to inline when we clear the VideoFullscreenModePictureInPicture mode
3441         in -[WebVideoFullscreenInterfaceMacObjC pipDidClose:].
3442
3443         Since standard fullscreen on Mac doesn't make use of the video fullscreen layer,
3444         we need to make sure we return the video layer back to inline when the presentation
3445         mode changes to "fullscreen". We only do this on Mac because iOS does use
3446         the video fullscreen layer for standard fullscreen.
3447
3448         * Modules/mediacontrols/MediaControlsHost.cpp:
3449         (WebCore::MediaControlsHost::setPreparedToReturnVideoLayerToInline):
3450         Renamed from MediaControlsHost::setPreparedForInline to make it clear this is about
3451         whether the video layer should be inline.
3452         (WebCore::MediaControlsHost::setPreparedForInline): Deleted.
3453         * Modules/mediacontrols/MediaControlsHost.h:
3454         * Modules/mediacontrols/MediaControlsHost.idl:
3455
3456         * Modules/mediacontrols/mediaControlsApple.js:
3457         (Controller.prototype.shouldReturnVideoLayerToInline):
3458         On Mac, the video layer is inline when the presentation mode is "inline" or "fullscreen".
3459         (Controller.prototype.handlePresentationModeChange):
3460         Call shouldReturnVideoLayerToInline() to determine whether the video layer should be inline.
3461
3462         * Modules/mediacontrols/mediaControlsiOS.js: