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