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