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