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