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