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