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