83c93e211cf27687efb58c758bbd98cb34d37ba6
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-08-03  Zan Dobersek  <zdobersek@igalia.com>
2
3         [GCrypt] Implement CryptoKeyEC PKCS#8 imports
4         https://bugs.webkit.org/show_bug.cgi?id=173647
5
6         Reviewed by Jiewen Tan.
7
8         No new tests -- affected tests are now passing and are unskipped.
9
10         Implement libgcrypt-based support for PKCS#8 imports of EC keys.
11
12         Existing libtasn1 utilities are used to achieve this. First, the provided key data
13         is decoded against the PrivateKeyInfo ASN.1 definition. First, the version member
14         of that structure is validated, followed by the algorithm member. The latter is
15         also properly tested depending on this being an import of an ECDSA or ECDH key.
16
17         Data of the parameters member is decoded against the ECParameters ASN.1 definition,
18         and the namedCurve object identifier is validated, making sure it represents a
19         valid EC curve and that this curve maches the one specified for the import
20         operation.
21
22         Data of the privateKey member is decoded against the ECPrivateKey ASN.1 definition.
23         The version member of that structure is properly validated. The optional parameters
24         member of that structure is already decoded against the ECParameters ASN.1
25         definition. If present, it is checked to contain a valid EC curve identifier that
26         matches the specified curve.
27
28         The optional publicKey member of the ECPrivateKey structure is validated, testing
29         that its data matches in size an uncompressed EC point, and that the first byte
30         of this data is 0x04, as expected for an uncompressed EC point.
31
32         What's left is the private key data on the initial ECPrivateKey structure. That
33         data is retrieved and validated, making sure its size matches the size of the
34         specified curve. The `private-key` s-expression is then constructed, embedding
35         the curve name and the validated private key data. This s-expression is then used
36         to construct an EC context.
37
38         If the optional publicKey data was provided, it's used to set the `q` parameter
39         for this EC context. Otherwise, the value for `q` is computed on-the-fly for the
40         specified EC and the provided private key. The `q` point is then tested through
41         the gcry_mpi_ec_curve_point() function, making sure that the derived point is
42         indeed located on the given EC.
43
44         Finally, with the private key properly validated, a new CryptoKeyEC object is
45         constructed, using the `private-key` s-expression and the parameters that were
46         specified for this import operation.
47
48         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
49         (WebCore::CryptoKeyEC::platformImportPkcs8):
50         * crypto/gcrypt/GCryptUtilities.h:
51
52 2017-08-03  Chris Dumez  <cdumez@apple.com>
53
54         Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.' without a leading 0
55         https://bugs.webkit.org/show_bug.cgi?id=175132
56
57         Reviewed by Darin Adler.
58
59         Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.', without
60         a leading 0. This is as per https://github.com/whatwg/html/pull/2852.
61
62         The latest spec is at:
63         - https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh
64
65         Test: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html
66
67         * html/parser/HTMLParserIdioms.cpp:
68         (WebCore::parseHTTPRefreshInternal):
69
70 2017-08-03  Brian Burg  <bburg@apple.com>
71
72         Remove ENABLE(WEB_SOCKET) guards
73         https://bugs.webkit.org/show_bug.cgi?id=167044
74
75         Reviewed by Joseph Pecoraro.
76
77         * Configurations/FeatureDefines.xcconfig:
78         * Modules/websockets/ThreadableWebSocketChannel.cpp:
79         * Modules/websockets/ThreadableWebSocketChannel.h:
80         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
81         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
82         * Modules/websockets/WebSocket.cpp:
83         * Modules/websockets/WebSocket.h:
84         * Modules/websockets/WebSocket.idl:
85         * Modules/websockets/WebSocketChannel.cpp:
86         * Modules/websockets/WebSocketChannel.h:
87         * Modules/websockets/WebSocketChannelClient.h:
88         * Modules/websockets/WebSocketDeflateFramer.cpp:
89         * Modules/websockets/WebSocketDeflateFramer.h:
90         * Modules/websockets/WebSocketDeflater.cpp:
91         * Modules/websockets/WebSocketDeflater.h:
92         * Modules/websockets/WebSocketExtensionDispatcher.cpp:
93         * Modules/websockets/WebSocketExtensionDispatcher.h:
94         * Modules/websockets/WebSocketExtensionParser.cpp:
95         * Modules/websockets/WebSocketExtensionParser.h:
96         * Modules/websockets/WebSocketExtensionProcessor.h:
97         * Modules/websockets/WebSocketFrame.cpp:
98         * Modules/websockets/WebSocketFrame.h:
99         * Modules/websockets/WebSocketHandshake.cpp:
100         * Modules/websockets/WebSocketHandshake.h:
101         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
102         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
103         * dom/Document.cpp:
104         (WebCore::Document::Document):
105         (WebCore::Document::idbConnectionProxy):
106         (WebCore::Document::socketProvider):
107         * dom/Document.h:
108         * dom/ScriptExecutionContext.h:
109         * inspector/InspectorInstrumentation.cpp:
110         (WebCore::InspectorInstrumentation::didSendWebSocketFrameImpl):
111         * inspector/InspectorInstrumentation.h:
112         (WebCore::InspectorInstrumentation::didSendWebSocketFrame):
113         * inspector/InspectorNetworkAgent.cpp:
114         * inspector/InspectorNetworkAgent.h:
115         * page/RuntimeEnabledFeatures.cpp:
116         (WebCore::RuntimeEnabledFeatures::webSocketEnabled const):
117         * page/RuntimeEnabledFeatures.h:
118         * page/SocketProvider.cpp:
119         * page/SocketProvider.h:
120         * workers/WorkerGlobalScope.cpp:
121         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
122         * workers/WorkerGlobalScope.h:
123         * workers/WorkerMessagingProxy.cpp:
124         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
125         * workers/WorkerThread.cpp:
126         (WebCore::WorkerThread::WorkerThread):
127         (WebCore::WorkerThread::socketProvider):
128         * workers/WorkerThread.h:
129
130 2017-08-03  Don Olmstead  <don.olmstead@sony.com>
131
132         Remove LayoutUnit dependency in TextStream
133         https://bugs.webkit.org/show_bug.cgi?id=175110
134
135         Reviewed by Zalan Bujtas.
136
137         No new tests. No change in behavior.
138
139         * CMakeLists.txt:
140         * WebCore.xcodeproj/project.pbxproj:
141         * platform/LayoutUnit.cpp: Added.
142         (WebCore::operator<<):
143         * platform/LayoutUnit.h:
144         * platform/text/TextStream.cpp:
145         * platform/text/TextStream.h:
146
147 2017-08-03  Jeremy Jones  <jeremyj@apple.com>
148
149         Improve WebKitLegacy video fullscreen animation begin and end rects.
150         https://bugs.webkit.org/show_bug.cgi?id=175152
151         rdar://problem/32840576
152
153         Reviewed by Eric Carlson.
154
155         No new tests, becuase this change has no effect on the DOM.
156
157         This change uses different rects for fullscreen animation to prevent the animation
158         from failing, and to improve the aesthetics of the animation.
159
160         * platform/mac/WebVideoFullscreenController.mm:
161         (frameExpandedToRatioOfFrame):
162         (-[WebVideoFullscreenController enterFullscreen:]):
163         (-[WebVideoFullscreenController exitFullscreen]):
164         (-[WebVideoFullscreenWindow animateFromRect:toRect:withSubAnimation:controllerAction:]):
165         (constrainFrameToRatioOfFrame): Deleted.
166
167 2017-08-03  Jer Noble  <jer.noble@apple.com>
168
169         [EME][Mac] SecureStop left on disk in Private Browsing mode.
170         https://bugs.webkit.org/show_bug.cgi?id=175162
171
172         Reviewed by Eric Carlson.
173
174         Return an empty string from mediaKeysStorageDirectory() when the page indicates that storage should
175         be ephemeral(). Previously, an empty string in this case would be treated as an error. Instead, treat
176         an empty string as valid, and do not try to store or retrieve session information to disk in that case.
177
178         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
179         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
180         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
181         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
182         (WebCore::CDMSessionAVContentKeySession::update):
183         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
184         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
185         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
186         (WebCore::CDMSessionMediaSourceAVFObjC::storagePath const):
187
188 2017-08-03  Youenn Fablet  <youenn@apple.com>
189
190         [Fetch API] Add support for Request keepalive getter
191         https://bugs.webkit.org/show_bug.cgi?id=175151
192
193         Reviewed by Chris Dumez.
194
195         Test: imported/w3c/web-platform-tests/fetch/api/request/request-keepalive.html
196
197         Adding keepalive as a fetch option.
198         Adding initialization and getter of keepalive into FetchRequest.
199
200         * Modules/fetch/FetchRequest.cpp:
201         (WebCore::buildOptions):
202         * Modules/fetch/FetchRequest.h:
203         * Modules/fetch/FetchRequest.idl:
204         * loader/FetchOptions.h:
205
206 2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>
207
208         [PAL] Move spi/cf directory into PAL
209         https://bugs.webkit.org/show_bug.cgi?id=175057
210
211         Reviewed by Antti Koivisto.
212
213         * WebCore.xcodeproj/project.pbxproj:
214         * loader/cocoa/DiskCacheMonitorCocoa.mm:
215         * loader/cocoa/SubresourceLoaderCocoa.mm:
216         * loader/mac/ResourceLoaderMac.mm:
217         * platform/cf/CoreMediaSoftLink.cpp:
218         * platform/cf/CoreMediaSoftLink.h:
219         * platform/mac/PluginBlacklist.mm:
220         * platform/mac/WebCoreNSStringExtras.mm:
221         * platform/mac/WebGLBlacklist.mm:
222         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
223         * platform/network/NetworkStorageSession.h:
224         * platform/network/cf/CookieJarCFNet.cpp:
225         * platform/network/cf/CredentialStorageCFNet.cpp:
226         * platform/network/cf/ResourceHandleCFNet.cpp:
227         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
228         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
229         * platform/network/cf/ResourceRequestCFNet.cpp:
230         * platform/network/cf/ResourceRequestCFNet.h:
231         * platform/network/cf/ResourceResponse.h:
232         * platform/network/cf/ResourceResponseCFNet.cpp:
233         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
234         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
235         * platform/network/cocoa/CookieStorageObserver.h:
236         * platform/network/cocoa/CredentialCocoa.h:
237         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
238         * platform/network/cocoa/ResourceRequestCocoa.mm:
239         * platform/network/cocoa/ResourceResponseCocoa.mm:
240         * platform/network/ios/ResourceRequestIOS.mm:
241         * platform/network/mac/CookieJarMac.mm:
242         * platform/network/mac/FormDataStreamMac.mm:
243         * platform/network/mac/ResourceHandleMac.mm:
244         * platform/network/mac/ResourceRequestMac.mm:
245         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
246         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
247         * platform/network/mac/WebCoreURLResponse.h:
248         * testing/cocoa/WebArchiveDumpSupport.mm:
249
250 2017-08-03  Youenn Fablet  <youenn@apple.com>
251
252         Remove FETCH_API compilation guard
253         https://bugs.webkit.org/show_bug.cgi?id=175154
254
255         Reviewed by Chris Dumez.
256
257         No change of behavior.
258
259         * Configurations/FeatureDefines.xcconfig:
260         * Modules/fetch/DOMWindowFetch.cpp:
261         * Modules/fetch/DOMWindowFetch.h:
262         * Modules/fetch/DOMWindowFetch.idl:
263         * Modules/fetch/FetchBody.cpp:
264         * Modules/fetch/FetchBody.h:
265         * Modules/fetch/FetchBody.idl:
266         * Modules/fetch/FetchBodyConsumer.cpp:
267         * Modules/fetch/FetchBodyConsumer.h:
268         * Modules/fetch/FetchBodyOwner.cpp:
269         * Modules/fetch/FetchBodyOwner.h:
270         * Modules/fetch/FetchHeaders.cpp:
271         * Modules/fetch/FetchHeaders.h:
272         * Modules/fetch/FetchHeaders.idl:
273         * Modules/fetch/FetchInternals.js:
274         * Modules/fetch/FetchLoader.cpp:
275         * Modules/fetch/FetchLoader.h:
276         * Modules/fetch/FetchLoaderClient.h:
277         * Modules/fetch/FetchRequest.cpp:
278         * Modules/fetch/FetchRequest.h:
279         * Modules/fetch/FetchRequest.idl:
280         * Modules/fetch/FetchResponse.cpp:
281         * Modules/fetch/FetchResponse.h:
282         * Modules/fetch/FetchResponse.idl:
283         * Modules/fetch/FetchResponse.js:
284         * Modules/fetch/FetchResponseSource.cpp:
285         * Modules/fetch/FetchResponseSource.h:
286         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
287         * Modules/fetch/WorkerGlobalScopeFetch.h:
288         * Modules/fetch/WorkerGlobalScopeFetch.idl:
289         * page/RuntimeEnabledFeatures.h:
290         (WebCore::RuntimeEnabledFeatures::fetchAPIEnabled const):
291
292 2017-08-03  Devin Rousso  <drousso@apple.com>
293
294         Web Inspector: add button to open Inspector^2
295         https://bugs.webkit.org/show_bug.cgi?id=175108
296
297         Reviewed by Brian Burg.
298
299         This patch just exposes a function to the inspector page. No new functionality was added.
300
301         * inspector/InspectorFrontendHost.idl:
302         * inspector/InspectorFrontendHost.h:
303         * inspector/InspectorFrontendHost.cpp:
304         (WebCore::InspectorFrontendHost::inspectInspector):
305
306 2017-08-03  Matt Baker  <mattbaker@apple.com>
307
308         Web Inspector: Instrument WebGLProgram created/deleted
309         https://bugs.webkit.org/show_bug.cgi?id=175059
310
311         Reviewed by Devin Rousso.
312
313         Tests: inspector/canvas/shaderProgram-add-remove-webgl.html
314                inspector/canvas/shaderProgram-add-remove-webgl2.html
315
316         This patch adds instrumentation to WebGLRenderingContextBase for tracking
317         WebGLPrograms. A new helper class, InspectorShaderProgram, is used by
318         the CanvasAgent to hold related data.
319
320         * CMakeLists.txt:
321         * WebCore.xcodeproj/project.pbxproj:
322
323         * html/canvas/WebGLRenderingContextBase.cpp:
324         (WebCore::WebGLRenderingContextBase::createProgram):
325         (WebCore::WebGLRenderingContextBase::deleteProgram):
326
327         * inspector/InspectorCanvasAgent.cpp:
328         (WebCore::InspectorCanvasAgent::enable):
329         (WebCore::InspectorCanvasAgent::frameNavigated):
330         (WebCore::InspectorCanvasAgent::didCreateProgram):
331         (WebCore::InspectorCanvasAgent::willDeleteProgram):
332         (WebCore::InspectorCanvasAgent::clearCanvasData):
333         (WebCore::InspectorCanvasAgent::unbindCanvas):
334         (WebCore::InspectorCanvasAgent::unbindProgram):
335         (WebCore::InspectorCanvasAgent::assertInspectorProgram):
336         (WebCore::InspectorCanvasAgent::findInspectorProgram):
337         * inspector/InspectorCanvasAgent.h:
338
339         * inspector/InspectorInstrumentation.cpp:
340         (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
341         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
342         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
343         (WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl):
344         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
345         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
346         (WebCore::InspectorInstrumentation::didCreateProgramImpl):
347         (WebCore::InspectorInstrumentation::willDeleteProgramImpl):
348
349         * inspector/InspectorInstrumentation.h:
350         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
351         (WebCore::InspectorInstrumentation::didCreateCSSCanvas):
352         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
353         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
354         (WebCore::InspectorInstrumentation::didChangeCanvasMemory):
355         (WebCore::InspectorInstrumentation::recordCanvasAction):
356         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrame):
357         (WebCore::InspectorInstrumentation::didCreateProgram):
358         (WebCore::InspectorInstrumentation::willDeleteProgram):
359
360         * inspector/InspectorShaderProgram.cpp: Added.
361         (WebCore::InspectorShaderProgram::create):
362         (WebCore::InspectorShaderProgram::InspectorShaderProgram):
363         (WebCore::InspectorShaderProgram::context const):
364         * inspector/InspectorShaderProgram.h: Added.
365
366 2017-08-03  Matt Lewis  <jlewis3@apple.com>
367
368         Unreviewed, rolling out r220209.
369
370         This caused internal build failures.
371
372         Reverted changeset:
373
374         "Use MPAVRoutingController instead of deprecated versions."
375         https://bugs.webkit.org/show_bug.cgi?id=175063
376         http://trac.webkit.org/changeset/220209
377
378 2017-08-03  Brady Eidson  <beidson@apple.com>
379
380         Add SW IDLs and stub out basic functionality.
381         https://bugs.webkit.org/show_bug.cgi?id=175115
382
383         Reviewed by Chris Dumez.
384
385         No new tests (Currently no behavior change).
386
387         Overall note: This feature is EnabledAtRuntime as opposed to EnabledBySetting because
388         the Settings-based code generation is completely broken for non-Document contexts,
389         whereas the RuntimeEnabledFeatures-based generation is not.
390     
391         * CMakeLists.txt:
392         * Configurations/FeatureDefines.xcconfig:
393         * DerivedSources.make:
394         * WebCore.xcodeproj/project.pbxproj:
395
396         * bindings/scripts/preprocess-idls.pl: Handle the new global scope c'tor file.
397
398         * bindings/js/JSServiceWorkerContainerCustom.cpp: Added.
399         (WebCore::JSServiceWorkerContainer::ready const):
400
401         * bindings/js/JSWorkerGlobalScopeBase.cpp:
402         (WebCore::toJSWorkerGlobalScope): Refactor to handle both types of derived workers.
403         (WebCore::toJSServiceWorkerGlobalScope):
404         * bindings/js/JSWorkerGlobalScopeBase.h:
405
406         * dom/EventNames.h:
407         * dom/EventTargetFactory.in:
408
409         * features.json: Change status of feature.
410
411         * page/Navigator.idl:
412         * page/NavigatorBase.cpp:
413         (WebCore::NavigatorBase::serviceWorker):
414         * page/NavigatorBase.h:
415         * page/NavigatorServiceWorker.idl: Added.
416
417         * page/RuntimeEnabledFeatures.h:
418         (WebCore::RuntimeEnabledFeatures::serviceWorkerEnabled const):
419         (WebCore::RuntimeEnabledFeatures::setServiceWorkerEnabled):
420
421         * workers/ServiceWorker.cpp: Added.
422         (WebCore::ServiceWorker::postMessage):
423         (WebCore::ServiceWorker::~ServiceWorker):
424         (WebCore::ServiceWorker::scriptURL const):
425         (WebCore::ServiceWorker::state const):
426         (WebCore::ServiceWorker::eventTargetInterface const):
427         (WebCore::ServiceWorker::scriptExecutionContext const):
428         * workers/ServiceWorker.h: Added.
429         * workers/ServiceWorker.idl: Added.
430
431         * workers/ServiceWorkerContainer.cpp: Added.
432         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
433         (WebCore::ServiceWorkerContainer::controller const):
434         (WebCore::ServiceWorkerContainer::ready):
435         (WebCore::ServiceWorkerContainer::addRegistration):
436         (WebCore::ServiceWorkerContainer::getRegistration):
437         (WebCore::ServiceWorkerContainer::getRegistrations):
438         (WebCore::ServiceWorkerContainer::startMessages):
439         (WebCore::ServiceWorkerContainer::eventTargetInterface const):
440         (WebCore::ServiceWorkerContainer::scriptExecutionContext const):
441         * workers/ServiceWorkerContainer.h: Added.
442         * workers/ServiceWorkerContainer.idl: Added.
443
444         * workers/ServiceWorkerGlobalScope.cpp: Added.
445         (WebCore::ServiceWorkerGlobalScope::registration):
446         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
447         * workers/ServiceWorkerGlobalScope.h: Added.
448         * workers/ServiceWorkerGlobalScope.idl: Added.
449
450         * workers/ServiceWorkerRegistration.cpp: Added.
451         (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
452         (WebCore::ServiceWorkerRegistration::installing):
453         (WebCore::ServiceWorkerRegistration::waiting):
454         (WebCore::ServiceWorkerRegistration::active):
455         (WebCore::ServiceWorkerRegistration::scope const):
456         (WebCore::ServiceWorkerRegistration::update):
457         (WebCore::ServiceWorkerRegistration::unregister):
458         (WebCore::ServiceWorkerRegistration::eventTargetInterface const):
459         (WebCore::ServiceWorkerRegistration::scriptExecutionContext const):
460         * workers/ServiceWorkerRegistration.h: Added.
461         * workers/ServiceWorkerRegistration.idl: Added.
462
463 2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>
464
465         [WebCore] Sort Xcode project files
466         https://bugs.webkit.org/show_bug.cgi?id=175121
467
468         Reviewed by Antti Koivisto.
469
470         * WebCore.xcodeproj/project.pbxproj:
471
472 2017-08-02  Sam Weinig  <sam@webkit.org>
473
474         [WebIDL] Convert MutationCallback to be a normal generated callback
475         https://bugs.webkit.org/show_bug.cgi?id=174140
476
477         Reviewed by Darin Adler.
478
479         To make this work more nicely, I:
480         - Added the ability to for non-nullable interfaces in sequences to be passed
481           via a Ref<> rather than a RefPtr<> as a parameter to a callback function.
482           (e.g. callback MyCallback = void (sequence<Foo> foos) will now have the 
483           signature, CallbackResult<void> handleEvent(const Vector<Ref<Foo>>&) rather
484           than CallbackResult<void> handleEvent(const Vector<RefPtr<Foo>>&).
485         - Added a new extended attribute for callback functions called [CallbackThisObject=Type]
486           which allows you to specify that the callback needs a this object in addition
487           to its arguments. When specified, the first argument of the C++ implementation
488           function will now correspond to the this object, with the remaining arguments
489           shifted over one.
490         - Converted callback objects to all inherit directly from ActiveDOMCallback rather
491           than having the generated JS callback derived class inherit from it. This allows
492           us to have access to a callback's canInvokeCallback() function anywhere (needed
493           for MutationCallback) as well as giving a place to put an optional virtual 
494           visitJSFunction to allow marking weak callbacks (while not an ideal layering, 
495           this matches what we do in EventListener). This change requires each callback to
496           have a bit more code to import the ActiveDOMCallback's constructor and requires
497           non-JS derived callbacks to pass a ScriptExecutionContext (e.g. the Document).
498
499         * CMakeLists.txt:
500         * DerivedSources.make:
501         * WebCore.xcodeproj/project.pbxproj:
502         * bindings/js/JSMutationCallback.cpp: Removed.
503         * bindings/js/JSMutationCallback.h: Removed.
504         Remove custom JSMutationCallback.h/cpp
505
506         * Modules/geolocation/PositionCallback.h:
507         * Modules/geolocation/PositionErrorCallback.h:
508         * Modules/notifications/NotificationPermissionCallback.h:
509         * Modules/webaudio/AudioBufferCallback.h:
510         * Modules/webdatabase/DatabaseCallback.h:
511         * Modules/webdatabase/SQLStatementCallback.h:
512         * Modules/webdatabase/SQLStatementErrorCallback.h:
513         * Modules/webdatabase/SQLTransactionCallback.h:
514         * Modules/webdatabase/SQLTransactionErrorCallback.h:
515         * css/MediaQueryListListener.h:
516         * dom/NodeFilter.h:
517         * dom/RequestAnimationFrameCallback.h:
518         * dom/StringCallback.h:
519         * fileapi/BlobCallback.h:
520         * html/VoidCallback.h:
521         * page/IntersectionObserverCallback.h:
522         * page/PerformanceObserverCallback.h:
523         Add ActiveDOMCallback as a base class. Import the ActiveDOMCallback constructor.
524
525         * Modules/mediastream/MediaDevicesRequest.cpp:
526         (WebCore::MediaDevicesRequest::filterDeviceList):
527         (WebCore::MediaDevicesRequest::start):
528         * Modules/mediastream/MediaDevicesRequest.h:
529         Change filterDeviceList to take a Vector of Refs.
530
531         * bindings/IDLTypes.h:
532         Add InnerParameterType and NullableInnerParameterType type hooks
533         and specialize wrappers to use Ref for InnerParameterType, and RefPtr
534         for NullableInnerParameterType.
535
536         * bindings/js/JSCallbackData.cpp:
537         * bindings/js/JSCallbackData.h:
538         Add support for passing a this object and give JSCallbackDataWeak a visitJSFunction
539         to allow marking the underlying function.
540
541         * bindings/js/JSMutationObserverCustom.cpp:
542         (WebCore::JSMutationObserver::visitAdditionalChildren):
543         (WebCore::constructJSMutationObserver): Deleted.
544         Remove the custom constructor and replace it with a custom visitAdditionalChildren
545         that calls the new ActiveDOMObject's visitJSFunction.
546
547         * bindings/scripts/CodeGenerator.pm:
548         (ParseType):
549         Add helper to parse a type and cache the result.
550
551         * bindings/scripts/CodeGeneratorJS.pm:
552         (GenerateCallbackHeaderContent):
553         (GenerateCallbackImplementationContent):
554         (GetJSCallbackDataType): Deleted.
555         - Add support for [CallbackThisObject]. When [CallbackThisObject] is not specified, use jsUndefined() 
556           as the this object as specified by WebIDL.
557         - Stop inheriting from ActiveDOMCallback now that callbacks need to do this themselves.
558         - Add a visitJSFunction override for weak callback functions which calls into the callback data.
559
560         * bindings/scripts/IDLAttributes.json:
561         Add [CallbackThisObject].
562
563         * bindings/scripts/IDLParser.pm:
564         (ParseType):
565         Add entry point to parse a single type.
566
567         * css/FontFaceSet.h:
568         Use Ref rather than RefPtr for the faces sequence.
569
570         * dom/ActiveDOMCallback.h:
571         (WebCore::ActiveDOMCallback::visitJSFunction):
572         Add an optional visitJSFunction virtual function so that derived classes
573         have a way of marking underlying function objects.
574
575         * dom/MutationCallback.h:
576         Convert to support generation (return a CallbackResult, inherit from ActiveDOMObject).
577
578         * dom/MutationCallback.idl: Added.
579         Added to generate the callback. Uses the new [CallbackThisObject].
580
581         * dom/MutationObserver.cpp:
582         (WebCore::MutationObserver::deliver):
583         Switch to call idiomatic handleEvent, and pass *this as the first parameter
584         which will be translated into the this object.
585
586         * dom/MutationObserver.h:
587         (WebCore::MutationObserver::callback):
588         Expose the callback so it can marked during GC.
589
590         * dom/MutationObserver.idl:
591         Remove CustomConstructor and replace it with a custom mark function.
592
593         * dom/NativeNodeFilter.cpp:
594         * dom/NativeNodeFilter.h:
595         * inspector/InspectorDatabaseAgent.cpp:
596         Pass now needed ScriptExecutionContext to non-js based callbacks.
597
598         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
599         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
600         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: Added.
601         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: Added.
602         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
603         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
604         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
605         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
606         * bindings/scripts/test/TestCallbackFunctionWithThisObject.idl: Added.
607         * bindings/scripts/test/TestCallbackInterface.idl:
608         Add/update tests.
609
610 2017-08-03  Jeremy Jones  <jeremyj@apple.com>
611
612         Use MPAVRoutingController instead of deprecated versions.
613         https://bugs.webkit.org/show_bug.cgi?id=175063
614
615         Reviewed by Tim Horton.
616
617         No new tests because no behavior change. This uses a different platform class to present
618         an interface.
619
620         Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
621         Add MPMediaControlsViewController.
622
623         * platform/spi/ios/MediaPlayerSPI.h:
624
625 2017-08-03  Chris Dumez  <cdumez@apple.com>
626
627         Improve our support for referrer policies
628         https://bugs.webkit.org/show_bug.cgi?id=175069
629         <rdar://problem/33677313>
630
631         Reviewed by Darin Adler.
632
633         Improve our support for referrer policies. In particular, we now support the
634         additional following ones: "same-origin", "origin-when-cross-origin" and
635         "strict-origin-when-cross-origin".
636
637         This is as per the following specification:
638         - https://www.w3.org/TR/referrer-policy/#referrer-policies
639
640         Also refactor the code a bit for clarity: I merged the ReferrerPolicy enum and the
641         FetchOptions::ReferrerPolicy one.
642
643         Tests: http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http-http.html
644                http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http.https.html
645                http/tests/referrer-policy/origin-when-cross-origin/same-origin.html
646                http/tests/referrer-policy/same-origin/cross-origin-http-http.html
647                http/tests/referrer-policy/same-origin/cross-origin-http.https.html
648                http/tests/referrer-policy/same-origin/same-origin.html
649                http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http-http.html
650                http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http.https.html
651                http/tests/referrer-policy/strict-origin-when-cross-origin/same-origin.html
652                http/tests/referrer-policy/strict-origin/cross-origin-http-http.html
653                http/tests/referrer-policy/strict-origin/cross-origin-http.https.html
654                http/tests/referrer-policy/strict-origin/same-origin.html
655
656         * Modules/fetch/FetchLoader.cpp:
657         (WebCore::FetchLoader::start):
658         * Modules/fetch/FetchReferrerPolicy.h:
659         * Modules/fetch/FetchReferrerPolicy.idl:
660         * Modules/fetch/FetchRequest.h:
661         * Modules/fetch/FetchRequestInit.h:
662         * dom/Document.cpp:
663         (WebCore::Document::processReferrerPolicy):
664         (WebCore::Document::applyQuickLookSandbox):
665         (WebCore::Document::applyContentDispositionAttachmentSandbox):
666         * dom/Document.h:
667         * loader/FetchOptions.h:
668         * loader/FrameNetworkingContext.h:
669         * loader/PingLoader.cpp:
670         (WebCore::PingLoader::sendBeacon):
671         Drop explicit call to SecurityPolicy::shouldHideReferrer(). This is already called inside
672         SecurityPolicy::generateReferrerHeader() and used only when needed, depending on the
673         actual referrer policy.
674
675         * loader/cache/CachedResourceLoader.cpp:
676         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
677         * loader/cache/CachedResourceRequest.cpp:
678         (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
679         * page/SecurityPolicy.cpp:
680         (WebCore::referrerToOriginString):
681         (WebCore::SecurityPolicy::generateReferrerHeader):
682         * page/SecurityPolicy.h:
683         * platform/ReferrerPolicy.h:
684
685 2017-08-03  Daniel Bates  <dabates@apple.com>
686
687         Support ::marker pseudo-element
688         https://bugs.webkit.org/show_bug.cgi?id=141477
689
690         Reviewed by David Hyatt.
691
692         Implements the ::marker pseudo element as per the CSS Pseudo-Element Module Level 4
693         spec., <https://drafts.csswg.org/css-pseudo-4> (Editor's Draft, 24 July 2017).
694
695         The ::marker pseudo element is a convenience pseudo element that allows a person to
696         style the appearance of a list item marker. For example, to render all list item
697         markers in bolded, blue text you would define a stylesheet with the following content:
698
699         li::marker {
700             color: blue;
701             font-weight: bold;
702         }
703
704         and this could be applied to a page that contains markup of the form:
705
706         <ol>
707             <li>Item 1</li>
708             <li>Item 2</li>
709             ...
710             <li>Item N-1</li>
711             <li>Item N</li>
712         </ol>
713
714         Formerly to the achieve the same effect you would need to use a stylesheet of the form:
715
716         li {
717             color: blue;
718             font-weight: bold;
719         }
720
721         .list-item-content {
722             all: initial;
723         }
724
725         and then write your markup to have the form:
726
727         <ol>
728             <li><span class="list-item-content">Item 1</span></li>
729             <li><span class="list-item-content">Item 2</span></li>
730             ...
731             <li><span class="list-item-content">Item N-1</span></li>
732             <li><span class="list-item-content">Item N</span></li>
733         </ol>
734
735         The ::marker pseudo element only supports stylizing all font properties and the color property
736         of a list item marker.
737
738         Tests: fast/lists/list-marker-with-display.html
739                http/wpt/css/css-pseudo-4/marker-and-other-pseudo-elements.html
740                http/wpt/css/css-pseudo-4/marker-color.html
741                http/wpt/css/css-pseudo-4/marker-font-properties.html
742                http/wpt/css/css-pseudo-4/marker-inherit-values.html
743
744         * css/CSSSelector.cpp:
745         (WebCore::CSSSelector::pseudoId): Return the pseudo id for the ::marker pseudo element.
746         * css/CSSSelector.h: Add enumerator PseudoElementMarker to the pseudo element enum.
747         * css/RuleSet.cpp:
748         (WebCore::determinePropertyWhitelistType): Return whitelist type PropertyWhitelistMarker for ::marker
749         so that we match rules against the acceptable rules for ::marker.
750         * css/RuleSet.h: Add enumerator PropertyWhitelistMarker to the property whitelist type enum.
751         * css/SelectorPseudoElementTypeMap.in: Add "marker" to the list of pseudo element types.
752         * css/StyleResolver.cpp:
753         (WebCore::isValidMarkerStyleProperty): Determines if the specified CSS property is valid inside ::marker.
754         (WebCore::StyleResolver::CascadedProperties::addMatch): Only recognize CSS properties in the content block
755         of ::marker that match the ::marker whitelist policy.
756         * rendering/RenderListItem.cpp:
757         (WebCore::RenderListItem::computeMarkerStyle): Computes the style object for the list item marker. We
758         apply the user-agent style to the marker here as opposed to defining ::marker in the UA sheet as per
759         the spec. as an optimization to avoid having the style resolver apply the pseudo element to all elements.
760         For now, we always inherit style from the originating element (list item). Added FIXME to selectively
761         inherit styles.
762         (WebCore::RenderListItem::styleDidChange): Always apply the list marker style to the list marker renderer.
763         * rendering/RenderListItem.h:
764         * rendering/style/RenderStyleConstants.h: Add pseudo ID for the ::marker pseudo element.
765
766 2017-08-03  Antti Koivisto  <antti@apple.com>
767
768         Factor common code in Style::*ChangeInvalidation into helper functions
769         https://bugs.webkit.org/show_bug.cgi?id=174312
770
771         Reviewed by Andreas Kling.
772
773         There is a lot of copy code here.
774
775         * Style/StyleInvalidationFunctions.h: Added.
776         (WebCore::Style::traverseRuleFeaturesInShadowTree):
777         (WebCore::Style::traverseRuleFeaturesForSlotted):
778         (WebCore::Style::traverseRuleFeatures):
779
780             Add functions for traversing rule features that may affect style of an element.
781             Use lambdas to implement client-specific behavior.
782
783         * WebCore.xcodeproj/project.pbxproj:
784         * style/AttributeChangeInvalidation.cpp:
785         (WebCore::Style::mayBeAffectedByAttributeChange):
786         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
787         (WebCore::Style::mayBeAffectedByHostRules): Deleted.
788         (WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
789         * style/ClassChangeInvalidation.cpp:
790         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
791         (WebCore::Style::mayBeAffectedByHostRules): Deleted.
792         (WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
793         * style/IdChangeInvalidation.cpp:
794         (WebCore::Style::IdChangeInvalidation::invalidateStyle):
795         (WebCore::Style::mayBeAffectedByHostRules): Deleted.
796         (WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
797
798 2017-08-03  Zan Dobersek  <zdobersek@igalia.com>
799
800         [EME] CDM constructor assigns CDMPrivate member multiple times
801         https://bugs.webkit.org/show_bug.cgi?id=175128
802
803         Reviewed by Xabier Rodriguez-Calvar.
804
805         In the CDM class constructor, iterate over the registered CDM
806         factories, finding one that supports the specified key system.
807         A CDMPrivate object is created through that factory, and the
808         iteration is now stopped at that point, while previously it
809         contined to potentially create CDMPrivate objects through
810         other factories.
811
812         Helper createCDMPrivateForKeySystem() function is removed.
813
814         * Modules/encryptedmedia/CDM.cpp:
815         (WebCore::CDM::CDM):
816         (WebCore::createCDMPrivateForKeySystem): Deleted.
817
818 2017-08-03  Emilio Cobos Álvarez  <ecobos@igalia.com>
819
820         Don't always recalc the style of display: contents elements.
821         https://bugs.webkit.org/show_bug.cgi?id=172753
822
823         Reviewed by Antti Koivisto.
824
825         No new tests (no functionality change). This only removes an
826         inefficiency.
827
828         * dom/Element.cpp:
829         (WebCore::Element::existingComputedStyle):
830         * dom/Element.h:
831         * style/RenderTreeUpdater.cpp:
832         (WebCore::RenderTreeUpdater::updateRenderTree):
833         (WebCore::RenderTreeUpdater::updateElementRenderer):
834         * style/StyleTreeResolver.cpp:
835         (WebCore::Style::renderOrDisplayContentsStyle):
836         (WebCore::Style::TreeResolver::resolveElement):
837         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
838         (WebCore::Style::shouldResolveElement):
839         (WebCore::Style::TreeResolver::resolveComposedTree):
840
841 2017-08-02  Devin Rousso  <drousso@apple.com>
842
843         Web Inspector: add stack trace information for each RecordingAction
844         https://bugs.webkit.org/show_bug.cgi?id=174663
845
846         Reviewed by Joseph Pecoraro.
847
848         Tests: inspector/canvas/recording-2d.html
849                inspector/model/recording.html
850
851         * inspector/InspectorCanvas.h:
852         * inspector/InspectorCanvas.cpp:
853         (WebCore::InspectorCanvas::indexForData):
854         (WebCore::InspectorCanvas::buildAction):
855
856 2017-08-02  Yusuke Suzuki  <utatane.tea@gmail.com>
857
858         Merge WTFThreadData to Thread::current
859         https://bugs.webkit.org/show_bug.cgi?id=174716
860
861         Reviewed by Mark Lam.
862
863         Use Thread::current() instead.
864
865         * fileapi/AsyncFileStream.cpp:
866         * platform/ThreadGlobalData.cpp:
867         (WebCore::ThreadGlobalData::ThreadGlobalData):
868         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
869         * platform/ios/wak/WebCoreThread.mm:
870         (StartWebThread):
871         * workers/WorkerThread.cpp:
872         (WebCore::WorkerThread::workerThread):
873
874 2017-08-02  Sam Weinig  <sam@webkit.org>
875
876         Fix crashes in GC creating a document fragment on a background thread
877         https://bugs.webkit.org/show_bug.cgi?id=175111
878
879         Reviewed by Chris Dumez.
880
881         r220095 (https://webkit.org/b/175006) change JSHTMLTemplateElement from using a
882         private name + property to manager the lifetime of the reference DocumentFragment
883         to using the idiomatic visitAdditionalChildren. Unfortunately, the function to access
884         the DocumentFragment lazily creates it. If this lazy creation happens on a GC thread,
885         badness ensues. This introduces an accessor that returns the DocumentFragment if it
886         has been created or null if it has not.
887
888         * bindings/js/JSHTMLTemplateElementCustom.cpp:
889         (WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
890         * html/HTMLTemplateElement.cpp:
891         (WebCore::HTMLTemplateElement::contentIfAvailable):
892         * html/HTMLTemplateElement.h:
893
894 2017-08-02  Sam Weinig  <sam@webkit.org>
895
896         [WebIDL] Simplify [EnabledBySettings] extended attribute code to not require passing a global object to finishCreation
897         https://bugs.webkit.org/show_bug.cgi?id=175087
898
899         Reviewed by Chris Dumez.
900
901         * bindings/scripts/CodeGeneratorJS.pm:
902         (GenerateImplementation):
903         (GeneratePrototypeDeclaration):
904         Remove unnecessary passing of the global object to finishCreation for [EnabledBySettings].
905
906         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
907         * bindings/scripts/test/JS/JSTestNode.cpp:
908         * bindings/scripts/test/JS/JSTestObj.cpp:
909         Update tests.
910
911 2017-08-02  Andy Estes  <aestes@apple.com>
912
913         REGRESSION (r207155): Unable to switch sheets when previewing Numbers '09 spreadsheets
914         https://bugs.webkit.org/show_bug.cgi?id=175098
915         <rdar://problem/31416763>
916
917         Reviewed by Daniel Bates.
918
919         r207155 enabled sandboxing on the frame displaying a QuickLook preview. This restricted
920         frames within the sandbox from navigating their sandboxed siblings or ancestors, which
921         breaks the functionality of multi-sheet Numbers '09 spreadsheet previews. These previews
922         contain a frameset with a table of contents frame and a content frame, and the table of
923         contents frame needs to be able to navigate the content frame when the sheet selection
924         changes.
925
926         Fix this by disabling the SandboxNavigation flag in the QuickLook sandbox. Frames within the
927         sandbox will be able to navigate each other, but will not be able to navigate the top frame
928         (due to SandboxTopNavigation still being enabled), nor will they be able to navigate any
929         other ancestor frame outside the sandbox (due to QuickLook previews being in a different
930         origin than the hosting frame). These two cases are covered by existing tests.
931
932         Test: quicklook/multi-sheet-numbers-09.html
933
934         * dom/Document.cpp:
935         (WebCore::Document::applyQuickLookSandbox): Added a call to
936         disableSandboxFlags(SandboxNavigation) after applying the content security policy.
937         * dom/SecurityContext.h:
938         (WebCore::SecurityContext::disableSandboxFlags): Defined disableSandboxFlags().
939
940 2017-08-02  Jer Noble  <jer.noble@apple.com>
941
942         [MSE] Removing samples when presentation order does not match decode order can cause bad behavior.
943         https://bugs.webkit.org/show_bug.cgi?id=175091
944
945         Reviewed by Eric Carlson.
946
947         Address follow-up comments to r219519.
948
949         * Modules/mediasource/SourceBuffer.cpp:
950         (WebCore::SourceBuffer::removeCodedFrames):
951
952 2017-08-02  Jeremy Jones  <jeremyj@apple.com>
953
954         Remove unused and obsolete setting mediaDocumentEntersFullscreenAutomatically
955         https://bugs.webkit.org/show_bug.cgi?id=175080
956
957         Reviewed by Jon Lee.
958
959         No new tests because this only removes unused code.
960
961         This is obsolete because of the alternate solution in
962         https://bugs.webkit.org/show_bug.cgi?id=174850
963
964         * page/Settings.in:
965
966 2017-08-02  Filip Pizlo  <fpizlo@apple.com>
967
968         GPUBuffer::length() should return the size of the array buffer backing the GPU buffer, not the rounded-up GPU buffer length
969         https://bugs.webkit.org/show_bug.cgi?id=175079
970
971         Reviewed by Simon Fraser.
972
973         This fixes a failure in the GPU.BufferCreate unit test.
974         
975         The problem is that in order to have a Metal buffer wrap memory we allocated, we have to tell Metal
976         that the memory is page-aligned. This means that the Metal buffer reports back a page-aligned size,
977         which is different than what the test expected.
978         
979         It seems that it's most convenient for our GPUBuffer class to return the unaligned length, rather
980         than the aligned length. This is just a simple matter of returning the length from the ArrayBuffer
981         rather than the Metal buffer.
982         
983         This fixes the unit test and is probably more sensible for actual users of this class, since the page
984         alignment of the length is a goofy implementation detail.
985
986         * platform/graphics/cocoa/GPUBufferMetal.mm:
987         (WebCore::GPUBuffer::length const):
988
989 2017-08-01  Brian Burg  <bburg@apple.com>
990
991         HTML file input elements do not support file extensions in the "accept" attribute
992         https://bugs.webkit.org/show_bug.cgi?id=95698
993         <rdar://problem/12231850>
994
995         Reviewed by Darin Adler.
996
997         Serialize the accepted file extensions so they can be accessed in the UI process.
998
999         * platform/FileChooser.h:
1000         * platform/FileChooser.cpp:
1001         (WebCore::FileChooser::invalidate): Modernize.
1002         (WebCore::FileChooserSettings::acceptTypes const): Deleted.
1003         This is dead code, it was only used by Chromium.
1004
1005 2017-08-02  Fujii Hironori  <Hironori.Fujii@sony.com>
1006
1007         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
1008         https://bugs.webkit.org/show_bug.cgi?id=175010
1009         <rdar://problem/33647818>
1010
1011         Reviewed by Alex Christensen.
1012
1013         No new tests because no behavior change.
1014
1015         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
1016
1017         * contentextensions/ContentExtensionParser.cpp:
1018         (WebCore::ContentExtensions::isValidCSSSelector):
1019         Call QualifiedName::init().
1020         * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp.
1021         * dom/QualifiedName.cpp:
1022         (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct
1023         instead of placement new.
1024         * dom/QualifiedName.h: Use LazyNeverDestroyed.
1025
1026 2017-08-01  Joseph Pecoraro  <pecoraro@apple.com>
1027
1028         CFString leak dragging an image - allocation under PlatformPasteboard::writeObjectRepresentations
1029         https://bugs.webkit.org/show_bug.cgi?id=175064
1030
1031         Reviewed by Tim Horton.
1032
1033         * platform/ios/PlatformPasteboardIOS.mm:
1034         (WebCore::PlatformPasteboard::writeObjectRepresentations):
1035         Adopt a created string into the RetainPtr.
1036
1037         * platform/ios/WebItemProviderPasteboard.h:
1038         * platform/ios/WebItemProviderPasteboard.mm:
1039         (-[WebItemProviderRegistrationInfoList dealloc]):
1040         Release suggestedName and switch from -strong to -copy.
1041
1042 2017-08-01  Chris Dumez  <cdumez@apple.com>
1043
1044         Unreviewed, update Beacon API status to "In Development".
1045
1046         * features.json:
1047
1048 2017-08-01  Chris Dumez  <cdumez@apple.com>
1049
1050         Add initial support for navigator.sendBeacon
1051         https://bugs.webkit.org/show_bug.cgi?id=175007
1052         <rdar://problem/33547728>
1053
1054         Reviewed by Sam Weinig.
1055
1056         Add initial support for navigator.sendBeacon behind an experimental
1057         feature runtime flag. The specification is available at:
1058         - https://w3c.github.io/beacon/
1059
1060         The current implementation supports sending beacons with all types of
1061         payloads except for ReadableStream. Some functionality is incomplete
1062         and will be taken care of in follow-up patches:
1063         - Support for CORS preflight for the cases where it is required. We currently
1064           return false and do not send the beacon in such cases.
1065         - Better support for redirects.
1066         - Use a more power-friendly network priority for beacon requests.
1067
1068         Tests: http/tests/blink/sendbeacon/*
1069                http/tests/security/mixedContent/beacon/insecure-beacon-in-iframe.html
1070                http/wpt/beacon/*
1071                imported/blink/fast/beacon/*
1072                imported/w3c/web-platform-tests/beacon/*
1073
1074         * CMakeLists.txt:
1075         * DerivedSources.make:
1076         * Modules/beacon/NavigatorBeacon.cpp: Added.
1077         (WebCore::NavigatorBeacon::sendBeacon):
1078         * Modules/beacon/NavigatorBeacon.h: Added.
1079         * Modules/beacon/NavigatorBeacon.idl: Added.
1080         * WebCore.xcodeproj/project.pbxproj:
1081         * loader/PingLoader.cpp:
1082         (WebCore::PingLoader::sendBeacon):
1083         * loader/PingLoader.h:
1084
1085 2017-08-01  Filip Pizlo  <fpizlo@apple.com>
1086
1087         Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
1088         https://bugs.webkit.org/show_bug.cgi?id=174727
1089
1090         Reviewed by Mark Lam.
1091
1092         No new tests because no change in behavior.
1093         
1094         Needed to teach Metal how to allocate in the Gigacage.
1095
1096         * platform/graphics/cocoa/GPUBufferMetal.mm:
1097         (WebCore::GPUBuffer::GPUBuffer):
1098         (WebCore::GPUBuffer::contents):
1099
1100 2017-08-01  Fujii Hironori  <Hironori.Fujii@sony.com>
1101
1102         [WinCairo] Implement Font::platformBoundsForGlyph
1103         https://bugs.webkit.org/show_bug.cgi?id=174813
1104
1105         Reviewed by Alex Christensen.
1106
1107         Test: fast/text/emphasis.html
1108
1109         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
1110         (WebCore::Font::platformBoundsForGlyph): Implemented by copying
1111         the code from Font::boundsForGDIGlyph().
1112
1113 2017-08-01  Zalan Bujtas  <zalan@apple.com>
1114
1115         REGRESSION (r217197): New Yorker website hangs for a long time on load, lots of blank tiles
1116         https://bugs.webkit.org/show_bug.cgi?id=175009
1117         <rdar://problem/33505791>
1118
1119         Reviewed by Simon Fraser.
1120
1121         This patch ensures that we report the desktop, non-frame-flattened frame size for media queries in subframes.
1122         Some websites don't expect the iframes to be expanded to the size of the content and when the media query
1123         callback mutates the content (triggering frame resize), they might end up getting into a never ending layout.
1124
1125         Test: fast/frames/flattening/media-query-growing-content.html
1126
1127         * css/MediaQueryEvaluator.cpp:
1128         (WebCore::orientationEvaluate):
1129         (WebCore::aspectRatioEvaluate):
1130         (WebCore::heightEvaluate):
1131         (WebCore::widthEvaluate):
1132         * page/FrameView.cpp:
1133         (WebCore::FrameView::layout):
1134         (WebCore::FrameView::layoutSizeForMediaQuery const):
1135         (WebCore::FrameView::evaluateMediaQueryList):
1136         * page/FrameView.h:
1137
1138 2017-07-26  Jiewen Tan  <jiewen_tan@apple.com>
1139
1140         Add tests to detect mistakes in backward compatibility when the structured clone algorithm is changed in the future
1141         https://bugs.webkit.org/show_bug.cgi?id=173998
1142
1143         Reviewed by Darin Adler.
1144
1145         * bindings/js/SerializedScriptValue.cpp:
1146         Add a comment.
1147
1148 2017-08-01  Matt Lewis  <jlewis3@apple.com>
1149
1150         Unreviewed, rolling out r220089.
1151
1152         This caused multiple crashes on macOS Debug testers.
1153
1154         Reverted changeset:
1155
1156         "Use LazyNeverDestroyed instead of DEFINE_GLOBAL for
1157         QualifiedName"
1158         https://bugs.webkit.org/show_bug.cgi?id=175010
1159         http://trac.webkit.org/changeset/220089
1160
1161 2017-08-01  Sam Weinig  <sam@webkit.org>
1162
1163         [WebIDL] Swap a custom attribute for a custom mark function for HTMLTemplateElement
1164         https://bugs.webkit.org/show_bug.cgi?id=175006
1165
1166         Reviewed by Chris Dumez.
1167
1168         Use the standard way of augmenting GC, visitAdditionalChildren, rather
1169         than using a private name to create ownership.
1170
1171         * bindings/js/JSHTMLTemplateElementCustom.cpp:
1172         (WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
1173         (WebCore::JSHTMLTemplateElement::content const): Deleted.
1174         * html/HTMLTemplateElement.idl:
1175
1176 2017-08-01  Zan Dobersek  <zdobersek@igalia.com>
1177
1178         [GCrypt] Gather crypto constants in a single location
1179         https://bugs.webkit.org/show_bug.cgi?id=174091
1180
1181         Reviewed by Jiewen Tan.
1182
1183         Gather common constants used across the libgcrypt-specific Web Crypto
1184         implementations in a single place -- in the GCryptUtilities.h header,
1185         inside the CryptoConstants namespace. The various ASN.1 object identifiers
1186         and other helper values are placed inside, in the std::array<uint8_t, N>
1187         container.
1188
1189         Additionally, CryptoConstants::matches() helper function is provided. It
1190         compares the provided data-and-size pair with the given std::array
1191         container and returns true if the std::memcmp() call returns 0.
1192
1193         Changes in CryptoKeyEC and CryptoKeyRSA consist mostly of switching to the
1194         use of CryptoConstants::matches() and the CryptoConstants data arrays, as
1195         well as some whitespace cleanup.
1196
1197         Additionallity in CryptoKeyEC, the helper functions covering various curve
1198         attributes are reordered, renamed and reorganized for simplicity.
1199
1200         No new tests -- no changes in behavior.
1201
1202         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1203         (WebCore::curveIdentifier):
1204         (WebCore::curveSize):
1205         (WebCore::curveUncompressedFieldElementSize):
1206         (WebCore::curveUncompressedPointSize):
1207         (WebCore::CryptoKeyEC::platformImportRaw):
1208         (WebCore::CryptoKeyEC::platformImportJWKPublic):
1209         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
1210         (WebCore::supportedAlgorithmIdentifier):
1211         (WebCore::curveForIdentifier):
1212         (WebCore::CryptoKeyEC::platformImportSpki):
1213         (WebCore::CryptoKeyEC::platformExportRaw):
1214         (WebCore::CryptoKeyEC::platformAddFieldElements):
1215         (WebCore::CryptoKeyEC::platformExportSpki):
1216         (WebCore::CryptoKeyEC::platformExportPkcs8):
1217         (WebCore::uncompressedPointSizeForCurve): Deleted.
1218         (WebCore::uncompressedFieldElementSizeForCurve): Deleted.
1219         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1220         (WebCore::supportedAlgorithmIdentifier):
1221         (WebCore::CryptoKeyRSA::importPkcs8):
1222         (WebCore::CryptoKeyRSA::exportSpki):
1223         (WebCore::CryptoKeyRSA::exportPkcs8):
1224         * crypto/gcrypt/GCryptUtilities.h:
1225         (WebCore::CryptoConstants::matches):
1226
1227 2017-07-31  Fujii Hironori  <Hironori.Fujii@sony.com>
1228
1229         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for MediaFeatureNames
1230         https://bugs.webkit.org/show_bug.cgi?id=175008
1231
1232         Reviewed by Alex Christensen.
1233
1234         No new tests because no behavior change.
1235
1236         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
1237
1238         * css/MediaFeatureNames.cpp:
1239         (WebCore::MediaFeatureNames::init): Do not include
1240         <wtf/StaticConstructors.h>. Use LazyNeverDestroyed instead of
1241         DEFINE_GLOBAL. Call LazyNeverDestroyed::construct instead of
1242         placement new.
1243         * css/MediaFeatureNames.h: Use LazyNeverDestroyed.
1244         * css/MediaQueryEvaluator.cpp:
1245         (WebCore::MediaQueryEvaluator::evaluate const): Dereference with ->.
1246
1247 2017-07-31  Fujii Hironori  <Hironori.Fujii@sony.com>
1248
1249         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
1250         https://bugs.webkit.org/show_bug.cgi?id=175010
1251
1252         Reviewed by Alex Christensen.
1253
1254         No new tests because no behavior change.
1255
1256         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
1257
1258         * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp.
1259         * dom/QualifiedName.cpp:
1260         (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct
1261         instead of placement new.
1262         * dom/QualifiedName.h: Use LazyNeverDestroyed.
1263
1264 2017-07-31  Matt Rajca  <mrajca@apple.com>
1265
1266         Support quirk for letting media autoplay if the user interacted with at least one media element.
1267         https://bugs.webkit.org/show_bug.cgi?id=175005
1268         <rdar://problem/33476038>
1269
1270         Reviewed by Eric Carlson.
1271
1272         If the user has interacted with at least one media element, let other media elements auto-play
1273         as a quirk.
1274
1275         * dom/Document.cpp:
1276         (WebCore::Document::updateIsPlayingMedia):
1277         * dom/Document.h:
1278         (WebCore::Document::noteUserInteractionWithMediaElement):
1279         * html/HTMLMediaElement.cpp:
1280         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
1281         * html/MediaElementSession.cpp:
1282         (WebCore::needsDocumentLevelMediaUserGestureQuirk):
1283         (WebCore::MediaElementSession::playbackPermitted const):
1284         * page/MediaProducer.h:
1285
1286 2017-07-31  Nan Wang  <n_wang@apple.com>
1287
1288         AX: CFEqual is failing on text markers with exact same data
1289         https://bugs.webkit.org/show_bug.cgi?id=175002
1290         <rdar://problem/33636985>
1291
1292         Reviewed by Chris Fleizach.
1293
1294         We should zero the memory of the TextMarkerData instance so that it
1295         can be tested for byte-equivalence.
1296
1297         Made sure this change won't break any of the existing tests.
1298
1299         * accessibility/AXObjectCache.cpp:
1300         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
1301         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
1302
1303 2017-07-28  Matt Rajca  <mrajca@apple.com>
1304
1305         Propagate user gesture tokens when script elements are loaded.
1306         https://bugs.webkit.org/show_bug.cgi?id=174959
1307
1308         Reviewed by Eric Carlson.
1309
1310         Propagate user gesture tokens when script elements are loaded (i.e. between the time an
1311         element is created and its onload handler is invoked).
1312
1313         * dom/ScriptElement.cpp:
1314         (WebCore::ScriptElement::ScriptElement):
1315         (WebCore::ScriptElement::dispatchLoadEventRespectingUserGestureIndicator):
1316         (WebCore::ScriptElement::executeScriptAndDispatchEvent):
1317         (WebCore::ScriptElement::executePendingScript):
1318         * dom/ScriptElement.h:
1319
1320 2017-07-31  Matt Lewis  <jlewis3@apple.com>
1321
1322         Unreviewed, rolling out r220048.
1323
1324         This revision caused multiple crashes in fast/images. See
1325         webkit.org/b/174990
1326
1327         Reverted changeset:
1328
1329         "RenderImageResourceStyleImage::image() should return the
1330         nullImage() if the image is not available"
1331         https://bugs.webkit.org/show_bug.cgi?id=174874
1332         http://trac.webkit.org/changeset/220048
1333
1334 2017-07-31  Sam Weinig  <sam@webkit.org>
1335
1336         Remove unnecessary exceptions from storage code
1337         https://bugs.webkit.org/show_bug.cgi?id=174572
1338
1339         Reviewed by Chris Dumez.
1340
1341         Remove checks for canAccessStorage() and the exceptions they would cause.
1342         These were used for Storage in ephemeral sessions, but they are now supported.
1343         Add checks for a null frame to functions that can mutate the storage, as the
1344         frame is needed for that, and it retains our existing behavior for disconnected
1345         frames. By removing these checks / exceptions, we can fully generate Storage.idl.
1346
1347         * CMakeLists.txt:
1348         * WebCore.xcodeproj/project.pbxproj:
1349         * bindings/js/JSBindingsAllInOne.cpp:
1350         * bindings/js/JSStorageCustom.cpp: Removed.
1351         Remove JSStorageCustom.cpp
1352
1353         * loader/EmptyClients.cpp:
1354         * page/DOMWindow.cpp:
1355         (WebCore::DOMWindow::sessionStorage):
1356         (WebCore::DOMWindow::localStorage):
1357         * storage/StorageArea.h:
1358         Remove canAccessStorage.
1359
1360         * storage/Storage.cpp:
1361         (WebCore::Storage::length):
1362         (WebCore::Storage::key):
1363         (WebCore::Storage::getItem):
1364         (WebCore::Storage::setItem):
1365         (WebCore::Storage::removeItem):
1366         (WebCore::Storage::clear):
1367         (WebCore::Storage::contains):
1368         (WebCore::Storage::isSupportedPropertyName):
1369         (WebCore::Storage::supportedPropertyNames):
1370         * storage/Storage.h:
1371         * storage/Storage.idl:
1372         Remove canAccessStorage checks and corresponding exceptions. Add supportedPropertyNames
1373         to allow the removal of the [CustomGetOwnPropertyNames].
1374
1375 2017-07-31  Matt Lewis  <jlewis3@apple.com>
1376
1377         Unreviewed, rolling out r220060.
1378
1379         This broke our internal builds. Contact reviewer of patch for
1380         more information.
1381
1382         Reverted changeset:
1383
1384         "Merge WTFThreadData to Thread::current"
1385         https://bugs.webkit.org/show_bug.cgi?id=174716
1386         http://trac.webkit.org/changeset/220060
1387
1388 2017-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1389
1390         Merge WTFThreadData to Thread::current
1391         https://bugs.webkit.org/show_bug.cgi?id=174716
1392
1393         Reviewed by Sam Weinig.
1394
1395         Use Thread::current() instead.
1396
1397         * fileapi/AsyncFileStream.cpp:
1398         * platform/ThreadGlobalData.cpp:
1399         (WebCore::ThreadGlobalData::ThreadGlobalData):
1400         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
1401         * platform/ios/wak/WebCoreThread.mm:
1402         (StartWebThread):
1403         * workers/WorkerThread.cpp:
1404         (WebCore::WorkerThread::workerThread):
1405
1406 2017-07-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1407
1408         Created a bool pretty printer at WTF for debugging purposes
1409         https://bugs.webkit.org/show_bug.cgi?id=174893
1410
1411         Reviewed by Darin Adler.
1412
1413         Use WTF::boolPrettyPrinter in debugging messages.
1414
1415         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1416         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
1417         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1418         (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
1419
1420 2017-07-30  Zan Dobersek  <zdobersek@igalia.com>
1421
1422         Unreviewed. Suppress the -Wextra compiler warning when building with GCC 6.3.0,
1423         explicitly initializing the RefCounted<> base class in the
1424         FetchHeaders(const FetchHeaders&) constructor.
1425
1426         Note that while that's the signature of the copy constructor for the FetchHeaders
1427         class, the base RefCounted<> class is not copyable, so the default RefCounted<>
1428         constructor is used, but the FetchHeaders resources are normally copied into the
1429         new object from the one that's passed in.
1430
1431         * Modules/fetch/FetchHeaders.h:
1432         (WebCore::FetchHeaders::FetchHeaders):
1433
1434 2017-07-30  Darin Adler  <darin@apple.com>
1435
1436         Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout
1437         https://bugs.webkit.org/show_bug.cgi?id=130653
1438
1439         Reviewed by Antti Koivisto.
1440
1441         Also fixes a bug where load events are delivered prematurely in some cases
1442         when an object, embed, frame, or iframe element is still loading.
1443
1444         * dom/Document.cpp:
1445         (WebCore::Document::loadEventDelayTimerFired): Added a call to
1446         FrameLoader::checkLoadComplete. Goes along with the change to
1447         FrameLoader::checkLoadCompleteForThisFrame, which now respects the
1448         isDelayingLoadEvent flag.
1449
1450         * html/HTMLAppletElement.cpp:
1451         (WebCore::HTMLAppletElement::HTMLAppletElement): Removed the createdByParser argument,
1452         no longer needed by the base class.
1453         (WebCore::HTMLAppletElement::create): Added call to finishCreating, which is now part of
1454         the process of creating any object in a class derived from HTMLPlugInImageElement.
1455         (WebCore::HTMLAppletElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
1456         is only called when it's becoming false; avoids a false/true/false round trip that can
1457         cause trouble.
1458         * html/HTMLAppletElement.h: Updated for the above.
1459
1460         * html/HTMLEmbedElement.cpp:
1461         (WebCore::HTMLEmbedElement::HTMLEmbedElement): Removed the createdByParser argument,
1462         no longer needed by the base class.
1463         (WebCore::HTMLEmbedElement::create): Added call to finishCreating, which is now part of
1464         the process of creating any object in a class derived from HTMLPlugInImageElement.
1465         (WebCore::HTMLEmbedElement::parseAttribute): Changed srcAttr to call
1466         updateImageLoaderWithNewURLSoon to do the image loading logic.
1467         (WebCore::HTMLEmbedElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
1468         is only called when it's becoming false; avoids a false/true/false round trip that can
1469         cause trouble.
1470         * html/HTMLEmbedElement.h: Updated for the above.
1471
1472         * html/HTMLMediaElement.cpp:
1473         (WebCore::HTMLMediaElement::setReadyState): Call setShouldDelayLoadEvent(false) when
1474         transitioning to HAVE_CURRENT_DATA (or beyond), even if we have already fired a loadeddata
1475         event in the past. This matches what the HTML specification calls for, but only if you
1476         read it carefully. Without this change, and with the more complete implementation of
1477         load event delay below, one of the regression tests hangs because are permanently stuck
1478         dealying load events. Also added a FIXME about other code that likely has a similar
1479         problem; the symptom is likely to be subtle and minor, though.
1480
1481         * html/HTMLObjectElement.cpp:
1482         (WebCore::HTMLObjectElement::HTMLObjectElement): Removed the createdByParser argument,
1483         no longer needed by the base class.
1484         (WebCore::HTMLObjectElement::create): Added call to finishCreating, which is now part of
1485         the process of creating any object in a class derived from HTMLPlugInImageElement.
1486         (WebCore::HTMLObjectElement::parseAttribute): Changed dataAttr to use
1487         updateImageLoaderWithNewURLSoon. Explicitly call scheduleUpdateForAfterStyleResolution
1488         since just calling invalidateStyleAndRenderersForSubtree alone is no longer sufficient.
1489         (WebCore::HTMLObjectElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
1490         is only called when it's becoming false; avoids a false/true/false round trip that can
1491         cause trouble.
1492         (WebCore::HTMLObjectElement::childrenChanged): Added calls to the new
1493         scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
1494         (WebCore::HTMLObjectElement::renderFallbackContent): Remove the call to
1495         updateStyleIfNeeded. This is the main change that the title of this bug refers to.
1496         * html/HTMLObjectElement.h: Updated for the above. Also removed the
1497         clearUseFallbackContent function because it's clearer to set the data member in
1498         line at the single call site in HTMLObjectElement::parseAttribute.
1499
1500         * html/HTMLPlugInImageElement.cpp:
1501         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Removed the createdByParser
1502         argument; no need to set an m_needsWidgetUpdate flag differently for parser cases now.
1503         (WebCore::HTMLPlugInImageElement::finshCreating): Added. To be called after creating
1504         an element to do work that can't be done in a constructor.
1505         (WebCore::HTMLPlugInImageElement::didRecalcStyle): Added. Calls the new
1506         scheduleUpdateForAfterStyleResolution function.
1507         (WebCore::HTMLPlugInImageElement::didAttachRenderers): Moved all the logic from this
1508         function into scheduleUpdateForAfterStyleResolution. Also added a call through to the base
1509         class; cleans things up, even though it's just an assertion.
1510         (WebCore::HTMLPlugInImageElement::willDetachRenderers): Removed the call to
1511         setNeedsWidgetUpdate(true) here; no longer needed because the new logic already
1512         does the right thing in this case.
1513         (WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary): Deleted. Now handled by
1514         updateAfterStyleResolution instead.
1515         (WebCore::HTMLPlugInImageElement::finishParsingChildren): Deleted. Handling updates
1516         after parsing all the children now comes naturally out of the new implementation.
1517         (WebCore::HTMLPlugInImageElement::scheduleUpdateForAfterStyleResolution): Added.
1518         Schedules a call to updateAfterStyleResolution when needed, and equally importantly,
1519         increments the load event delay count to make sure that loads that are part of that
1520         update can participate in decision about whether it's time for the load event.
1521         (WebCore::HTMLPlugInImageElement::updateAfterStyleResolution): Added.
1522         Combines updateWidgetIfNecessary and startLoadingImage, and also deals with the new
1523         m_needsImageReload boolean in cases where no actual loading is done.
1524         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Update load event delay
1525         count when moving an element that is in the middle of loading. This lets the
1526         updateAfterStyleResolution function do the right thing even when the element is
1527         moved without leaving anything stuck in a strange state.
1528         (WebCore::HTMLPlugInImageElement::prepareForDocumentSuspension): Call the new
1529         scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
1530         (WebCore::HTMLPlugInImageElement::startLoadingImage): Deleted. Now handled by
1531         updateAfterStyleResolution instead.
1532         (WebCore::HTMLPlugInImageElement::updateImageLoaderWithNewURLSoon): Added. Does all
1533         the right things for when an image URL is changed; for use by the concrete derived classes.
1534         * html/HTMLPlugInImageElement.h: Updated for above changes. Also made m_imageLoader
1535         private rather than protected, and added the two new boolean data members.
1536
1537         * html/HTMLTagNames.in: Removed unneeded constructorNeedsCreatedByParser flags for
1538         applet, embed, and object.
1539
1540         * loader/DocumentLoader.cpp:
1541         (WebCore::DocumentLoader::isLoadingInAPISense): Return true if the document is
1542         delaying a load event.
1543
1544         * loader/FrameLoader.cpp:
1545         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Don't do any work if
1546         isDelayingLoadEvent is true; otherwise this function can have a side effect of
1547         triggering the load event.
1548         (WebCore::FrameLoader::detachFromParent): Schedule a checkLoadComplete here, too, not
1549         just a checkCompleted. This is relevant if the frame we are detaching was delaying
1550         a load event because it no longer will be and so the load might be complete.
1551
1552 2017-07-30  Sam Weinig  <sam@webkit.org>
1553
1554         [WebIDL] Remove JS builtin bindings for FetchRequest, DOMWindowFetch and WorkerGlobalScopeFetch
1555         https://bugs.webkit.org/show_bug.cgi?id=174974
1556
1557         Reviewed by Darin Adler.
1558
1559         * CMakeLists.txt:
1560         * DerivedSources.make:
1561         * WebCore.xcodeproj/project.pbxproj:
1562         * Modules/fetch/DOMWindowFetch.js: Removed.
1563         * Modules/fetch/FetchRequest.js: Removed.
1564         * Modules/fetch/WorkerGlobalScopeFetch.js: Removed.
1565         Remove builtin files.
1566
1567         * Modules/fetch/DOMWindowFetch.cpp:
1568         (WebCore::DOMWindowFetch::fetch):
1569         * Modules/fetch/DOMWindowFetch.h:
1570         * Modules/fetch/DOMWindowFetch.idl:
1571         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
1572         (WebCore::WorkerGlobalScopeFetch::fetch):
1573         * Modules/fetch/WorkerGlobalScopeFetch.h:
1574         * Modules/fetch/WorkerGlobalScopeFetch.idl:
1575         Remove builtin and instead create FetchRequest in the implementation.
1576
1577         * Modules/fetch/FetchBody.cpp:
1578         (WebCore::FetchBody::extract):
1579         * Modules/fetch/FetchBody.h:
1580         * Modules/fetch/FetchBodyOwner.cpp:
1581         (WebCore::FetchBodyOwner::extractBody):
1582         * Modules/fetch/FetchBodyOwner.h:
1583         * Modules/fetch/FetchResponse.cpp:
1584         * Modules/fetch/FetchResponse.h:
1585         Rename FetchBody::BindingDataType to FetchBody::Init to match its IDL naming.
1586
1587         * Modules/fetch/FetchHeaders.cpp:
1588         (WebCore::appendToHeaderMap):
1589         (WebCore::fillHeaderMap):
1590         (WebCore::FetchHeaders::create):
1591         (WebCore::FetchHeaders::fill):
1592         * Modules/fetch/FetchHeaders.h:
1593         Add helpers to implement the fill algorithm for various input types.
1594         Leave the existing fill for now, as it is still used by the FetchResponse
1595         builtin, but will eventually be removed.
1596
1597         * Modules/fetch/FetchRequest.cpp:
1598         (WebCore::FetchRequest::initializeOptions):
1599         (WebCore::FetchRequest::initializeWith):
1600         (WebCore::FetchRequest::setBody):
1601         (WebCore::FetchRequest::create):
1602         (WebCore::FetchRequest::setBodyFromInputRequest): Deleted.
1603         * Modules/fetch/FetchRequest.h:
1604         Migrate builtin code to the implementation. This is 1-to-1 re-implementation,
1605         so I did not attempt to fix any conformance issues. That will come in follow up.
1606
1607         * Modules/fetch/FetchRequest.idl:
1608         Replace builtins with an IDL constructor.
1609
1610         * Modules/fetch/FetchRequestInit.h:
1611         * Modules/fetch/FetchRequestInit.idl:
1612         Add missing headers and body to FetchRequestInit.
1613
1614 2017-07-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1615
1616         RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available
1617         https://bugs.webkit.org/show_bug.cgi?id=174874
1618         <rdar://problem/33530130>
1619
1620         Reviewed by Darin Adler.
1621
1622         If an <img> element has image content data for a none cached image, e.g.
1623         -webkit-named-image, RenderImageResourceStyleImage will be created and 
1624         attached to the RenderImage. RenderImageResourceStyleImage::m_cachedImage
1625         will be set to null because the m_styleImage->isCachedImage() is false in
1626         this case. When ImageLoader finishes loading the url of the src attribute, 
1627         RenderImageResource::setCachedImage() will be called to set m_cachedImage.
1628
1629         A crash will happen when the RenderImage is destroyed. Destroying the 
1630         RenderImage calls RenderImageResourceStyleImage::shutdown() which checks
1631         m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image()
1632         which ends up calling CSSNamedImageValue::image() which returns a null pointer
1633         because the size is empty. RenderImageResourceStyleImage::shutdown() calls
1634         image()->stopAnimation() without checking the return value of image().
1635
1636         Like the base class virtual method RenderImageResource::image(), 
1637         RenderImageResourceStyleImage::image() should return the nullImage() if
1638         the image is not available.
1639
1640         Test: fast/images/image-element-image-content-data.html
1641
1642         * css/CSSCrossfadeValue.cpp:
1643         * css/CSSFilterImageValue.cpp:
1644         * page/EventHandler.cpp:
1645         * page/PageSerializer.cpp:
1646         * rendering/RenderElement.cpp:
1647         * rendering/RenderImageResource.cpp:
1648         * rendering/RenderImageResourceStyleImage.cpp:
1649         (WebCore::RenderImageResourceStyleImage::initialize):
1650
1651         (WebCore::RenderImageResourceStyleImage::shutdown): Revert back the changes
1652         of r208511 in this function. Add a call to image()->stopAnimation() without
1653         checking the return of image() since it will return the nullImage() if
1654         the image not available. There is no need to check m_cachedImage before 
1655         calling image() because image() does not check or access m_cachedImage.
1656
1657         (WebCore::RenderImageResourceStyleImage::image): The base class method
1658         RenderImageResource::image() returns the nullImage() if the image not
1659         available. This is because CachedImage::imageForRenderer() returns
1660         the nullImage() if the image is not available; see CachedImage.h. We should
1661         do the same for the derived class for consistency.
1662
1663         * rendering/style/ContentData.cpp:
1664         * rendering/style/StyleCachedImage.cpp:
1665         * style/StylePendingResources.cpp:
1666
1667 2017-07-29  Filip Pizlo  <fpizlo@apple.com>
1668
1669         Unreviewed, rollout r220044 because it set the bots on fire.
1670         
1671         It seems that the "-Wunguarded-availability-new" pragma is not widely supported. So, a bunch of the
1672         Mac bots are now unable to build and that includes EWS.
1673         
1674         Fixing by rolling it out.
1675
1676         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1677         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1678         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1679         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
1680         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
1681         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
1682         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1683         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1684         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
1685         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
1686         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
1687         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1688         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
1689         (WebCore::SourceBufferPrivateAVFObjC::flush):
1690
1691 2017-07-29  Dan Bernstein  <mitz@apple.com>
1692
1693         Fixed building for macOS 10.12 with the macOS 10.13 SDK.
1694
1695         Suppressed the unguarded-availability-new warning around uses of AVSampleBufferAudioRenderer
1696         and AVSampleBufferRenderSynchronizer. Even though the 10.13 SDK declares them as available
1697         starting in that release, they have been available as SPI earlier.
1698
1699         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1700         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1701         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1702         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
1703         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
1704         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
1705         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1706         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1707         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
1708         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
1709         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
1710         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1711         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
1712         (WebCore::SourceBufferPrivateAVFObjC::flush):
1713
1714 2017-07-29  Nan Wang  <n_wang@apple.com>
1715
1716         AX: findMatchingObjects doesn't work when the startObject is ignored
1717         https://bugs.webkit.org/show_bug.cgi?id=174965
1718
1719         Reviewed by Chris Fleizach.
1720
1721         findMatchingObjects would return a wrong element if we pass in an ignored
1722         start object. To fix this, we should use the closest accessible sibling as 
1723         the start object.
1724
1725         Test: accessibility/mac/search-predicate-from-ignored-element.html
1726
1727         * accessibility/AccessibilityObject.cpp:
1728         (WebCore::appendChildrenToArray):
1729
1730 2017-07-29  Aaron Chu  <aaron_chu@apple.com>
1731
1732         AX: FKA: Buttons need a visible focus indicator
1733         https://bugs.webkit.org/show_bug.cgi?id=171040
1734         <rdar://problem/30922548>
1735
1736         Reviewed by Antoine Quint.
1737
1738         Added a background color for the focus state of the icon buttons in modern media controls.
1739
1740         Test: media/modern-media-controls/button/button-focus-state.html
1741
1742         * Modules/modern-media-controls/controls/button.css:
1743         (button:focus):
1744         (button:focus > picture):
1745         * Modules/modern-media-controls/controls/slider.css:
1746         (.slider > input):
1747
1748 2017-07-28  Sam Weinig  <sam@webkit.org>
1749
1750         [WebIDL] Remove JS builtin bindings for FetchHeaders
1751         https://bugs.webkit.org/show_bug.cgi?id=174905
1752
1753         Reviewed by Alex Christensen.
1754
1755         * CMakeLists.txt:
1756         * DerivedSources.make:
1757         * WebCore.xcodeproj/project.pbxproj:
1758         * Modules/fetch/FetchHeaders.js: Removed.
1759         Remove FetchHeaders.js
1760
1761         * Modules/fetch/FetchHeaders.cpp:
1762         (WebCore::appendToHeaderMap):
1763         (WebCore::FetchHeaders::create):
1764         (WebCore::FetchHeaders::append):
1765         * Modules/fetch/FetchHeaders.h:
1766         (WebCore::FetchHeaders::FetchHeaders):
1767         Add create function for generated constructor.
1768         Add appendToHeaderMap static function which takes the functionality
1769         from the existing append function, and makes it useable in create.
1770
1771         * Modules/fetch/FetchHeaders.idl:
1772         Replace [JSBuiltinConstructor] with real constructor. Keep other builtin
1773         attributes as they are still used by other Fetch code.
1774
1775         * bindings/js/JSDOMConvertRecord.h:
1776         Fix record conversion to work with proxies by changing to use the method table
1777         for getOwnPropertyNames, and undefined values by not excluding undefined values. 
1778
1779 2017-07-28  Matt Baker  <mattbaker@apple.com>
1780
1781         Web Inspector: capture an async stack trace when web content calls addEventListener
1782         https://bugs.webkit.org/show_bug.cgi?id=174739
1783         <rdar://problem/33468197>
1784
1785         Reviewed by Brian Burg.
1786
1787         Test: inspector/debugger/async-stack-trace.html
1788
1789         Add instrumentation to EventTarget to support showing asynchronous
1790         stack traces when the debugger breaks in a script event listener.
1791
1792         * dom/EventTarget.cpp:
1793         (WebCore::EventTarget::addEventListener):
1794         (WebCore::EventTarget::removeEventListener):
1795         (WebCore::EventTarget::fireEventListeners):
1796         * inspector/InspectorInstrumentation.cpp:
1797         (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
1798         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
1799         (WebCore::InspectorInstrumentation::willHandleEventImpl):
1800         (WebCore::InspectorInstrumentation::didHandleEventImpl):
1801         * inspector/InspectorInstrumentation.h:
1802         (WebCore::InspectorInstrumentation::didAddEventListener):
1803         (WebCore::InspectorInstrumentation::willRemoveEventListener):
1804         (WebCore::InspectorInstrumentation::willHandleEvent):
1805         (WebCore::InspectorInstrumentation::didHandleEvent):
1806         * inspector/PageDebuggerAgent.cpp:
1807         (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
1808         (WebCore::PageDebuggerAgent::didAddEventListener):
1809         (WebCore::PageDebuggerAgent::willRemoveEventListener):
1810         (WebCore::PageDebuggerAgent::willHandleEvent):
1811         * inspector/PageDebuggerAgent.h:
1812
1813 2017-07-28  Matt Rajca  <mrajca@apple.com>
1814
1815         Don't add autoplay restrictions to media elements created in response to user gestures.
1816         https://bugs.webkit.org/show_bug.cgi?id=174947
1817
1818         Reviewed by Eric Carlson.
1819
1820         Test: media/video-create-with-user-gesture.html
1821
1822         * html/HTMLMediaElement.cpp:
1823         (WebCore::HTMLMediaElement::HTMLMediaElement):
1824
1825 2017-07-28  Jeremy Jones  <jeremyj@apple.com>
1826
1827         WebMediaSessionHelper calls -[UIApplication beginReceivingRemoteControlEvents] from WebThread
1828         https://bugs.webkit.org/show_bug.cgi?id=174934
1829         rdar://problem/33586772
1830
1831         Reviewed by Eric Carlson.
1832
1833         No new tests because no effect on DOM.
1834
1835         This dispatches a UIKit call to the main thread since it might happen on WebThread in WK1.
1836
1837         * platform/audio/ios/MediaSessionManagerIOS.mm:
1838         (-[WebMediaSessionHelper initWithCallback:]):
1839
1840 2017-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
1841
1842         [macOS] Reeder's defaults font is Times instead of San Francisco
1843         https://bugs.webkit.org/show_bug.cgi?id=174885
1844         <rdar://problem/33462483>
1845
1846         Reviewed by Simon Fraser.
1847
1848         Reeder uses explicit dot-prefixed names in its source code. Within Core Text,
1849         dot-prefixed names cannot be matched case insensitively. The solution is to
1850         not case-fold these family names, and to make our caches case sensitive for
1851         these special names.
1852
1853         Tests: fast/text/font-lookup-dot-prefix-case-sensitive-2.html
1854                fast/text/font-lookup-dot-prefix-case-sensitive.html
1855
1856         * platform/graphics/FontCache.cpp:
1857         (WebCore::FontPlatformDataCacheKey::operator==):
1858         (WebCore::FontPlatformDataCacheKeyHash::hash):
1859         * platform/graphics/FontCascade.cpp:
1860         (WebCore::keysMatch):
1861         (WebCore::computeFontCascadeCacheHash):
1862         * platform/graphics/FontDescription.cpp:
1863         (WebCore::FontCascadeDescription::familyNamesAreEqual):
1864         (WebCore::FontCascadeDescription::familyNameHash):
1865         (WebCore::FontCascadeDescription::foldedFamilyName):
1866         * platform/graphics/FontDescription.h:
1867         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1868         (WebCore::FontDatabase::fontForPostScriptName):
1869
1870 2017-07-28  Devin Rousso  <drousso@apple.com>
1871
1872         Web Inspector: Record actions performed on CanvasRenderingContext2D
1873         https://bugs.webkit.org/show_bug.cgi?id=174482
1874
1875         Reviewed by Joseph Pecoraro.
1876
1877         Tests: inspector/canvas/recording-2d.html
1878                inspector/canvas/recording.html
1879
1880         * html/canvas/CanvasRenderingContext2D.idl:
1881         Add CallTracingCallback to interface to record all API calls.
1882
1883         * html/HTMLCanvasElement.cpp:
1884         (WebCore::HTMLCanvasElement::paint):
1885         If a recording is active, mark the current frame as completed.
1886
1887         * bindings/scripts/CodeGeneratorJS.pm:
1888         (GenerateAttributeGetterBodyDefinition):
1889         (GenerateAttributeSetterBodyDefinition):
1890         (GenerateImplementationFunctionCall):
1891         (GenerateCallTracerParameter):
1892         (GenerateCallTracer):
1893         * bindings/scripts/test/TestCallTracer.idl:
1894         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1895         (WebCore::setJSTestCallTracerTestAttributeInterfaceSetter):
1896         (WebCore::setJSTestCallTracerTestAttributeSpecifiedSetter):
1897         (WebCore::jsTestCallTracerTestAttributeWithVariantGetter):
1898         (WebCore::jsTestCallTracerTestAttributeWithVariant):
1899         (WebCore::setJSTestCallTracerTestAttributeWithVariantSetter):
1900         (WebCore::setJSTestCallTracerTestAttributeWithVariant):
1901         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody):
1902         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody):
1903         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody):
1904         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody):
1905         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody):
1906         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument):
1907         * inspector/InspectorCanvas.h:
1908         * inspector/InspectorCanvas.cpp:
1909         (WebCore::InspectorCanvas::recordAction):
1910         (WebCore::InspectorCanvas::buildAction):
1911         Change CallTracer IDL generation to flatten any variants so that all types for the
1912         parameters of an action are able to be listed in a single variant. This prevents possible
1913         ambiguity when constructing the variant, as they require that exactly one type be
1914         constructible and a sub-variant might not satisfy that condition. This was only an issue for
1915         older mac SDKs.
1916
1917         * bindings/js/CallTracer.h:
1918         * bindings/js/CallTracer.cpp:
1919         (WebCore::CallTracer::recordCanvasAction):
1920         * bindings/js/CallTracerTypes.h:
1921         * inspector/InspectorCanvasAgent.h:
1922         * inspector/InspectorCanvasAgent.cpp:
1923         (WebCore::InspectorCanvasAgent::recordCanvasAction):
1924         * inspector/InspectorInstrumentation.h:
1925         * inspector/InspectorInstrumentation.cpp:
1926         (WebCore::InspectorInstrumentation::recordCanvasAction):
1927         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
1928         Rename CanvasActionParameterVariant to RecordCanvasActionVariant to match what is expected by
1929         the IDL generator. Also remove unnecessary includes now that they are in CallTracerTypes.h.
1930
1931         * CMakeLists.txt:
1932         * bindings/js/JSBindingsAllInOne.cpp:
1933         Add CallTracer for CMake builds.
1934
1935 2017-07-28  Sam Weinig  <sam@webkit.org>
1936
1937         [WebIDL] Split-up and cleanup Fetch IDL files in preparation for removing unnecessary js builtins
1938         https://bugs.webkit.org/show_bug.cgi?id=174915
1939
1940         Reviewed by Alex Christensen.
1941
1942         - Split FetchRequest enums and Init dictionary out of FetchRequest so they
1943           can be used from other files like WorkerGlobalScopeFetch and DOMWindowFetch.
1944         - Add missing FetchResponseInit. Currently unused but will be in a subsequent patch.
1945         - Add and update comments about missing properties and functions.
1946
1947         * CMakeLists.txt:
1948         * DerivedSources.make:
1949         * WebCore.xcodeproj/project.pbxproj:
1950         * Modules/fetch/DOMWindowFetch.idl:
1951         * Modules/fetch/FetchBody.idl:
1952         * Modules/fetch/FetchBodyOwner.h:
1953         * Modules/fetch/FetchHeaders.h:
1954         * Modules/fetch/FetchHeaders.idl:
1955         * Modules/fetch/FetchReferrerPolicy.h: Added.
1956         * Modules/fetch/FetchReferrerPolicy.idl: Added.
1957         * Modules/fetch/FetchRequest.h:
1958         * Modules/fetch/FetchRequest.idl:
1959         * Modules/fetch/FetchRequestCache.h: Added.
1960         * Modules/fetch/FetchRequestCache.idl: Added.
1961         * Modules/fetch/FetchRequestCredentials.h: Added.
1962         * Modules/fetch/FetchRequestCredentials.idl: Added.
1963         * Modules/fetch/FetchRequestInit.h: Added.
1964         * Modules/fetch/FetchRequestInit.idl: Added.
1965         * Modules/fetch/FetchRequestMode.h: Added.
1966         * Modules/fetch/FetchRequestMode.idl: Added.
1967         * Modules/fetch/FetchRequestRedirect.h: Added.
1968         * Modules/fetch/FetchRequestRedirect.idl: Added.
1969         * Modules/fetch/FetchResponse.h:
1970         * Modules/fetch/FetchResponse.idl:
1971         * Modules/fetch/WorkerGlobalScopeFetch.idl:
1972
1973 2017-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
1974
1975         REGRESSION(r216944): Fallback fonts erroneously visible when the primary font is loading
1976         https://bugs.webkit.org/show_bug.cgi?id=174772
1977         <rdar://problem/33267643>
1978
1979         Reviewed by Simon Fraser.
1980
1981         During a font load, we try pretty hard to find a font to use that isn't the
1982         last resort font (which happens to be Times). We do this by iterating through
1983         all the fonts in the font-family list, as well as through all the relevant
1984         @font-face blocks which share the requested font family name. 
1985
1986         Unfortunately, if we find one of these fallback fonts, we were simply using it
1987         directly, which means that it was being drawn as visible (because the
1988         visibility setting lives inside the Font object). Instead, we should carry the
1989         invisibility setting from the interstitial font to this used fallback font.
1990
1991         This patch is an extension of r219221, which fixed the problem only for system
1992         fallback fonts. This patch adopts the same methodology to all fallback fonts.
1993
1994         Test: http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html
1995
1996         * platform/graphics/FontCascadeFonts.cpp:
1997         (WebCore::FontCascadeFonts::glyphDataForVariant):
1998         (WebCore::glyphPageFromFontRanges):
1999         * platform/graphics/FontRanges.cpp:
2000         (WebCore::FontRanges::glyphDataForCharacter):
2001
2002 2017-07-28  Frederic Wang  <fwang@igalia.cpm>
2003
2004         Fix typo in scrollPositionChangedViaDelegatedScrolling
2005         https://bugs.webkit.org/show_bug.cgi?id=174937
2006
2007         Reviewed by Wenson Hsieh.
2008
2009         No new tests, fix typo in the inUserInteraction parameter.
2010
2011         * page/scrolling/ScrollingTree.cpp:
2012         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
2013         * page/scrolling/ScrollingTree.h:
2014
2015 2017-07-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2016
2017         [iOS DnD] [WK1] Snapshots generated using -[DOMRange renderImageForcingBlackText:] are upside down
2018         https://bugs.webkit.org/show_bug.cgi?id=174928
2019         <rdar://problem/33584280>
2020
2021         Reviewed by Tim Horton.
2022
2023         Pulls the implementation of createDragImageForRange out into DragImageIOS, and use TextIndicator to generate a
2024         snapshot instead of FrameSelection's snapshotting utilities. This makes snapshotting a DOMRange behave the same
2025         way as snapshotting a dragged selection.
2026
2027         No way of testing TextIndicator-based snapshotting yet.
2028
2029         * platform/DragImage.cpp:
2030
2031         Guard createDragImageForRange for !PLATFORM(IOS).
2032
2033         * platform/ios/DragImageIOS.mm:
2034         (WebCore::createDragImageForSelection):
2035
2036         Add a FIXME to point out that having an additional context flip inside the UIGraphicsImageRenderer block results
2037         in an upside-down drag image being returned from createDragImageFromImage. This image is being flipped elsewhere
2038         in drag initiation code, which eventually results in the correct orientation; we'll need further investigation
2039         to remove this extraneous flip.
2040
2041         (WebCore::createDragImageForRange):
2042
2043 2017-07-28  Jeremy Jones  <jeremyj@apple.com>
2044
2045         Remove Web prefix from WebVideoFullscreen and WebPlaybackSession classes.
2046         https://bugs.webkit.org/show_bug.cgi?id=174437
2047
2048         Reviewed by Darin Adler.
2049
2050         No new tests because no behavior change.
2051
2052         Remove redundant Web- prefix from classes in WebCore namespace.
2053
2054         * WebCore.xcodeproj/project.pbxproj:
2055         * html/HTMLMediaElement.cpp:
2056         * html/HTMLVideoElement.cpp:
2057         * platform/cocoa/PlaybackSessionInterface.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionInterface.h.
2058         (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface):
2059         * platform/cocoa/PlaybackSessionModel.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h.
2060         (WebCore::PlaybackSessionModel::~PlaybackSessionModel):
2061         (WebCore::PlaybackSessionModelClient::~PlaybackSessionModelClient):
2062         (WebCore::PlaybackSessionModelClient::externalPlaybackChanged):
2063         * platform/cocoa/PlaybackSessionModelMediaElement.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h.
2064         * platform/cocoa/PlaybackSessionModelMediaElement.mm: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm.
2065         * platform/cocoa/VideoFullscreenChangeObserver.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenChangeObserver.h.
2066         (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver):
2067         * platform/cocoa/VideoFullscreenModel.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h.
2068         (WebCore::VideoFullscreenModel::~VideoFullscreenModel):
2069         (WebCore::VideoFullscreenModelClient::~VideoFullscreenModelClient):
2070         * platform/cocoa/VideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h.
2071         (WebCore::VideoFullscreenModelVideoElement::create):
2072         * platform/cocoa/VideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm.
2073         * platform/ios/PlaybackSessionInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.h.
2074         * platform/ios/PlaybackSessionInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.mm.
2075         * platform/ios/VideoFullscreenInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h.
2076         * platform/ios/VideoFullscreenInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm.
2077         * platform/ios/WebAVPlayerController.h:
2078         * platform/ios/WebAVPlayerController.mm:
2079         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2080         * platform/mac/PlaybackSessionInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.h.
2081         * platform/mac/PlaybackSessionInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm.
2082         * platform/mac/VideoFullscreenInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h.
2083         * platform/mac/VideoFullscreenInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm.
2084         * platform/mac/WebPlaybackControlsManager.h:
2085         * platform/mac/WebPlaybackControlsManager.mm:
2086
2087 2017-07-27  Jeremy Jones  <jeremyj@apple.com>
2088
2089         Don't override _allowsMediaDocumentInlinePlayback in MediaDocument with playsinlineAttr.
2090         https://bugs.webkit.org/show_bug.cgi?id=174850
2091         rdar://problem/33449903
2092
2093         Reviewed by Jon Lee.
2094
2095         This change removes playsinlineAttr from MediaDocument so that it doesn't override the setting
2096         from _allowsMediaDocumentInlinePlayback. In its place is an update to requiresFullscreenForVideoPlayback
2097         that implements the details of exactly which media documents are still allowed to play inlne.
2098
2099         Media documents always use a video element; but when there are no video tracks, it has behavior like 
2100         an audio element. See media-controller.js isAudio().
2101
2102         This change preserves this behavior with respect to fullscreen requirements for media document by
2103         mirroring the isAudio() check in requiresFullscreenForVideoPlayback.
2104
2105         * html/MediaDocument.cpp:
2106         (WebCore::MediaDocumentParser::createDocumentStructure):
2107         * html/MediaElementSession.cpp:
2108         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
2109
2110 2017-07-27  Jeremy Jones  <jeremyj@apple.com>
2111
2112         MediaDocument fullscreen pinch gesture should trigger navigate back.
2113         https://bugs.webkit.org/show_bug.cgi?id=174914
2114
2115         Reviewed by Jon Lee.
2116
2117         No new tests because only effect is from interaction with platform.
2118
2119         For media documents, pressing the "done" button on fullscreen video navigates back
2120         to the previous page. The same should happen for other gestures that pause playback
2121         when returning to inline. This allows the gesture to have the same behavior as the
2122         button.
2123
2124         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2125         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
2126
2127 2017-07-27  Aaron Chu  <aaron_chu@apple.com>
2128
2129         AX: VoiceOver silent or skipping over time values on media player.
2130         https://bugs.webkit.org/show_bug.cgi?id=174324
2131         <rdar://problem/32021784>
2132
2133         Reviewed by Antoine Quint.
2134
2135         Added role attribute to modern media controls time lable class so that VoiceOver can access the time label when the media is playing.
2136
2137         Test Updated: media/modern-media-controls/time-label/time-label.html
2138         Test Added: media/modern-media-controls/time-label/ios-time-label.html
2139         
2140         * Modules/modern-media-controls/controls/time-label.js:
2141
2142 2017-07-27  Yusuke Suzuki  <utatane.tea@gmail.com>
2143
2144         Hoist DOM binding attribute getter prologue into JavaScriptCore taking advantage of DOMJIT / CheckSubClass
2145         https://bugs.webkit.org/show_bug.cgi?id=171637
2146
2147         Reviewed by Darin Adler.
2148
2149         We use DOMAttribute. When DOMAttribute is specified, ClassInfo check is performed by JSC side.
2150         So, we can drop ClassInfo check from the actual function.
2151
2152         We also simplify DOMJIT::GetterSetter to make it smaller size.
2153
2154         WebCore size comparison
2155             Before: 48443292
2156             After:  48087800 (0.7% reduction)
2157
2158         Speedometer Scores show 0.8% improvement.
2159             Before: 158.9 +- 0.46
2160             After:  160.2 +- 0.36
2161
2162         Dromaeo DOM core Scores show 5.8% improvement.
2163                                         Before                   After
2164             Total Score:         8424.12runs/s ±1.38%     8911.60runs/s ±1.47%
2165               DOM Attributes    12627.27runs/s ±1.87%    14023.17runs/s ±1.87%
2166               DOM Modification   1207.82runs/s ±2.48%     1204.21runs/s ±3.05%
2167               DOM Query         68068.82runs/s ±0.63%    74273.38runs/s ±0.69%
2168               DOM Traversal      1240.07runs/s ±1.96%     1256.64runs/s ±1.77%
2169
2170         Performance improvement can be explained by the following optimizations.
2171
2172         1. Type checks are typically eliminated in all the JIT tiers. IC / DFG / FTL can
2173            drop type checks since get_by_id operation already performs a structure check
2174            which subsumes this type check.
2175         2. Direct getter call by CallDOMGetter without creating IC in DFG and FTL.
2176
2177         * bindings/js/JSDOMAttribute.h:
2178         (WebCore::IDLAttribute::get):
2179         Add CastedThisErrorBehavior::Assert case. When this is specified, we perform casting without using jsDynamicCast.
2180
2181         * bindings/scripts/CodeGeneratorJS.pm:
2182         (IsAcceleratedDOMAttribute):
2183         (GetJSCAttributesForAttribute):
2184         (GenerateHeader):
2185         (GeneratePropertiesHashTable):
2186         (GenerateImplementation):
2187         (GenerateAttributeGetterTrampolineDefinition):
2188         (GenerateAttributeGetterDefinition):
2189         (GenerateCallbackImplementationContent):
2190         (GenerateHashTableValueArray):
2191         (GenerateHashTable):
2192         (GenerateConstructorHelperMethods):
2193         Update CodeGeneratorJS to emit DOMAttribute. And DOMJIT::GetterSetter becomes changed to be smaller size.
2194
2195         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2196         (WebCore::JSInterfaceNamePrototype::finishCreation):
2197         * bindings/scripts/test/JS/JSMapLike.cpp:
2198         (WebCore::JSMapLikePrototype::finishCreation):
2199         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2200         (WebCore::JSReadOnlyMapLikePrototype::finishCreation):
2201         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2202         (WebCore::JSTestActiveDOMObjectPrototype::finishCreation):
2203         (WebCore::jsTestActiveDOMObjectExcitingAttr):
2204         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2205         (WebCore::JSTestCEReactionsPrototype::finishCreation):
2206         (WebCore::jsTestCEReactionsAttributeWithCEReactions):
2207         (WebCore::jsTestCEReactionsReflectAttributeWithCEReactions):
2208         (WebCore::jsTestCEReactionsStringifierAttribute):
2209         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2210         (WebCore::JSTestCEReactionsStringifierPrototype::finishCreation):
2211         (WebCore::jsTestCEReactionsStringifierValue):
2212         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2213         (WebCore::JSTestCallTracerPrototype::finishCreation):
2214         (WebCore::jsTestCallTracerTestAttributeInterface):
2215         (WebCore::jsTestCallTracerTestAttributeSpecified):
2216         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
2217         (WebCore::JSTestCallbackInterfaceConstructor::initializeProperties):
2218         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2219         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::finishCreation):
2220         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2221         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
2222         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2223         (WebCore::JSTestDOMJITPrototype::finishCreation):
2224         (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT): Deleted.
2225         (WebCore::domJITGetterSetterForTestDOMJITAnyAttr): Deleted.
2226         (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT): Deleted.
2227         (WebCore::domJITGetterSetterForTestDOMJITBooleanAttr): Deleted.
2228         (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT): Deleted.
2229         (WebCore::domJITGetterSetterForTestDOMJITByteAttr): Deleted.
2230         (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT): Deleted.
2231         (WebCore::domJITGetterSetterForTestDOMJITOctetAttr): Deleted.
2232         (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT): Deleted.
2233         (WebCore::domJITGetterSetterForTestDOMJITShortAttr): Deleted.
2234         (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT): Deleted.
2235         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr): Deleted.
2236         (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT): Deleted.
2237         (WebCore::domJITGetterSetterForTestDOMJITLongAttr): Deleted.
2238         (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT): Deleted.
2239         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr): Deleted.
2240         (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT): Deleted.
2241         (WebCore::domJITGetterSetterForTestDOMJITLongLongAttr): Deleted.
2242         (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT): Deleted.
2243         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr): Deleted.
2244         (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT): Deleted.
2245         (WebCore::domJITGetterSetterForTestDOMJITFloatAttr): Deleted.
2246         (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT): Deleted.
2247         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr): Deleted.
2248         (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT): Deleted.
2249         (WebCore::domJITGetterSetterForTestDOMJITDoubleAttr): Deleted.
2250         (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT): Deleted.
2251         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr): Deleted.
2252         (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT): Deleted.
2253         (WebCore::domJITGetterSetterForTestDOMJITDomStringAttr): Deleted.
2254         (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT): Deleted.
2255         (WebCore::domJITGetterSetterForTestDOMJITByteStringAttr): Deleted.
2256         (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT): Deleted.
2257         (WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr): Deleted.
2258         (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT): Deleted.
2259         (WebCore::domJITGetterSetterForTestDOMJITNodeAttr): Deleted.
2260         (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT): Deleted.
2261         (WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr): Deleted.
2262         (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT): Deleted.
2263         (WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr): Deleted.
2264         (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT): Deleted.
2265         (WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr): Deleted.
2266         (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT): Deleted.
2267         (WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr): Deleted.
2268         (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT): Deleted.
2269         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr): Deleted.
2270         (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT): Deleted.
2271         (WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr): Deleted.
2272         (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT): Deleted.
2273         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr): Deleted.
2274         (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT): Deleted.
2275         (WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr): Deleted.
2276         (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT): Deleted.
2277         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr): Deleted.
2278         (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT): Deleted.
2279         (WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr): Deleted.
2280         (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT): Deleted.
2281         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr): Deleted.
2282         (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT): Deleted.
2283         (WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr): Deleted.
2284         (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT): Deleted.
2285         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr): Deleted.
2286         (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT): Deleted.
2287         (WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr): Deleted.
2288         (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT): Deleted.
2289         (WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr): Deleted.
2290         (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT): Deleted.
2291         (WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr): Deleted.
2292         (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT): Deleted.
2293         (WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr): Deleted.
2294         * bindings/scripts/test/JS/JSTestDOMJIT.h:
2295         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2296         (WebCore::JSTestEventConstructorPrototype::finishCreation):
2297         (WebCore::jsTestEventConstructorAttr1):
2298         (WebCore::jsTestEventConstructorAttr2):
2299         (WebCore::jsTestEventConstructorAttr3):
2300         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2301         (WebCore::JSTestEventTargetPrototype::finishCreation):
2302         * bindings/scripts/test/JS/JSTestException.cpp:
2303         (WebCore::JSTestExceptionPrototype::finishCreation):
2304         (WebCore::jsTestExceptionName):
2305         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2306         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
2307         (WebCore::jsTestGenerateIsReachableASecretAttribute):
2308         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2309         (WebCore::jsTestGlobalObjectRegularAttribute):
2310         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2311         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::finishCreation):
2312         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2313         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::finishCreation):
2314         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2315         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::finishCreation):
2316         * bindings/scripts/test/JS/JSTestInterface.cpp:
2317         (WebCore::JSTestInterfaceConstructor::initializeProperties):
2318         (WebCore::JSTestInterfacePrototype::finishCreation):
2319         (WebCore::jsTestInterfaceImplementsStr1):
2320         (WebCore::jsTestInterfaceImplementsStr2):
2321         (WebCore::jsTestInterfaceImplementsStr3):
2322         (WebCore::jsTestInterfaceImplementsNode):
2323         (WebCore::jsTestInterfaceSupplementalStr1):
2324         (WebCore::jsTestInterfaceSupplementalStr2):
2325         (WebCore::jsTestInterfaceSupplementalStr3):
2326         (WebCore::jsTestInterfaceSupplementalNode):
2327         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2328         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation):
2329         (WebCore::jsTestInterfaceLeadingUnderscoreReadonly):
2330         * bindings/scripts/test/JS/JSTestIterable.cpp:
2331         (WebCore::JSTestIterablePrototype::finishCreation):
2332         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2333         (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation):
2334         (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom):
2335         (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom):
2336         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2337         (WebCore::JSTestMediaQueryListListenerPrototype::finishCreation):
2338         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2339         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::finishCreation):
2340         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2341         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::finishCreation):
2342         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2343         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation):
2344         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2345         (WebCore::JSTestNamedConstructorPrototype::finishCreation):
2346         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2347         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::finishCreation):
2348         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2349         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::finishCreation):
2350         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2351         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::finishCreation):
2352         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2353         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::finishCreation):
2354         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2355         (WebCore::JSTestNamedGetterCallWithPrototype::finishCreation):
2356         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2357         (WebCore::JSTestNamedGetterNoIdentifierPrototype::finishCreation):
2358         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2359         (WebCore::JSTestNamedGetterWithIdentifierPrototype::finishCreation):
2360         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2361         (WebCore::JSTestNamedSetterNoIdentifierPrototype::finishCreation):
2362         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2363         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::finishCreation):
2364         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2365         (WebCore::JSTestNamedSetterWithIdentifierPrototype::finishCreation):
2366         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2367         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::finishCreation):
2368         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2369         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::finishCreation):
2370         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2371         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::finishCreation):
2372         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2373         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::finishCreation):
2374         (WebCore::jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute):
2375         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2376         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::finishCreation):
2377         (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute):
2378         * bindings/scripts/test/JS/JSTestNode.cpp:
2379         (WebCore::JSTestNodePrototype::finishCreation):
2380         (WebCore::jsTestNodeName):
2381         * bindings/scripts/test/JS/JSTestObj.cpp:
2382         (WebCore::JSTestObjConstructor::initializeProperties):
2383         (WebCore::JSTestObjPrototype::finishCreation):
2384         (WebCore::jsTestObjReadOnlyLongAttr):
2385         (WebCore::jsTestObjReadOnlyStringAttr):
2386         (WebCore::jsTestObjReadOnlyTestObjAttr):
2387         (WebCore::jsTestObjEnumAttr):
2388         (WebCore::jsTestObjByteAttr):
2389         (WebCore::jsTestObjOctetAttr):
2390         (WebCore::jsTestObjShortAttr):
2391         (WebCore::jsTestObjClampedShortAttr):
2392         (WebCore::jsTestObjEnforceRangeShortAttr):
2393         (WebCore::jsTestObjUnsignedShortAttr):
2394         (WebCore::jsTestObjLongAttr):
2395         (WebCore::jsTestObjLongLongAttr):
2396         (WebCore::jsTestObjUnsignedLongLongAttr):
2397         (WebCore::jsTestObjStringAttr):
2398         (WebCore::jsTestObjUsvstringAttr):
2399         (WebCore::jsTestObjTestObjAttr):
2400         (WebCore::jsTestObjTestNullableObjAttr):
2401         (WebCore::jsTestObjUnforgeableAttr):
2402         (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString):
2403         (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString):
2404         (WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyString):
2405         (WebCore::jsTestObjStringLongRecordAttr):
2406         (WebCore::jsTestObjUsvstringLongRecordAttr):
2407         (WebCore::jsTestObjStringObjRecordAttr):
2408         (WebCore::jsTestObjStringNullableObjRecordAttr):
2409         (WebCore::jsTestObjDictionaryAttr):
2410         (WebCore::jsTestObjNullableDictionaryAttr):
2411         (WebCore::jsTestObjAnnotatedTypeInUnionAttr):
2412         (WebCore::jsTestObjAnnotatedTypeInSequenceAttr):
2413         (WebCore::jsTestObjImplementationEnumAttr):
2414         (WebCore::jsTestObjXMLObjAttr):
2415         (WebCore::jsTestObjCreate):
2416         (WebCore::jsTestObjReflectedStringAttr):
2417         (WebCore::jsTestObjReflectedUSVStringAttr):
2418         (WebCore::jsTestObjReflectedIntegralAttr):
2419         (WebCore::jsTestObjReflectedUnsignedIntegralAttr):
2420         (WebCore::jsTestObjReflectedBooleanAttr):
2421         (WebCore::jsTestObjReflectedURLAttr):
2422         (WebCore::jsTestObjReflectedUSVURLAttr):
2423         (WebCore::jsTestObjReflectedCustomIntegralAttr):
2424         (WebCore::jsTestObjReflectedCustomBooleanAttr):
2425         (WebCore::jsTestObjReflectedCustomURLAttr):
2426         (WebCore::jsTestObjEnabledAtRuntimeAttribute):
2427         (WebCore::jsTestObjEnabledBySettingAttribute):
2428         (WebCore::jsTestObjTypedArrayAttr):
2429         (WebCore::jsTestObjAttributeWithGetterException):
2430         (WebCore::jsTestObjAttributeWithSetterException):
2431         (WebCore::jsTestObjStringAttrWithGetterException):
2432         (WebCore::jsTestObjStringAttrWithSetterException):
2433         (WebCore::jsTestObjCustomAttr):
2434         (WebCore::jsTestObjOnfoo):
2435         (WebCore::jsTestObjOnwebkitfoo):
2436         (WebCore::jsTestObjWithScriptStateAttribute):
2437         (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute):
2438         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
2439         (WebCore::jsTestObjWithScriptStateAttributeRaises):
2440         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
2441         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
2442         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
2443         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
2444         (WebCore::jsTestObjConditionalAttr1):
2445         (WebCore::jsTestObjConditionalAttr2):
2446         (WebCore::jsTestObjConditionalAttr3):
2447         (WebCore::jsTestObjCachedAttribute1):
2448         (WebCore::jsTestObjCachedAttribute2):
2449         (WebCore::jsTestObjAnyAttribute):
2450         (WebCore::jsTestObjObjectAttribute):
2451         (WebCore::jsTestObjContentDocument):
2452         (WebCore::jsTestObjMutablePoint):
2453         (WebCore::jsTestObjStrawberry):
2454         (WebCore::jsTestObjDescription):
2455         (WebCore::jsTestObjId):
2456         (WebCore::jsTestObjHash):
2457         (WebCore::jsTestObjReplaceableAttribute):
2458         (WebCore::jsTestObjNullableDoubleAttribute):
2459         (WebCore::jsTestObjNullableLongAttribute):
2460         (WebCore::jsTestObjNullableBooleanAttribute):
2461         (WebCore::jsTestObjNullableStringAttribute):
2462         (WebCore::jsTestObjNullableLongSettableAttribute):
2463         (WebCore::jsTestObjNullableStringSettableAttribute):
2464         (WebCore::jsTestObjNullableUSVStringSettableAttribute):
2465         (WebCore::jsTestObjNullableByteStringSettableAttribute):
2466         (WebCore::jsTestObjNullableStringValue):
2467         (WebCore::jsTestObjAttribute):
2468         (WebCore::jsTestObjAttributeWithReservedEnumType):
2469         (WebCore::jsTestObjPutForwardsAttribute):
2470         (WebCore::jsTestObjPutForwardsNullableAttribute):
2471         (WebCore::jsTestObjStringifierAttribute):
2472         (WebCore::jsTestObjConditionallyReadWriteAttribute):
2473         (WebCore::jsTestObjConditionalAndConditionallyReadWriteAttribute):
2474         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2475         (WebCore::JSTestOverloadedConstructorsPrototype::finishCreation):
2476         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2477         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::finishCreation):
2478         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2479         (WebCore::JSTestOverrideBuiltinsPrototype::finishCreation):
2480         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2481         (WebCore::JSTestPluginInterfacePrototype::finishCreation):
2482         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2483         (WebCore::JSTestPromiseRejectionEventPrototype::finishCreation):
2484         (WebCore::jsTestPromiseRejectionEventReason):
2485         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2486         (WebCore::JSTestSerializationPrototype::finishCreation):
2487         (WebCore::jsTestSerializationFirstStringAttribute):
2488         (WebCore::jsTestSerializationSecondLongAttribute):
2489         (WebCore::jsTestSerializationThirdUnserializableAttribute):
2490         (WebCore::jsTestSerializationFourthUnrestrictedDoubleAttribute):
2491         (WebCore::jsTestSerializationFifthLongAttribute):
2492         (WebCore::jsTestSerializationSixthTypedefAttribute):
2493         (WebCore::jsTestSerializationSeventhDirectlySerializableAttribute):
2494         (WebCore::jsTestSerializationEighthIndirectlyAttribute):
2495         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2496         (WebCore::JSTestSerializationIndirectInheritancePrototype::finishCreation):
2497         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2498         (WebCore::JSTestSerializationInheritPrototype::finishCreation):
2499         (WebCore::jsTestSerializationInheritInheritLongAttribute):
2500         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2501         (WebCore::JSTestSerializationInheritFinalPrototype::finishCreation):
2502         (WebCore::jsTestSerializationInheritFinalFinalLongAttributeFoo):
2503         (WebCore::jsTestSerializationInheritFinalFinalLongAttributeBar):
2504         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2505         (WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation):
2506         (WebCore::jsTestSerializedScriptValueInterfaceValue):
2507         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
2508         (WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
2509         (WebCore::jsTestSerializedScriptValueInterfacePorts):
2510         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
2511         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2512         (WebCore::JSTestStringifierPrototype::finishCreation):
2513         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2514         (WebCore::JSTestStringifierAnonymousOperationPrototype::finishCreation):
2515         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2516         (WebCore::JSTestStringifierNamedOperationPrototype::finishCreation):
2517         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2518         (WebCore::JSTestStringifierOperationImplementedAsPrototype::finishCreation):
2519         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2520         (WebCore::JSTestStringifierOperationNamedToStringPrototype::finishCreation):
2521         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2522         (WebCore::JSTestStringifierReadOnlyAttributePrototype::finishCreation):
2523         (WebCore::jsTestStringifierReadOnlyAttributeIdentifier):
2524         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2525         (WebCore::JSTestStringifierReadWriteAttributePrototype::finishCreation):
2526         (WebCore::jsTestStringifierReadWriteAttributeIdentifier):
2527         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2528         (WebCore::JSTestTypedefsConstructor::initializeProperties):
2529         (WebCore::JSTestTypedefsPrototype::finishCreation):
2530         (WebCore::jsTestTypedefsUnsignedLongLongAttr):
2531         (WebCore::jsTestTypedefsSerializedScriptValue):
2532         (WebCore::jsTestTypedefsAttributeWithClamp):
2533         (WebCore::jsTestTypedefsAttributeWithClampInTypedef):
2534         (WebCore::jsTestTypedefsAttrWithGetterException):
2535         (WebCore::jsTestTypedefsAttrWithSetterException):
2536         (WebCore::jsTestTypedefsStringAttrWithGetterException):
2537         (WebCore::jsTestTypedefsStringAttrWithSetterException):
2538         (WebCore::jsTestTypedefsBufferSourceAttr):
2539         (WebCore::jsTestTypedefsDomTimeStampAttr):
2540         They are binding test rebaselines.
2541
2542         * domjit/DOMJITIDLTypeFilter.h:
2543         * domjit/JSDocumentDOMJIT.cpp:
2544         (WebCore::compileDocumentDocumentElementAttribute):
2545         (WebCore::compileDocumentBodyAttribute):
2546         (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): Deleted.
2547         (WebCore::DocumentBodyDOMJIT::callDOMGetter): Deleted.
2548         * domjit/JSNodeDOMJIT.cpp:
2549         (WebCore::compileNodeFirstChildAttribute):
2550         (WebCore::compileNodeLastChildAttribute):
2551         (WebCore::compileNodeNextSiblingAttribute):
2552         (WebCore::compileNodePreviousSiblingAttribute):
2553         (WebCore::compileNodeParentNodeAttribute):
2554         (WebCore::compileNodeNodeTypeAttribute):
2555         (WebCore::compileNodeOwnerDocumentAttribute):
2556         (WebCore::NodeFirstChildDOMJIT::callDOMGetter): Deleted.
2557         (WebCore::NodeLastChildDOMJIT::callDOMGetter): Deleted.
2558         (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): Deleted.
2559         (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): Deleted.
2560         (WebCore::NodeParentNodeDOMJIT::callDOMGetter): Deleted.
2561         (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): Deleted.
2562         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted.
2563         DOMJIT::GetterSetter becomes smaller constexpr data.
2564
2565 2017-07-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2566
2567         [GStreamer][EME] Not having a key id buffer should not always error
2568         https://bugs.webkit.org/show_bug.cgi?id=174889
2569
2570         Reviewed by Žan Doberšek.
2571
2572         In r219946 we introduced a hard requirement for a key id buffer
2573         that does not happen for all CDMs.
2574
2575         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2576         (webKitMediaClearKeyDecryptorSetupCipher): Check for key id buffer
2577         and error if we didn't get it.
2578         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2579         (webkitMediaCommonEncryptionDecryptTransformInPlace): Soften the
2580         requirement for key id buffer.
2581
2582 2017-07-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2583
2584         [GStreamer][EME] Fix phony debug output in player base for supported key system
2585         https://bugs.webkit.org/show_bug.cgi?id=174888
2586
2587         Reviewed by Žan Doberšek.
2588
2589         The debug output was returning always false because that method
2590         was not checking anything before. Now it is and should reflect it.
2591
2592         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2593         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
2594
2595 2017-07-27  Zan Dobersek  <zdobersek@igalia.com>
2596
2597         [EME][GStreamer] Add barebones CDM interface implementations for ClearKey
2598         https://bugs.webkit.org/show_bug.cgi?id=174887
2599
2600         Reviewed by Xabier Rodriguez-Calvar.
2601
2602         Add empty ClearKey derivations of CDMFactory, CDMPrivate and CDMInstance
2603         classes. These will be enhanced as the implementation progresses.
2604
2605         ClearKey is added to CDMInstance::ImplementationType, and the
2606         CDMInstanceClearKey::implementationType() override returns that value.
2607         Type traits specialization for the CDMInstanceClearKey class is also
2608         added, utilizing the CDMInstance::ImplementationType::ClearKey value.
2609
2610         The implementation file is added to the WPE build, along with the
2611         necessary inclusion directory.
2612
2613         * PlatformWPE.cmake:
2614         * platform/encryptedmedia/CDMInstance.h:
2615         * platform/encryptedmedia/clearkey/CDMClearKey.cpp: Added.
2616         (WebCore::CDMFactoryClearKey::createCDM):
2617         (WebCore::CDMFactoryClearKey::supportsKeySystem):
2618         (WebCore::CDMPrivateClearKey::supportsInitDataType):
2619         (WebCore::CDMPrivateClearKey::supportsConfiguration):
2620         (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions):
2621         (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration):
2622         (WebCore::CDMPrivateClearKey::supportsRobustness):
2623         (WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement):
2624         (WebCore::CDMPrivateClearKey::persistentStateRequirement):
2625         (WebCore::CDMPrivateClearKey::distinctiveIdentifiersAreUniquePerOriginAndClearable):
2626         (WebCore::CDMPrivateClearKey::createInstance):
2627         (WebCore::CDMPrivateClearKey::loadAndInitialize):
2628         (WebCore::CDMPrivateClearKey::supportsServerCertificates):
2629         (WebCore::CDMPrivateClearKey::supportsSessions):
2630         (WebCore::CDMPrivateClearKey::supportsInitData):
2631         (WebCore::CDMPrivateClearKey::sanitizeResponse):
2632         (WebCore::CDMPrivateClearKey::sanitizeSessionId):
2633         (WebCore::CDMInstanceClearKey::initializeWithConfiguration):
2634         (WebCore::CDMInstanceClearKey::setDistinctiveIdentifiersAllowed):
2635         (WebCore::CDMInstanceClearKey::setPersistentStateAllowed):
2636         (WebCore::CDMInstanceClearKey::setServerCertificate):
2637         (WebCore::CDMInstanceClearKey::requestLicense):
2638         (WebCore::CDMInstanceClearKey::updateLicense):
2639         (WebCore::CDMInstanceClearKey::loadSession):
2640         (WebCore::CDMInstanceClearKey::closeSession):
2641         (WebCore::CDMInstanceClearKey::removeSessionData):
2642         (WebCore::CDMInstanceClearKey::storeRecordOfKeyUsage):
2643         * platform/encryptedmedia/clearkey/CDMClearKey.h: Added.
2644
2645 2017-07-27  Zan Dobersek  <zdobersek@igalia.com>
2646
2647         [EME] Allow CDMInstance type traits specialization
2648         https://bugs.webkit.org/show_bug.cgi?id=174886
2649
2650         Reviewed by Xabier Rodriguez-Calvar.
2651
2652         Allow using the trait-based type casting for the CDMInstance class and its
2653         derivatives. ImplementationType enumeration values are to be used and
2654         returned from the new implementationType() virtual method. This method is
2655         leveraged in the type trait specialization that enables using is<>() and
2656         downcast<>() helpers for CDMInstance objects.
2657
2658         This will allow differentiating between CDMInstance implementations once
2659         the media playback pipeline has to retrieve any key information that's
2660         necessary for playback of encrypted content.
2661
2662         MockCDMInstance class overrides the implementationType() method, returning
2663         the ImplementationType::Mock value. Type trait specializations for this
2664         class aren't added since they're not needed anywhere at this point.
2665
2666         * platform/encryptedmedia/CDMInstance.h:
2667         * testing/MockCDMFactory.h:
2668
2669 2017-07-27  Zan Dobersek  <zdobersek@igalia.com>
2670
2671         [GCrypt] Key serialization support
2672         https://bugs.webkit.org/show_bug.cgi?id=173883
2673
2674         Reviewed by Jiewen Tan.
2675
2676         Implement crypto key serialization for platforms that use libgcrypt.
2677
2678         Despite the function names and the existing implementation for the Mac port,
2679         we don't perform the KEK wrapping and unwrapping due to the review feedback
2680         advising against it.
2681
2682         Instead the passed-in key data is simply copied and returned as the result of
2683         the 'wrapping' operation, and similarly the passed-in serialized data is simply
2684         copied and returned as the result of the 'unwrapping' operation.
2685
2686         No new tests -- related tests are now passing and are unskipped.
2687
2688         * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp:
2689         (WebCore::getDefaultWebCryptoMasterKey):
2690         (WebCore::wrapSerializedCryptoKey):
2691         (WebCore::unwrapSerializedCryptoKey):
2692
2693 2017-07-26  Arnaud Renevier  <a.renevier@sisa.samsung.com> and Fujii Hironori  <Hironori.Fujii@sony.com>
2694
2695         Implement new TextMetrics, returned by canvas measureText()
2696         https://bugs.webkit.org/show_bug.cgi?id=82798
2697         <rdar://problem/11159332>
2698
2699         Reviewed by Dean Jackson.
2700
2701         The specification: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-measuretext
2702
2703         Add new attributes to TextMetrics.
2704
2705         Add a new method textOffset() of CanvasRenderingContext2D by
2706         extracting from drawTextInternal() to use the same horizontal and
2707         vertical offsets of a text in both drawTextInternal() and
2708         measureText().
2709
2710         Test: fast/canvas/canvas-measureText-2.html
2711
2712         * html/TextMetrics.h:
2713         (WebCore::TextMetrics::actualBoundingBoxLeft):
2714         (WebCore::TextMetrics::setActualBoundingBoxLeft):
2715         (WebCore::TextMetrics::actualBoundingBoxRight):
2716         (WebCore::TextMetrics::setActualBoundingBoxRight):
2717         (WebCore::TextMetrics::fontBoundingBoxAscent):
2718         (WebCore::TextMetrics::setFontBoundingBoxAscent):
2719         (WebCore::TextMetrics::fontBoundingBoxDescent):
2720         (WebCore::TextMetrics::setFontBoundingBoxDescent):
2721         (WebCore::TextMetrics::actualBoundingBoxAscent):
2722         (WebCore::TextMetrics::setActualBoundingBoxAscent):
2723         (WebCore::TextMetrics::actualBoundingBoxDescent):
2724         (WebCore::TextMetrics::setActualBoundingBoxDescent):
2725         (WebCore::TextMetrics::emHeightAscent):
2726         (WebCore::TextMetrics::setEmHeightAscent):
2727         (WebCore::TextMetrics::emHeightDescent):
2728         (WebCore::TextMetrics::setEmHeightDescent):
2729         (WebCore::TextMetrics::hangingBaseline):
2730         (WebCore::TextMetrics::setHangingBaseline):
2731         (WebCore::TextMetrics::alphabeticBaseline):
2732         (WebCore::TextMetrics::setAlphabeticBaseline):
2733         (WebCore::TextMetrics::ideographicBaseline):
2734         (WebCore::TextMetrics::setIdeographicBaseline):
2735         Added getters and setters.
2736         (WebCore::TextMetrics::TextMetrics): Deleted.
2737         * html/TextMetrics.idl: Added new attributes.
2738         * html/canvas/CanvasRenderingContext2D.cpp:
2739         (WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics):
2740         Changed the return value type to a const reference of FontMetrics
2741         not to copy it.
2742         (WebCore::CanvasRenderingContext2D::FontProxy::width):
2743         Added the second arguemnt of GlyphOverflow type.
2744         (WebCore::CanvasRenderingContext2D::measureText): Calculate and
2745         set the new attributes of TextMetrics.
2746         (WebCore::CanvasRenderingContext2D::textOffset): Extracted from drawTextInternal.
2747         (WebCore::CanvasRenderingContext2D::drawTextInternal): Removed the
2748         offset calculation code and call textOffset.
2749         * html/canvas/CanvasRenderingContext2D.h: Added the method
2750         declaration of textOffset. Change types of fontMetrics and width
2751         methods.
2752         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2753         (WebCore::FontCascade::floatWidthForComplexText): Added a dummy
2754         implementation of calculating GlyphOverflow.
2755
2756 2017-07-26  Devin Rousso  <drousso@apple.com>
2757
2758         Web Inspector: create protocol for recording Canvas contexts
2759         https://bugs.webkit.org/show_bug.cgi?id=174481
2760
2761         Reviewed by Joseph Pecoraro.
2762
2763         Currently, a recording doesn't actually "start" until an action is performed on the context.
2764         This change adds the recording logic, but it does not use it anywhere. Additonal tests will
2765         be added in the patches that add uses:
2766          - <https://webkit.org/b/174482> Web Inspector: Record actions performed on CanvasRenderingContext2D
2767          - <https://webkit.org/b/174483> Web Inspector: Record actions performed on WebGLRenderingContext
2768
2769         Test: inspector/model/recording.html
2770
2771         * bindings/scripts/IDLAttributes.json:
2772         * bindings/scripts/CodeGeneratorJS.pm:
2773         (GenerateAttributeGetterBodyDefinition):
2774         (GenerateAttributeSetterBodyDefinition):
2775         (GenerateImplementationFunctionCall):
2776         * WebCore.xcodeproj/project.pbxproj:
2777         * bindings/js/CallTracer.h: Added.
2778         * bindings/js/CallTracer.cpp: Added.
2779         (WebCore::CallTracer::recordCanvasAction):
2780         * bindings/js/CallTracerTypes.h: Added.
2781         * bindings/scripts/test/TestCallTracer.idl: Added.
2782         * bindings/scripts/test/JS/JSTestCallTracer.h: Added.
2783         * bindings/scripts/test/JS/JSTestCallTracer.cpp: Added.
2784
2785         Create new IDL extended attribute called "CallTracingCallback" that will add code to call a
2786         static function on CallTracer with the given extended attribute value as the function name,
2787         the `impl` object as the first parameter, the name of the attribute/operation as the second,
2788         and an optional object that accepts an initializer list of all the parameters as the third.
2789
2790         This function will not be called, however, unless a `callTracingActive` function on the
2791         `impl` object returns true, and this is marked as UNLIKELY.
2792
2793         "CallTracingCallback" can be added to an Interface, in which case it will apply to all
2794         attributes/operations of the generated class, or an individual Attribute/Operation.
2795
2796         * html/canvas/CanvasRenderingContext.h:
2797         (WebCore::CanvasRenderingContext::callTracingActive):
2798         (WebCore::CanvasRenderingContext::setCallTracingActive):
2799
2800         * inspector/InspectorCanvas.h:
2801         * inspector/InspectorCanvas.cpp:
2802         (WebCore::InspectorCanvas::~InspectorCanvas):
2803         (WebCore::InspectorCanvas::resetRecordingData):
2804         (WebCore::InspectorCanvas::hasRecordingData):
2805         (WebCore::InspectorCanvas::recordAction):
2806         (WebCore::InspectorCanvas::releaseInitialState):
2807         (WebCore::InspectorCanvas::releaseFrames):
2808         (WebCore::InspectorCanvas::releaseData):
2809         (WebCore::InspectorCanvas::markNewFrame):
2810         (WebCore::InspectorCanvas::markCurrentFrameIncomplete):
2811         (WebCore::InspectorCanvas::setBufferLimit):
2812         (WebCore::InspectorCanvas::hasBufferSpace):
2813         (WebCore::InspectorCanvas::singleFrame):
2814         (WebCore::InspectorCanvas::setSingleFrame):
2815         (WebCore::InspectorCanvas::indexForData):
2816         (WebCore::buildArrayForAffineTransform):
2817         (WebCore::buildArrayForVector):
2818         (WebCore::InspectorCanvas::buildInitialState):
2819         (WebCore::InspectorCanvas::buildAction):
2820         (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
2821         (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
2822         (WebCore::InspectorCanvas::buildArrayForImageData):
2823
2824         Hold the recording data on the corresponding InspectorCanvas. Recording Frames are
2825         completed when the HTMLCanvasElement paints or a  0_s timer is fired. A recording is not
2826         considered valid until at least one action is performed on the canvas context. Once that
2827         condition is satisfied, canceling the recording will flush the data.
2828
2829         * inspector/InspectorCanvasAgent.h:
2830         * inspector/InspectorCanvasAgent.cpp:
2831         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
2832         (WebCore::InspectorCanvasAgent::disable):
2833         (WebCore::InspectorCanvasAgent::requestRecording):
2834         (WebCore::InspectorCanvasAgent::cancelRecording):
2835         (WebCore::InspectorCanvasAgent::recordCanvasAction):
2836         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
2837         (WebCore::InspectorCanvasAgent::canvasDestroyed):
2838         (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired):
2839         (WebCore::InspectorCanvasAgent::clearCanvasData):
2840
2841         * inspector/InspectorInstrumentation.h:
2842         * inspector/InspectorInstrumentation.cpp:
2843         (WebCore::InspectorInstrumentation::recordCanvasAction):
2844         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
2845         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
2846
2847         * html/canvas/CanvasRenderingContext2D.h:
2848         * html/canvas/CanvasRenderingContext2D.cpp:
2849         (WebCore::CanvasRenderingContext2D::stringForWindingRule):
2850         (WebCore::CanvasRenderingContext2D::stringForImageSmoothingQuality):
2851
2852         * platform/graphics/Gradient.h:
2853         (WebCore::Gradient::stops):
2854
2855         * svg/SVGPathUtilities.h:
2856         * svg/SVGPathUtilities.cpp:
2857         (WebCore::buildStringFromPath):
2858
2859 2017-07-26  Ali Juma  <ajuma@chromium.org>
2860
2861         Implement document.elementsFromPoint
2862         https://bugs.webkit.org/show_bug.cgi?id=153137
2863
2864         Reviewed by Simon Fraser.
2865
2866         This ports Blink's implementation of elementsFromPoint, from the
2867         following patches by Philip Rogers (pdr@chromium.org):
2868         -https://src.chromium.org/viewvc/blink?revision=190686&view=revision
2869         -https://src.chromium.org/viewvc/blink?revision=191240&view=revision
2870         -https://src.chromium.org/viewvc/blink?revision=199214&view=revision
2871
2872         Tests: imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-iframes.html
2873                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-invalid-cases.html
2874                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-shadowroot.html
2875                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-simple.html
2876                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-svg.html
2877                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-table.html
2878
2879         * dom/DocumentOrShadowRoot.idl:
2880         * dom/TreeScope.cpp:
2881         (WebCore::absolutePointIfNotClipped):
2882         (WebCore::TreeScope::nodeFromPoint):
2883         (WebCore::TreeScope::elementFromPoint):
2884         (WebCore::TreeScope::elementsFromPoint):
2885         * dom/TreeScope.h:
2886         * page/EventHandler.cpp:
2887         (WebCore::EventHandler::hitTestResultAtPoint):
2888         * rendering/EllipsisBox.cpp:
2889         (WebCore::EllipsisBox::nodeAtPoint):
2890         * rendering/HitTestRequest.h:
2891         (WebCore::HitTestRequest::HitTestRequest):
2892         (WebCore::HitTestRequest::resultIsElementList):
2893         (WebCore::HitTestRequest::includesAllElementsUnderPoint):
2894         * rendering/HitTestResult.cpp:
2895         (WebCore::HitTestResult::HitTestResult):
2896         (WebCore::HitTestResult::operator=):
2897         (WebCore::HitTestResult::addNodeToListBasedTestResult):
2898         (WebCore::HitTestResult::append):
2899         (WebCore::HitTestResult::listBasedTestResult):
2900         (WebCore::HitTestResult::mutableListBasedTestResult):
2901         (WebCore::HitTestResult::addNodeToRectBasedTestResult): Deleted.
2902         (WebCore::HitTestResult::rectBasedTestResult): Deleted.
2903         (WebCore::HitTestResult::mutableRectBasedTestResult): Deleted.
2904         * rendering/HitTestResult.h:
2905         * rendering/InlineFlowBox.cpp:
2906         (WebCore::InlineFlowBox::nodeAtPoint):
2907         * rendering/InlineTextBox.cpp:
2908         (WebCore::InlineTextBox::nodeAtPoint):
2909         * rendering/RenderBlock.cpp:
2910         (WebCore::RenderBlock::nodeAtPoint):
2911         * rendering/RenderBox.cpp:
2912         (WebCore::RenderBox::nodeAtPoint):
2913         * rendering/RenderImage.cpp:
2914         (WebCore::RenderImage::nodeAtPoint):
2915         * rendering/RenderInline.cpp:
2916         (WebCore::RenderInline::hitTestCulledInline):
2917         * rendering/RenderLayer.cpp:
2918         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
2919         (WebCore::RenderLayer::hitTestLayer):
2920         (WebCore::RenderLayer::hitTestContents):
2921         (WebCore::RenderLayer::hitTestList):
2922         (WebCore::RenderLayer::calculateClipRects):
2923         * rendering/RenderTable.cpp:
2924         (WebCore::RenderTable::nodeAtPoint):
2925         * rendering/RenderTableSection.cpp:
2926         (WebCore::RenderTableSection::nodeAtPoint):
2927         * rendering/RenderWidget.cpp:
2928         (WebCore::RenderWidget::nodeAtPoint):
2929         * rendering/SimpleLineLayoutFunctions.cpp:
2930         (WebCore::SimpleLineLayout::hitTestFlow):
2931         * rendering/svg/RenderSVGContainer.cpp:
2932         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
2933         * rendering/svg/RenderSVGImage.cpp:
2934         (WebCore::RenderSVGImage::nodeAtFloatPoint):
2935         * rendering/svg/RenderSVGRoot.cpp:
2936         (WebCore::RenderSVGRoot::nodeAtPoint):
2937         * rendering/svg/RenderSVGShape.cpp:
2938         (WebCore::RenderSVGShape::nodeAtFloatPoint):
2939         * rendering/svg/SVGInlineTextBox.cpp:
2940         (WebCore::SVGInlineTextBox::nodeAtPoint):
2941         * testing/Internals.cpp:
2942         (WebCore::Internals::nodesFromRect):
2943
2944 2017-07-26  Charlie Turner  <cturner@igalia.com>
2945
2946         [GStreamer] Review WebKitWebSource after r219252.
2947         https://bugs.webkit.org/show_bug.cgi?id=174415
2948
2949         Reviewed by Carlos Garcia Campos.
2950
2951         Remove ResourceHandleStreamingClient, and flatten the StreamingClient
2952         into CachedResourceStreamingClient (the only implemetation left). They
2953         are no longer required after r219252.
2954
2955         Also remove the locking code. It's not needed now, and what existed
2956         was heavy-handed and missed several cases it was supposed to protect
2957
2958         Covered by existing tests.
2959
2960         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2961         (webkit_web_src_init):
2962         (webKitWebSrcDispose):
2963         (webKitWebSrcStop):
2964         (webKitWebSrcStart):
2965         (webKitWebSrcNeedData):
2966         (webKitWebSrcEnoughData):
2967         (webKitWebSrcSeek):
2968         (webKitWebSrcSetMediaPlayer):
2969         (CachedResourceStreamingClient::CachedResourceStreamingClient):
2970         (CachedResourceStreamingClient::~CachedResourceStreamingClient):
2971         (CachedResourceStreamingClient::getOrCreateReadBuffer):
2972         (CachedResourceStreamingClient::responseReceived):
2973         (CachedResourceStreamingClient::dataReceived):
2974         (CachedResourceStreamingClient::loadFinished):
2975         (ResourceHandleStreamingClient::create): Deleted.
2976         (): Deleted.
2977         (StreamingClient::StreamingClient): Deleted.
2978         (StreamingClient::~StreamingClient): Deleted.
2979         (StreamingClient::createReadBuffer): Deleted.
2980         (StreamingClient::handleResponseReceived): Deleted.
2981         (StreamingClient::handleDataReceived): Deleted.
2982         (StreamingClient::handleNotifyFinished): Deleted.
2983         (ResourceHandleStreamingClient::ResourceHandleStreamingClient): Deleted.
2984         (ResourceHandleStreamingClient::~ResourceHandleStreamingClient): Deleted.
2985         (ResourceHandleStreamingClient::cleanupAndStopRunLoop): Deleted.
2986         (ResourceHandleStreamingClient::invalidate): Deleted.
2987         (ResourceHandleStreamingClient::loadFailed): Deleted.
2988         (ResourceHandleStreamingClient::setDefersLoading): Deleted.
2989         (ResourceHandleStreamingClient::getOrCreateReadBuffer): Deleted.
2990         (ResourceHandleStreamingClient::willSendRequest): Deleted.
2991         (ResourceHandleStreamingClient::didReceiveResponse): Deleted.
2992         (ResourceHandleStreamingClient::didReceiveData): Deleted.
2993         (ResourceHandleStreamingClient::didReceiveBuffer): Deleted.
2994         (ResourceHandleStreamingClient::didFinishLoading): Deleted.
2995         (ResourceHandleStreamingClient::didFail): Deleted.
2996         (ResourceHandleStreamingClient::wasBlocked): Deleted.
2997         (ResourceHandleStreamingClient::cannotShowURL): Deleted.
2998
2999 2017-07-26  Brian Burg  <bburg@apple.com>
3000
3001         Remove WEB_TIMING feature flag
3002         https://bugs.webkit.org/show_bug.cgi?id=174795
3003
3004         Reviewed by Alex Christensen.
3005
3006         * Configurations/FeatureDefines.xcconfig:
3007         * bindings/js/JSPerformanceEntryCustom.cpp:
3008         * dom/Document.cpp:
3009         (WebCore::Document::setReadyState):
3010         (WebCore::Document::finishedParsing):
3011         * dom/Document.h:
3012         (WebCore::Document::timing):
3013         * dom/DocumentTiming.h:
3014         * dom/EventTargetFactory.in:
3015         * loader/DocumentThreadableLoader.cpp:
3016         (WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad):
3017         (WebCore::DocumentThreadableLoader::loadRequest):
3018         * loader/DocumentThreadableLoader.h:
3019         * loader/ResourceTimingInformation.cpp:
3020         * loader/ResourceTimingInformation.h:
3021         * loader/SubresourceLoader.cpp:
3022         (WebCore::SubresourceLoader::didFinishLoading):
3023         (WebCore::SubresourceLoader::reportResourceTiming):
3024         * loader/SubresourceLoader.h:
3025         * loader/ThreadableLoaderClient.h:
3026         (WebCore::ThreadableLoaderClient::didFail):
3027         (WebCore::ThreadableLoaderClient::didFinishTiming):
3028         * loader/WorkerThreadableLoader.cpp:
3029         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
3030         * loader/WorkerThreadableLoader.h:
3031         * loader/cache/CachedResourceLoader.cpp:
3032         (WebCore::CachedResourceLoader::requestResource):
3033         (WebCore::CachedResourceLoader::revalidateResource):
3034         (WebCore::CachedResourceLoader::loadResource):
3035         * loader/cache/CachedResourceLoader.h:
3036         (WebCore::CachedResourceLoader::resourceTimingInformation):
3037         * page/DOMWindow.cpp:
3038         (WebCore::DOMWindow::~DOMWindow):
3039         (WebCore::DOMWindow::resetDOMWindowProperties):
3040         (WebCore::DOMWindow::nowTimestamp):
3041         (WebCore::DOMWindow::removeAllEventListeners):
3042         * page/DOMWindow.h:
3043         * page/GlobalPerformance.idl:
3044         * page/Performance.cpp:
3045         * page/Performance.h:
3046         * page/Performance.idl:
3047         * page/PerformanceEntry.cpp:
3048         * page/PerformanceEntry.h:
3049         * page/PerformanceEntry.idl:
3050         * page/PerformanceMark.h:
3051         * page/PerformanceMark.idl:
3052         * page/PerformanceMeasure.h:
3053         * page/PerformanceMeasure.idl:
3054         * page/PerformanceNavigation.cpp:
3055         * page/PerformanceNavigation.h:
3056         * page/PerformanceNavigation.idl:
3057         * page/PerformanceObserver.cpp:
3058         * page/PerformanceObserver.h:
3059         * page/PerformanceObserver.idl:
3060         * page/PerformanceObserverCallback.h:
3061         * page/PerformanceObserverCallback.idl:
3062         * page/PerformanceObserverEntryList.cpp:
3063         * page/PerformanceObserverEntryList.h:
3064         * page/PerformanceObserverEntryList.idl:
3065         * page/PerformanceResourceTiming.cpp:
3066         * page/PerformanceResourceTiming.h:
3067         * page/PerformanceResourceTiming.idl:
3068         * page/PerformanceTiming.cpp:
3069         * page/PerformanceTiming.h:
3070         * page/PerformanceTiming.idl:
3071         * page/PerformanceUserTiming.cpp:
3072         * page/PerformanceUserTiming.h:
3073         * platform/network/ResourceHandle.h:
3074         * platform/network/ResourceHandleInternal.h:
3075         * platform/network/cf/ResourceHandleCFNet.cpp:
3076         (WebCore::ResourceHandle::start):
3077         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3078         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
3079         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
3080         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
3081         * platform/network/curl/ResourceHandleCurl.cpp:
3082         (WebCore::ResourceHandleInternal::didFinish):
3083         (WebCore::ResourceHandleInternal::calculateWebTimingInformations):
3084         (WebCore::ResourceHandleInternal::dispatchSynchronousJob):
3085         * platform/network/mac/ResourceHandleMac.mm:
3086         (WebCore::ResourceHandle::createNSURLConnection):
3087         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
3088         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
3089         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3090         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
3091         * platform/network/soup/ResourceHandleSoup.cpp:
3092         (WebCore::restartedCallback):
3093         (WebCore::sendRequestCallback):
3094         (WebCore::createSoupMessageForHandleAndRequest):
3095         (WebCore::ResourceHandle::sendPendingRequest):
3096         * platform/network/soup/SoupNetworkSession.cpp:
3097         (WebCore::SoupNetworkSession::SoupNetworkSession):
3098         * workers/WorkerGlobalScope.cpp:
3099         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
3100         (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
3101         (WebCore::WorkerGlobalScope::removeAllEventListeners):
3102         * workers/WorkerGlobalScope.h:
3103
3104 2017-07-26  Chris Dumez  <cdumez@apple.com>
3105
3106         Pressing the Escape key should not be a valid user gesture to enter fullscreen
3107         https://bugs.webkit.org/show_bug.cgi?id=174864
3108         <rdar://problem/33009088>
3109
3110         Reviewed by Geoffrey Garen.
3111
3112         Pressing the Escape key should not be a valid user gesture to enter fullscreen since this
3113         is the gesture to exit fullscreen already.
3114
3115         Test: fullscreen/requestFullscreen-escape-key.html
3116
3117         * dom/Document.cpp:
3118         (WebCore::Document::requestFullScreenForElement):
3119         * dom/UserGestureIndicator.cpp:
3120         (WebCore::UserGestureIndicator::UserGestureIndicator):
3121         * dom/UserGestureIndicator.h:
3122         (WebCore::UserGestureToken::create):
3123         (WebCore::UserGestureToken::gestureType):
3124         (WebCore::UserGestureToken::UserGestureToken):
3125         * page/EventHandler.cpp:
3126         (WebCore::EventHandler::internalKeyEvent):
3127
3128 2017-07-26  Nan Wang  <n_wang@apple.com>
3129
3130         AX: Incorrect range from index and length in contenteditable with <p> tags
3131         https://bugs.webkit.org/show_bug.cgi?id=174856
3132
3133         Reviewed by Chris Fleizach.
3134
3135         When asking for the string inside a text control with a given range, we sometimes get
3136         a wrong string at the line boundary due to a bad plain range to text marker conversion.
3137         To fix this, we should use the exsisting method on text controls to avoid this issue. 
3138
3139         Updated the test to test the problematic case.
3140
3141         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3142         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
3143
3144 2017-07-26  Daewoong Jang  <daewoong.jang@navercorp.com>
3145
3146         [Curl] Bug fix after r219606
3147         https://bugs.webkit.org/show_bug.cgi?id=174845
3148
3149         Reviewed by Alex Christensen.
3150
3151         * platform/network/curl/CurlContext.h:
3152         (WebCore::CurlSList::isEmpty):
3153         * platform/network/curl/ResourceHandleCurl.cpp:
3154         (WebCore::ResourceHandleInternal::didReceiveHeaderLine):
3155         (WebCore::ResourceHandleInternal::headerCallback):
3156
3157 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
3158
3159         [EME][GStreamer] Multi-key support in the GStreamer ClearKey decryptor
3160         https://bugs.webkit.org/show_bug.cgi?id=174779
3161
3162         Reviewed by Xabier Rodriguez-Calvar.
3163
3164         In the CENC decryptor, the key ID value is retrieved from the info structure
3165         on the GstProtectionMeta object. GstBuffer for that value is retrieved and
3166         passed to the setupCipher() function.
3167
3168         In the ClearKey decryptor (which extends the CENC decryptor), the single
3169         GstBuffer object on the private instance that holds the key value is replaced
3170         with a Vector object that holds pairs of key ID and value GstBuffers. In the
3171         handleKeyResponse() implementation that Vector is emptied and then refilled
3172         with key ID and value pairs that are passed in through the drm-cipher-clearkey
3173         structure that's attached to the GstEvent that signalled new key information.
3174
3175         In the ClearKey decryptor's setupCipher() implementation the passed-in key ID
3176         buffer is used to find a matching key ID and value pair stored on the private
3177         instance. If not found, an error is thrown. If found, the matching key value
3178         is used for decryption.
3179
3180         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
3181         (webKitMediaClearKeyDecryptorHandleKeyResponse):
3182         (webKitMediaClearKeyDecryptorSetupCipher):
3183         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
3184         (webkitMediaCommonEncryptionDecryptTransformInPlace):
3185         (webKitMediaCommonEncryptionDecryptDefaultSetupCipher):
3186         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
3187
3188 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
3189
3190         [EME][GStreamer] Handle ClearKey as a supported key system
3191         https://bugs.webkit.org/show_bug.cgi?id=174778
3192
3193         Reviewed by Xabier Rodriguez-Calvar.
3194
3195         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3196         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
3197         Return true for the 'org.w3.clearkey' key system when building with
3198         ENCRYPTED_MEDIA enabled. The underlying implementation will follow.
3199
3200 2017-07-26  Claudio Saavedra  <csaavedra@igalia.com>
3201
3202         [WPE] Fix a potential crash in the platform pasteboard when reading a string
3203         https://bugs.webkit.org/show_bug.cgi?id=174859
3204
3205         Reviewed by Žan Doberšek.
3206
3207         We shouldn't assume that the wpe_pasteboard_string struct will be
3208         filled in, so initialize it.
3209
3210         * platform/wpe/PlatformPasteboardWPE.cpp:
3211         (WebCore::PlatformPasteboard::readString): Initialize the struct
3212         before passing it to wpe and early return if it's still empty.
3213
3214 2017-07-26  Javier Fernandez  <jfernandez@igalia.com>
3215
3216         InsertOrderedList command applied to table cells inserts an extra BR before the table
3217         https://bugs.webkit.org/show_bug.cgi?id=174593
3218
3219         Reviewed by Darin Adler.
3220
3221         Don't add BR when pruning empty blocks if it's the start of a paragraph.
3222
3223         The function MoveParagraph is used for several operations and editing
3224         commands, like 'insertOrderedList'. When moving paragraphs we check out
3225         whether we should add a 'br' element to avoid undesired block collapse.
3226
3227         However, we shouldn't do this when destination is the start of a
3228         paragraph.
3229
3230         Tests: editing/inserting/insert-list-in-table-cell-01.html
3231                editing/inserting/insert-list-in-table-cell-02.html
3232                editing/inserting/insert-list-in-table-cell-03.html
3233                editing/inserting/insert-list-in-table-cell-04.html
3234                editing/inserting/insert-list-in-table-cell-05.html
3235                editing/inserting/insert-list-in-table-cell-06.html
3236                editing/inserting/insert-list-in-table-cell-07.html
3237                editing/inserting/insert-list-in-table-cell-08.html
3238
3239         * editing/CompositeEditCommand.cpp:
3240         (WebCore::CompositeEditCommand::moveParagraphs):
3241
3242 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
3243
3244         [WPE] WebGL2 support
3245         https://bugs.webkit.org/show_bug.cgi?id=174249
3246
3247         Reviewed by Alex Christensen.
3248
3249         Implement WebGL2 support in GraphicsContext3DCairo for the WPE port, but keep
3250         the implementation specific to libepoxy (which WPE leverages by default).
3251
3252         In the GraphicsContext3D::create() method, we first construct the
3253         GraphicsContext3D object that also ensures a current GL context on this thread.
3254         Only then can we determine through libepoxy whether the underlying GL library
3255         is able to support WebGL2.
3256
3257         For WebGL2, the GLES3 support is required. The initial libepoxy implementation
3258         ensures this only in case of 'non-desktop GL' library of minimum version 3.0.
3259         This effectively translates to the only supported configuration being the
3260         EGL and OpenGL ES 3.0 (or higher) combination. If this cannot be ensured, we
3261         discard the existing GraphicsContext3D object and return null.
3262
3263         WebGL2 can also be supported via OpenGL (i.e. 'desktop GL'), but this hasn't
3264         been tested yet. Implementation will in the future be extended to support that
3265         as required.
3266
3267         In the GraphicsContext3D constructor itself, the ANGLEWebKitBridge constructor
3268         has to now receive the second argument, the desired shader specification that's
3269         used when parsing the provided shaders. This should be SH_WEBGL_SPEC for WebGL1,
3270         and SH_WEBGL2_SPEC for WebGL2.
3271
3272         No new tests -- a small set of existing WebGL2 tests is unskipped and passing.
3273
3274         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3275         (WebCore::GraphicsContext3D::create):
3276         (WebCore::GraphicsContext3D::GraphicsContext3D):
3277         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3278         Add WebGL2-specific methods to the build.
3279
3280 2017-07-26  Nan Wang  <n_wang@apple.com>
3281
3282         AX: should dispatch accessibilityPerformPressAction async on MacOS
3283         https://bugs.webkit.org/show_bug.cgi?id=174849
3284
3285         Reviewed by Chris Fleizach.
3286
3287         If performing the accessibility press action results in a modal alert being displayed,
3288         it can cause VoiceOver to hang. To fix it, we should dispatch the action asynchronously.
3289
3290         Updated tests to adapt to this change.
3291
3292         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3293         (-[WebAccessibilityObjectWrapper accessibilityPerformPressAction]):
3294         (-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]):
3295
3296 2017-07-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3297
3298         Icon loader error on startup
3299         https://bugs.webkit.org/show_bug.cgi?id=174787
3300
3301         Reviewed by Brady Eidson.
3302
3303         This is a regression of the new icon loading, it happens with pages that shouldn't have a favicon, like about
3304         pages. IconController::startLoader() did several checks before starting the load that
3305         DocumentLoader::startIconLoading() is not doing. It checked that the frame is the main one, the document can have
3306         an icon (document url is not empty and not about:blank) and that favicon url is in HTTP family. We should do the
3307         same checks now before starting to load icons.
3308
3309         * loader/DocumentLoader.cpp:
3310         (WebCore::DocumentLoader::startIconLoading):
3311
3312 2017-07-25  Sam Weinig  <sam@webkit.org>
3313
3314         [WebIDL] Remove custom bindings for HTMLCanvasElement
3315         https://bugs.webkit.org/show_bug.cgi?id=174847
3316
3317         Reviewed by Darin Adler.
3318
3319         * CMakeLists.txt:
3320         * WebCore.xcodeproj/project.pbxproj:
3321         * bindings/js/JSBindingsAllInOne.cpp:
3322         * bindings/js/JSHTMLCanvasElementCustom.cpp: Removed.
3323         Remove JSHTMLCanvasElementCustom.
3324
3325         * html/HTMLCanvasElement.cpp:
3326         (WebCore::HTMLCanvasElement::getContext):
3327         (WebCore::HTMLCanvasElement::getContext2d):
3328         (WebCore::HTMLCanvasElement::getContextWebGL):
3329         (WebCore::HTMLCanvasElement::getContextWebGPU):
3330         * html/HTMLCanvasElement.h:
3331         * html/HTMLCanvasElement.idl:
3332         Move context picking code to HTMLCanvasElement. Give more
3333         exact types to remaining context getters.
3334
3335 2017-07-25  Chris Dumez  <cdumez@apple.com>
3336
3337         Clean up ExceptionCode enumeration
3338         https://bugs.webkit.org/show_bug.cgi?id=174812
3339
3340         Reviewed by Darin Adler.
3341
3342         Clean up ExceptionCode enumeration:
3343         - Updated comments to reflect the latest WebIDL specification
3344         - Drop special values given to some exception codes. Those legacy codes are already in the
3345           table inside DOMException.cpp. This also allows us to drop empty rows in the DOMException
3346           table
3347         - Drop NoException value in the enumeration and use std::optional<ExceptionCode> when needed
3348           instead.
3349
3350         * Modules/indexeddb/shared/IDBError.cpp:
3351         (WebCore::IDBError::IDBError):
3352         (WebCore::IDBError::name):
3353         (WebCore::IDBError::message):
3354         * Modules/indexeddb/shared/IDBError.h:
3355         (WebCore::IDBError::code):
3356         (WebCore::IDBError::encode):
3357         (WebCore::IDBError::decode):
3358         * dom/DOMException.cpp:
3359         * dom/ExceptionCode.h:
3360         * fileapi/FileReaderSync.cpp:
3361         (WebCore::errorCodeToException):
3362         (WebCore::FileReaderSync::startLoading):
3363         * xml/XMLHttpRequest.cpp:
3364         (WebCore::XMLHttpRequest::createRequest):
3365         * xml/XMLHttpRequest.h:
3366
3367 2017-07-25  Andy Estes  <aestes@apple.com>
3368
3369         [Apple Pay] Add "carteBancaire" as a supported payment network
3370         https://bugs.webkit.org/show_bug.cgi?id=174841
3371         <rdar://problem/31935596>
3372
3373         Reviewed by Alex Christensen.
3374
3375         Tests: http/tests/ssl/applepay/ApplePaySession.html
3376                http/tests/ssl/applepay/ApplePaySessionV3.html
3377
3378         * Modules/applepay/PaymentRequest.cpp:
3379         (WebCore::PaymentRequest::isValidSupportedNetwork):
3380
3381 2017-07-25  Daniel Bates  <dabates@apple.com>
3382
3383         Make StyleResolver::isValid{Cue, Region}StyleProperty() static, inline, non-member functions
3384         https://bugs.webkit.org/show_bug.cgi?id=174827
3385
3386         Reviewed by Simon Fraser.
3387
3388         StyleResolver::isValid{Cue, Region}StyleProperty() access neither instance nor
3389         class data. Moreover, they are private member functions and hence cannot be
3390         used outside of StyleResolver's implementation. So, make these static, inline,
3391         non-member functions.
3392
3393         * css/StyleResolver.cpp:
3394         (WebCore::isValidRegionStyleProperty):
3395         (WebCore::isValidCueStyleProperty):
3396         (WebCore::StyleResolver::CascadedProperties::addMatch):
3397         (WebCore::StyleResolver::isValidRegionStyleProperty): Deleted.
3398         (WebCore::StyleResolver::isValidCueStyleProperty): Deleted.
3399         * css/StyleResolver.h:
3400
3401 2017-07-25  Per Arne Vollan  <pvollan@apple.com>
3402
3403         Dragged links are blurry on 1x displays.
3404         https://bugs.webkit.org/show_bug.cgi?id=174831
3405         <rdar://problem/33519698>
3406
3407         Reviewed by Simon Fraser.
3408
3409         When the width and height of the drag image is a multiple of 2, the drag image is not blurry
3410         on a 1x display. This is a workaround which should be removed when <rdar://problem/33059739>
3411         is fixed.
3412
3413         No new tests, since this is not straightforward to test with a layout test.
3414
3415         * platform/mac/DragImageMac.mm:
3416         (WebCore::LinkImageLayout::LinkImageLayout):
3417
3418 2017-07-25  Matt Baker  <mattbaker@apple.com>
3419
3420         Web Inspector: Refactoring: extract async stack trace logic from InspectorInstrumentation
3421         https://bugs.webkit.org/show_bug.cgi?id=174738
3422
3423         Reviewed by Brian Burg.
3424
3425         Relocate AsyncCallType from InspectorInstrumentation to the debugger
3426         agent. Plumbing for `requestAnimationFrame` notifications has been added
3427         to PageDebuggerAgent, which is responsible for managing async stack traces. 
3428
3429         * dom/ScriptedAnimationController.cpp:
3430         (WebCore::ScriptedAnimationController::registerCallback):
3431         (WebCore::ScriptedAnimationController::cancelCallback):
3432         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
3433
3434         * inspector/InspectorInstrumentation.cpp:
3435         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
3436         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
3437         (WebCore::InspectorInstrumentation::willFireTimerImpl):
3438         (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
3439         (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
3440         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
3441         (): Deleted.
3442         (WebCore::didScheduleAsyncCall): Deleted.
3443
3444         * inspector/InspectorInstrumentation.h:
3445         (WebCore::InspectorInstrumentation::didRequestAnimationFrame):
3446         (WebCore::InspectorInstrumentation::didCancelAnimationFrame):
3447         (WebCore::InspectorInstrumentation::willFireAnimationFrame):
3448         Replaced Frame and Document pointers with references and moved
3449         pointer validation upstream.
3450
3451         * inspector/PageDebuggerAgent.cpp:
3452         (WebCore::PageDebuggerAgent::didRequestAnimationFrame):
3453         (WebCore::PageDebuggerAgent::willFireAnimationFrame):
3454         (WebCore::PageDebuggerAgent::didCancelAnimationFrame):
3455         * inspector/PageDebuggerAgent.h:
3456
3457 2017-07-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
3458
3459         Async image decoding for large images should be disabled after the first time a tile is painted
3460         https://bugs.webkit.org/show_bug.cgi?id=174451
3461         <rdar://problem/31246421>
3462
3463         Reviewed by Simon Fraser.
3464
3465         Flashing because of DOM mutation can be fixed by disabling the asynchronous
3466         image decoding after the first time a tile was painted.
3467
3468         We can detect this by consulting the tile repaintCount. If it is zero, then
3469         it is safe to use asynchronous image decoded. If the tile repaintCount is
3470         greater than zero, we are not sure if the renderer rectangle has an image
3471         drawn in it already or not. In this case we have to use the synchronous
3472         image decoding to avoid causing a flash.
3473
3474         Tests: fast/images/async-image-background-change.html
3475                fast/images/async-image-src-change.html
3476                http/tests/multipart/multipart-async-image.html
3477
3478         * html/shadow/MediaControlElements.cpp:
3479         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
3480         * page/FrameView.cpp:
3481         (WebCore::FrameView::willPaintContents):
3482         (WebCore::FrameView::paintContentsForSnapshot):
3483         * page/PageOverlayController.cpp:
3484         (WebCore::PageOverlayController::paintContents):
3485         * page/PageOverlayController.h:
3486         * page/linux/ResourceUsageOverlayLinux.cpp:
3487         * page/mac/ServicesOverlayController.h:
3488         * page/mac/ServicesOverlayController.mm:
3489         (WebCore::ServicesOverlayController::Highlight::paintContents):
3490         * platform/graphics/BitmapImage.cpp:
3491         (WebCore::BitmapImage::draw):
3492         * platform/graphics/BitmapImage.h:
3493         * platform/graphics/GraphicsLayer.cpp:
3494         (WebCore::GraphicsLayer::paintGraphicsLayerContents):
3495         * platform/graphics/GraphicsLayer.h:
3496         * platform/graphics/GraphicsLayerClient.h:
3497         (WebCore::GraphicsLayerClient::paintContents):
3498         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3499         (WebCore::LayerClient::platformCALayerPaintContents):
3500         * platform/graphics/ca/GraphicsLayerCA.cpp:
3501         (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
3502         * platform/graphics/ca/GraphicsLayerCA.h:
3503         * platform/graphics/ca/PlatformCALayer.h:
3504         * platform/graphics/ca/PlatformCALayerClient.h:
3505         (WebCore::PlatformCALayerClient::platformCALayerRepaintCount):
3506         * platform/graphics/ca/TileCoverageMap.cpp:
3507         (WebCore::TileCoverageMap::platformCALayerPaintContents):
3508         * platform/graphics/ca/TileCoverageMap.h:
3509         * platform/graphics/ca/TileGrid.cpp:
3510         (WebCore::TileGrid::platformCALayerPaintContents):
3511         (WebCore::TileGrid::platformCALayerRepaintCount):
3512         * platform/graphics/ca/TileGrid.h:
3513         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3514         (PlatformCALayer::drawLayerContents):
3515         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3516         (PlatformCALayer::drawLayerContents):
3517         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
3518         (PlatformCALayerWinInternal::displayCallback):
3519         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
3520         (WebTiledBackingLayerWin::displayCallback):
3521         * platform/graphics/mac/WebLayer.mm:
3522         (-[WebLayer drawInContext:]):
3523         (-[WebSimpleLayer drawInContext:]):
3524         * rendering/PaintPhase.h:
3525         * rendering/RenderBoxModelObject.cpp:
3526         (WebCore::RenderBoxModelObject::decodingModeForImageDraw):
3527         * rendering/RenderElement.h:
3528         * rendering/RenderLayer.cpp:
3529         (WebCore::RenderLayer::paintLayerContents):
3530         (WebCore::RenderLayer::paintForegroundForFragments):
3531         * rendering/RenderLayerBacking.cpp:
3532         (WebCore::RenderLayerBacking::paintContents):
3533         * rendering/RenderLayerBacking.h:
3534         * rendering/RenderLayerCompositor.cpp:
3535         (WebCore::RenderLayerCompositor::paintContents):
3536         * rendering/RenderLayerCompositor.h:
3537         * rendering/RenderWidget.cpp:
3538         (WebCore::RenderWidget::paintContents):
3539         * testing/Internals.cpp:
3540         (WebCore::imageFromImageElement):
3541         (WebCore::bitmapImageFromImageElement):
3542         (WebCore::Internals::imageFrameIndex):
3543         (WebCore::Internals::setImageFrameDecodingDuration):
3544         (WebCore::Internals::resetImageAnimation):
3545         (WebCore::Internals::isImageAnimating):
3546         (WebCore::Internals::setClearDecoderAfterAsyncFrameRequestForTesting):
3547         (WebCore::Internals::imageDecodeCount):
3548         (WebCore::Internals::setLargeImageAsyncDecodingEnabledForTesting):
3549         * testing/Internals.h:
3550         * testing/Internals.idl:
3551
3552 2017-07-23  Sam Weinig  <sam@webkit.org>
3553
3554         [WebIDL] Add support for generating timer bindings
3555         https://bugs.webkit.org/show_bug.cgi?id=174766
3556
3557         Reviewed by Darin Adler.
3558
3559         Adds a new non-standard type, ScheduledAction, which stands in for the
3560         standard (DOMString or Function). It would be good to move to that in
3561         future, but for now, this allows for forward momentum on removing custom
3562         bindings.
3563
3564         * WebCore.xcodeproj/project.pbxproj:
3565         Add JSDOMConvertScheduledAction.h.
3566
3567         * bindings/IDLTypes.h:
3568         Add IDLScheduledAction.
3569
3570         * bindings/js/JSDOMConvertScheduledAction.h: Added.
3571         (WebCore::Converter<IDLScheduledAction>::convert):
3572         Add conversion from JSValue -> ScheduledAction. This is moved from the old ScheduledAction
3573         create function.
3574
3575         * bindings/js/JSDOMConvertVariadic.h:
3576         (WebCore::convertVariadicArguments):
3577         (WebCore::Detail::VariadicConverterBase::convert): Deleted.
3578         (WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert): Deleted.
3579         * bindings/js/JSDOMConvertBase.h:
3580         * bindings/js/JSDOMConvertAny.h:
3581         (WebCore::VariadicConverter<IDLAny>::convert):
3582         * bindings/js/JSDOMConvertInterface.h:
3583         (WebCore::VariadicConverter<IDLInterface<T>>::convert):
3584         Rename VariadicConverter to VariadicConverterDetails, and remove base class. Rename 
3585         VariadicConverterBase to VariadicConverter, and move specializations to the file
3586         containing the base converter for that IDL type 
3587
3588         * bindings/js/JSDOMWindowCustom.cpp:
3589         (WebCore::JSDOMWindow::setTimeout): Deleted.
3590         (WebCore::JSDOMWindow::setInterval): Deleted.
3591         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
3592         (WebCore::JSWorkerGlobalScope::setTimeout): Deleted.
3593         (WebCore::JSWorkerGlobalScope::setInterval): Deleted.
3594         Remove custom implementations of setTimeout and setInterval.
3595
3596         * bindings/js/ScheduledAction.cpp:
3597         (WebCore::ScheduledAction::create):
3598         (WebCore::ScheduledAction::ScheduledAction):
3599         (WebCore::ScheduledAction::~ScheduledAction):
3600         (WebCore::ScheduledAction::addArguments):
3601         (WebCore::ScheduledAction::executeFunctionInContext):
3602         * bindings/js/ScheduledAction.h:
3603         (WebCore::ScheduledAction::ScheduledAction): Deleted.
3604         Rework ScheduledAction. Now has two create functions, one for the function
3605         form, one for the string form. These are now called by the Converter. Also,
3606         rather than extracting the arguments directly from the ExecState, allow the
3607         bindings to work as designed, and have the arguments come in as variadic 
3608         arguments to setTimeout/setInterval and get added to the ScheduledAction if
3609         needed. Also, move ContentSecurityPolicy check out of construction, and into
3610         setTimeout/setInterval.
3611
3612         * bindings/scripts/CodeGenerator.pm:
3613         (IsBuiltinType):
3614         Add ScheduledAction to the builtin list.
3615
3616         * bindings/scripts/CodeGeneratorJS.pm:
3617         (AddToIncludesForIDLType):
3618         Add the correct include when ScheduledAction is used.
3619
3620         (GenerateParametersCheck):
3621         Remove rule disallowing optional arguments before variadic arguments. That works
3622         just fine.
3623
3624         (GetBaseIDLType):
3625         Add mapping of ScheduledAction -> IDLScheduledAction.
3626
3627         (JSValueToNativeDOMConvertNeedsGlobalObject):
3628         Add ScheduledAction to the list of types that need a global object
3629         for conversion.
3630
3631         * page/WindowOrWorkerGlobalScope.idl:
3632         Update interface to match spec and add FIXMEs for moving to TimerHandler.
3633
3634         * page/DOMWindow.cpp:
3635         (WebCore::DOMWindow::setTimeout):
3636         (WebCore::DOMWindow::setInterval):
3637         * page/DOMWindow.h:
3638         * workers/WorkerGlobalScope.cpp:
3639         (WebCore::WorkerGlobalScope::setTimeout):
3640         (WebCore::WorkerGlobalScope::setInterval):
3641         * workers/WorkerGlobalScope.h:
3642         Update for new signatures. WorkerGlobalScope now has to return ExceptionOr<int>
3643         even though it never throws, due to having one IDL file defining these. This is 
3644         unfortunate and something we should look at addressing the future.
3645
3646 2017-07-25  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
3647
3648         [WinCairo] Fix build with AllInOnes disabled
3649         https://bugs.webkit.org/show_bug.cgi?id=174784
3650         <rdar://problem/33488914>
3651
3652         Reviewed by Alex Christensen.
3653
3654         * PlatformWin.cmake:
3655         Add RenderThemeWin.cpp to WebCore_SOURCES
3656
3657         * rendering/RenderingAllInOne.cpp:
3658         Remove #include "RenderThemeWin.cpp"
3659
3660         * testing/MemoryInfo.h:
3661         Remove #include "JSDomWindow.h"
3662
3663         * bindings/js/JSDOMGlobalObject.cpp:
3664         * bindings/js/JSDOMPromiseDeferred.cpp:
3665         * bindings/js/JSDOMWrapper.cpp:
3666         * bindings/js/JSImageDataCustom.cpp:
3667         * bindings/scripts/CodeGeneratorJS.pm:
3668         (GenerateCallWith):
3669         * dom/ScriptExecutionContext.cpp:
3670         * inspector/InspectorController.cpp:
3671         * inspector/InspectorTimelineAgent.cpp:
3672         * rendering/RenderMediaControls.cpp:
3673         * rendering/RenderMediaControls.h:
3674         * rendering/RenderThemeWin.cpp:
3675
3676         * bindings/scripts/test/JS/JSTestObj.cpp:
3677         Update test results.
3678
3679 2017-07-25  Konstantin Tokarev  <annulen@yandex.ru>
3680
3681         Unreviewed, fix Mac CMake build after r219567
3682
3683         * PlatformMac.cmake:
3684
3685 2017-07-23  Darin Adler  <darin@apple.com>
3686
3687         More NeverDestroyed and related cleanup
3688         https://bugs.webkit.org/show_bug.cgi?id=174745
3689
3690         Reviewed by Alex Christensen.
3691
3692         * bindings/js/JSCustomElementInterface.cpp:
3693         (WebCore::JSCustomElementInterface::constructElementWithFallback):
3694         Use isNull() rather than comparing against nullAtom() since it's
3695         slightly more efficient.
3696
3697         * css/MediaQueryEvaluator.cpp:
3698         (WebCore::prefersReducedMotionEvaluate): Use a switch statement for the
3699         three states of forcedPrefersReducedMotionAccessibilityValue. Also update
3700         to use Theme::singleton() instead of platformTheme().
3701
3702         * dom/QualifiedName.h: Removed some unneeded includes, minor style tweaks,
3703         and use isNull() rather than comparing against nullAtom() since it's
3704         slightly more efficient.
3705
3706         * html/Autofill.cpp:
3707         (WebCore::AutofillData::createFromHTMLFormControlElement): Use isNull()
3708         rather than comparing against nullAtom() since it's slightly more efficient.
3709
3710         * html/HTMLDocument.cpp:
3711         (WebCore::addLocalNameToSet): Deleted.
3712         (WebCore::createHtmlCaseInsensitiveAttributesSet): Deleted.
3713         (WebCore::HTMLDocument::isCaseSensitiveAttribute): Moved the case-sensitive
3714         attribute set in here and made it use makeNeverDestroyed.
3715
3716         * html/HTMLNameCollection.cpp:
3717         (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
3718         Formatted vertically and sorted so it's easier to see what it does.
3719         (WebCore::WindowNameCollection::elementMatches): Use boolean logic instead
3720         of multiple return statements to make this a little more straightforward.
3721         (WebCore::isObjectElementForDocumentNameCollection): Added. Calls the new
3722         isExposed function. The old code called this isDocNamedItem.
3723         (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
3724         Use isObjectElementForDocumentNameCollection to clean up logic. Also
3725         sorted classes.
3726         (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
3727         Use isObjectElementForDocumentNameCollection to clean up logic. Also
3728         sorted classes and formatted vertically.
3729         (WebCore::DocumentNameCollection::elementMatches): Write in terms of
3730         above functions for clarity. Efficiency is roughly the same.
3731
3732         * html/HTMLObjectElement.cpp:
3733         (WebCore::HTMLObjectElement::HTMLObjectElement): Initialize data members
3734         in class definition instead of here.
3735         (WebCore::HTMLObjectElement::childrenChanged): Update for name change;
3736         function is now called updateExposedState rather than updateDocNamedItem.
3737         Also use m_useFallbackContent directly instead of through a function.
3738         (WebCore::HTMLObjectElement::renderFallbackContent): Ditto.
3739         (WebCore::preventsParentObjectFromExposure): Added. Replaces the old
3740         isRecognizedTagName function, and does almost the same thing, but the
3741         argument type is different and the param tag is now one of the tags
3742         exempted here. Also broke up into two overloads so we can handle the
3743         Element, Text, and other Node cases.
3744         (WebCore::shouldBeExposed): Added. Helper for the updateExposedState
3745         function that handles the logic of when the element should be exposed,
3746         separating it from what to do when the state changes.
3747         (WebCore::HTMLObjectElement::updateExposedState): Renamed from
3748         updateDocNamedItem.
3749
3750         * html/HTMLObjectElement.h: Renamed isDocNamedItem -> isExposed,
3751         m_docNamedItem -> m_isExposed, updateDocNamedItem -> updateExposedState,
3752         stopped using bit fields for the two boolean data members, and
3753         initialized those data members here in the class definition.
3754
3755         * platform/Theme.cpp:
3756         (WebCore::Theme::baselinePositionAdjustment): Moved here from header.
3757         (WebCore::Theme::controlFont): Ditto.
3758         (WebCore::Theme::controlSize): Ditto.
3759         (WebCore::Theme::minimumControlSize): Ditto.
3760         (WebCore::Theme::controlRequiresPreWhiteSpace): Ditto.
3761         (WebCore::Theme::paint): Ditto.
3762         (WebCore::Theme::inflateControlPaintRect): Ditto.
3763         (WebCore::Theme::userPrefersReducedMotion): Ditto.
3764         (WebCore::Theme::controlBorder): Fixed switch statement indentation.
3765         (WebCore::Theme::controlPadding): Ditto.
3766
3767         * platform/Theme.h: Removed the many unnecessary includes. The one
3768         I was really after here was FontCascade.h. Replaced the platformTheme
3769         function with a singleton function, following our normal style. Also
3770         changed the return type to a reference rather than a pointer.
3771         Removed many unused function and data members.
3772
3773         * platform/cocoa/ThemeCocoa.h: Tightened up implementation, removing
3774         unnecessary members and making overrides private.
3775         * platform/cocoa/ThemeCocoa.mm: Moved include in here.
3776
3777         * platform/gamepad/glib/GamepadsGlib.cpp:
3778         (WebCore::sampleGamepads): Use NeverDestroyed instead of
3779         DEPRECATED_DEFINE_STATIC_LOCAL.
3780
3781         * platform/graphics/FontCascade.cpp:
3782         (WebCore::useBackslashAsYenSignForFamily): Build the set in a cleaner
3783         way and use a NeverDestroyed set instead of a heap-allocated one.
3784         (WebCore::FontCascade::FontCascade): Moved initialization of data members
3785         to the class definition.
3786
3787         * platform/graphics/FontCascade.h: Initialize GlyphOverflow and
3788         FonstCascade data members in the class definition. Remove the constructor
3789         for GlyphOverflow entirely. Added FIXME about the peculiar != operator we
3790         defined for GlyphOverflow.
3791
3792         * platform/graphics/NamedImageGeneratedImage.cpp:
3793         (WebCore::NamedImageGeneratedImage::draw): Use Theme::singleton() instead
3794         of platformTheme().
3795         (WebCore::NamedImageGeneratedImage::drawPattern): Ditto.
3796
3797         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3798         (WebCore::CMTimeRangeStartKey): Use CFSTR directly instead of using
3799         DEPRECATED_DEFINE_STATIC_LOCAL.
3800         (WebCore::CMTimeRangeDurationKey): Ditto.
3801         (WebCore::CACFContextNeedsFlushNotification): Ditto.
3802
3803         * platform/graphics/ca/win/LayerChangesFlusher.cpp:
3804         (WebCore::LayerChangesFlusher::singleton): Use NeverDestroyed instead of
3805         DEPRECATED_DEFINE_STATIC_LOCAL.
3806         * platform/graphics/ca/win/LayerChangesFlusher.h: Ditto.
3807
3808         * platform/graphics/cg/ImageSourceCGWin.cpp:
3809         (WebCore::preferredExtensionForImageSourceType): Use HashMap constructor
3810         instead of writing out a lot of add calls.
3811
3812         * platform/graphics/harfbuzz/HarfBuzzFace.cpp:
3813         (WebCore::harfBuzzFaceCache): Use NeverDestroyed instead of
3814         DEPRECATED_DEFINE_STATIC_LOCAL.
3815         * platform/graphics/win/FontCacheWin.cpp:
3816         (WebCore::FontCache::lastResortFallbackFont): Ditto.
3817
3818         * platform/ios/ThemeIOS.h: Tightened up implementation, removing
3819         unnecessary members and making overrides private.
3820         * platform/ios/ThemeIOS.mm:
3821         (WebCore::Theme::singleton): Renamed from platformTheme.
3822
3823         * platform/mac/ThemeMac.h: Tightened up implementation, removing
3824         unnecessary members and making overrides private. Removed unneeded
3825         WTF_MAKE_FAST_ALLOCATED since this is never allocated on the heap.
3826         Removed unused -[NSFont webCoreFamilyName] method.
3827         * platform/mac/ThemeMac.mm:
3828         (-[NSFont webCoreFamilyName]): Deleted.
3829         (WebCore::Theme::singleton): Renamed from platformTheme.
3830
3831         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
3832         Removed unneeded include of FontCascade.h.
3833         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
3834         Ditto.
3835         * platform/mock/MockRealtimeAudioSource.h: Ditto.
3836
3837         * platform/network/win/DownloadBundleWin.cpp:
3838         (WebCore::DownloadBundle::fileExtension): Use NeverDestroyed
3839         instead of DEPRECATED_DEFINE_STATIC_LOCAL.
3840
3841         * platform/win/ClipboardUtilitiesWin.cpp:
3842         (WebCore::replaceNewlinesWithWindowsStyleNewlines): Use
3843         appendLiteral instead of DEPRECATED_DEFINE_STATIC_LOCAL.
3844
3845         * platform/win/FileSystemWin.cpp:
3846         (WebCore::bundleName): Use NeverDestroyed instead of
3847         DEPRECATED_DEFINE_STATIC_LOCAL, and used a lambda to initialize
3848         rather than a boolean to control one-time code.
3849         (WebCore::storageDirectory): Removed unneeded use of
3850         DEPRECATED_DEFINE_STATIC_LOCAL for a prefix we are appending to
3851         a String. The + operator can handle a literal just as efficiently
3852         without first storing it in a String.
3853
3854         * platform/wpe/ThemeWPE.cpp:
3855         (WebCore::Theme::singleton): Renamed from platformTheme.
3856         * platform/wpe/ThemeWPE.h: Tightened up implementation, removing
3857         unnecessary members and making overrides private.
3858
3859         * rendering/RenderTheme.cpp:
3860         (WebCore::RenderTheme::RenderTheme): No need to initialize m_theme.
3861         (WebCore::RenderTheme::adjustStyle): Use Theme::singleton() instead
3862         of accessing it through m_theme.
3863         (WebCore::RenderTheme::paint): Ditto.
3864         (WebCore::RenderTheme::baselinePosition): Ditto.
3865         (WebCore::RenderTheme::adjustRepaintRect): Ditto.
3866         (WebCore::RenderTheme::setCustomFocusRingColor): Ditto.
3867         (WebCore::RenderTheme::platformTapHighlightColor): Ditto.
3868
3869         * rendering/RenderTheme.h: Removed unneded m_theme and unneeded
3870         inclusion of Theme.h.
3871
3872         * rendering/line/LineBreaker.h: Removed unneeded include of
3873         FontCascade.h.
3874
3875 2017-07-24  Chris Dumez  <cdumez@apple.com>
3876
3877         ExceptionCode enumeration should use modern exception names
3878         https://bugs.webkit.org/show_bug.cgi?id=174794
3879
3880         Reviewed by Geoffrey Garen.
3881
3882         ExceptionCode enumeration should use modern exception names consistently.
3883         This makes the code nicer and closer to the text of the specification.
3884
3885 2017-07-24  Andy Estes  <aestes@apple.com>
3886
3887         Consider implementing W3C Payment Request API
3888         https://bugs.webkit.org/show_bug.cgi?id=174796
3889
3890         Reviewed by Daniel Bates.
3891
3892         Add Payment Request to features.json as "Under Consideration".
3893
3894         * features.json:
3895
3896 2017-07-24  Konstantin Tokarev  <annulen@yandex.ru>
3897
3898         Unreviewed attempt to fix Mac cmake build
3899
3900         * PlatformMac.cmake:
3901
3902 2017-07-24  Chris Dumez  <cdumez@apple.com>
3903
3904         Make ExceptionCode a proper enumeration
3905         https://bugs.webkit.org/show_bug.cgi?id=174771
3906
3907         Reviewed by Sam Weinig.
3908
3909         Make ExceptionCode a proper enumeration instead of a typedef to uint8_t.
3910
3911         * Modules/fetch/FetchBody.h:
3912         (WebCore::FetchBody::formData):
3913         * Modules/indexeddb/shared/IDBError.h:
3914         (WebCore::IDBError::encode):
3915         (WebCore::IDBError::decode):
3916         * bindings/js/JSSubtleCryptoCustom.cpp:
3917         (WebCore::rejectWithException):
3918         * dom/Exception.h:
3919         * dom/ExceptionCode.h:
3920         * fileapi/FileReaderSync.cpp:
3921         (WebCore::errorCodeToExceptionCode):
3922         * html/canvas/WebGLRenderingContextBase.cpp:
3923         (WebCore::WebGLRenderingContextBase::texSubImage2D):
3924         (WebCore::WebGLRenderingContextBase::texImage2D):
3925         * xml/XMLHttpRequest.cpp:
3926         (WebCore::XMLHttpRequest::createRequest):
3927         * xml/XMLHttpRequest.h:
3928
3929 2017-07-24  Simon Fraser  <simon.fraser@apple.com>
3930
3931         Change "client" coordinates back to match scrolling coordinates
3932         https://bugs.webkit.org/show_bug.cgi?id=174734
3933         rdar://problem/33336930
3934
3935         Reviewed by Tim Horton.
3936
3937         Baidu.com (which uses jQuery), and various iOS apps make the assumption that getBoundingClientRect() returns a rectangle
3938         that can be used to set or compare with the scroll position. With visual viewports, that assumption is no longer valid
3939         when the page is zoomed, or when the keyboard has caused the visual viewport to detach from the layout viewport.
3940
3941         At this point the compatibility cost of shipping layout viewport-based client rects seems higher than the gain, so revert
3942         to the shipping behavior. This reverts r216803, and will re-introduce bugs that occurred on zoomed pages on macOS,
3943         many of which are noted in webkit.org/b/170981.
3944
3945         * page/FrameView.cpp:
3946         (WebCore::FrameView::documentToClientOffset):
3947
3948 2017-07-24  Zan Dobersek  <zdobersek@igalia.com>
3949
3950         [WPE] libepoxy headers can use EGL_CAST, which might not be defined by eglplatform.h
3951         https://bugs.webkit.org/show_bug.cgi?id=174780
3952
3953         Reviewed by Carlos Garcia Campos.
3954
3955         Newer versions of libepoxy provide EGL definitions that already use the EGL_CAST macro.
3956         We'd like to compile on systems where the eglplatform.h header doesn't yet provide
3957         that macro that was added only recently (e.g. it's available in Mesa 17.1, but not
3958         before).
3959
3960         To address that, the EpoxyEGL.h header is added that first includes the libepoxy's EGL
3961         header and then provides the EGL_CAST definition in case the eglplatform.h header doesn't.