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