* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-08-16  Darin Adler  <darin@apple.com>
2
3         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
4         Regenerated results, which were affected by the sequence<T> change last night.
5
6 2016-08-16  Per Arne Vollan  <pvollan@apple.com>
7
8         [Win] Hardening of getLinkedFonts function.
9         https://bugs.webkit.org/show_bug.cgi?id=160850
10
11         The SUCCEEDED macro should only be used for functions returning a HRESULT type.
12         Also, make sure a string array index will not exceed the string length.
13
14         * platform/graphics/win/FontCacheWin.cpp:
15         (WebCore::getLinkedFonts):
16
17 2016-08-16  Alex Christensen  <achristensen@webkit.org>
18
19         Simplify SocketStreamError
20         https://bugs.webkit.org/show_bug.cgi?id=160888
21
22         Reviewed by Darin Adler.
23
24         SocketStreamErrorBase and platform-specific SocketStreamError were overly complicated.
25         They had many functions that were never used.  There's no reason to have two separate classes.
26
27         * WebCore.xcodeproj/project.pbxproj:
28         * platform/network/SocketStreamError.h: Copied from Source/WebCore/platform/network/SocketStreamErrorBase.h.
29         (WebCore::SocketStreamError::SocketStreamError):
30         (WebCore::SocketStreamError::isNull):
31         (WebCore::SocketStreamError::errorCode):
32         (WebCore::SocketStreamError::failingURL):
33         (WebCore::SocketStreamError::localizedDescription):
34         (WebCore::SocketStreamErrorBase::isNull): Deleted.
35         (WebCore::SocketStreamErrorBase::errorCode): Deleted.
36         (WebCore::SocketStreamErrorBase::failingURL): Deleted.
37         (WebCore::SocketStreamErrorBase::localizedDescription): Deleted.
38         (WebCore::SocketStreamErrorBase::SocketStreamErrorBase): Deleted.
39         (WebCore::operator==): Deleted.
40         (WebCore::operator!=): Deleted.
41         * platform/network/SocketStreamErrorBase.cpp: Removed.
42         * platform/network/SocketStreamErrorBase.h: Removed.
43         * platform/network/cf/SocketStreamError.h: Removed.
44         * platform/network/curl/SocketStreamError.h: Removed.
45         * platform/network/soup/SocketStreamError.h: Removed.
46
47 2016-08-15  Ryosuke Niwa  <rniwa@webkit.org>
48
49         Conversion to sequence<T> is broken for iterable objects
50         https://bugs.webkit.org/show_bug.cgi?id=160801
51
52         Reviewed by Darin Adler.
53
54         Added the proper iterator support for sequence<T> with one caveat that we don't check for RegExp object
55         per https://github.com/heycam/webidl/issues/145.
56
57         See http://heycam.github.io/webidl/#es-sequence and http://heycam.github.io/webidl/#es-overloads
58
59         Tests: bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl
60
61         * bindings/js/JSDOMBinding.cpp:
62         (WebCore::hasIteratorMethod): Added. A helper function for checking whether a JSValue is iterable or not.
63         * bindings/js/JSDOMBinding.h:
64         (WebCore::NativeValueTraits<unsigned>::nativeValue): Removed the check for isNumber to match the spec'ed
65         behavior at http://heycam.github.io/webidl/#es-unsigned-long which calls ToNumber first without checking
66         whether the value is a number or not.
67         (WebCore::toRefPtrNativeArray): Replaced isJSArray check by isObject check and throw a TypeError. Deployed
68         forEachInIterable to support non-JSArray iterable objects. Also removed the function pointer from the third
69         argument since we were always calling JSCT::toWrapped.
70         (WebCore::toNativeArray): Ditto.
71         * bindings/js/JSDOMConvert.h:
72         (WebCore::Converter<Vector<T>>::convert): Removed the comment about toNativeArray not throwing when value
73         is not an object.
74         * bindings/scripts/CodeGeneratorJS.pm:
75         (GenerateOverloadedFunctionOrConstructor): Removed the check for isJSArray for sequence<T> as an iterable
76         object is not necessary a JSArray.
77         (WillConvertUndefinedToDefaultParameterValue): Don't return 1 for all sequences since toNativeArray and
78         toRefPtrNativeArray now throws on undefined due to isObject check.
79         (JSValueToNative): Removed the third argument from toRefPtrNativeArray.
80
81         * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.cpp: Added.
82         * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.h: Added.
83         * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequencePrivate.h: Added.
84         * bindings/scripts/test/JS/JSTestObj.cpp:
85         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
86         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: Added.
87         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h: Added.
88         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
89         (WebCore::jsTestTypedefsPrototypeFunctionFunc):
90         * bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl: Added.
91
92 2016-08-15  Chris Dumez  <cdumez@apple.com>
93
94         Rename RegisteredEventListener::listener() to callback() for clarity
95         https://bugs.webkit.org/show_bug.cgi?id=160873
96
97         Reviewed by Darin Adler.
98
99         Rename RegisteredEventListener::listener() to callback() for clarity
100         and to match the specification:
101         - https://dom.spec.whatwg.org/#concept-event-listener
102
103         Always calling listener->listener() seems wrong.
104
105         * bindings/js/JSCommandLineAPIHostCustom.cpp:
106         (WebCore::getJSListenerFunctions):
107         * dom/EventListenerMap.cpp:
108         (WebCore::findListener):
109         (WebCore::removeFirstListenerCreatedFromMarkup):
110         (WebCore::copyListenersNotCreatedFromMarkupToTarget):
111         (WebCore::EventListenerIterator::nextListener):
112         * dom/EventTarget.cpp:
113         (WebCore::EventTarget::getAttributeEventListener):
114         (WebCore::EventTarget::fireEventListeners):
115         * dom/RegisteredEventListener.h:
116         (WebCore::RegisteredEventListener::callback):
117         (WebCore::RegisteredEventListener::RegisteredEventListener):
118         (WebCore::RegisteredEventListener::listener): Deleted.
119         * inspector/InspectorDOMAgent.cpp:
120         (WebCore::InspectorDOMAgent::getEventListeners):
121         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
122
123 2016-08-15  Chris Dumez  <cdumez@apple.com>
124
125         Add support for dictionary members of non nullable wrapper types
126         https://bugs.webkit.org/show_bug.cgi?id=160876
127
128         Reviewed by Darin Adler.
129
130         Add support for dictionary members of non nullable wrapper types. We
131         only supported nullable wrapper types as dictionary members so far.
132
133         No new tests, updated bindings tests.
134
135         * bindings/js/JSDOMConvert.h:
136         * bindings/scripts/CodeGeneratorJS.pm:
137         (GenerateDictionaryImplementationContent):
138         (GenerateParametersCheck):
139         (JSValueToNative):
140         (GenerateConstructorDefinition):
141         * bindings/scripts/test/JS/JSTestInterface.cpp:
142         (WebCore::JSTestInterfaceConstructor::construct):
143         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
144         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
145         * bindings/scripts/test/JS/JSTestObj.cpp:
146         (WebCore::convertDictionary<TestObj::Dictionary>):
147         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
148         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
149         (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
150         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
151         (WebCore::constructJSTestOverloadedConstructors4):
152         (WebCore::constructJSTestOverloadedConstructors5):
153         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
154         (WebCore::JSTestTypedefsConstructor::construct):
155         * bindings/scripts/test/TestObj.idl:
156
157 2016-08-15  Chris Dumez  <cdumez@apple.com>
158
159         Drop unused EventTarget::hasActiveEventListeners()
160         https://bugs.webkit.org/show_bug.cgi?id=160869
161
162         Reviewed by Alex Christensen.
163
164         * dom/EventListenerMap.cpp:
165         (WebCore::EventListenerMap::containsActive): Deleted.
166         * dom/EventListenerMap.h:
167         * dom/EventTarget.cpp:
168         (WebCore::EventTarget::hasActiveEventListeners): Deleted.
169         * dom/EventTarget.h:
170
171 2016-08-15  Sam Weinig  <sam@webkit.org>
172
173         Speed up compile times by not including wtf/Variant.h so much
174         https://bugs.webkit.org/show_bug.cgi?id=160847
175
176         Reviewed by Alex Christensen and Saam Barati.
177
178         "using std::experimental::variant" caused internal compiler errors in MSVC2015, 
179         so we are just writing std::experimental where we use it for now.
180         We should move variant into the std::experimental namespace.
181
182         * bindings/js/JSNodeOrString.cpp:
183         (WebCore::toNodeOrStringVector):
184         * bindings/js/JSNodeOrString.h:
185         * dom/ContainerNode.cpp:
186         (WebCore::ContainerNode::childElementCount):
187         (WebCore::ContainerNode::append):
188         (WebCore::ContainerNode::prepend):
189         * dom/ContainerNode.h:
190         * dom/Node.cpp:
191         (WebCore::Node::appendChild):
192         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
193         (WebCore::firstFollowingSiblingNotInNodeSet):
194         (WebCore::Node::convertNodesOrStringsIntoNode):
195         (WebCore::Node::before):
196         (WebCore::Node::after):
197         (WebCore::Node::replaceWith):
198         * dom/Node.h:
199         (WebCore::Node::setStyleChange):
200         (WebCore::Node::customPseudoId):
201
202 2016-08-15  Daniel Bates  <dabates@apple.com>
203
204         ASSERTION FAILURE: [[videoLayer delegate] isKindOfClass:getUIViewClass()] in WebAVPlayerLayerView_videoView()
205         https://bugs.webkit.org/show_bug.cgi?id=160433
206
207         Reviewed by Eric Carlson.
208
209         Early return from WebAVPlayerLayerView_videoView() if the PiP layer does not have a non-nil delegate view.
210
211         Test: media/controls/close-page-with-picture-in-picture-video-assertion-failure.html
212
213         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
214         (WebAVPlayerLayerView_videoView):
215
216 2016-08-15  Alex Christensen  <achristensen@webkit.org>
217
218         Rename SocketStreamHandleBase to SocketStreamHandle and SocketStreamHandle to SocketStreamHandleImpl
219         https://bugs.webkit.org/show_bug.cgi?id=160858
220
221         Reviewed by Brady Eidson.
222
223         No new tests.  No change in behavior, except GTK's SocketStreamHandleImpl is now safely ThreadSafeRefCounted.
224         This is preparation for making a new kind of SocketStreamHandle which is a proxy that communicates with the NetworkProcess in WebKit2.
225
226         * CMakeLists.txt:
227         * PlatformAppleWin.cmake:
228         * PlatformEfl.cmake:
229         * PlatformGTK.cmake:
230         * PlatformMac.cmake:
231         * PlatformWinCairo.cmake:
232         * WebCore.xcodeproj/project.pbxproj:
233         * page/SocketProvider.cpp:
234         (WebCore::SocketProvider::createSocketStreamHandle):
235         * platform/network/SocketStreamHandle.cpp: Copied from Source/WebCore/platform/network/SocketStreamHandleBase.cpp.
236         (WebCore::SocketStreamHandle::SocketStreamHandle):
237         (WebCore::SocketStreamHandle::state):
238         (WebCore::SocketStreamHandle::send):
239         (WebCore::SocketStreamHandle::close):
240         (WebCore::SocketStreamHandle::disconnect):
241         (WebCore::SocketStreamHandle::sendPendingData):
242         (WebCore::SocketStreamHandleBase::SocketStreamHandleBase): Deleted.
243         (WebCore::SocketStreamHandleBase::state): Deleted.
244         (WebCore::SocketStreamHandleBase::send): Deleted.
245         (WebCore::SocketStreamHandleBase::close): Deleted.
246         (WebCore::SocketStreamHandleBase::disconnect): Deleted.
247         (WebCore::SocketStreamHandleBase::sendPendingData): Deleted.
248         * platform/network/SocketStreamHandle.h: Copied from Source/WebCore/platform/network/SocketStreamHandleBase.h.
249         (WebCore::SocketStreamHandle::~SocketStreamHandle):
250         (WebCore::SocketStreamHandle::client):
251         (WebCore::SocketStreamHandleBase::~SocketStreamHandleBase): Deleted.
252         (WebCore::SocketStreamHandleBase::client): Deleted.
253         * platform/network/SocketStreamHandleBase.cpp: Removed.
254         * platform/network/SocketStreamHandleBase.h: Removed.
255         * platform/network/cf/SocketStreamHandle.h: Removed.
256         * platform/network/cf/SocketStreamHandleCFNet.cpp: Removed.
257         * platform/network/cf/SocketStreamHandleImpl.h: Copied from Source/WebCore/platform/network/cf/SocketStreamHandle.h.
258         (WebCore::SocketStreamHandleImpl::create):
259         (WebCore::SocketStreamHandle::create): Deleted.
260         * platform/network/cf/SocketStreamHandleImplCFNet.cpp: Copied from Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp.
261         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
262         (WebCore::SocketStreamHandleImpl::scheduleStreams):
263         (WebCore::SocketStreamHandleImpl::retainSocketStreamHandle):
264         (WebCore::SocketStreamHandleImpl::releaseSocketStreamHandle):
265         (WebCore::SocketStreamHandleImpl::copyPACExecutionDescription):
266         (WebCore::SocketStreamHandleImpl::pacExecutionCallback):
267         (WebCore::SocketStreamHandleImpl::executePACFileURL):
268         (WebCore::SocketStreamHandleImpl::removePACRunLoopSource):
269         (WebCore::SocketStreamHandleImpl::chooseProxy):
270         (WebCore::SocketStreamHandleImpl::chooseProxyFromArray):
271         (WebCore::SocketStreamHandleImpl::createStreams):
272         (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
273         (WebCore::authenticationSchemeFromAuthenticationMethod):
274         (WebCore::SocketStreamHandleImpl::addCONNECTCredentials):
275         (WebCore::SocketStreamHandleImpl::copyCFStreamDescription):
276         (WebCore::SocketStreamHandleImpl::readStreamCallback):
277         (WebCore::SocketStreamHandleImpl::writeStreamCallback):
278         (WebCore::SocketStreamHandleImpl::reportErrorToClient):
279         (WebCore::SocketStreamHandleImpl::~SocketStreamHandleImpl):
280         (WebCore::SocketStreamHandleImpl::platformSend):
281         (WebCore::SocketStreamHandleImpl::platformClose):
282         (WebCore::SocketStreamHandleImpl::port):
283         (WebCore::SocketStreamHandle::SocketStreamHandle): Deleted.
284         (WebCore::SocketStreamHandle::scheduleStreams): Deleted.
285         (WebCore::SocketStreamHandle::retainSocketStreamHandle): Deleted.
286         (WebCore::SocketStreamHandle::releaseSocketStreamHandle): Deleted.
287         (WebCore::SocketStreamHandle::copyPACExecutionDescription): Deleted.
288         (WebCore::SocketStreamHandle::pacExecutionCallback): Deleted.
289         (WebCore::SocketStreamHandle::executePACFileURL): Deleted.
290         (WebCore::SocketStreamHandle::removePACRunLoopSource): Deleted.
291         (WebCore::SocketStreamHandle::chooseProxy): Deleted.
292         (WebCore::SocketStreamHandle::chooseProxyFromArray): Deleted.
293         (WebCore::SocketStreamHandle::createStreams): Deleted.
294         (WebCore::SocketStreamHandle::getStoredCONNECTProxyCredentials): Deleted.
295         (WebCore::SocketStreamHandle::addCONNECTCredentials): Deleted.
296         (WebCore::SocketStreamHandle::copyCFStreamDescription): Deleted.
297         (WebCore::SocketStreamHandle::readStreamCallback): Deleted.
298         (WebCore::SocketStreamHandle::writeStreamCallback): Deleted.
299         (WebCore::SocketStreamHandle::reportErrorToClient): Deleted.
300         (WebCore::SocketStreamHandle::~SocketStreamHandle): Deleted.
301         (WebCore::SocketStreamHandle::platformSend): Deleted.
302         (WebCore::SocketStreamHandle::platformClose): Deleted.
303         (WebCore::SocketStreamHandle::port): Deleted.
304         * platform/network/curl/SocketStreamHandle.h: Removed.
305         * platform/network/curl/SocketStreamHandleCurl.cpp: Removed.
306         * platform/network/curl/SocketStreamHandleImpl.h: Copied from Source/WebCore/platform/network/curl/SocketStreamHandle.h.
307         (WebCore::SocketStreamHandleImpl::create):
308         (WebCore::SocketStreamHandle::create): Deleted.
309         * platform/network/curl/SocketStreamHandleImplCurl.cpp: Copied from Source/WebCore/platform/network/curl/SocketStreamHandleCurl.cpp.
310         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
311         (WebCore::SocketStreamHandleImpl::~SocketStreamHandleImpl):
312         (WebCore::SocketStreamHandleImpl::platformSend):
313         (WebCore::SocketStreamHandleImpl::platformClose):
314         (WebCore::SocketStreamHandleImpl::readData):
315         (WebCore::SocketStreamHandleImpl::sendData):
316         (WebCore::SocketStreamHandleImpl::waitForAvailableData):
317         (WebCore::SocketStreamHandleImpl::startThread):
318         (WebCore::SocketStreamHandleImpl::stopThread):
319         (WebCore::SocketStreamHandleImpl::didReceiveData):
320         (WebCore::SocketStreamHandleImpl::didOpenSocket):
321         (WebCore::SocketStreamHandleImpl::createCopy):
322         (WebCore::SocketStreamHandle::SocketStreamHandle): Deleted.
323         (WebCore::SocketStreamHandle::~SocketStreamHandle): Deleted.
324         (WebCore::SocketStreamHandle::platformSend): Deleted.
325         (WebCore::SocketStreamHandle::platformClose): Deleted.
326         (WebCore::SocketStreamHandle::readData): Deleted.
327         (WebCore::SocketStreamHandle::sendData): Deleted.
328         (WebCore::SocketStreamHandle::waitForAvailableData): Deleted.
329         (WebCore::SocketStreamHandle::startThread): Deleted.
330         (WebCore::SocketStreamHandle::stopThread): Deleted.
331         (WebCore::SocketStreamHandle::didReceiveData): Deleted.
332         (WebCore::SocketStreamHandle::didOpenSocket): Deleted.
333         (WebCore::SocketStreamHandle::createCopy): Deleted.
334         * platform/network/soup/SocketStreamHandle.h: Removed.
335         * platform/network/soup/SocketStreamHandleImpl.h: Copied from Source/WebCore/platform/network/soup/SocketStreamHandle.h.
336         * platform/network/soup/SocketStreamHandleImplSoup.cpp: Copied from Source/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp.
337         (WebCore::SocketStreamHandleImpl::create):
338         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
339         (WebCore::SocketStreamHandleImpl::~SocketStreamHandleImpl):
340         (WebCore::SocketStreamHandleImpl::connected):
341         (WebCore::SocketStreamHandleImpl::connectedCallback):
342         (WebCore::SocketStreamHandleImpl::readBytes):
343         (WebCore::SocketStreamHandleImpl::readReadyCallback):
344         (WebCore::SocketStreamHandleImpl::didFail):
345         (WebCore::SocketStreamHandleImpl::writeReady):
346         (WebCore::SocketStreamHandleImpl::platformSend):
347         (WebCore::SocketStreamHandleImpl::platformClose):
348         (WebCore::SocketStreamHandleImpl::beginWaitingForSocketWritability):
349         (WebCore::SocketStreamHandleImpl::stopWaitingForSocketWritability):
350         (WebCore::SocketStreamHandleImpl::writeReadyCallback):
351         (WebCore::SocketStreamHandle::create): Deleted.
352         (WebCore::SocketStreamHandle::SocketStreamHandle): Deleted.
353         (WebCore::SocketStreamHandle::~SocketStreamHandle): Deleted.
354         (WebCore::SocketStreamHandle::connected): Deleted.
355         (WebCore::SocketStreamHandle::connectedCallback): Deleted.
356         (WebCore::SocketStreamHandle::readBytes): Deleted.
357         (WebCore::SocketStreamHandle::readReadyCallback): Deleted.
358         (WebCore::SocketStreamHandle::didFail): Deleted.
359         (WebCore::SocketStreamHandle::writeReady): Deleted.
360         (WebCore::SocketStreamHandle::platformSend): Deleted.
361         (WebCore::SocketStreamHandle::platformClose): Deleted.
362         (WebCore::SocketStreamHandle::beginWaitingForSocketWritability): Deleted.
363         (WebCore::SocketStreamHandle::stopWaitingForSocketWritability): Deleted.
364         (WebCore::SocketStreamHandle::writeReadyCallback): Deleted.
365         * platform/network/soup/SocketStreamHandleSoup.cpp: Removed.
366
367 2016-08-15  Jiewen Tan  <jiewen_tan@apple.com>
368
369         Expose crypto.getRandomValues to Web Workers
370         https://bugs.webkit.org/show_bug.cgi?id=104851
371         <rdar://problem/27285714>
372
373         Reviewed by Darin Adler.
374
375         Tests: crypto/webkitSubtle/disallowed-in-worker.html
376                crypto/workers/crypto-gc-worker.html
377                crypto/workers/crypto-random-values-limits-worker.html
378                crypto/workers/crypto-random-values-types-worker.html
379                crypto/workers/crypto-random-values-worker.html
380
381         Expose both crypto and crypto.getRandomValues to Web Workers. However, webkitSubtle is
382         disabled in Web Workers. This change also refactors a bit on IDLs related to Crypto
383         interface.
384
385         * CMakeLists.txt:
386         * DerivedSources.cpp:
387         * DerivedSources.make:
388         * WebCore.xcodeproj/project.pbxproj:
389         Introduce GlobalCrypto Interface which is used to repalace the partial IDL in both
390         DOMWindow and WorkerGlobalScope with sub-implememtations.
391         * bindings/js/JSDocumentCustom.cpp:
392         (WebCore::JSDocument::visitAdditionalChildren):
393         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
394         (WebCore::JSWorkerGlobalScope::visitAdditionalChildren):
395         * bindings/scripts/CodeGeneratorJS.pm:
396         (GenerateImplementation):
397         * bindings/scripts/IDLAttributes.txt:
398         * dom/Document.idl:
399         Add support of GenerateIsReachable=ImplScriptExecutionContext, which allow registered
400         JS Objects to live as long as ScriptExecutionContext lives, i.e. Document and
401         WorkerGlobalScope.
402         * page/Crypto.cpp:
403         (WebCore::Crypto::Crypto):
404         (WebCore::Crypto::webkitSubtle):
405         (WebCore::Crypto::document): Deleted.
406         * page/Crypto.h:
407         (WebCore::Crypto::create):
408         * page/Crypto.idl:
409         Change the opaque root of Crypto to ScriptExecutionContext such that it perserves
410         the same live time in both Window and Web Worker. And disable WebKitSubtle in Web
411         Workers.
412         * page/DOMWindow.idl:
413         * page/GlobalCrypto.idl: Added.
414         Replace partial IDL to sub-implementation of crypto attribute.
415         * workers/WorkerGlobalScope.cpp:
416         (WebCore::WorkerGlobalScope::crypto):
417         * workers/WorkerGlobalScope.h:
418         * workers/WorkerGlobalScope.idl:
419         Introduce crypto attribute to Web Workers.
420
421 2016-08-15  Joseph Pecoraro  <pecoraro@apple.com>
422
423         Use #pragma once in inspector headers
424         https://bugs.webkit.org/show_bug.cgi?id=160861
425
426         Reviewed by Mark Lam.
427
428         * inspector/*.h:
429
430 2016-08-15  Keith Rollin  <krollin@apple.com>
431
432         Rename LOG_ALWAYS
433         https://bugs.webkit.org/show_bug.cgi?id=160768
434
435         Rename LOG_ALWAYS and friends, given that the first parameter to it is
436         a boolean expression that determines whether or not logging should be
437         performed.
438
439         Reviewed by Chris Dumez.
440
441         No new tests. No new functionality is added. Only some macro names
442         have been changed.
443
444         * loader/FrameLoader.cpp:
445         (WebCore::FrameLoader::prepareForLoadStart):
446         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
447         * platform/MemoryPressureHandler.cpp:
448         (WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
449         * platform/graphics/cocoa/IOSurface.mm:
450         (WebCore::IOSurface::IOSurface):
451
452 2016-08-15  Daniel Bates  <dabates@apple.com>
453
454         Cannot build WebKit for iOS device using Xcode 7.3/iOS 9.3 public SDK due to missing
455         private frameworks and libraries
456         https://bugs.webkit.org/show_bug.cgi?id=155931
457         <rdar://problem/25807989>
458
459         Reviewed by Dan Bernstein.
460
461         Add directory WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/X to the framework search path
462         where X is the major version of the active iOS SDK.
463
464         * Configurations/WebCore.xcconfig:
465
466 2016-08-15  Simon Fraser  <simon.fraser@apple.com>
467
468         Add a setting and preferences to enable visual viewport mode
469         https://bugs.webkit.org/show_bug.cgi?id=160843
470
471         Reviewed by Sam Weinig.
472
473         Add a visualViewportEnabled setting, in the start of a group at the bottom
474         of the file which is intended as the future home for all runtime-enabled
475         settings.
476
477         * page/Settings.in:
478
479 2016-08-15  Alex Christensen  <achristensen@webkit.org>
480
481         Fix WinCairo build after r204466.
482
483         * platform/network/curl/SocketStreamHandleCurl.cpp:
484
485 2016-08-15  Alex Christensen  <achristensen@webkit.org>
486
487         Fix GTK build after r204466.
488
489         * platform/gtk/DataObjectGtk.h:
490
491 2016-08-15  Joseph Pecoraro  <pecoraro@apple.com>
492
493         Remove unused includes of wtf headers
494         https://bugs.webkit.org/show_bug.cgi?id=160839
495
496         Reviewed by Alex Christensen.
497
498         * Lots of files.
499
500 2016-08-15  Alex Christensen  <achristensen@webkit.org>
501
502         Remove unused WebSocketChannel::willOpenSocketStream
503         https://bugs.webkit.org/show_bug.cgi?id=160851
504
505         Reviewed by Daniel Bates.
506
507         * Modules/websockets/WebSocketChannel.cpp:
508         (WebCore::WebSocketChannel::willOpenSocketStream): Deleted.
509         * Modules/websockets/WebSocketChannel.h:
510         * platform/network/SocketStreamHandleClient.h:
511         (WebCore::SocketStreamHandleClient::willOpenSocketStream): Deleted.
512
513 2016-08-12  Anders Carlsson  <andersca@apple.com>
514
515         Move the plug-in and WebGL blacklist code to WebCore
516         https://bugs.webkit.org/show_bug.cgi?id=160831
517
518         Reviewed by Sam Weinig.
519
520         * WebCore.xcodeproj/project.pbxproj:
521         * platform/mac/BlacklistUpdater.h: Added.
522         (WebCore::BlacklistUpdater::queue):
523         (WebCore::BlacklistUpdater::pluginBlacklist):
524         (WebCore::BlacklistUpdater::webGLBlacklist):
525         * platform/mac/BlacklistUpdater.mm: Added.
526         (WebCore::BlacklistUpdater::readBlacklistData):
527         (WebCore::BlacklistUpdater::reloadIfNecessary):
528         (WebCore::BlacklistUpdater::initializeQueue):
529         * platform/mac/PluginBlacklist.h: Added.
530         * platform/mac/PluginBlacklist.mm: Added.
531         (WebCore::PluginBlacklist::loadPolicyForPluginVersion):
532         (WebCore::PluginBlacklist::isPluginUpdateAvailable):
533         (WebCore::PluginBlacklist::create):
534         (WebCore::PluginBlacklist::~PluginBlacklist):
535         (WebCore::PluginBlacklist::splitOSVersion):
536         (WebCore::PluginBlacklist::loadPolicyForPlugin):
537         (WebCore::PluginBlacklist::isUpdateAvailable):
538         (WebCore::PluginBlacklist::PluginBlacklist):
539         * platform/mac/WebGLBlacklist.h: Added.
540         * platform/mac/WebGLBlacklist.mm: Added.
541         (WebCore::OSBuildInfo::OSBuildInfo):
542         (WebCore::OSBuildInfo::operator==):
543         (WebCore::OSBuildInfo::operator>):
544         (WebCore::OSBuildInfo::operator<=):
545         (WebCore::OSBuildInfo::operator<):
546         (WebCore::buildInfoFromOSBuildString):
547         (WebCore::WebGLBlacklist::shouldBlockWebGL):
548         (WebCore::WebGLBlacklist::shouldSuggestBlockingWebGL):
549         (WebCore::matchesGPU):
550         (WebCore::gpuMaskFromString):
551         (WebCore::matchesBuildInfo):
552         (WebCore::WebGLBlacklist::create):
553         (WebCore::WebGLBlacklist::shouldBlock):
554         (WebCore::WebGLBlacklist::shouldSuggestBlocking):
555         (WebCore::WebGLBlacklist::WebGLBlacklist):
556         (WebCore::WebGLBlacklist::~WebGLBlacklist):
557         * platform/spi/cf/CFUtilitiesSPI.h: Added.
558
559 2016-08-14  Chris Dumez  <cdumez@apple.com>
560
561         Align the event listener firing code with the latest DOM Specification and simplify it
562         https://bugs.webkit.org/show_bug.cgi?id=160828
563
564         Reviewed by Darin Adler.
565
566         Align the event listener firing code with the latest DOM specification:
567         - https://dom.spec.whatwg.org/#concept-event-listener-invoke
568         - https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke
569         - https://dom.spec.whatwg.org/#concept-event-listener
570
571         The following changes were made:
572         1. RegisteredEventListener (equivalent to "event listener" in the spec)
573            is now RefCounted
574         2. RegisteredEventListener now has a wasRemoved flag as in specification.
575         3. fireEventListeners() is now iterating over a copy of the event
576            listeners, as in the specification. We rely on the wasRemoved removed
577            flag to avoid executing event listeners that were removed while we
578            iterate.
579
580         Previously, the code was modifying the event listeners vector we were
581         iterating on. Doing so safely lead to complicated and error prone code.
582         The new code is much simpler and easier to reason about.
583
584         This change seems to be perf-neutral on Speedometer.
585
586         No new tests, no web-exposed behavior change.
587
588         * CMakeLists.txt:
589         * WebCore.xcodeproj/project.pbxproj:
590         * bindings/js/JSCommandLineAPIHostCustom.cpp:
591         (WebCore::getJSListenerFunctions):
592         * dom/DOMAllInOne.cpp:
593         * dom/EventListenerMap.cpp:
594         (WebCore::EventListenerMap::assertNoActiveIterators):
595         (WebCore::EventListenerMap::containsCapturing):
596         (WebCore::EventListenerMap::containsActive):
597         (WebCore::findListener):
598         (WebCore::EventListenerMap::add):
599         (WebCore::removeListenerFromVector):
600         (WebCore::EventListenerMap::remove):
601         (WebCore::EventListenerMap::find):
602         (WebCore::removeFirstListenerCreatedFromMarkup):
603         (WebCore::copyListenersNotCreatedFromMarkupToTarget):
604         (WebCore::EventListenerMap::copyEventListenersNotCreatedFromMarkupToTarget):
605         (WebCore::EventListenerIterator::nextListener):
606         (WebCore::EventListenerMap::clear): Deleted.
607         * dom/EventListenerMap.h:
608         (WebCore::EventListenerMap::contains):
609         (WebCore::EventListenerMap::assertNoActiveIterators):
610         * dom/EventTarget.cpp:
611         (WebCore::EventTarget::removeEventListener):
612         (WebCore::EventTarget::getAttributeEventListener):
613         (WebCore::FiringEventListenersScope::FiringEventListenersScope):
614         (WebCore::FiringEventListenersScope::~FiringEventListenersScope):
615         (WebCore::EventTarget::fireEventListeners):
616         (WebCore::EventTarget::setAttributeEventListener): Deleted.
617         (WebCore::EventTarget::hasActiveEventListeners): Deleted.
618         (WebCore::EventTarget::dispatchEventForBindings): Deleted.
619         (WebCore::EventTarget::getEventListeners): Deleted.
620         * dom/EventTarget.h:
621         (WebCore::EventTarget::isFiringEventListeners):
622         * dom/RegisteredEventListener.cpp: Removed.
623         * dom/RegisteredEventListener.h:
624         (WebCore::RegisteredEventListener::Options::Options):
625         (WebCore::RegisteredEventListener::create):
626         (WebCore::RegisteredEventListener::listener):
627         (WebCore::RegisteredEventListener::useCapture):
628         (WebCore::RegisteredEventListener::isPassive):
629         (WebCore::RegisteredEventListener::isOnce):
630         (WebCore::RegisteredEventListener::wasRemoved):
631         (WebCore::RegisteredEventListener::markAsRemoved):
632         (WebCore::RegisteredEventListener::RegisteredEventListener):
633         * inspector/InspectorDOMAgent.cpp:
634         (WebCore::InspectorDOMAgent::getEventListenersForNode):
635         (WebCore::InspectorDOMAgent::getEventListeners):
636         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
637         * inspector/InspectorDOMAgent.h:
638         (WebCore::EventListenerInfo::EventListenerInfo):
639         * svg/SVGElement.cpp:
640         (WebCore::hasLoadListener):
641
642 2016-08-14  Daniel Bates  <dabates@apple.com>
643
644         Fix compiler errors when building iOS WebKit using the iOS 10 beta SDK
645         https://bugs.webkit.org/show_bug.cgi?id=160725
646
647         Reviewed by Sam Weinig.
648
649         * platform/cocoa/ThemeCocoa.mm: Unconditionally include header dlfcn.h as it
650         exists in both the public iOS 9.3 SDK and iOS 10 beta SDK.
651         * platform/spi/cocoa/CoreTextSPI.h: Add SPI declarations for constants that were
652         used in r204107.
653         * platform/spi/cocoa/PassKitSPI.h: Remove unnecessary #import statements when
654         building with the Apple Internal SDK. Include header PassKit/PassKit.h when
655         building for iOS.
656         * platform/spi/cocoa/QuartzCoreSPI.h: No need to define CLayer.contentsFormat
657         when building with the iOS 10 beta SDK as it is now part of the public API.
658
659 2016-08-14  Jonathan Bedard  <jbedard@apple.com>
660
661         Dereferenced NULL pointer in StyleResolver
662         https://bugs.webkit.org/show_bug.cgi?id=160823
663
664         Reviewed by Darin Adler.
665
666         No behavior changed, new tests unneeded.
667
668         This change was initiated by a NULL pointer dereference to provide this unused argument.
669
670         * css/StyleResolver.cpp:
671         (WebCore::StyleResolver::CascadedProperties::addStyleProperties): Removed unused function argument.
672         (WebCore::StyleResolver::CascadedProperties::addMatch): Ditto.
673         * css/StyleResolver.h: Ditto.
674
675 2016-08-14  Myles C. Maxfield  <mmaxfield@apple.com>
676
677         Fix GTK Debug bots after r204400
678         https://bugs.webkit.org/show_bug.cgi?id=160818
679
680         Reviewed by Carlos Garcia Campos.
681
682         Because the GTK EWS bot doesn't run tests, I missed this.
683
684         No new tests because there is no behavior change.
685
686         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
687         (WebCore::HarfBuzzShaper::selectionRect):
688
689 2016-08-13  Chris Dumez  <cdumez@apple.com>
690
691         'compatMode' property should be on Document, not HTMLDocument
692         https://bugs.webkit.org/show_bug.cgi?id=160819
693
694         Reviewed by Sam Weinig.
695
696         'compatMode' property should be on Document, not HTMLDocument:
697         - https://dom.spec.whatwg.org/#dom-document-compatmode
698
699         WebKit had it on both. Firefox and Chrome have it on Document only.
700
701         Test: fast/dom/Document/compatMode-location.html
702
703         * html/HTMLDocument.idl:
704
705 2016-08-13  Chris Dumez  <cdumez@apple.com>
706
707         Move 'embeds' / 'plugins'/ 'scripts' attributes from HTMLDocument to Document
708         https://bugs.webkit.org/show_bug.cgi?id=160829
709
710         Reviewed by Sam Weinig.
711
712         Move 'embeds' / 'plugins'/ 'scripts' attributes from HTMLDocument to Document
713         to match the latest specification:
714         - https://html.spec.whatwg.org/multipage/dom.html#the-document-object
715
716         This also matches Chrome.
717
718         No new tests, rebaselined existing test.
719
720         * dom/Document.idl:
721         * html/HTMLDocument.idl:
722
723 2016-08-13  Chris Dumez  <cdumez@apple.com>
724
725         Move designMode attribute from HTMLDocument to Document
726         https://bugs.webkit.org/show_bug.cgi?id=160838
727
728         Reviewed by Sam Weinig.
729
730         Move designMode attribute from HTMLDocument to Document to match the
731         latest HTML specification:
732         - https://html.spec.whatwg.org/multipage/interaction.html#designMode
733
734         This also matches Chrome.
735
736         No new tests, rebaselined existing test.
737
738         * dom/Document.cpp:
739         (WebCore::Document::designMode):
740         (WebCore::Document::setDesignMode):
741         * dom/Document.h:
742         * dom/Document.idl:
743         * html/HTMLDocument.cpp:
744         (WebCore::HTMLDocument::bgColor): Deleted.
745         (WebCore::HTMLDocument::setBgColor): Deleted.
746         (WebCore::HTMLDocument::fgColor): Deleted.
747         * html/HTMLDocument.h:
748         * html/HTMLDocument.idl:
749
750 2016-08-12  Chris Dumez  <cdumez@apple.com>
751
752         getElementsByTagName() should take a qualifiedName in parameter
753         https://bugs.webkit.org/show_bug.cgi?id=160682
754
755         Reviewed by Ryosuke Niwa.
756
757         getElementsByTagName() should take a qualifiedName in parameter, not a
758         localName, according to the latest DOM specification:
759         - https://dom.spec.whatwg.org/#dom-document-getelementsbytagname
760         - https://dom.spec.whatwg.org/#concept-getelementsbytagname
761
762         The new behavior matches Firefox and Edge. There is a slight
763         compatiblity risk but we should give it a try.
764
765         No new tests, rebaselined existing tests.
766
767         * WebCore.xcodeproj/project.pbxproj:
768         * dom/AllDescendantsCollection.h: Added.
769         * dom/ContainerNode.cpp:
770         (WebCore::ContainerNode::getElementsByTagName):
771         (WebCore::ContainerNode::getElementsByTagNameNS):
772         * dom/Node.cpp:
773         (WebCore::NodeListsNodeData::invalidateCaches):
774         * dom/NodeRareData.h:
775         (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
776         (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
777         (WebCore::NodeListsNodeData::adoptDocument):
778         (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList):
779         * dom/TagCollection.cpp:
780         (WebCore::makeQualifiedName):
781         (WebCore::splitQualifiedName):
782         (WebCore::TagCollectionNS::TagCollectionNS):
783         (WebCore::TagCollectionNS::~TagCollectionNS):
784         (WebCore::TagCollection::TagCollection):
785         (WebCore::TagCollection::~TagCollection):
786         (WebCore::HTMLTagCollection::HTMLTagCollection):
787         (WebCore::HTMLTagCollection::~HTMLTagCollection):
788         * dom/TagCollection.h:
789         (WebCore::TagCollection::elementMatches):
790         (WebCore::TagCollectionNS::elementMatches):
791         (WebCore::HTMLTagCollection::elementMatches):
792         * html/CollectionType.h:
793         * html/GenericCachedHTMLCollection.cpp:
794         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches):
795         * html/HTMLCollection.cpp:
796         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
797
798 2016-08-12  Alex Christensen  <achristensen@webkit.org>
799
800         Make URLParser work with URLs missing URL parts
801         https://bugs.webkit.org/show_bug.cgi?id=160824
802
803         Reviewed by Brady Eidson.
804
805         My initial implementation of URLParser didn't work correctly with URLs missing parts,
806         like a URL with no fragment, or a URL with no query.  This fixes and tests parsing such URLS.
807         Covered by new API tests.
808
809         * platform/URLParser.cpp:
810         (WebCore::URLParser::parse):
811         (WebCore::URLParser::allValuesEqual):
812         * platform/URLParser.h:
813         (WebCore::URLParser::parse):
814
815 2016-08-12  Johan K. Jensen  <johan_jensen@apple.com>
816
817         Rename DocumentLoadTiming and ResourceLoadTiming
818         https://bugs.webkit.org/show_bug.cgi?id=160821
819
820         Reviewed by Alex Christensen.
821
822         Renames ResourceLoadTiming to NetworkLoadTiming.
823         Renames DocumentLoadTiming to LoadTiming as well as
824         navigationStart() to startTime(), so it's generic for
825         both the main resource and subresources.
826
827         * CMakeLists.txt:
828         * Modules/gamepad/NavigatorGamepad.cpp:
829         (WebCore::NavigatorGamepad::from):
830         * PlatformMac.cmake:
831         * WebCore.xcodeproj/project.pbxproj:
832         * inspector/InspectorNetworkAgent.cpp:
833         (WebCore::buildObjectForTiming):
834         (WebCore::buildObjectForResourceResponse):
835         * loader/DocumentLoader.cpp:
836         (WebCore::DocumentLoader::startLoadingMainResource):
837         * loader/DocumentLoader.h:
838         (WebCore::DocumentLoader::timing):
839         (WebCore::DocumentLoader::resetTiming):
840         * loader/FrameLoader.cpp:
841         (WebCore::FrameLoader::dispatchUnloadEvents):
842         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
843         * loader/LoadTiming.cpp: Renamed from Source/WebCore/loader/DocumentLoadTiming.cpp.
844         (WebCore::LoadTiming::LoadTiming):
845         (WebCore::LoadTiming::monotonicTimeToZeroBasedDocumentTime):
846         (WebCore::LoadTiming::monotonicTimeToPseudoWallTime):
847         (WebCore::LoadTiming::markStartTime):
848         (WebCore::LoadTiming::addRedirect):
849         * loader/LoadTiming.h: Renamed from Source/WebCore/loader/DocumentLoadTiming.h.
850         (WebCore::LoadTiming::markUnloadEventStart):
851         (WebCore::LoadTiming::markUnloadEventEnd):
852         (WebCore::LoadTiming::markRedirectStart):
853         (WebCore::LoadTiming::markRedirectEnd):
854         (WebCore::LoadTiming::markFetchStart):
855         (WebCore::LoadTiming::setResponseEnd):
856         (WebCore::LoadTiming::markLoadEventStart):
857         (WebCore::LoadTiming::markLoadEventEnd):
858         (WebCore::LoadTiming::setHasSameOriginAsPreviousDocument):
859         (WebCore::LoadTiming::startTime):
860         (WebCore::LoadTiming::unloadEventStart):
861         (WebCore::LoadTiming::unloadEventEnd):
862         (WebCore::LoadTiming::redirectStart):
863         (WebCore::LoadTiming::redirectEnd):
864         (WebCore::LoadTiming::redirectCount):
865         (WebCore::LoadTiming::fetchStart):
866         (WebCore::LoadTiming::responseEnd):
867         (WebCore::LoadTiming::loadEventStart):
868         (WebCore::LoadTiming::loadEventEnd):
869         (WebCore::LoadTiming::hasCrossOriginRedirect):
870         (WebCore::LoadTiming::hasSameOriginAsPreviousDocument):
871         (WebCore::LoadTiming::referenceMonotonicTime):
872         (WebCore::LoadTiming::referenceWallTime):
873         * page/DOMWindow.cpp:
874         (WebCore::DOMWindow::dispatchLoadEvent):
875         * page/PerformanceNavigation.cpp:
876         (WebCore::PerformanceNavigation::redirectCount):
877         * page/PerformanceResourceTiming.cpp:
878         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
879         (WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds):
880         * page/PerformanceResourceTiming.h:
881         * page/PerformanceTiming.cpp:
882         (WebCore::PerformanceTiming::navigationStart):
883         (WebCore::PerformanceTiming::unloadEventStart):
884         (WebCore::PerformanceTiming::unloadEventEnd):
885         (WebCore::PerformanceTiming::redirectStart):
886         (WebCore::PerformanceTiming::redirectEnd):
887         (WebCore::PerformanceTiming::fetchStart):
888         (WebCore::PerformanceTiming::domainLookupStart):
889         (WebCore::PerformanceTiming::domainLookupEnd):
890         (WebCore::PerformanceTiming::connectStart):
891         (WebCore::PerformanceTiming::connectEnd):
892         (WebCore::PerformanceTiming::secureConnectionStart):
893         (WebCore::PerformanceTiming::requestStart):
894         (WebCore::PerformanceTiming::responseStart):
895         (WebCore::PerformanceTiming::responseEnd):
896         (WebCore::PerformanceTiming::loadEventStart):
897         (WebCore::PerformanceTiming::loadEventEnd):
898         (WebCore::PerformanceTiming::loadTiming):
899         (WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds):
900         * page/PerformanceTiming.h:
901         * platform/network/NetworkLoadTiming.h: Renamed from Source/WebCore/platform/network/ResourceLoadTiming.h.
902         (WebCore::NetworkLoadTiming::NetworkLoadTiming):
903         (WebCore::NetworkLoadTiming::operator=):
904         (WebCore::NetworkLoadTiming::isolatedCopy):
905         (WebCore::NetworkLoadTiming::operator==):
906         (WebCore::NetworkLoadTiming::operator!=):
907         (WebCore::NetworkLoadTiming::encode):
908         (WebCore::NetworkLoadTiming::decode):
909         * platform/network/ResourceHandle.h:
910         * platform/network/ResourceResponseBase.cpp:
911         (WebCore::ResourceResponseBase::crossThreadData):
912         (WebCore::ResourceResponseBase::fromCrossThreadData):
913         (WebCore::ResourceResponseBase::compare):
914         * platform/network/ResourceResponseBase.h:
915         (WebCore::ResourceResponseBase::networkLoadTiming):
916         (WebCore::ResourceResponseBase::encode):
917         (WebCore::ResourceResponseBase::decode):
918         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
919         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
920         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
921         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
922         * platform/network/cocoa/NetworkLoadTiming.mm: Renamed from Source/WebCore/platform/network/cocoa/ResourceLoadTiming.mm.
923         (WebCore::timingValue):
924         (WebCore::copyTimingData):
925         (WebCore::setCollectsTimingData):
926         * platform/network/curl/ResourceHandleManager.cpp:
927         (WebCore::calculateWebTimingInformations):
928         * platform/network/mac/ResourceHandleMac.mm:
929         (WebCore::ResourceHandle::getConnectionTimingData):
930         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
931         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
932         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
933         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
934         * platform/network/soup/ResourceHandleSoup.cpp:
935         (WebCore::sendRequestCallback):
936         (WebCore::ResourceHandle::didStartRequest):
937         (WebCore::networkEventCallback):
938
939 2016-08-12  Joseph Pecoraro  <pecoraro@apple.com>
940
941         Remove unused includes of RefCountedLeakCounter.h
942         https://bugs.webkit.org/show_bug.cgi?id=160817
943
944         Reviewed by Mark Lam.
945
946         * bindings/js/JSEventListener.cpp:
947         * rendering/RenderBlockLineLayout.cpp:
948
949 2016-08-12  Alex Christensen  <achristensen@webkit.org>
950
951         Initial URLParser implementation
952         https://bugs.webkit.org/show_bug.cgi?id=160811
953
954         Reviewed by Brady Eidson.
955
956         There are a lot of missing parts, but it works in one case, so I test that one case.
957
958         * platform/URLParser.cpp:
959         (WebCore::isC0Control):
960         (WebCore::isC0ControlOrSpace):
961         (WebCore::isTabOrNewline):
962         (WebCore::isASCIIDigit):
963         (WebCore::isASCIIAlpha):
964         (WebCore::isASCIIAlphanumeric):
965         (WebCore::isSpecialScheme):
966         (WebCore::URLParser::parse):
967
968 2016-08-12  Commit Queue  <commit-queue@webkit.org>
969
970         Unreviewed, rolling out r204404.
971         https://bugs.webkit.org/show_bug.cgi?id=160805
972
973         "Broke the build for some Apple Internal projects" (Requested
974         by bradee-oh on #webkit).
975
976         Reverted changeset:
977
978         "Support WebIDL unions (Part 1)"
979         https://bugs.webkit.org/show_bug.cgi?id=160769
980         http://trac.webkit.org/changeset/204404
981
982 2016-08-12  Philippe Normand  <pnormand@igalia.com>
983
984         [GStreamer] Performance problems with bigger video resolution in the webrtc media player
985         https://bugs.webkit.org/show_bug.cgi?id=153826
986
987         Reviewed by Alejandro G. Castro.
988
989         Keep the OpenWebRTC video renderer size synchronized with the Media element size.
990
991         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
992         (WebCore::MediaPlayerPrivateGStreamerOwr::setSize):
993         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
994
995 2016-08-12  Philippe Normand  <pnormand@igalia.com>
996
997         [GStreamer][OWR] Video rendering fixes
998         https://bugs.webkit.org/show_bug.cgi?id=160764
999
1000         Reviewed by Xabier Rodriguez-Calvar.
1001
1002         The video renderer of OpenWebRTC now uses OpenGL so we have two
1003         options to correctly handle this in WebKit:
1004
1005         - if USE_GSTREAMER_GL is enabled then we simply pass our GL
1006           appsink to the renderer and there is no need to create glupload
1007           and glcolorconvert element on WebKit side because those elements
1008           are already created on OpenWebRTC side.
1009         - if USE_GSTREAMER_GL is disabled then we need our sink to download
1010           frames from the GPU so that rendering can be done with the WebKit
1011           video sink in main memory.
1012
1013         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1014         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Split out GL appsink management
1015         to a separate method that can be used by sub-classes.
1016         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL): Use new createGLAppSink method.
1017         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1018         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
1019         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink): handle GStreamer-GL configurations
1020         and pass a different element to the renderer depending on the configuration.
1021
1022 2016-08-11  Sam Weinig  <sam@webkit.org>
1023
1024         Support WebIDL unions (Part 1)
1025         https://bugs.webkit.org/show_bug.cgi?id=160769
1026
1027         Reviewed by Chris Dumez.
1028
1029         This is the first part of an effort to add support for union types
1030         in our code generators. This change:
1031         - Adds a domType struct to hold the parsed type information. For now, we only
1032           use it temporarily while parsing, and don't expose it to the code generators,
1033           but that will change in a later patch.
1034         - Remove support for scoped identifiers for types. They are not supported by WebIDL.
1035         - Make debugging the parser easier by providing backtraces when asserting.
1036
1037         There should be no observable changes.
1038
1039         * bindings/scripts/IDLParser.pm:
1040
1041 2016-08-11  Myles C. Maxfield  <mmaxfield@apple.com>
1042
1043         Migrate from ints to unsigneds when referring to indices into strings
1044         https://bugs.webkit.org/show_bug.cgi?id=160735
1045
1046         Reviewed by Simon Fraser.
1047
1048         There are a few cases where we use ints to refer to indices into strings:
1049         - A simple historical accident. These were migrated to unsigneds directly.
1050         - Where we use -1 as a sentinal value. These were migrated to Optional<unsigned>.
1051
1052         This patch only modifies rendering code (rather than DOM code). There are a few
1053         places in DOM code (such as Position and Node::maxCharacterOffset()) which also
1054         erroneously use ints; however, I didn't want this change to be observable from
1055         script and I wanted to keep this patch to a reasonable size.
1056
1057         No new tests because there is no behavior change.
1058
1059         * editing/FrameSelection.cpp:
1060         (WebCore::FrameSelection::updateAppearance):
1061         (WebCore::FrameSelection::setCaretVisibility):
1062         * platform/DragImage.cpp:
1063         (WebCore::createDragImageForRange):
1064         * platform/graphics/FontCascade.cpp:
1065         (WebCore::FontCascade::glyphBufferForTextRun):
1066         (WebCore::FontCascade::drawText):
1067         (WebCore::FontCascade::drawEmphasisMarks):
1068         (WebCore::FontCascade::adjustSelectionRectForText):
1069         (WebCore::computeUnderlineType):
1070         (WebCore::FontCascade::getGlyphsAndAdvancesForSimpleText):
1071         (WebCore::FontCascade::drawEmphasisMarksForSimpleText):
1072         (WebCore::FontCascade::drawGlyphBuffer):
1073         (WebCore::offsetToMiddleOfGlyphAtIndex):
1074         (WebCore::FontCascade::adjustSelectionRectForSimpleText):
1075         * platform/graphics/FontCascade.h:
1076         * platform/graphics/GlyphBuffer.h:
1077         (WebCore::GlyphBuffer::size):
1078         (WebCore::GlyphBuffer::glyphs):
1079         (WebCore::GlyphBuffer::advances):
1080         (WebCore::GlyphBuffer::fontAt):
1081         (WebCore::GlyphBuffer::glyphAt):
1082         (WebCore::GlyphBuffer::advanceAt):
1083         (WebCore::GlyphBuffer::offsetAt):
1084         (WebCore::GlyphBuffer::reverse):
1085         (WebCore::GlyphBuffer::offsetInString):
1086         (WebCore::GlyphBuffer::shrink):
1087         (WebCore::GlyphBuffer::swap):
1088         * platform/graphics/GraphicsContext.cpp:
1089         (WebCore::GraphicsContext::drawText):
1090         (WebCore::GraphicsContext::drawGlyphs):
1091         (WebCore::GraphicsContext::drawEmphasisMarks):
1092         * platform/graphics/GraphicsContext.h:
1093         * platform/graphics/Latin1TextIterator.h:
1094         (WebCore::Latin1TextIterator::Latin1TextIterator):
1095         (WebCore::Latin1TextIterator::currentCharacter):
1096         * platform/graphics/SurrogatePairAwareTextIterator.cpp:
1097         (WebCore::SurrogatePairAwareTextIterator::SurrogatePairAwareTextIterator):
1098         * platform/graphics/SurrogatePairAwareTextIterator.h:
1099         (WebCore::SurrogatePairAwareTextIterator::currentCharacter):
1100         * platform/graphics/WidthIterator.cpp:
1101         (WebCore::WidthIterator::applyFontTransforms):
1102         (WebCore::WidthIterator::advanceInternal):
1103         (WebCore::WidthIterator::advance):
1104         (WebCore::WidthIterator::advanceOneCharacter):
1105         * platform/graphics/WidthIterator.h:
1106         * platform/graphics/cairo/FontCairo.cpp:
1107         (WebCore::drawGlyphsToContext):
1108         (WebCore::drawGlyphsShadow):
1109         (WebCore::FontCascade::drawGlyphs):
1110         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1111         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
1112         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
1113         (WebCore::FontCascade::adjustSelectionRectForComplexText):
1114         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1115         (WebCore::fillVectorWithHorizontalGlyphPositions):
1116         (WebCore::showLetterpressedGlyphsWithAdvances):
1117         (WebCore::showGlyphsWithAdvances):
1118         (WebCore::FontCascade::drawGlyphs):
1119         (WebCore::FontCascade::dashesForIntersectionsWithRect):
1120         (WebCore::FontCascade::adjustSelectionRectForComplexText):
1121         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
1122         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
1123         * platform/graphics/displaylists/DisplayListRecorder.cpp:
1124         (WebCore::DisplayList::Recorder::drawGlyphs):
1125         * platform/graphics/displaylists/DisplayListRecorder.h:
1126         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
1127         (WebCore::HarfBuzzShaper::selectionRect):
1128         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
1129         * platform/graphics/mac/ComplexTextController.h:
1130         * platform/graphics/win/FontCGWin.cpp:
1131         (WebCore::FontCascade::drawGlyphs):
1132         * platform/graphics/win/FontWin.cpp:
1133         (WebCore::FontCascade::adjustSelectionRectForComplexText):
1134         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
1135         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
1136         * rendering/EllipsisBox.cpp:
1137         (WebCore::EllipsisBox::paintSelection):
1138         * rendering/InlineTextBox.cpp:
1139         (WebCore::InlineTextBox::isSelected):
1140         (WebCore::InlineTextBox::selectionState):
1141         (WebCore::InlineTextBox::localSelectionRect):
1142         (WebCore::InlineTextBox::paint):
1143         (WebCore::InlineTextBox::clampedOffset):
1144         (WebCore::InlineTextBox::selectionStartEnd):
1145         (WebCore::InlineTextBox::paintSelection):
1146         (WebCore::InlineTextBox::paintCompositionBackground):
1147         (WebCore::InlineTextBox::paintDocumentMarker):
1148         (WebCore::InlineTextBox::paintTextMatchMarker):
1149         (WebCore::InlineTextBox::positionForOffset):
1150         * rendering/InlineTextBox.h:
1151         (WebCore::InlineTextBox::offsetRun):
1152         (WebCore::InlineTextBox::InlineTextBox): Deleted.
1153         * rendering/RenderBlock.cpp:
1154         (WebCore::RenderBlock::localCaretRect):
1155         * rendering/RenderBlock.h:
1156         * rendering/RenderBox.cpp:
1157         (WebCore::RenderBox::localCaretRect):
1158         * rendering/RenderBox.h:
1159         * rendering/RenderInline.cpp:
1160         (WebCore::RenderInline::localCaretRect):
1161         * rendering/RenderInline.h:
1162         * rendering/RenderLineBreak.cpp:
1163         (WebCore::RenderLineBreak::localCaretRect):
1164         * rendering/RenderLineBreak.h:
1165         * rendering/RenderObject.cpp:
1166         (WebCore::RenderObject::selectionStartEnd):
1167         (WebCore::RenderObject::localCaretRect):
1168         * rendering/RenderObject.h:
1169         * rendering/RenderReplaced.cpp:
1170         (WebCore::RenderReplaced::isSelected):
1171         * rendering/RenderText.cpp:
1172         (WebCore::RenderText::localCaretRect):
1173         (WebCore::RenderText::collectSelectionRectsForLineBoxes):
1174         * rendering/RenderText.h:
1175         * rendering/RenderTextLineBoxes.cpp:
1176         (WebCore::RenderTextLineBoxes::setSelectionState):
1177         * rendering/RenderView.cpp:
1178         (WebCore::RenderView::subtreeSelectionBounds):
1179         (WebCore::RenderView::repaintSubtreeSelection):
1180         (WebCore::RenderView::setSelection):
1181         (WebCore::RenderView::splitSelectionBetweenSubtrees):
1182         (WebCore::RenderView::clearSubtreeSelection):
1183         (WebCore::RenderView::applySubtreeSelection):
1184         (WebCore::RenderView::getSelection):
1185         (WebCore::RenderView::clearSelection):
1186         (WebCore::RenderView::RenderView): Deleted.
1187         * rendering/RenderView.h:
1188         * rendering/SelectionSubtreeRoot.cpp:
1189         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
1190         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot): Deleted.
1191         * rendering/SelectionSubtreeRoot.h:
1192         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData):
1193         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartPos):
1194         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos):
1195         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionClear):
1196         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartEndPositions):
1197         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStartPos):
1198         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEndPos):
1199         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::clearSelection):
1200         (WebCore::SelectionSubtreeRoot::OldSelectionData::OldSelectionData): Deleted.
1201         * rendering/TextPainter.cpp:
1202         (WebCore::TextPainter::drawTextOrEmphasisMarks):
1203         (WebCore::TextPainter::paintTextWithShadows):
1204         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
1205         (WebCore::TextPainter::paintText):
1206         * rendering/TextPainter.h:
1207         (WebCore::TextPainter::addEmphasis):
1208         * rendering/svg/RenderSVGInlineText.cpp:
1209         (WebCore::RenderSVGInlineText::localCaretRect):
1210         * rendering/svg/RenderSVGInlineText.h:
1211         * rendering/svg/SVGInlineTextBox.cpp:
1212         (WebCore::SVGInlineTextBox::positionForOffset):
1213         (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
1214         (WebCore::SVGInlineTextBox::localSelectionRect):
1215         (WebCore::SVGInlineTextBox::paintSelectionBackground):
1216         (WebCore::SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates):
1217         (WebCore::SVGInlineTextBox::paintTextWithShadows):
1218         (WebCore::SVGInlineTextBox::paintText):
1219         * rendering/svg/SVGInlineTextBox.h:
1220         * rendering/svg/SVGTextQuery.cpp:
1221         (WebCore::SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates):
1222         (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
1223         (WebCore::SVGTextQuery::subStringLengthCallback):
1224         (WebCore::SVGTextQuery::startPositionOfCharacterCallback):
1225         (WebCore::SVGTextQuery::endPositionOfCharacterCallback):
1226         (WebCore::SVGTextQuery::rotationOfCharacterCallback):
1227         (WebCore::calculateGlyphBoundaries):
1228         (WebCore::SVGTextQuery::extentOfCharacterCallback):
1229         (WebCore::SVGTextQuery::characterNumberAtPositionCallback):
1230         * rendering/svg/SVGTextQuery.h:
1231
1232 2016-08-11  Alex Christensen  <achristensen@webkit.org>
1233
1234         Don't use a NetworkingContext when creating SocketStreamHandles
1235         https://bugs.webkit.org/show_bug.cgi?id=160732
1236
1237         Reviewed by Brady Eidson.
1238
1239         No change in behavior.  After r204327 a SessionID is all we need to get the NetworkStorageSession,
1240         and we pass the SessionID to the SocketStreamHandle constructor, so use that instead.
1241         SessionIDs can be serialized and sent over IPC.  NetworkingContexts can't.
1242
1243         * Modules/websockets/WebSocketChannel.cpp:
1244         (WebCore::WebSocketChannel::connect):
1245         * page/SocketProvider.cpp:
1246         (WebCore::SocketProvider::createSocketStreamHandle):
1247         * page/SocketProvider.h:
1248         * platform/network/cf/SocketStreamHandle.h:
1249         (WebCore::SocketStreamHandle::create):
1250         * platform/network/cf/SocketStreamHandleCFNet.cpp:
1251         (WebCore::SocketStreamHandle::SocketStreamHandle):
1252         (WebCore::SocketStreamHandle::getStoredCONNECTProxyCredentials):
1253         * platform/network/curl/SocketStreamHandle.h:
1254         (WebCore::SocketStreamHandle::create):
1255         * platform/network/soup/SocketStreamHandle.h:
1256         * platform/network/soup/SocketStreamHandleSoup.cpp:
1257         (WebCore::SocketStreamHandle::create):
1258
1259 2016-08-11  Alex Christensen  <achristensen@webkit.org>
1260
1261         Use StringBuilder::appendLiteral when possible don't append result of makeString
1262         https://bugs.webkit.org/show_bug.cgi?id=160772
1263
1264         Reviewed by Sam Weinig.
1265
1266         StringBuilder::append does an unnecessary strlen call.
1267         append(makeString(...)) always does unnecessary allocations and copies.
1268         It's currently only used in debug logging, but we shouldn't have this pattern in WebKit.
1269
1270         * Modules/indexeddb/server/IndexValueStore.cpp:
1271         (WebCore::IDBServer::IndexValueStore::loggingString):
1272         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
1273         (WebCore::IDBDatabaseInfo::loggingString):
1274         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1275         (WebCore::IDBObjectStoreInfo::loggingString):
1276         * contentextensions/CombinedURLFilters.cpp:
1277         (WebCore::ContentExtensions::prefixTreeVertexToString):
1278         (WebCore::ContentExtensions::recursivePrint):
1279         * html/HTMLMediaElement.cpp:
1280         (WebCore::actionName):
1281         * html/MediaElementSession.cpp:
1282         (WebCore::restrictionName):
1283         * loader/ResourceLoadStatistics.cpp:
1284         (WebCore::appendBoolean):
1285         (WebCore::appendHashCountedSet):
1286         (WebCore::ResourceLoadStatistics::toString):
1287         * platform/PODInterval.h:
1288         (WebCore::PODInterval::toString):
1289         * platform/URL.cpp:
1290         (WebCore::URL::setHost):
1291         (WebCore::URL::setHostAndPort):
1292         (WebCore::URL::serialize):
1293         * testing/Internals.cpp:
1294         (WebCore::appendOffsets):
1295         (WebCore::Internals::scrollSnapOffsets):
1296
1297 2016-08-11  Chris Dumez  <cdumez@apple.com>
1298
1299         Align Range.surroundContents() with the latest DOM specification
1300         https://bugs.webkit.org/show_bug.cgi?id=160777
1301
1302         Reviewed by Ryosuke Niwa.
1303
1304         Align Range.surroundContents() with the latest DOM specification:
1305         - https://dom.spec.whatwg.org/#dom-range-surroundcontents
1306
1307         In particular, the following changes were made:
1308         1. Drop early check to see if startContainer() accepts children like
1309            newParent. This check is not in the specification. Let the later
1310            call to Range.insertNode() take care of doing the check and
1311            throwing.
1312         2. Drop early check to see if newParent contains the range's start
1313            node, for the same reasons as above.
1314         3. Move extractContents() call *before* removing newParent's children
1315            to match the order in the specification (steps 3 & 4).
1316
1317         This makes our behavior much closer to Firefox's as well.
1318
1319         No new tests, rebaselined existing W3C test.
1320
1321         * dom/Range.cpp:
1322         (WebCore::Range::surroundContents):
1323
1324 2016-08-11  Alex Christensen  <achristensen@webkit.org>
1325
1326         Add URLParser stub
1327         https://bugs.webkit.org/show_bug.cgi?id=160770
1328
1329         Reviewed by Sam Weinig.
1330
1331         Added API test stub.
1332
1333         * CMakeLists.txt:
1334         * WebCore.xcodeproj/project.pbxproj:
1335         * platform/URL.h:
1336         * platform/URLParser.cpp: Added.
1337         (WebCore::URLParser::parse):
1338         * platform/URLParser.h: Added.
1339         (WebCore::URLParser::parse):
1340
1341 2016-08-11  Chris Dumez  <cdumez@apple.com>
1342
1343         Move dataset attribute from Element to HTMLElement / SVGElement
1344         https://bugs.webkit.org/show_bug.cgi?id=160766
1345
1346         Reviewed by Alex Christensen.
1347
1348         Move dataset attribute from Element to HTMLElement / SVGElement as per
1349         the specifications:
1350         - https://html.spec.whatwg.org/multipage/dom.html#htmlelement
1351         - https://svgwg.org/svg2-draft/types.html#InterfaceSVGElement
1352
1353         Firefox and Chrome seem to have dataset on HTMLElement but not on
1354         SVGElement (yet).
1355
1356         No new tests, rebaselined existing test.
1357
1358         * dom/Element.idl:
1359         * html/HTMLElement.idl:
1360         * svg/SVGElement.idl:
1361
1362 2016-08-11  Eric Carlson  <eric.carlson@apple.com>
1363
1364         Unreviewed, update MediaRemoteSPI.h after r204082.
1365
1366         * platform/spi/mac/MediaRemoteSPI.h:
1367
1368 2016-08-10  Joseph Pecoraro  <pecoraro@apple.com>
1369
1370         Web Inspector: Should be able to Edit Node Attributes and Styles for non-UserAgent Shadow DOM nodes
1371         https://bugs.webkit.org/show_bug.cgi?id=160762
1372         <rdar://problem/27798271>
1373
1374         Reviewed by Ryosuke Niwa.
1375
1376         * inspector/InspectorDOMAgent.cpp:
1377         (WebCore::InspectorDOMAgent::assertEditableNode):
1378         (WebCore::InspectorDOMAgent::assertEditableElement):
1379         * inspector/PageConsoleAgent.cpp:
1380         (WebCore::PageConsoleAgent::addInspectedNode):
1381         Allow editing shadow DOM nodes as long as they are not in a UserAgent shadow tree.
1382
1383 2016-08-10  Chris Dumez  <cdumez@apple.com>
1384
1385         Optimization in Node.insertBefore() is not spec-compliant
1386         https://bugs.webkit.org/show_bug.cgi?id=160746
1387
1388         Reviewed by Ryosuke Niwa.
1389
1390         We have an optimization in Node.insertBefore(newNode, refChild) to avoid
1391         doing any work when newNode == refChild or newNode.nextSibling == refChild.
1392
1393         This optimization is not in the specification:
1394         - https://dom.spec.whatwg.org/#concept-node-replace
1395
1396         The issue is that this optimization is observable with DOM mutation
1397         observers / listeners or DOM ranges.
1398
1399         This patch addresses the issue by dropping the optimization. This case
1400         does not seem common enough to be worth optimizing for. However, if it
1401         turns out to regress the performance of things we care about, we could
1402         fallback to doing the optimization only when it is not observable.
1403
1404         Test: fast/dom/Node/insertBefore-no-op-mutationobserver.html
1405
1406         * dom/ContainerNode.cpp:
1407         (WebCore::checkAcceptChild):
1408         Move refChild->parent() == parent check from insertBefore() to our
1409         pre-insertion check function, right after checking if newNode contains
1410         parent. This was done in order to match more closely the specification
1411         and to make sure that exception are thrown in the correct order:
1412         - https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity (steps 2 and 3)
1413
1414         (WebCore::ContainerNode::insertBefore):
1415         1. Drop the (refChild->previousSibling() == &newChild || refChild == &newChild)
1416            optimization as it is not spc-compliant.
1417         2. If refChild is newNode, then set refChild to newChild.nextSibling as per:
1418            - https://dom.spec.whatwg.org/#concept-node-pre-insert (step 3)
1419
1420 2016-08-10  Ryosuke Niwa  <rniwa@webkit.org>
1421
1422         Move document.defineElement to customElements.define
1423         https://bugs.webkit.org/show_bug.cgi?id=160731
1424
1425         Reviewed by Chris Dumez.
1426
1427         Replaced Document.prototype.defineElement by CustomElementsRegistry.prototype.define to match
1428         the latest HTML specification: https://html.spec.whatwg.org/#custom-elements-api 
1429
1430         This patch renames the existing CustomElementDefinitions to CustomElementsRegistry and exposes
1431         it on window.customElements. CustomElementDefinitions is now owned by DOMWindow instead of
1432         Document to match the spec's new semantics.
1433
1434         No new tests. The existing tests have been updated to reflect the change.
1435
1436         * DerivedSources.cpp:
1437         * DerivedSources.make:
1438         * WebCore.xcodeproj/project.pbxproj:
1439         * bindings/js/JSCustomElementsRegistryCustom.cpp: Added.
1440         (WebCore::JSCustomElementsRegistry::define): Moved from JSDocumentCustom. Removed the check for
1441         the existence of DOMWindow since CustomElementsRegistry is an attribute on DOMWindow itself.
1442         * bindings/js/JSDocumentCustom.cpp:
1443         (WebCore::JSDocument::defineElement): Deleted.
1444         * bindings/js/JSHTMLElementCustom.cpp: Added the code to check the existence of DOMWindow since
1445         the registry is associated with DOMWindow, not Document.
1446         (WebCore::constructJSHTMLElement):
1447         * dom/CustomElementsRegistry.cpp: Renamed from Source/WebCore/dom/CustomElementDefinitions.cpp.
1448         (WebCore::CustomElementsRegistry::create): Added.
1449         (WebCore::CustomElementsRegistry::CustomElementsRegistry): Added.
1450         (WebCore::CustomElementsRegistry::~CustomElementsRegistry): Added.
1451         (WebCore::CustomElementsRegistry::addElementDefinition): Moved from CustomElementDefinitions.
1452         (WebCore::CustomElementsRegistry::addUpgradeCandidate): Ditto.
1453         (WebCore::CustomElementsRegistry::findInterface): Ditto.
1454         (WebCore::CustomElementsRegistry::containsConstructor): Ditto.
1455         * dom/CustomElementsRegistry.h: Renamed from Source/WebCore/dom/CustomElementDefinitions.h.
1456         * dom/CustomElementsRegistry.idl: Added.
1457         * dom/Document.cpp:
1458         (WebCore::createUpgradeCandidateElement): Extracted out of createHTMLElementWithNameValidation
1459         and createFallbackHTMLElement to share code.
1460         (WebCore::createHTMLElementWithNameValidation):
1461         (WebCore::createFallbackHTMLElement): This function was missing a check for the runtime flag.
1462         Sharing code with createHTMLElementWithNameValidation via createUpgradeCandidateElement fixes it.
1463         (WebCore::Document::ensureCustomElementDefinitions): Deleted.
1464         * dom/Document.h:
1465         (WebCore::Document::customElementDefinitions): Deleted.
1466         * dom/Document.idl:
1467         * dom/Element.cpp:
1468         (WebCore::Element::attributeChanged):
1469         * html/parser/HTMLConstructionSite.cpp:
1470         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
1471         * page/DOMWindow.cpp:
1472         (WebCore::DOMWindow::ensureCustomElementsRegistry): Added. Moved from Document.
1473         * page/DOMWindow.h:
1474         * page/DOMWindow.idl: Added customElements on DOMWindow.
1475
1476 2016-08-10  Alex Christensen  <achristensen@webkit.org>
1477
1478         Fix WinCairo build after r204327.
1479
1480         * platform/network/NetworkStorageSessionStub.cpp:
1481         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Renamed from create...
1482         (WebCore::NetworkStorageSession::createPrivateBrowsingSession): Deleted.
1483
1484 2016-08-10  Nan Wang  <n_wang@apple.com>
1485
1486         AX: Media controls timeline should have percentage value description
1487         https://bugs.webkit.org/show_bug.cgi?id=160619
1488
1489         Reviewed by Eric Carlson.
1490
1491         Added aria-valuetext attribute to the timeline slider and set its value to
1492         the percentage format. Also formatted the elapsed/remaining timer's description
1493         so that it's more human readable.
1494
1495         Test: http/tests/media/hls/video-duration-accessibility.html
1496
1497         * English.lproj/mediaControlsLocalizedStrings.js:
1498         * Modules/mediacontrols/mediaControlsApple.js:
1499         (Controller.prototype.drawVolumeBackground):
1500         (Controller.prototype.formatTimeDescription):
1501         (Controller.prototype.formatTime):
1502         (Controller.prototype.updateTime):
1503         (Controller.prototype.updateControlsWhileScrubbing):
1504
1505 2016-08-10  Anders Carlsson  <andersca@apple.com>
1506
1507         Revert back to the old style member function state machine for callbacks
1508         https://bugs.webkit.org/show_bug.cgi?id=160756
1509
1510         Reviewed by Tim Horton.
1511
1512         This is another step towards merging SQLTransactionBackend and SQLTransaction,
1513         and using a single state machine for both sides.
1514
1515         * Modules/webdatabase/SQLTransaction.cpp:
1516         (WebCore::SQLTransaction::SQLTransaction):
1517         (WebCore::SQLTransaction::performPendingCallback):
1518         (WebCore::SQLTransaction::checkAndHandleClosedDatabase):
1519         (WebCore::SQLTransaction::scheduleCallback):
1520         (WebCore::SQLTransaction::openTransactionAndPreflight):
1521         (WebCore::SQLTransaction::runCurrentStatement):
1522         (WebCore::SQLTransaction::handleCurrentStatementError):
1523         (WebCore::SQLTransaction::handleTransactionError):
1524         (WebCore::SQLTransaction::postflightAndCommit):
1525         (WebCore::SQLTransaction::debugStepName):
1526         * Modules/webdatabase/SQLTransaction.h:
1527
1528 2016-08-09  Skachkov Oleksandr  <gskachkov@gmail.com>
1529
1530         [ES2016] Implement Object.values
1531         https://bugs.webkit.org/show_bug.cgi?id=160410
1532
1533         Reviewed by Saam Barati, Yusuke Suzuki.
1534
1535         No new tests because all tests are implemented in JavaScriptCore 
1536         and there is no behavior change.
1537
1538         * ForwardingHeaders/runtime/IterationKind.h: Added.
1539         * bindings/js/SerializedScriptValue.cpp:
1540         (WebCore::CloneSerializer::serialize):
1541
1542 2016-08-10  Anders Carlsson  <andersca@apple.com>
1543
1544         Move more functions to from SQLTransactionBackend to SQLTransaction
1545         https://bugs.webkit.org/show_bug.cgi?id=160752
1546
1547         Reviewed by Tim Horton.
1548
1549         * Modules/webdatabase/SQLTransaction.cpp:
1550         (WebCore::SQLTransaction::acquireLock):
1551         (WebCore::SQLTransaction::openTransactionAndPreflight):
1552         (WebCore::SQLTransaction::runStatements):
1553         (WebCore::SQLTransaction::cleanupAndTerminate):
1554         (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
1555         * Modules/webdatabase/SQLTransaction.h:
1556         * Modules/webdatabase/SQLTransactionBackend.cpp:
1557         (WebCore::SQLTransactionBackend::acquireLock):
1558         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
1559         (WebCore::SQLTransactionBackend::runStatements):
1560         (WebCore::SQLTransactionBackend::cleanupAndTerminate):
1561         (WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):
1562
1563 2016-08-10  Anders Carlsson  <andersca@apple.com>
1564
1565         Begin moving member functions from SQLTransactionBackend to SQLTransaction
1566         https://bugs.webkit.org/show_bug.cgi?id=160747
1567
1568         Reviewed by Tim Horton.
1569
1570         * Modules/webdatabase/Database.cpp:
1571         (WebCore::Database::performClose):
1572         * Modules/webdatabase/DatabaseTask.cpp:
1573         (WebCore::DatabaseTransactionTask::~DatabaseTransactionTask):
1574         (WebCore::DatabaseTransactionTask::doPerformTask):
1575         * Modules/webdatabase/SQLTransaction.cpp:
1576         (WebCore::SQLTransaction::executeSQL):
1577         (WebCore::SQLTransaction::lockAcquired):
1578         (WebCore::SQLTransaction::performNextStep):
1579         (WebCore::SQLTransaction::performPendingCallback):
1580         (WebCore::SQLTransaction::notifyDatabaseThreadIsShuttingDown):
1581         (WebCore::SQLTransaction::enqueueStatement):
1582         (WebCore::SQLTransaction::getNextStatement):
1583         (WebCore::SQLTransaction::runCurrentStatement):
1584         (WebCore::SQLTransaction::handleCurrentStatementError):
1585         (WebCore::SQLTransaction::handleTransactionError):
1586         (WebCore::SQLTransaction::postflightAndCommit):
1587         (WebCore::SQLTransaction::acquireOriginLock):
1588         (WebCore::SQLTransaction::releaseOriginLockIfNeeded):
1589         * Modules/webdatabase/SQLTransaction.h:
1590         (WebCore::SQLTransaction::backend): Deleted.
1591         * Modules/webdatabase/SQLTransactionBackend.cpp:
1592         (WebCore::SQLTransactionBackend::doCleanup):
1593         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
1594         (WebCore::SQLTransactionBackend::runStatements):
1595         (WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):
1596         (WebCore::SQLTransactionBackend::enqueueStatement): Deleted.
1597         (WebCore::SQLTransactionBackend::performNextStep): Deleted.
1598         (WebCore::SQLTransactionBackend::executeSQL): Deleted.
1599         (WebCore::SQLTransactionBackend::lockAcquired): Deleted.
1600         (WebCore::SQLTransactionBackend::getNextStatement): Deleted.
1601         (WebCore::SQLTransactionBackend::runCurrentStatement): Deleted.
1602         (WebCore::SQLTransactionBackend::handleCurrentStatementError): Deleted.
1603         (WebCore::SQLTransactionBackend::handleTransactionError): Deleted.
1604         (WebCore::SQLTransactionBackend::postflightAndCommit): Deleted.
1605         (WebCore::SQLTransactionBackend::acquireOriginLock): Deleted.
1606         (WebCore::SQLTransactionBackend::releaseOriginLockIfNeeded): Deleted.
1607         * Modules/webdatabase/SQLTransactionBackend.h:
1608         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
1609         (WebCore::SQLTransactionCoordinator::processPendingTransactions):
1610         (WebCore::SQLTransactionCoordinator::shutdown):
1611
1612 2016-08-10  Anders Carlsson  <andersca@apple.com>
1613
1614         Move all SQLTransactionBackend member variables to SQLTransaction
1615         https://bugs.webkit.org/show_bug.cgi?id=160745
1616
1617         Reviewed by Tim Horton.
1618
1619         * Modules/webdatabase/ChangeVersionWrapper.cpp:
1620         (WebCore::ChangeVersionWrapper::performPreflight):
1621         (WebCore::ChangeVersionWrapper::performPostflight):
1622         (WebCore::ChangeVersionWrapper::handleCommitFailedAfterPostflight):
1623         * Modules/webdatabase/ChangeVersionWrapper.h:
1624         (WebCore::ChangeVersionWrapper::sqlError): Deleted.
1625         * Modules/webdatabase/SQLTransaction.cpp:
1626         (WebCore::SQLTransaction::SQLTransaction):
1627         (WebCore::SQLTransaction::deliverTransactionErrorCallback):
1628         (WebCore::SQLTransaction::deliverStatementCallback):
1629         (WebCore::SQLTransaction::deliverQuotaIncreaseCallback):
1630         (WebCore::SQLTransaction::hasCallback): Deleted.
1631         (WebCore::SQLTransaction::hasSuccessCallback): Deleted.
1632         (WebCore::SQLTransaction::hasErrorCallback): Deleted.
1633         * Modules/webdatabase/SQLTransaction.h:
1634         (WebCore::SQLTransaction::isReadOnly):
1635         * Modules/webdatabase/SQLTransactionBackend.cpp:
1636         (WebCore::SQLTransactionBackend::SQLTransactionBackend):
1637         (WebCore::SQLTransactionBackend::~SQLTransactionBackend):
1638         (WebCore::SQLTransactionBackend::doCleanup):
1639         (WebCore::SQLTransactionBackend::enqueueStatement):
1640         (WebCore::SQLTransactionBackend::computeNextStateAndCleanupIfNeeded):
1641         (WebCore::SQLTransactionBackend::executeSQL):
1642         (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown):
1643         (WebCore::SQLTransactionBackend::acquireLock):
1644         (WebCore::SQLTransactionBackend::lockAcquired):
1645         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
1646         (WebCore::SQLTransactionBackend::runStatements):
1647         (WebCore::SQLTransactionBackend::getNextStatement):
1648         (WebCore::SQLTransactionBackend::runCurrentStatement):
1649         (WebCore::SQLTransactionBackend::handleCurrentStatementError):
1650         (WebCore::SQLTransactionBackend::handleTransactionError):
1651         (WebCore::SQLTransactionBackend::postflightAndCommit):
1652         (WebCore::SQLTransactionBackend::cleanupAndTerminate):
1653         (WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):
1654         (WebCore::SQLTransactionBackend::requestTransitToState):
1655         (WebCore::SQLTransactionBackend::acquireOriginLock):
1656         (WebCore::SQLTransactionBackend::releaseOriginLockIfNeeded):
1657         (WebCore::SQLTransactionBackend::currentStatement): Deleted.
1658         (WebCore::SQLTransactionBackend::transactionError): Deleted.
1659         (WebCore::SQLTransactionBackend::setShouldRetryCurrentStatement): Deleted.
1660         (WebCore::SQLTransactionBackend::enqueueStatementBackend): Deleted.
1661         * Modules/webdatabase/SQLTransactionBackend.h:
1662         (WebCore::SQLTransactionBackend::database): Deleted.
1663         (WebCore::SQLTransactionBackend::isReadOnly): Deleted.
1664         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
1665         (WebCore::SQLTransactionCoordinator::processPendingTransactions):
1666         (WebCore::SQLTransactionCoordinator::releaseLock):
1667
1668 2016-08-10  Simon Fraser  <simon.fraser@apple.com>
1669
1670         Sort the project file.
1671
1672         * WebCore.xcodeproj/project.pbxproj:
1673
1674 2016-08-10  Simon Fraser  <simon.fraser@apple.com>
1675
1676         Sort the feature flags in the FEATURE_DEFINES lines
1677         https://bugs.webkit.org/show_bug.cgi?id=160742
1678
1679         Reviewed by Anders Carlsson.
1680
1681         * Configurations/FeatureDefines.xcconfig:
1682
1683 2016-08-10  Anders Carlsson  <andersca@apple.com>
1684
1685         Make SQLTransactionBackend a member of SQLTransaction
1686         https://bugs.webkit.org/show_bug.cgi?id=160741
1687
1688         Reviewed by Tim Horton.
1689
1690         This is another step towards merging SQLTransaction and SQLTransactionBackend.
1691
1692         * Modules/webdatabase/Database.cpp:
1693         (WebCore::Database::performClose):
1694         (WebCore::Database::scheduleTransaction):
1695         (WebCore::Database::scheduleTransactionStep):
1696         (WebCore::Database::runTransaction):
1697         * Modules/webdatabase/Database.h:
1698         * Modules/webdatabase/DatabaseTask.cpp:
1699         (WebCore::DatabaseTransactionTask::DatabaseTransactionTask):
1700         (WebCore::DatabaseTransactionTask::~DatabaseTransactionTask):
1701         (WebCore::DatabaseTransactionTask::doPerformTask):
1702         * Modules/webdatabase/DatabaseTask.h:
1703         (WebCore::DatabaseTransactionTask::transaction):
1704         * Modules/webdatabase/DatabaseThread.cpp:
1705         * Modules/webdatabase/SQLTransaction.cpp:
1706         (WebCore::SQLTransaction::SQLTransaction):
1707         (WebCore::SQLTransaction::deliverTransactionCallback):
1708         (WebCore::SQLTransaction::deliverTransactionErrorCallback):
1709         (WebCore::SQLTransaction::deliverStatementCallback):
1710         (WebCore::SQLTransaction::deliverQuotaIncreaseCallback):
1711         (WebCore::SQLTransaction::deliverSuccessCallback):
1712         (WebCore::SQLTransaction::executeSQL):
1713         (WebCore::SQLTransaction::computeNextStateAndCleanupIfNeeded):
1714         (WebCore::SQLTransaction::setBackend): Deleted.
1715         * Modules/webdatabase/SQLTransaction.h:
1716         (WebCore::SQLTransaction::backend):
1717         * Modules/webdatabase/SQLTransactionBackend.cpp:
1718         (WebCore::SQLTransactionBackend::SQLTransactionBackend):
1719         (WebCore::SQLTransactionBackend::doCleanup):
1720         (WebCore::SQLTransactionBackend::computeNextStateAndCleanupIfNeeded):
1721         (WebCore::SQLTransactionBackend::acquireLock):
1722         (WebCore::SQLTransactionBackend::lockAcquired):
1723         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
1724         (WebCore::SQLTransactionBackend::runCurrentStatement):
1725         (WebCore::SQLTransactionBackend::handleCurrentStatementError):
1726         (WebCore::SQLTransactionBackend::handleTransactionError):
1727         (WebCore::SQLTransactionBackend::postflightAndCommit):
1728         (WebCore::SQLTransactionBackend::requestTransitToState):
1729         (WebCore::SQLTransactionBackend::create): Deleted.
1730         * Modules/webdatabase/SQLTransactionBackend.h:
1731         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
1732         (WebCore::getDatabaseIdentifier):
1733         (WebCore::SQLTransactionCoordinator::processPendingTransactions):
1734         (WebCore::SQLTransactionCoordinator::acquireLock):
1735         (WebCore::SQLTransactionCoordinator::releaseLock):
1736         (WebCore::SQLTransactionCoordinator::shutdown):
1737         * Modules/webdatabase/SQLTransactionCoordinator.h:
1738
1739 2016-08-08  Simon Fraser  <simon.fraser@apple.com>
1740
1741         child-transform-with-anchor-point-expected.html renders incorrectly
1742         https://bugs.webkit.org/show_bug.cgi?id=160616
1743
1744         Reviewed by Zalan Bujtas.
1745         
1746         If a layer has perspective, we need to ensure that its bounds don't collapse to 0x0 when clipped out,
1747         otherwise the sublayerTransform geometry gets messed up.
1748
1749         Test: compositing/geometry/clipped-out-perspective.html
1750
1751         * rendering/RenderLayerBacking.cpp:
1752         (WebCore::RenderLayerBacking::updateCompositedBounds):
1753
1754 2016-08-09  Sam Weinig  <sam@webkit.org>
1755
1756         Remove support for array types in IDLs
1757         https://bugs.webkit.org/show_bug.cgi?id=160729
1758
1759         Reviewed by Anders Carlsson.
1760
1761         Array types have been removed from WebIDL in favor of sequence<> and FrozenArray<>.
1762
1763         - Replace all current uses of Array types with sequences. This causes
1764           no functional change.
1765
1766         * bindings/scripts/CodeGenerator.pm:
1767         * bindings/scripts/CodeGeneratorGObject.pm:
1768         * bindings/scripts/CodeGeneratorJS.pm:
1769         * bindings/scripts/IDLParser.pm:
1770         Remove array support from the generators.
1771
1772         * Modules/gamepad/Gamepad.idl:
1773         * Modules/gamepad/NavigatorGamepad.idl:
1774         * Modules/gamepad/deprecated/Gamepad.idl:
1775         * Modules/mediacontrols/MediaControlsHost.idl:
1776         * Modules/mediastream/MediaStream.idl:
1777         * Modules/mediastream/MediaTrackConstraints.idl:
1778         * Modules/mediastream/RTCConfiguration.idl:
1779         * Modules/mediastream/RTCIceServer.idl:
1780         * Modules/mediastream/RTCTrackEvent.idl:
1781         * crypto/CryptoKey.idl:
1782         * dom/MessageEvent.idl:
1783         * testing/Internals.idl:
1784         Switch from array to sequence.
1785
1786 2016-08-10  Alex Christensen  <achristensen@webkit.org>
1787
1788         Use unsigned for locations in URL
1789         https://bugs.webkit.org/show_bug.cgi?id=160706
1790
1791         Reviewed by Sam Weinig.
1792
1793         No change in behavior.
1794
1795         * platform/URL.cpp:
1796         (WebCore::isSchemeFirstChar):
1797         (WebCore::findFirstOf):
1798         (WebCore::checkEncodedString):
1799         (WebCore::URL::host):
1800         (WebCore::URL::protocolIs):
1801         (WebCore::URL::setPort):
1802         (WebCore::URL::setUser):
1803         (WebCore::URL::setPass):
1804         (WebCore::escapeAndAppendNonHierarchicalPart):
1805         (WebCore::copyPathRemovingDots):
1806         (WebCore::URL::serialize):
1807         (WebCore::isDefaultPortForScheme):
1808         (WebCore::hostPortIsEmptyButCredentialsArePresent):
1809         (WebCore::URL::parse):
1810         (WebCore::protocolHostAndPortAreEqual):
1811         (WebCore::hostsAreEqual):
1812         (WebCore::protocolIs):
1813         (WebCore::findHostnamesInMailToURL):
1814         (WebCore::findHostnameInHierarchicalURL):
1815         (WebCore::encodeHostnames):
1816         (WebCore::encodeRelativeString):
1817         * platform/URL.h:
1818
1819 2016-08-09  Anders Carlsson  <andersca@apple.com>
1820
1821         Move SQLTransactionBackend construction inside SQLTransaction
1822         https://bugs.webkit.org/show_bug.cgi?id=160726
1823
1824         Reviewed by Tim Horton.
1825
1826         This is the first step towards re-merging SQLTransactionBackend and SQLTransaction and clean up the code.
1827
1828         * Modules/webdatabase/ChangeVersionWrapper.cpp:
1829         * Modules/webdatabase/ChangeVersionWrapper.h:
1830         * Modules/webdatabase/Database.cpp:
1831         (WebCore::Database::performClose):
1832         (WebCore::Database::scheduleTransactionStep):
1833         (WebCore::Database::changeVersion):
1834         (WebCore::Database::transaction):
1835         (WebCore::Database::readTransaction):
1836         (WebCore::Database::runTransaction):
1837         * Modules/webdatabase/Database.h:
1838         * Modules/webdatabase/DatabaseTask.cpp:
1839         * Modules/webdatabase/SQLTransaction.cpp:
1840         (WebCore::SQLTransaction::create):
1841         (WebCore::SQLTransaction::SQLTransaction):
1842         * Modules/webdatabase/SQLTransaction.h:
1843         (WebCore::SQLTransactionWrapper::~SQLTransactionWrapper):
1844         (WebCore::SQLTransaction::backend):
1845         * Modules/webdatabase/SQLTransactionBackend.cpp:
1846         (WebCore::SQLTransactionBackend::lockAcquired):
1847         (WebCore::SQLTransactionBackend::requestTransitToState):
1848         * Modules/webdatabase/SQLTransactionBackend.h:
1849         (WebCore::SQLTransactionWrapper::~SQLTransactionWrapper): Deleted.
1850
1851 2016-08-10  Chris Dumez  <cdumez@apple.com>
1852
1853         It should be possible to re-initialize a MutationEvent after it's been dispatched
1854         https://bugs.webkit.org/show_bug.cgi?id=160703
1855
1856         Reviewed by Sam Weinig.
1857
1858         It should be possible to re-initialize a MutationEvent after it's been dispatched,
1859         similarly to Event:
1860         - https://www.w3.org/TR/2015/WD-uievents-20151215/#widl-MutationEvent-initMutationEvent
1861
1862         Test: fast/events/initMutationEvent-after-dispatch.html
1863
1864         * dom/MutationEvent.cpp:
1865         (WebCore::MutationEvent::initMutationEvent):
1866
1867 2016-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
1868
1869         [ES6] Add ModuleLoaderPrototype and move methods to it
1870         https://bugs.webkit.org/show_bug.cgi?id=160633
1871
1872         Reviewed by Saam Barati.
1873
1874         No behavior change.
1875
1876         * ForwardingHeaders/runtime/JSModuleLoader.h: Added.
1877         * bindings/js/JSDOMWindowBase.cpp:
1878         (WebCore::JSDOMWindowBase::moduleLoaderResolve):
1879         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
1880         (WebCore::JSDOMWindowBase::moduleLoaderEvaluate):
1881         * bindings/js/JSDOMWindowBase.h:
1882         * bindings/js/JSModuleLoader.cpp:
1883         (WebCore::JSModuleLoader::resolve):
1884         (WebCore::JSModuleLoader::fetch):
1885         (WebCore::JSModuleLoader::evaluate):
1886         * bindings/js/JSModuleLoader.h:
1887
1888 2016-08-10  Per Arne Vollan  <pvollan@apple.com>
1889
1890         [Win] Warning fix.
1891         https://bugs.webkit.org/show_bug.cgi?id=160687
1892
1893         Reviewed by Sam Weinig.
1894
1895         Avoid forward declarations with different dll linkage.
1896
1897         * platform/spi/cf/CFNetworkSPI.h:
1898
1899 2016-08-10  Per Arne Vollan  <pvollan@apple.com>
1900
1901         [Win] Warning fix.
1902         https://bugs.webkit.org/show_bug.cgi?id=160690
1903
1904         Reviewed by Sam Weinig.
1905
1906         Use static cast to convert from enum to unsigned.
1907
1908         * platform/network/ProtectionSpaceHash.h:
1909         (WebCore::ProtectionSpaceHash::hash):
1910
1911 2016-08-09  Alex Christensen  <achristensen@webkit.org>
1912
1913         Move NetworkStorageSession management to WebCore
1914         https://bugs.webkit.org/show_bug.cgi?id=160173
1915
1916         Reviewed by Brady Eidson.
1917
1918         No new tests.  No change in behaviour.
1919         Just moving the mapping from SessionID to NetworkStorageSession so we can use it from WebCore.
1920         I need this so we can get to the NetworkStorageSession from SocketStreamHandle without requiring a NetworkingContext.
1921
1922         * CMakeLists.txt:
1923         * WebCore.xcodeproj/project.pbxproj:
1924         * loader/CookieJar.cpp:
1925         * platform/network/NetworkStorageSession.cpp: Added.
1926         (WebCore::globalSessionMap):
1927         (WebCore::NetworkStorageSession::storageSession):
1928         (WebCore::NetworkStorageSession::destroySession):
1929         (WebCore::NetworkStorageSession::forEach):
1930         Moved from forEachNetworkStorageSession and fixed the FIXME.  This function now includes the default NetworkStorageSession.
1931         * platform/network/NetworkStorageSession.h:
1932         * platform/network/NetworkingContext.h:
1933         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1934         (WebCore::NetworkStorageSession::defaultStorageSession):
1935         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
1936         (WebCore::NetworkStorageSession::cookieStorage):
1937         (WebCore::NetworkStorageSession::createPrivateBrowsingSession): Deleted.
1938         * platform/network/cf/SocketStreamHandleCFNet.cpp:
1939         * platform/network/soup/CookieJarSoup.cpp:
1940         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1941         (WebCore::NetworkStorageSession::defaultStorageSession):
1942         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
1943         (WebCore::NetworkStorageSession::switchToNewTestingSession):
1944         (WebCore::NetworkStorageSession::createPrivateBrowsingSession): Deleted.
1945         * platform/network/soup/ResourceHandleSoup.cpp:
1946
1947 2016-08-09  Chris Dumez  <cdumez@apple.com>
1948
1949         Optimization in Node.replaceChild() is not spec-compliant
1950         https://bugs.webkit.org/show_bug.cgi?id=160730
1951
1952         Reviewed by Ryosuke Niwa.
1953
1954         We have an optimization in Node.replaceChild() to avoid doing any work
1955         when the reference child and the new child are the same node. This
1956         optimization is not spec-compliant:
1957         - https://dom.spec.whatwg.org/#concept-node-replace
1958
1959         This is an issue because it is observable via Mutation observers /
1960         listeners or DOM ranges.
1961
1962         To address the issue, this patch drops the optimization. This is
1963         probably not common enough to be worth optimizing for. However,
1964         if it turns out to regress performance of things we care about,
1965         we can fall back to do the optimization only in cases where it
1966         is not observable.
1967
1968         No new tests, rebaselined existing tests.
1969
1970         * dom/ContainerNode.cpp:
1971         (WebCore::ContainerNode::replaceChild):
1972         1. Drop the oldChild == newChild optimization which is not in the
1973            specification.
1974         2. Add a null check for oldChild.parentNode() before trying to
1975            remove it from its parent, as per step 12 of the specification.
1976            oldChild.parentNode() is null when oldChild is newChild.
1977         3. Make sure we enqueue separate mutation records for the adoption
1978            of newNode into parent's node document and for the removal of
1979            oldChild / insertion of newChild. This is mandated by the
1980            specification (steps 10 and 15). Without this change, the
1981            following test would still not pass after dropping the
1982            optimization:
1983            imported/w3c/web-platform-tests/dom/nodes/MutationObserver-childList.html
1984
1985 2016-08-09  Chris Dumez  <cdumez@apple.com>
1986
1987         Optimization in Node::appendChild() is not spec-compliant
1988         https://bugs.webkit.org/show_bug.cgi?id=160728
1989
1990         Reviewed by Ryosuke Niwa.
1991
1992         We have an optimization in Node::appendChild() that avoid doing any work
1993         if the node to be appended is already the last child. This optimization
1994         is not spec-compliant:
1995         - https://dom.spec.whatwg.org/#dom-node-appendchild
1996
1997         The issue is that this is observable via DOM Mutation observers / listeners
1998         or DOM ranges.
1999
2000         To address the issue, this patch drops the optimization in appendChild().
2001         This seems like an odd case to optimize for as I am not convinced it is
2002         common to call parent.appendChild(parent.lastChild). If it turns out to
2003         regress the performance of things we care about though, we could fall
2004         back to do the optimization only when it is not observable.
2005
2006         Test: fast/dom/Node/appendChild-no-op-mutationobserver.html
2007
2008         * dom/ContainerNode.cpp:
2009         (WebCore::ContainerNode::appendChild): Deleted.
2010
2011 2016-08-09  Anders Carlsson  <andersca@apple.com>
2012
2013         Instantiate WebKit plug-ins at layout time, instead of at style resolution time
2014         https://bugs.webkit.org/show_bug.cgi?id=160715
2015
2016         Reviewed by Tim Horton.
2017
2018         This gets rid of the differentiation of WebKit plug-ins and Netscape plug-ins, and
2019         always instantiates plug-ins at layout time.
2020         
2021         Initially, plug-ins were always instantiated after style recalc, but that lead to bugs
2022         where plug-ins wouldn't be instantiated with their correct size. Fixing that bug lead
2023         to a regression in the Web Clip widget which is why the special casing was introduced.
2024         
2025         The Web Clip widget has now been fixed, so we can get rid of the special case.
2026
2027         * html/HTMLAppletElement.cpp:
2028         (WebCore::HTMLAppletElement::updateWidget):
2029         * html/HTMLAppletElement.h:
2030         * html/HTMLEmbedElement.cpp:
2031         (WebCore::HTMLEmbedElement::updateWidget):
2032         * html/HTMLEmbedElement.h:
2033         * html/HTMLObjectElement.cpp:
2034         (WebCore::HTMLObjectElement::updateWidget):
2035         * html/HTMLObjectElement.h:
2036         * html/HTMLPlugInImageElement.cpp:
2037         (WebCore::HTMLPlugInImageElement::isImageType):
2038         (WebCore::HTMLPlugInImageElement::wouldLoadAsPlugIn):
2039         (WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary):
2040         (WebCore::HTMLPlugInImageElement::wouldLoadAsNetscapePlugin): Deleted.
2041         * html/HTMLPlugInImageElement.h:
2042         * loader/EmptyClients.h:
2043         * loader/FrameLoaderTypes.h:
2044         * loader/SubframeLoader.cpp:
2045         (WebCore::SubframeLoader::shouldUsePlugin):
2046         * page/FrameView.cpp:
2047         (WebCore::FrameView::updateEmbeddedObject):
2048
2049 2016-08-09  Chris Dumez  <cdumez@apple.com>
2050
2051         Unreviewed, fix assertions after r204311.
2052
2053         Range::textNodeSplit() can now get called with a node that
2054         does not have a nextSibling(), in the case where this node
2055         does not have a parent.
2056
2057         * dom/Range.cpp:
2058         (WebCore::Range::textNodeSplit):
2059
2060 2016-08-09  Chris Dumez  <cdumez@apple.com>
2061
2062         CharacterData.data setter optimization is not spec-compliant and is observable
2063         https://bugs.webkit.org/show_bug.cgi?id=160712
2064
2065         Reviewed by Ryosuke Niwa.
2066
2067         We have an optimization in CharacterData.setData() that avoid doing any
2068         work if the new data is identical to the old data. However, this
2069         optimization is not spec-compliant:
2070         - https://dom.spec.whatwg.org/#dom-characterdata-data
2071
2072         This is an issue because this is observable using DOM mutation observer
2073         or ranges.
2074
2075         To address the issue, we now:
2076         1. Only use the optimization if there are not DOM mutation observers /
2077            listeners on the page.
2078         2. We now update the associated range when we use the fast path as well.
2079
2080         Test: fast/dom/Text/setData-no-op-mutation.html
2081
2082         * dom/CharacterData.cpp:
2083         (WebCore::canUseSetDataOptimization):
2084         (WebCore::CharacterData::setData):
2085
2086 2016-08-09  George Ruan  <gruan@apple.com>
2087
2088         Implement functionality of media capture on iOS
2089         https://bugs.webkit.org/show_bug.cgi?id=158945
2090         <rdar://problem/26893343>
2091
2092         Reviewed by Tim Horton.
2093
2094         No new tests, feature requires user gesture which we are unable to
2095         test currently.
2096
2097         * Configurations/FeatureDefines.xcconfig: Enable Media Capture feature
2098         for iOS.
2099         * html/FileInputType.cpp:
2100         (WebCore::FileInputType::handleDOMActivateEvent): Modified call for
2101         mediaCaptureType property.
2102         * html/HTMLInputElement.cpp:
2103         (WebCore::HTMLInputElement::mediaCaptureType): Returns
2104         MediaCaptureType according to the value of the capture attribute on
2105         the HTMLInputElement.
2106         (WebCore::HTMLInputElement::shouldUseMediaCapture): Deleted.
2107         * html/HTMLInputElement.h:
2108         * html/HTMLInputElement.idl: As the capture attribute is specified as
2109         a boolean attribute in the Media Capture spec, this is a non-standard
2110         web-facing change with accordance to the proposal #1102. We would like
2111         to be able to specify a capture device to pull up upon interaction
2112         with the input type file element. In favor of not introducing a new
2113         attribute to specify the capture device, we reuse the capture
2114         attribute with a set of enumerated values (user, environment, none) to
2115         specify the desired media capture behavior.
2116         * platform/FileChooser.h: Created enum MediaCaptureType representing
2117         whether the front or rear camera shoul dbe shown when the capture
2118         attribute is specified.
2119
2120 2016-08-09  Chris Dumez  <cdumez@apple.com>
2121
2122         Calling splitText() on a parent-less Text node should update associated ranges
2123         https://bugs.webkit.org/show_bug.cgi?id=160710
2124
2125         Reviewed by Ryosuke Niwa.
2126
2127         Calling splitText() on a parent-less Text node should update associated ranges:
2128         - https://dom.spec.whatwg.org/#concept-text-split (Step 9)
2129
2130         Previously, we would only update ranges for Text nodes that have a parent.
2131
2132         No new tests, rebaselined existing test.
2133
2134         * dom/Range.cpp:
2135         (WebCore::boundaryTextNodesSplit):
2136         (WebCore::Range::textNodeSplit): Deleted.
2137         * dom/Text.cpp:
2138         (WebCore::Text::splitText):
2139
2140 2016-08-09  Chris Dumez  <cdumez@apple.com>
2141
2142         Drop unused NodeListsNodeData::isEmpty()
2143         https://bugs.webkit.org/show_bug.cgi?id=160704
2144
2145         Reviewed by Ryosuke Niwa.
2146
2147         Drop unused NodeListsNodeData::isEmpty(). Its implementation is incorrect
2148         anyway because it fails to check if the m_childNodeList / m_emptyChildNodeList
2149         members are null.
2150
2151         * dom/NodeRareData.h:
2152         (WebCore::NodeListsNodeData::isEmpty): Deleted.
2153
2154 2016-08-06  Sam Weinig  <sam@webkit.org>
2155
2156         Replace NodeOrString with std::variant<Ref<Node>, String>
2157         https://bugs.webkit.org/show_bug.cgi?id=160638
2158
2159         Reviewed by Anders Carlsson.
2160
2161         * WebCore.xcodeproj/project.pbxproj:
2162         Remove NodeOrString.h/cpp
2163
2164         * bindings/js/JSNodeOrString.cpp:
2165         * bindings/js/JSNodeOrString.h:
2166         * dom/ContainerNode.cpp:
2167         (WebCore::ContainerNode::append):
2168         (WebCore::ContainerNode::prepend):
2169         * dom/ContainerNode.h:
2170         * dom/Node.cpp:
2171         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
2172         (WebCore::firstFollowingSiblingNotInNodeSet):
2173         (WebCore::Node::convertNodesOrStringsIntoNode):
2174         (WebCore::Node::before):
2175         (WebCore::Node::after):
2176         (WebCore::Node::replaceWith):
2177         * dom/Node.h:
2178         Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode
2179         into Node.
2180
2181         * dom/NodeOrString.cpp: Removed.
2182         * dom/NodeOrString.h: Removed.
2183
2184 2016-08-09  Chris Dumez  <cdumez@apple.com>
2185
2186         It should be possible to re-initialize a CustomEvent after it's been dispatched
2187         https://bugs.webkit.org/show_bug.cgi?id=160664
2188
2189         Reviewed by Darin Adler.
2190
2191         It should be possible to re-initialize a CustomEvent after it's been dispatched:
2192         - https://dom.spec.whatwg.org/#dom-customevent-initcustomevent
2193
2194         Test: fast/events/initCustomEvent-after-dispatch.html
2195
2196         * dom/CustomEvent.cpp:
2197         (WebCore::CustomEvent::initCustomEvent):
2198
2199 2016-08-09  Anders Carlsson  <andersca@apple.com>
2200
2201         Get rid of PluginStrategy
2202         https://bugs.webkit.org/show_bug.cgi?id=160696
2203
2204         Reviewed by Dan Bernstein.
2205
2206         * WebCore.xcodeproj/project.pbxproj:
2207         * loader/EmptyClients.cpp:
2208         * platform/PlatformStrategies.h:
2209         (WebCore::PlatformStrategies::pluginStrategy): Deleted.
2210         * plugins/PluginInfoProvider.h:
2211         * plugins/PluginStrategy.h: Removed.
2212         (WebCore::PluginStrategy::~PluginStrategy): Deleted.
2213
2214 2016-08-08  Myles C. Maxfield  <mmaxfield@apple.com>
2215
2216         Ensure StringView lifetime is correct inside InlineTextBox
2217         https://bugs.webkit.org/show_bug.cgi?id=160584
2218
2219         Reviewed by Darin Adler.
2220
2221         A TextRun contains a StringView. Previously, we had a helper function which
2222         could possibly create a new string, and then create a TextRun whose StringView
2223         pointed inside this new string. Then, the string would be destroyed because it
2224         was on the stack.
2225
2226         Luckily, this is benign because this new string would always share a
2227         StringImpl with the string passed into the function (and the StringView
2228         would point into this StringImpl). However, relying on this is dangerous
2229         and we are trying to enforce StringView lifetime checks in
2230         https://bugs.webkit.org/show_bug.cgi?id=160384.
2231
2232         The solution is to make a helper function which returns this built string
2233         so that the caller can own this built string, thereby extending its lifetime.
2234         Unfortunately, this built string can't be a StringView because the same
2235         mechanism must be used for text-combine, which returns originalText(), which
2236         may return a built string if it is a RenderCounter. Perhaps it would be
2237         valuable to migrate RenderCounter::originalText() to something else, or to
2238         divorce text-combine from originalText(), but that is out of scope for this
2239         patch. Similarly, hyphenation uses this same mechanism, but because the
2240         hyphenated string needs to be created, we must own the string storage (so
2241         StringView is incorrect here).
2242
2243         Another reason is for performance: StringView::substring() is faster to use
2244         than String::substringSharingImpl(), since it does not allocate and destroy a
2245         StringImpl on the heap. This patch migrates away from
2246         String::substringSharingImpl() and onto StringView::substring().
2247
2248         No new tests because there is no behavior change.
2249
2250         * rendering/InlineTextBox.cpp:
2251         (WebCore::InlineTextBox::localSelectionRect):
2252         (WebCore::InlineTextBox::paint):
2253         (WebCore::InlineTextBox::selectionStartEnd):
2254         (WebCore::InlineTextBox::paintSelection):
2255         (WebCore::InlineTextBox::hyphenatedStringForTextRun):
2256         (WebCore::InlineTextBox::constructTextRun):
2257         * rendering/InlineTextBox.h:
2258         * rendering/RenderCombineText.cpp:
2259         (WebCore::RenderCombineText::maybeGetCombinedStringForRendering):
2260         (WebCore::RenderCombineText::getStringToRender): Deleted.
2261         * rendering/RenderCombineText.h:
2262
2263 2016-08-08  Jeremy Jones  <jeremyj@apple.com>
2264
2265         Clear fullscreen mode state after exiting fullscreen mode to keep state in sync.
2266         https://bugs.webkit.org/show_bug.cgi?id=160668
2267
2268         Reviewed by Jon Lee.
2269
2270         When exiting fullscreen while in auto picture in picture mode, fullscreen mode gets
2271         out of sync, causing exit fullscreen to fail. This change updates the state 
2272         to keep it correct.
2273
2274         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2275         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
2276
2277 2016-08-08  Chris Dumez  <cdumez@apple.com>
2278
2279         [Web IDL] We should resolve typedefs for dictionary members
2280         https://bugs.webkit.org/show_bug.cgi?id=160675
2281
2282         Reviewed by Sam Weinig.
2283
2284         Resolve typedefs for dictionary member types.
2285
2286         Added bindings test coverage.
2287
2288         * bindings/scripts/IDLParser.pm:
2289         (applyTypedefs):
2290         * bindings/scripts/test/JS/JSTestObj.cpp:
2291         (WebCore::convert<TestObj::Dictionary>):
2292         * bindings/scripts/test/TestObj.idl:
2293
2294 2016-08-08  Anders Carlsson  <andersca@apple.com>
2295
2296         Fix the Windows build.
2297
2298         * plugins/PluginInfoProvider.h:
2299
2300 2016-08-08  Anders Carlsson  <andersca@apple.com>
2301
2302         Add a new PluginInfoProvider class, to replace PluginStrategy
2303         https://bugs.webkit.org/show_bug.cgi?id=160670
2304
2305         Reviewed by Sam Weinig.
2306
2307         Add a per page PluginInfoProvider class that's going to ultimately replace the plug-in strategy.
2308
2309         * WebCore.xcodeproj/project.pbxproj:
2310         * loader/EmptyClients.cpp:
2311         (WebCore::fillWithEmptyClients):
2312         * page/Page.cpp:
2313         (WebCore::Page::Page):
2314         (WebCore::Page::~Page):
2315         (WebCore::Page::refreshPlugins):
2316         (WebCore::Page::pluginData):
2317         (WebCore::Page::pluginInfoProvider):
2318         * page/Page.h:
2319         * page/PageConfiguration.cpp:
2320         * page/PageConfiguration.h:
2321         * plugins/DOMPluginArray.cpp:
2322         (WebCore::DOMPluginArray::refresh):
2323         * plugins/DOMPluginArray.h:
2324         * plugins/PluginData.cpp:
2325         (WebCore::PluginData::PluginData):
2326         (WebCore::PluginData::webVisiblePlugins):
2327         (WebCore::PluginData::publiclyVisiblePlugins):
2328         (WebCore::PluginData::initPlugins):
2329         (WebCore::PluginData::refresh): Deleted.
2330         * plugins/PluginData.h:
2331         (WebCore::PluginData::create):
2332         (WebCore::PluginData::PluginData): Deleted.
2333         * plugins/PluginInfoProvider.cpp: Added.
2334         (WebCore::PluginInfoProvider::~PluginInfoProvider):
2335         (WebCore::PluginInfoProvider::addPage):
2336         (WebCore::PluginInfoProvider::removePage):
2337         * plugins/PluginInfoProvider.h: Added.
2338         * replay/SerializationMethods.cpp:
2339         (JSC::EncodingTraits<PluginData>::decodeValue):
2340         (JSC::DeserializedPluginData::DeserializedPluginData): Deleted.
2341
2342 2016-08-08  John Wilander  <wilander@apple.com>
2343
2344         Popups opened from a sandboxed iframe should themselves be sandboxed
2345         https://bugs.webkit.org/show_bug.cgi?id=134850
2346         <rdar://problem/27375388>
2347
2348         Reviewed by Brent Fulgham.
2349
2350         Test: http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox.html
2351
2352         * loader/FrameLoader.cpp:
2353         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2354             Now copies the opener's frame loader effective sandbox flags to the
2355             new frame loader.
2356
2357 2016-08-08  Chris Dumez  <cdumez@apple.com>
2358
2359         Align Selection API with the specification
2360         https://bugs.webkit.org/show_bug.cgi?id=160663
2361
2362         Reviewed by Ryosuke Niwa.
2363
2364         Align Selection API with the specification:
2365         - https://www.w3.org/TR/selection-api/#idl-def-Selection
2366
2367         In particular, the following changes were made:
2368         - Mark parameters as non-nullable when they should be.
2369         - Mark parameters as mandatory when they should be.
2370         - Use "unsigned long" type for offsets instead of "long".
2371
2372         This aligns our behavior with Firefox and Chrome.
2373
2374         Note that the Node parameters to setBaseAndExtent() operation were kept
2375         nullable, which does not match the specification. This is intentional
2376         as I worry about compatibility risk, especially considering they are
2377         still nullable in Chrome. Only Firefox marks them as non-nullable.
2378
2379         Test: editing/selection/bad-input.html
2380
2381         * dom/Position.h:
2382         (WebCore::Position::LegacyEditingOffset::value):
2383         (WebCore::Position::LegacyEditingOffset::LegacyEditingOffset):
2384         (WebCore::createLegacyEditingPosition):
2385         * page/DOMSelection.cpp:
2386         (WebCore::DOMSelection::anchorOffset):
2387         (WebCore::DOMSelection::focusOffset):
2388         (WebCore::DOMSelection::baseOffset):
2389         (WebCore::DOMSelection::extentOffset):
2390         (WebCore::DOMSelection::rangeCount):
2391         (WebCore::DOMSelection::collapse):
2392         (WebCore::DOMSelection::setBaseAndExtent):
2393         (WebCore::DOMSelection::setPosition):
2394         (WebCore::DOMSelection::extend):
2395         (WebCore::DOMSelection::getRangeAt):
2396         (WebCore::DOMSelection::addRange):
2397         (WebCore::DOMSelection::deleteFromDocument):
2398         (WebCore::DOMSelection::containsNode):
2399         (WebCore::DOMSelection::selectAllChildren):
2400         (WebCore::DOMSelection::shadowAdjustedOffset):
2401         (WebCore::DOMSelection::modify): Deleted.
2402         (WebCore::DOMSelection::shadowAdjustedNode): Deleted.
2403         (WebCore::DOMSelection::isValidForPosition): Deleted.
2404         * page/DOMSelection.h:
2405         * page/DOMSelection.idl:
2406
2407 2016-08-08  Chris Dumez  <cdumez@apple.com>
2408
2409         Regression(r204239): Caused flaky crashes under ~Database()
2410         https://bugs.webkit.org/show_bug.cgi?id=160665
2411         <rdar://problem/27748065>
2412
2413         Reviewed by Brady Eidson.
2414
2415         Make sure the scriptExecution context only gets ref'd / deref'd
2416         on the context thread. Document / WorkerGlobalScope are not
2417         ThreadSafeRefCounted.
2418
2419         No new tests, already covered by:
2420         storage/websql/open-database-creation-callback.html
2421
2422         * Modules/webdatabase/Database.cpp:
2423         (WebCore::Database::~Database):
2424
2425 2016-08-08  John Wilander  <wilander@apple.com>
2426
2427         Don't set document.domain to an IP address fragment
2428         https://bugs.webkit.org/show_bug.cgi?id=126045
2429         <rdar://problem/27331794>
2430
2431         Reviewed by Daniel Bates.
2432
2433         This patch matches the following Blink one:
2434         https://chromium.googlesource.com/chromium/blink//b19a57fdb323d5a80d3a1cb0a6b343558c4237b0
2435
2436         IP address octets should not be treated as subdomains when setting
2437         document.domain. The specs say:
2438         'The domain attribute's setter must run these steps: ...
2439         7. If host is not equal to effectiveDomain, then run these substeps:
2440             1. If host or effectiveDomain is not a domain, then throw a
2441             "SecurityError" DOMException.'
2442         https://html.spec.whatwg.org/multipage/browsers.html#relaxing-the-same-origin-restriction
2443         Last Updated 5 August 2016
2444
2445         'A host is a domain, an IPv4 address, or an IPv6 address.'
2446         https://url.spec.whatwg.org/#concept-domain
2447         Last Updated 28 July 2016
2448
2449         Test: http/tests/security/set-domain-remove-subdomain-for-ip-address.html
2450
2451         * dom/Document.cpp:
2452         (WebCore::Document::setDomain):
2453             Now checks whether the security origin is allowed to remove
2454             subdomains. If not, it throws a security error.
2455         * page/OriginAccessEntry.cpp:
2456         (WebCore::OriginAccessEntry::OriginAccessEntry):
2457             Constructor now expects an IP address setting.
2458         (WebCore::OriginAccessEntry::matchesOrigin):
2459             Now also checks whether the host in an IP address and returns
2460             false if IP addresses aren't configured to be treated as domains.
2461         * page/OriginAccessEntry.h:
2462             Introduced new enum for IP address setting.
2463             Constructor now expects an IP address setting.
2464         (WebCore::OriginAccessEntry::ipAddressSettings):
2465             New getter.
2466         (WebCore::operator==):
2467             Now also requires IP address settings to match.
2468         * page/SecurityPolicy.cpp:
2469         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
2470             Changes to match OriginAccessEntry's new constructor.
2471         (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
2472             Changes to match OriginAccessEntry's new constructor.
2473         * page/Settings.in:
2474             Added a setting to allow IP address octets to be treated as
2475             subdomains. This way our existing tests setting document.domain
2476             still work.
2477
2478 2016-08-04  Anders Carlsson  <andersca@apple.com>
2479
2480         Remove more unused bindings code
2481         https://bugs.webkit.org/show_bug.cgi?id=160568
2482
2483         Reviewed by Sam Weinig.
2484
2485         * CMakeLists.txt:
2486         * DerivedSources.make:
2487         * WebCore.xcodeproj/project.pbxproj:
2488         * bindings/objc/DOMDocument.mm:
2489         (-[DOMDocument execCommand:userInterface:]):
2490         (-[DOMDocument execCommand:]):
2491         (-[DOMDocument getMatchedCSSRules:pseudoElement:]):
2492         * bindings/objc/DOMHTMLBaseFontElement.mm:
2493         * bindings/objc/DOMHTMLCollection.mm:
2494         (-[DOMHTMLCollection tags:]):
2495         * bindings/objc/DOMWheelEvent.mm:
2496         (-[DOMWheelEvent isHorizontal]):
2497         * css/RGBColor.idl:
2498         * dom/Attr.idl:
2499         * dom/DOMImplementation.idl:
2500         * dom/Document.h:
2501         * dom/Document.idl:
2502         * dom/Element.idl:
2503         * dom/EventException.h: Removed.
2504         (WebCore::EventException::EventException): Deleted.
2505         * dom/EventException.idl: Removed.
2506         * dom/KeyboardEvent.idl:
2507         * dom/MessageEvent.cpp:
2508         (WebCore::MessageEvent::messagePort): Deleted.
2509         (WebCore::MessageEvent::initMessageEvent): Deleted.
2510         * dom/MessageEvent.h:
2511         * dom/MessagePort.cpp:
2512         (WebCore::MessagePort::postMessage): Deleted.
2513         * dom/MessagePort.h:
2514         * dom/Node.idl:
2515         * dom/NodeFilter.idl:
2516         * dom/OverflowEvent.idl:
2517         * dom/WheelEvent.h:
2518         * dom/WheelEvent.idl:
2519         * html/HTMLAllCollection.cpp:
2520         (WebCore::HTMLAllCollection::tags):
2521         * html/HTMLAllCollection.h:
2522         * html/HTMLAnchorElement.idl:
2523         * html/HTMLAreaElement.idl:
2524         * html/HTMLBaseFontElement.cpp: Removed.
2525         (WebCore::HTMLBaseFontElement::HTMLBaseFontElement): Deleted.
2526         * html/HTMLBaseFontElement.h: Removed.
2527         * html/HTMLBaseFontElement.idl: Removed.
2528         * html/HTMLButtonElement.idl:
2529         * html/HTMLCanvasElement.idl:
2530         * html/HTMLCollection.cpp:
2531         (WebCore::HTMLCollection::tags): Deleted.
2532         * html/HTMLCollection.h:
2533         * html/HTMLCollection.idl:
2534         * html/HTMLElement.idl:
2535         * html/HTMLFieldSetElement.idl:
2536         * html/HTMLFormElement.idl:
2537         * html/HTMLHyperlinkElementUtils.idl:
2538         * html/HTMLIFrameElement.idl:
2539         * html/HTMLImageElement.idl:
2540         * html/HTMLInputElement.idl:
2541         * html/HTMLLabelElement.idl:
2542         * html/HTMLLegendElement.idl:
2543         * html/HTMLLinkElement.idl:
2544         * html/HTMLMediaElement.idl:
2545         * html/HTMLObjectElement.idl:
2546         * html/HTMLOptionsCollection.idl:
2547         * html/HTMLSelectElement.idl:
2548         * html/HTMLTableCellElement.idl:
2549         * html/HTMLTextAreaElement.idl:
2550         * page/DOMWindow.cpp:
2551         (WebCore::DOMWindow::postMessage): Deleted.
2552         * page/DOMWindow.h:
2553         * workers/DedicatedWorkerGlobalScope.cpp:
2554         (WebCore::DedicatedWorkerGlobalScope::postMessage): Deleted.
2555         * workers/DedicatedWorkerGlobalScope.h:
2556         * workers/Worker.cpp:
2557         (WebCore::Worker::postMessage): Deleted.
2558         * workers/Worker.h:
2559
2560 2016-08-08  Brady Eidson  <beidson@apple.com>
2561
2562         Addressing late review feedback in bug 160605
2563         https://bugs.webkit.org/show_bug.cgi?id=160605
2564
2565         Reviewed by Darin's suggestions.
2566
2567         * Modules/gamepad/GamepadManager.cpp:
2568         (WebCore::GamepadManager::maybeStartMonitoringGamepads):
2569         (WebCore::GamepadManager::maybeStopMonitoringGamepads):
2570         
2571         * platform/gamepad/EmptyGamepadProvider.cpp:
2572         (WebCore::EmptyGamepadProvider::startMonitoringGamepads):
2573         (WebCore::EmptyGamepadProvider::stopMonitoringGamepads):
2574         * platform/gamepad/EmptyGamepadProvider.h:
2575         
2576         * platform/gamepad/GamepadProvider.h:
2577         
2578         * platform/gamepad/mac/HIDGamepadProvider.cpp:
2579         (WebCore::HIDGamepadProvider::startMonitoringGamepads):
2580         (WebCore::HIDGamepadProvider::stopMonitoringGamepads):
2581         * platform/gamepad/mac/HIDGamepadProvider.h:
2582         (WebCore::HIDGamepadProvider::platformGamepads): Deleted.
2583
2584 2016-08-08  Chris Dumez  <cdumez@apple.com>
2585
2586         It should be possible to re-initialize an Event after it's been dispatched
2587         https://bugs.webkit.org/show_bug.cgi?id=160651
2588
2589         Reviewed by Darin Adler.
2590
2591         Allow re-initialization of an Event that's already been dispatched, as
2592         per the latest DOM specification:
2593         - https://dom.spec.whatwg.org/#dom-event-initevent
2594
2595         Firefox already follows the specification here.
2596
2597         No new tests, rebaselined existing test.
2598
2599         Test: fast/events/initEvent-after-dispatch.html
2600
2601         * dom/Event.cpp:
2602         (WebCore::Event::initEvent):
2603         - Replace dispatched() check with isBeingDispatched() in order to
2604           allow initialization of an already dispatched event but prevent
2605           initialization of an event that is currently being dispatched
2606           as per:
2607           https://dom.spec.whatwg.org/#dom-event-initevent (step 1)
2608         - Reset target to null as per:
2609           https://dom.spec.whatwg.org/#concept-event-initialize (step 4)
2610
2611 2016-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2612
2613         Unreviewed. Fix GObject DOM bindings API break after r204236.
2614
2615         Text.replaceWholeText was removed from DOM API.
2616
2617         * bindings/gobject/WebKitDOMDeprecated.cpp:
2618         (webkit_dom_text_replace_whole_text):
2619         * bindings/gobject/WebKitDOMDeprecated.h:
2620         * bindings/gobject/WebKitDOMDeprecated.symbols:
2621
2622 2016-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2623
2624         Unreviewed. Fix GObject DOM bindings API break after r204113.
2625
2626         Document.defaultCharset was removed from DOM API.
2627
2628         * bindings/gobject/WebKitDOMDeprecated.cpp:
2629         (webkit_dom_document_get_default_charset):
2630         * bindings/gobject/WebKitDOMDeprecated.h:
2631         * bindings/gobject/WebKitDOMDeprecated.symbols:
2632
2633 2016-08-07  Chris Dumez  <cdumez@apple.com>
2634
2635         Node.baseURI should not be nullable
2636         https://bugs.webkit.org/show_bug.cgi?id=160649
2637
2638         Reviewed by Darin Adler.
2639
2640         Node.baseURI should not be nullable as per the latest DOM specification:
2641         - https://dom.spec.whatwg.org/#dom-node-baseuri
2642
2643         It is not nullable in Firefox. It is supposed to fallback to using the
2644         document's URL. The document's URL is "about:blank" by default so
2645         baseURI() now returns "about:blank" in the internal URL is null,
2646         similarly to what we do for Document.URL (c.g. urlForBindings()).
2647
2648         No new tests, rebaselined existing test.
2649
2650         * dom/Node.cpp:
2651         (WebCore::Node::baseURI):
2652         * dom/Node.h:
2653         * dom/Node.idl:
2654
2655 2016-08-07  Chris Dumez  <cdumez@apple.com>
2656
2657         Drop SVGDocument as per the SVG2 specification
2658         https://bugs.webkit.org/show_bug.cgi?id=160361
2659
2660         Reviewed by Darin Adler.
2661
2662         Drop SVGDocument as per the SVG2 specification:
2663         - https://www.w3.org/TR/SVG2/struct.html#InterfaceDocumentExtensions
2664
2665         SVGDocument has been merged into Document.
2666
2667         Chrome and Edge have dropped SVGDocument already, Firefox has not.
2668
2669         No new tests, rebaselined existing test.
2670
2671         * accessibility/AccessibilityRenderObject.cpp:
2672         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
2673         * bindings/js/JSDocumentCustom.cpp:
2674         (WebCore::createNewDocumentWrapper): Deleted.
2675         * bindings/js/JSXMLDocumentCustom.cpp:
2676         (WebCore::toJSNewlyCreated):
2677         (WebCore::toJS): Deleted.
2678         * page/DOMWindow.idl:
2679         * page/FrameView.cpp:
2680         (WebCore::FrameView::scrollToAnchor):
2681         * svg/SVGDocument.cpp:
2682         (WebCore::SVGDocument::rootElement):
2683         (WebCore::SVGDocument::zoomAndPanEnabled):
2684         (WebCore::SVGDocument::startPan):
2685         (WebCore::SVGDocument::updatePan):
2686         * svg/SVGDocument.h:
2687         * svg/SVGDocument.idl:
2688         * svg/graphics/SVGImage.cpp:
2689         (WebCore::SVGImage::rootElement):
2690
2691 2016-08-07  Chris Dumez  <cdumez@apple.com>
2692
2693         Un-expose DOMSettableTokenList
2694         https://bugs.webkit.org/show_bug.cgi?id=160643
2695
2696         Reviewed by Darin Adler.
2697
2698         Un-expose DOMSettableTokenList. We merged DOMSettableTokenList into
2699         DOMTokenList a while back, as per the specification. At the time, we
2700         kept DOMSettableTokenList on Window, as an alias to DOMTokenList.
2701         However, Firefox and Chrome dropped DOMSettableTokenList completely.
2702         We now do the same as other browsers.
2703
2704         No new tests, rebaselined existing test.
2705
2706         * page/DOMWindow.idl:
2707
2708 2016-08-07  Andreas Kling  <akling@apple.com>
2709
2710         DocumentRuleSets::collectFeatures() should shrink-to-fit.
2711         <https://webkit.org/b/160646>
2712
2713         Reviewed by Darin Adler.
2714
2715         We forgot to shrink-wrap the RuleFeatureSet in DocumentRuleSets
2716         after collecting the document-wide features.
2717
2718         * css/DocumentRuleSets.cpp:
2719         (WebCore::DocumentRuleSets::collectFeatures):
2720
2721 2016-08-06  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2722
2723         Purge all uses of PassRefPtr in WebCore/Modules
2724         https://bugs.webkit.org/show_bug.cgi?id=159965
2725
2726         Reviewed by Chris Dumez.
2727
2728         Final clean up in Modules directory.
2729
2730         No new tests, no behavior changes.
2731
2732         * Modules/gamepad/deprecated/GamepadList.cpp:
2733         (WebCore::GamepadList::set):
2734         * Modules/gamepad/deprecated/GamepadList.h:
2735         * Modules/indexeddb/IDBGetResult.h:
2736         (WebCore::IDBGetResult::IDBGetResult):
2737         * Modules/indieui/UIRequestEvent.cpp:
2738         (WebCore::UIRequestEvent::create):
2739         (WebCore::UIRequestEvent::UIRequestEvent):
2740         * Modules/indieui/UIRequestEvent.h:
2741         (WebCore::UIRequestEvent::receiver):
2742         * Modules/mediasource/MediaSourceRegistry.h:
2743         * Modules/mediasource/SampleMap.cpp:
2744         (WebCore::SampleMap::addSample):
2745         * Modules/mediasource/SampleMap.h:
2746         (WebCore::SampleMap::addRange):
2747         * Modules/mediasource/SourceBuffer.cpp:
2748         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2749         (WebCore::SourceBuffer::textTrackAddCue):
2750         (WebCore::SourceBuffer::textTrackRemoveCue):
2751         * Modules/mediasource/SourceBuffer.h:
2752         * Modules/mediastream/CaptureDeviceManager.cpp:
2753         (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
2754         * Modules/mediastream/CaptureDeviceManager.h:
2755         * Modules/mediastream/MediaDevicesRequest.h:
2756         * Modules/mediastream/MediaStream.cpp:
2757         (WebCore::MediaStream::internalAddTrack):
2758         (WebCore::MediaStream::internalRemoveTrack):
2759         * Modules/mediastream/MediaStreamRegistry.h:
2760         * Modules/mediastream/MediaStreamTrackEvent.cpp:
2761         (WebCore::MediaStreamTrackEvent::create):
2762         (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
2763         (WebCore::MediaStreamTrackEvent::track):
2764         * Modules/mediastream/MediaStreamTrackEvent.h:
2765         * Modules/mediastream/MediaTrackConstraints.cpp:
2766         (WebCore::MediaTrackConstraints::create):
2767         (WebCore::MediaTrackConstraints::MediaTrackConstraints):
2768         (WebCore::MediaTrackConstraints::optional):
2769         * Modules/mediastream/MediaTrackConstraints.h:
2770         * Modules/mediastream/RTCDTMFSender.cpp:
2771         (WebCore::RTCDTMFSender::create):
2772         (WebCore::RTCDTMFSender::RTCDTMFSender):
2773         * Modules/mediastream/RTCDTMFSender.h:
2774         * Modules/mediastream/RTCDataChannelEvent.cpp:
2775         (WebCore::RTCDataChannelEvent::create):
2776         (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
2777         (WebCore::RTCDataChannelEvent::channel):
2778         * Modules/mediastream/RTCDataChannelEvent.h:
2779         * Modules/mediastream/RTCIceServer.h:
2780         * Modules/mediastream/RTCStatsReport.h:
2781         * Modules/mediastream/SourceInfo.cpp:
2782         (WebCore::SourceInfo::create):
2783         (WebCore::SourceInfo::SourceInfo):
2784         * Modules/mediastream/SourceInfo.h:
2785         * Modules/mediastream/UserMediaClient.h:
2786         * Modules/mediastream/UserMediaRequest.cpp:
2787         (WebCore::UserMediaRequest::UserMediaRequest):
2788         (WebCore::UserMediaRequest::didCreateStream):
2789         * Modules/mediastream/UserMediaRequest.h:
2790         * Modules/webdatabase/Database.cpp:
2791         (WebCore::Database::~Database):
2792         * html/HTMLMediaElement.cpp:
2793         (WebCore::HTMLMediaElement::textTrackAddCue):
2794         (WebCore::HTMLMediaElement::textTrackRemoveCue):
2795         * html/HTMLMediaElement.h:
2796         * html/HTMLTrackElement.cpp:
2797         (WebCore::HTMLTrackElement::textTrackAddCue):
2798         (WebCore::HTMLTrackElement::textTrackRemoveCue):
2799         * html/HTMLTrackElement.h:
2800         * html/track/TextTrack.h:
2801         * platform/graphics/SourceBufferPrivateClient.h:
2802         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2803         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
2804         * platform/mediastream/MediaStreamCreationClient.h:
2805         * platform/mediastream/mac/AVCaptureDeviceManager.h:
2806         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2807         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints):
2808         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2809         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
2810         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2811         (WebCore::MockSourceBufferPrivate::didReceiveSample):
2812
2813 2016-08-06  Chris Dumez  <cdumez@apple.com>
2814
2815         a.replaceChild(a, a) should throw a HierarchyRequestError
2816         https://bugs.webkit.org/show_bug.cgi?id=160640
2817
2818         Reviewed by Darin Adler.
2819
2820         a.replaceChild(a, a) should throw a HierarchyRequestError, because 'a'
2821         is a host-including inclusive ancestor of 'a':
2822         - https://dom.spec.whatwg.org/#concept-node-replace
2823
2824         However, the call is merely ignored in WebKit.
2825
2826         No new tests, rebaselined existing test.
2827
2828         * dom/ContainerNode.cpp:
2829         (WebCore::ContainerNode::replaceChild):
2830
2831 2016-08-06  Chris Dumez  <cdumez@apple.com>
2832
2833         Drop legacy Text.replaceWholeText() API
2834         https://bugs.webkit.org/show_bug.cgi?id=160641
2835
2836         Reviewed by Darin Adler.
2837
2838         Drop legacy Text.replaceWholeText() API, which is no longer in the
2839         specification:
2840         - https://dom.spec.whatwg.org/#interface-text
2841
2842         Firefox and Chrome already dropped support for it.
2843
2844         No new tests, rebaselined existing test.
2845
2846         * dom/Text.idl:
2847
2848 2016-08-06  Chris Dumez  <cdumez@apple.com>
2849
2850         Align Range.createContextualFragment() input validation with the specification
2851         https://bugs.webkit.org/show_bug.cgi?id=160634
2852
2853         Reviewed by Darin Adler.
2854
2855         Align Range.createContextualFragment() input validation with the specification:
2856         - https://w3c.github.io/DOM-Parsing/#idl-def-range-createcontextualfragment(domstring) (Step 2)
2857
2858         In particular, we were throwing a NOT_SUPPORTED_ERR when element had localname
2859         "html" but was not in the HTML namespace. We should not throw in this case.
2860
2861         Firefox complies with the specification here.
2862
2863         No new tests, rebaselined existing test.
2864
2865         * dom/Range.cpp:
2866         (WebCore::Range::createContextualFragment): Deleted.
2867
2868 2016-08-06  Chris Dumez  <cdumez@apple.com>
2869
2870         [Web IDL] Add support for [Unscopable] extended attribute
2871         https://bugs.webkit.org/show_bug.cgi?id=160637
2872
2873         Reviewed by Darin Adler.
2874
2875         Add support for [Unscopable] extended attribute:
2876         - http://heycam.github.io/webidl/#Unscopable
2877
2878         No new tests, rebaselined existing test.
2879
2880         * bindings/scripts/CodeGeneratorJS.pm:
2881         (addUnscopableProperties):
2882         (GenerateImplementation):
2883         * bindings/scripts/IDLAttributes.txt:
2884         * bindings/scripts/test/JS/JSTestObj.cpp:
2885         (WebCore::JSTestObjPrototype::finishCreation):
2886         * bindings/scripts/test/TestObj.idl:
2887         * dom/ChildNode.idl:
2888         * dom/ParentNode.idl:
2889
2890 2016-08-06  Darin Adler  <darin@apple.com>
2891
2892         Simplify valueToUSVString
2893         https://bugs.webkit.org/show_bug.cgi?id=160628
2894
2895         Reviewed by Sam Weinig.
2896
2897         * bindings/js/JSDOMBinding.cpp:
2898         (WebCore::isUnmatchedSurrogatePair): Deleted. This function was incorrectly named,
2899         since it actually returned true if any surrogate code unit was passed.
2900         (WebCore::valueToUSVString): Added a fast path for 8-bit characters that doesn't
2901         bother iterating the string at all. Changed the fast path to actually check for
2902         surrogate pairs. Use StringView::codePoints rather than writing our own loop that
2903         does the same thing. In the slow path, use StringView::codePoints to make the logic
2904         clear rather than writing out exactly what the specification says. This gets rid of
2905         all the many constants the old version of the function contained.
2906
2907 2016-08-06  Youenn Fablet  <youenn@apple.com>
2908
2909         [Fetch API] Fetching with a FormData body should reject until it is implemented
2910         https://bugs.webkit.org/show_bug.cgi?id=160595
2911
2912         Reviewed by Alex Christensen.
2913
2914         Covered by updated tests.
2915
2916         This patch ensures that fetch will throw if trying to upload something that is not supported.
2917         This is the case of BufferSource (FetchBody does not yet extract it) and FormData (no upload support yet).
2918
2919         * Modules/fetch/FetchBody.cpp:
2920         (WebCore::FetchBody::extract): Added a FIXME.
2921         * Modules/fetch/FetchBodyOwner.h:
2922         (WebCore::FetchBodyOwner::bodyType): Getter used by FetchResponse.
2923         * Modules/fetch/FetchRequest.cpp:
2924         (WebCore::FetchRequest::setBody): Throwing if given body parameter cannot be extracted by FetchBody.
2925         This ensures that a fetch with a body that cannot be uploaded will fail.
2926         This is the case of BufferSource which is not yet supported.
2927         * Modules/fetch/FetchResponse.cpp:
2928         (WebCore::FetchResponse::fetch): Rejecting fetch promise if trying to upload a FormData as it is not implemented.
2929
2930 2016-08-06  Youenn Fablet  <youenn@apple.com>
2931
2932         [Fetch API] Fetch API should strip fragment and credentials from URLs used as referrer
2933         https://bugs.webkit.org/show_bug.cgi?id=160593
2934
2935         Reviewed by Alex Christensen.
2936
2937         Covered by updated tests.
2938
2939         Stripping of referrer value before sending a load request.
2940
2941         Fixing bug in workers as referrer value was overwritten by WorkerThreadableLoader.
2942         The current handling of referrer values as HTTP header is not great as this may trigger unnecessary preflighting.
2943         Refactoring should allow passing it as a separate parameter and setting it after preflighting as per
2944         https://fetch.spec.whatwg.org/#http-network-or-cache-fetch.
2945
2946         Also a newly added test is failing, as SubresourceLoader is removing the referer header in case of a cross-origin redirection.
2947         But none is added back.
2948
2949         * Modules/fetch/FetchRequest.cpp:
2950         (WebCore::FetchRequest::internalRequest): Stripping referrer value.
2951         * loader/WorkerThreadableLoader.cpp:
2952         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Do not override referrer value if one is defined.
2953         * page/SecurityPolicy.cpp:
2954         (WebCore::SecurityPolicy::generateReferrerHeader): Adding assertion to ensure referrer value does not contain
2955         credentials and/or fragment identifiers.
2956
2957 2016-08-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2958
2959         [ES6] Add ScriptElement::determineScriptType
2960         https://bugs.webkit.org/show_bug.cgi?id=149576
2961
2962         Reviewed by Ryosuke Niwa.
2963
2964         Change ScriptElement::isScriptTypeSupported to ScriptElement::determineScriptType.
2965         And introduce ScriptType, which is either "classic" or "module".
2966         And support "module" type in ScriptElement[1, 2].
2967         But this patch does not contain any module tag support code.
2968         This will be implemented in the subsequent patch.
2969
2970         [1]: https://html.spec.whatwg.org/multipage/webappapis.html#integration-with-the-javascript-module-system
2971         [2]: https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type
2972
2973         * dom/ScriptElement.cpp:
2974         (WebCore::ScriptElement::determineScriptType):
2975         (WebCore::ScriptElement::prepareScript):
2976         (WebCore::ScriptElement::isScriptTypeSupported): Deleted.
2977         * dom/ScriptElement.h:
2978
2979 2016-08-05  Jonathan Bedard  <jbedard@apple.com>
2980
2981         NULL Reference Error in ElementRuleCollector
2982         https://bugs.webkit.org/show_bug.cgi?id=160362
2983
2984         Reviewed by Darin Adler.
2985
2986         No new tests, existing CSS tests cover this change.
2987
2988         Undefined behavior sanitizer found a reference bound to a NULL pointer.
2989         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.
2990
2991         * css/DocumentRuleSets.cpp:
2992         (WebCore::DocumentRuleSets::DocumentRuleSets): Define author style by default.
2993         (WebCore::DocumentRuleSets::resetAuthorStyle): Switch author style flag.
2994         * css/DocumentRuleSets.h: Added author style flag, changed authorStyle accessor to reference from pointer.
2995         * css/ElementRuleCollector.cpp:
2996         (WebCore::ElementRuleCollector::ElementRuleCollector): Original location of undefined behavior.
2997         (WebCore::ElementRuleCollector::matchHostPseudoClassRules): Changed pointer to reference.
2998         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules): Changed pointer to reference.
2999         * css/PageRuleCollector.cpp:
3000         (WebCore::PageRuleCollector::matchAllPageRules): Check new flag, changed pointer to reference.
3001
3002         * css/StyleResolver.cpp: Changed pointer to reference.
3003         * dom/Document.cpp: Dito.
3004         * style/AttributeChangeInvalidation.cpp: Dito.
3005         * style/ClassChangeInvalidation.cpp: Dito.
3006         * style/IdChangeInvalidation.cpp: Dito.
3007         * style/StyleSharingResolver.cpp: Dito.
3008
3009 2016-08-05  Chris Dumez  <cdumez@apple.com>
3010
3011         DOMException should be constructible
3012         https://bugs.webkit.org/show_bug.cgi?id=160626
3013
3014         Reviewed by Darin Adler.
3015
3016         DOMException should be constructible:
3017         - http://heycam.github.io/webidl/#dfn-DOMException
3018         - http://heycam.github.io/webidl/#es-DOMException-constructor-object
3019
3020         DOMException already has a constructor in Firefox and Chrome so this
3021         aligns our behavior with other browsers.
3022
3023         Test: imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor.html
3024
3025         * dom/DOMCoreException.cpp:
3026         (WebCore::errorCodeFromName):
3027         (WebCore::DOMCoreException::create):
3028         (WebCore::DOMCoreException::DOMCoreException):
3029         * dom/DOMCoreException.h:
3030         * dom/DOMCoreException.idl:
3031         * dom/ExceptionBase.cpp:
3032         (WebCore::ExceptionBase::ExceptionBase):
3033         * dom/ExceptionBase.h:
3034
3035 2016-08-05  Chris Dumez  <cdumez@apple.com>
3036
3037         Align Range.insertNode() input validation with the specification
3038         https://bugs.webkit.org/show_bug.cgi?id=160624
3039
3040         Reviewed by Sam Weinig.
3041
3042         Align Range.insertNode() input validation with the specification:
3043         - https://dom.spec.whatwg.org/#dom-range-insertnode
3044         - https://dom.spec.whatwg.org/#concept-range-insert (step 1)
3045
3046         In particular, if range‚Äôs start node is a ProcessingInstruction or
3047         Comment node, is a Text node whose parent is null, or is node, then
3048         we should throw a HierarchyRequestError.
3049
3050         Chrome behaves according to the specification.
3051
3052         No new tests, rebaselined existing test.
3053
3054         * dom/Range.cpp:
3055         (WebCore::Range::insertNode):
3056
3057 2016-08-05  Chris Dumez  <cdumez@apple.com>
3058
3059         [Web IDL] Add support for 'any' type in dictionaries
3060         https://bugs.webkit.org/show_bug.cgi?id=160511
3061
3062         Reviewed by Sam Weinig.
3063
3064         Add support for 'any' type in dictionaries. It will pass the value as
3065         a JSValue to the implementation. If the member is not present, it will
3066         pass jsUndefined() to the implementation.
3067
3068         Having 'any' support in dictionaries is a convenient workaround for
3069         types we don't support yet (e.g. union types).
3070
3071         No new tests, updated bindings tests.
3072
3073         * bindings/js/JSDOMConvert.h:
3074         (WebCore::Converter<JSC::JSValue>::convert):
3075         * bindings/scripts/test/JS/JSTestObj.cpp:
3076         (WebCore::convert<TestObj::Dictionary>):
3077         * bindings/scripts/test/TestObj.idl:
3078
3079 2016-08-05  Chris Dumez  <cdumez@apple.com>
3080
3081         [Web IDL] Add support for USVString type
3082         https://bugs.webkit.org/show_bug.cgi?id=160608
3083
3084         Reviewed by Sam Weinig.
3085
3086         Add support for USVString type in our bindings generator:
3087         - http://heycam.github.io/webidl/#idl-USVString
3088
3089         Also start using USVString instead of DOMString when suitable as per
3090         the following specifications:
3091         - http://dom.spec.whatwg.org
3092         - http://html.spec.whatwg.org
3093         - http://url.spec.whatwg.org
3094
3095         Test: js/dom/webidl-type-mapping.html
3096
3097         * Modules/websockets/CloseEvent.idl:
3098         * Modules/websockets/WebSocket.idl:
3099         * bindings/js/JSDOMBinding.cpp:
3100         (WebCore::isUnmatchedSurrogatePair):
3101         (WebCore::valueToUSVString):
3102         (WebCore::valueToUSVStringTreatingNullAsEmptyString):
3103         (WebCore::valueToUSVStringWithUndefinedOrNullCheck):
3104         * bindings/js/JSDOMBinding.h:
3105         * bindings/js/JSDOMWindowCustom.cpp:
3106         (WebCore::JSDOMWindow::open):
3107         (WebCore::handlePostMessage):
3108         * bindings/js/JSHistoryCustom.cpp:
3109         (WebCore::JSHistory::pushState):
3110         (WebCore::JSHistory::replaceState):
3111         * bindings/js/JSMessageEventCustom.cpp:
3112         (WebCore::handleInitMessageEvent):
3113         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
3114         (WebCore::JSWorkerGlobalScope::importScripts):
3115         * bindings/scripts/CodeGenerator.pm:
3116         (SkipIncludeHeader):
3117         (IsStringOrEnumType):
3118         (IsStringType):
3119         (IsRefPtrType):
3120         * bindings/scripts/CodeGeneratorJS.pm:
3121         (GenerateParametersCheck):
3122         (JSValueToNative):
3123         (NativeToJSValue):
3124         * bindings/scripts/IDLParser.pm:
3125         (parseNonAnyType):
3126         * dom/Document.idl:
3127         * dom/ErrorEvent.idl:
3128         * dom/HashChangeEvent.idl:
3129         * dom/MessageEvent.idl:
3130         * dom/Node.idl:
3131         * html/DOMFormData.idl:
3132         * html/DOMURL.idl:
3133         * html/HTMLAnchorElement.idl:
3134         * html/HTMLAppletElement.idl:
3135         * html/HTMLAreaElement.idl:
3136         * html/HTMLBaseElement.idl:
3137         * html/HTMLButtonElement.idl:
3138         * html/HTMLEmbedElement.idl:
3139         * html/HTMLFormElement.idl:
3140         * html/HTMLFrameElement.idl:
3141         * html/HTMLHyperlinkElementUtils.idl:
3142         * html/HTMLIFrameElement.idl:
3143         * html/HTMLImageElement.idl:
3144         * html/HTMLInputElement.idl:
3145         * html/HTMLLinkElement.idl:
3146         * html/HTMLMediaElement.idl:
3147         * html/HTMLModElement.idl:
3148         * html/HTMLObjectElement.idl:
3149         * html/HTMLQuoteElement.idl:
3150         * html/HTMLScriptElement.idl:
3151         * html/HTMLSourceElement.idl:
3152         * html/HTMLTrackElement.idl:
3153         * html/HTMLVideoElement.idl:
3154         * html/URLUtils.idl:
3155         * page/DOMWindow.idl:
3156         * page/EventSource.idl:
3157         * page/History.idl:
3158         * page/Location.idl:
3159         * storage/StorageEvent.idl:
3160         * testing/TypeConversions.h:
3161         (WebCore::TypeConversions::testString):
3162         (WebCore::TypeConversions::setTestString):
3163         (WebCore::TypeConversions::testUSVString):
3164         (WebCore::TypeConversions::setTestUSVString):
3165         * testing/TypeConversions.idl:
3166         * workers/Worker.idl:
3167         * workers/WorkerGlobalScope.idl:
3168
3169 2016-08-05  Jeremy Jones  <jeremyj@apple.com>
3170
3171         revert r202466 r202546 this causes regressions in media loading with temporary redirects.
3172         https://bugs.webkit.org/show_bug.cgi?id=160613
3173
3174         Reviewed by Jon Lee.
3175
3176         No new tests. Skipping two tests.
3177
3178         This reverts a change that attempted to fix temporary redirects with media loading.
3179         The change introduced problems. Reverting this to require media stack to properly
3180         handle redirects.
3181
3182         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3183         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin):
3184         * platform/network/cocoa/WebCoreNSURLSession.h:
3185         * platform/network/cocoa/WebCoreNSURLSession.mm:
3186         (-[WebCoreNSURLSession initWithResourceLoader:delegate:delegateQueue:]): Deleted.
3187         (-[WebCoreNSURLSession updateHasSingleSecurityOrigin:]): Deleted.
3188         (-[WebCoreNSURLSession dataTaskWithRequest:]): Deleted.
3189         (-[WebCoreNSURLSession dataTaskWithURL:]): Deleted.
3190         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
3191         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]): Deleted.
3192
3193 2016-08-05  Simon Fraser  <simon.fraser@apple.com>
3194
3195         Add a tiny bit more image logging
3196         https://bugs.webkit.org/show_bug.cgi?id=160621
3197
3198         Reviewed by Tim Horton.
3199
3200         Add logging related to image subsampling.
3201
3202         * platform/graphics/BitmapImage.cpp:
3203         (WebCore::BitmapImage::frameImageAtIndex):
3204
3205 2016-08-05  Nan Wang  <n_wang@apple.com>
3206
3207         AX: Asking for group members of radio button that has no name attribute will cause crash
3208         https://bugs.webkit.org/show_bug.cgi?id=160583
3209
3210         Reviewed by Chris Fleizach.
3211
3212         The NameToGroupMap is null when there's no name attribute on the radio buttons. Added a 
3213         check so that we don't try to get a value from a null HashSet.
3214
3215         Test: accessibility/mac/radio-button-no-name-crash.html
3216
3217         * dom/RadioButtonGroups.cpp:
3218         (WebCore::RadioButtonGroups::groupMembers):
3219
3220 2016-08-05  Brent Fulgham  <bfulgham@apple.com>
3221
3222         ASSERTION FAILED: observer in WebCore::BitmapImage::drawPattern
3223         https://bugs.webkit.org/show_bug.cgi?id=141637
3224         <rdar://problem/27709864>
3225
3226         Reviewed by Tim Horton.
3227
3228         Test: fast/images/image-source-assert.html
3229
3230         * platform/graphics/BitmapImage.cpp:
3231         (WebCore::BitmapImage::drawPattern): Remove invalid assertion.
3232
3233 2016-08-05  Simon Fraser  <simon.fraser@apple.com>
3234
3235         marquee with "truespeed" animates at > 60fps, hogging CPU
3236         https://bugs.webkit.org/show_bug.cgi?id=160609
3237
3238         Reviewed by David Hyatt.
3239         
3240         A <marquee truespeed="" scrollDelay="0"> would fire a zero-delay timer and also
3241         fail to animate, hogging CPU.
3242         
3243         Fix to cap the timer at 16ms intervals. We don't believe it's necessary to
3244         maintain web compatibility here.
3245
3246         Tested by existing tests.
3247
3248         * html/HTMLMarqueeElement.cpp:
3249         (WebCore::HTMLMarqueeElement::minimumDelay):
3250         * html/HTMLMarqueeElement.h:
3251
3252 2016-08-05  Ryan Haddad  <ryanhaddad@apple.com>
3253
3254         Unreviewed, rolling out r204181.
3255
3256         This change caused an existing LayoutTest to fail on WK1
3257
3258         Reverted changeset:
3259
3260         "Don't set document.domain to an IP address fragment"
3261         https://bugs.webkit.org/show_bug.cgi?id=126045
3262         http://trac.webkit.org/changeset/204181
3263
3264 2016-08-05  Commit Queue  <commit-queue@webkit.org>
3265
3266         Unreviewed, rolling out r204128.
3267         https://bugs.webkit.org/show_bug.cgi?id=160607
3268
3269         Solve the issue by removing the workaround for static files
3270         (Requested by jonlee_ on #webkit).
3271
3272         Reverted changeset:
3273
3274         "Temporary redirected m3u8 streaming stopped working."
3275         https://bugs.webkit.org/show_bug.cgi?id=160472
3276         http://trac.webkit.org/changeset/204128
3277
3278 2016-08-05  Brent Fulgham  <bfulgham@apple.com>
3279
3280         validity assertion fails after removing a child of an <optgroup> element
3281         https://bugs.webkit.org/show_bug.cgi?id=155720
3282         <rdar://problem/27720746>
3283
3284         Reviewed by Brent Fulgham.
3285
3286         All calls to HTMLSelectElement::setRecalcListItems also need to call HTMLSelectElement::updateValidity.
3287
3288         Test: fast/dom/HTMLSelectElement/select-remove-from-optgroup.html
3289
3290         * html/HTMLOptGroupElement.cpp:
3291         (WebCore::HTMLOptGroupElement::recalcSelectOptions): Call 'updateValidity' after 'setRecalcListItems'.
3292         * html/HTMLOptionElement.cpp:
3293         (WebCore::HTMLOptionElement::insertedInto): Ditto.
3294         * html/HTMLSelectElement.cpp:
3295         (WebCore::HTMLSelectElement::parseAttribute): Ditto.
3296
3297 2016-08-05  Ryan Haddad  <ryanhaddad@apple.com>
3298
3299         Unreviewed, rolling out r204174.
3300
3301         The test for this change is failing on WK1
3302
3303         Reverted changeset:
3304
3305         "Popups opened from a sandboxed iframe should themselves be
3306         sandboxed"
3307         https://bugs.webkit.org/show_bug.cgi?id=134850
3308         http://trac.webkit.org/changeset/204174
3309
3310 2016-08-05  John Wilander  <wilander@apple.com>
3311
3312         Don't set document.domain to an IP address fragment
3313         https://bugs.webkit.org/show_bug.cgi?id=126045
3314         <rdar://problem/27331794>
3315
3316         Reviewed by Daniel Bates.
3317
3318         This patch matches the following Blink one:
3319         https://chromium.googlesource.com/chromium/blink/+/b19a57fdb323d5a80d3a1cb0a6b343558c4237b0
3320
3321         IP address octets should not be treated as subdomains when setting
3322         document.domain. The specs say:
3323         'The domain attribute's setter must run these steps: ...
3324         7. If host is not equal to effectiveDomain, then run these substeps:
3325             1. If host or effectiveDomain is not a domain, then throw a
3326             "SecurityError" DOMException.'
3327         https://html.spec.whatwg.org/multipage/browsers.html#relaxing-the-same-origin-restriction
3328         Last Updated 5 August 2016
3329
3330         'A host is a domain, an IPv4 address, or an IPv6 address.'
3331         https://url.spec.whatwg.org/#concept-domain
3332         Last Updated 28 July 2016
3333
3334         Test: http/tests/security/set-domain-remove-subdomain-for-ip-address.html
3335
3336         * dom/Document.cpp:
3337         (WebCore::Document::setDomain):
3338             Now checks whether the security origin is allowed to remove
3339             subdomains. If not, it throws a security error.
3340         * page/OriginAccessEntry.cpp:
3341         (WebCore::OriginAccessEntry::OriginAccessEntry):
3342             Constructor now expects an IP address setting.
3343         (WebCore::OriginAccessEntry::matchesOrigin):
3344             Now also checks whether the host in an IP address and returns
3345             false if IP addresses aren't configured to be treated as domains.
3346         * page/OriginAccessEntry.h:
3347             Introduced new enum for IP address setting.
3348             Constructor now expects an IP address setting.
3349         (WebCore::OriginAccessEntry::ipAddressSettings):
3350             New getter.
3351         (WebCore::operator==):
3352             Now also requires IP address settings to match.
3353         * page/SecurityPolicy.cpp:
3354         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
3355             Changes to match OriginAccessEntry's new constructor.
3356         (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
3357             Changes to match OriginAccessEntry's new constructor.
3358         * page/Settings.in:
3359             Added a setting to allow IP address octets to be treated as
3360             subdomains. This way our existing tests setting document.domain
3361             still work.
3362
3363 2016-08-05  Chris Dumez  <cdumez@apple.com>
3364
3365         Window's named properties should be exposed on a WindowProperties object in its prototype
3366         https://bugs.webkit.org/show_bug.cgi?id=160354
3367
3368         Reviewed by Gavin Barraclough.
3369
3370         Window's named properties should be exposed on a WindowProperties object
3371         in its prototype:
3372         - http://heycam.github.io/webidl/#named-properties-object
3373
3374         Firefox and Chrome both comply with the specification. However, WebKit
3375         had no "WindowProperties" object in the Window prototype chain and the
3376         named properties are exposed on the Window object itself.
3377
3378         No new tests, rebaselined existing tests.
3379
3380         * CMakeLists.txt:
3381         * WebCore.xcodeproj/project.pbxproj:
3382         * bindings/js/JSBindingsAllInOne.cpp:
3383         * bindings/js/JSDOMWindowCustom.cpp:
3384         (WebCore::JSDOMWindow::getOwnPropertySlot):
3385         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
3386         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): Deleted.
3387         (WebCore::JSDOMWindow::put): Deleted.
3388         (WebCore::JSDOMWindow::putByIndex): Deleted.
3389         (WebCore::JSDOMWindow::getEnumerableLength): Deleted.
3390         * bindings/js/JSDOMWindowProperties.cpp: Added.
3391         (WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter):
3392         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
3393         (WebCore::JSDOMWindowProperties::getOwnPropertySlotByIndex):
3394         * bindings/js/JSDOMWindowProperties.h: Added.
3395         (WebCore::JSDOMWindowProperties::create):
3396         (WebCore::JSDOMWindowProperties::createStructure):
3397         (WebCore::JSDOMWindowProperties::JSDOMWindowProperties):
3398         * bindings/js/JSDOMWindowShell.cpp:
3399         (WebCore::JSDOMWindowShell::setWindow):
3400
3401 2016-08-05  Brady Eidson  <beidson@apple.com>
3402
3403         Create platform/gamepad directory, and make GamepadProvider pure virtual (with a default empty implementation).
3404         https://bugs.webkit.org/show_bug.cgi?id=160599
3405
3406         Reviewed by Alex Christensen.
3407
3408         No new tests (No behavior change).
3409
3410         Except for the GamepadProvider/EmptyGamepadProvider split, this is just moving files around.
3411
3412         * CMakeLists.txt:
3413         * PlatformEfl.cmake:
3414         * PlatformGTK.cmake:
3415         * WebCore.xcodeproj/project.pbxproj:
3416         * platform/Linux.cmake:
3417
3418         * platform/gamepad.h: Removed.
3419         
3420         * platform/gamepad/EmptyGamepadProvider.cpp: 
3421         (WebCore::EmptyGamepadProvider::startMonitoringGamepads):
3422         (WebCore::EmptyGamepadProvider::stopMonitoringGamepads):
3423         (WebCore::EmptyGamepadProvider::platformGamepads):
3424         * platform/gamepad/EmptyGamepadProvider.h:
3425         
3426         * platform/gamepad/GamepadProvider.cpp: Renamed from Source/WebCore/platform/GamepadProvider.cpp.
3427         (WebCore::GamepadProvider::singleton):
3428         (WebCore::GamepadProvider::setSharedProvider):
3429         * platform/gamepad/GamepadProvider.h: Renamed from Source/WebCore/platform/GamepadProvider.h.
3430         (WebCore::GamepadProvider::~GamepadProvider):
3431         
3432         * platform/gamepad/GamepadProviderClient.h: Renamed from Source/WebCore/platform/GamepadProviderClient.h.
3433         (WebCore::GamepadProviderClient::~GamepadProviderClient):
3434         
3435         * platform/gamepad/PlatformGamepad.h: Renamed from Source/WebCore/platform/PlatformGamepad.h.
3436         (WebCore::PlatformGamepad::~PlatformGamepad):
3437         (WebCore::PlatformGamepad::id):
3438         (WebCore::PlatformGamepad::index):
3439         (WebCore::PlatformGamepad::lastUpdateTime):
3440         (WebCore::PlatformGamepad::connectTime):
3441         (WebCore::PlatformGamepad::PlatformGamepad):
3442
3443         * platform/gamepad/deprecated/Gamepads.h: Renamed from Source/WebCore/platform/Gamepads.h.
3444
3445         * platform/gamepad/efl/GamepadsEfl.cpp: Renamed from Source/WebCore/platform/efl/GamepadsEfl.cpp.
3446         (WebCore::GamepadDeviceEfl::resetFdHandler):
3447         (WebCore::GamepadDeviceEfl::deviceFile):
3448         (WebCore::GamepadDeviceEfl::GamepadDeviceEfl):
3449         (WebCore::GamepadDeviceEfl::~GamepadDeviceEfl):
3450         (WebCore::GamepadDeviceEfl::readCallback):
3451         (WebCore::GamepadsEfl::onGamePadChange):
3452         (WebCore::GamepadsEfl::GamepadsEfl):
3453         (WebCore::GamepadsEfl::~GamepadsEfl):
3454         (WebCore::GamepadsEfl::registerDevice):
3455         (WebCore::GamepadsEfl::unregisterDevice):
3456         (WebCore::GamepadsEfl::updateGamepadList):
3457         (WebCore::sampleGamepads):
3458         
3459         * platform/gamepad/glib/GamepadsGlib.cpp: Renamed from Source/WebCore/platform/glib/GamepadsGlib.cpp.
3460         (WebCore::GamepadDeviceGlib::GamepadDeviceGlib):
3461         (WebCore::GamepadDeviceGlib::~GamepadDeviceGlib):
3462         (WebCore::GamepadDeviceGlib::readCallback):
3463         (WebCore::GamepadsGlib::GamepadsGlib):
3464         (WebCore::GamepadsGlib::~GamepadsGlib):
3465         (WebCore::GamepadsGlib::registerDevice):
3466       &nb