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