Implement backing-sharing in compositing layers, allowing overlap layers to paint...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-05-08  Simon Fraser  <simon.fraser@apple.com>
2
3         Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer
4         https://bugs.webkit.org/show_bug.cgi?id=197561
5         <rdar://problem/50445998>
6
7         Reviewed by Antti Koivisto.
8
9         This change introduces the concept of layers that share backing store for compositing. A layer
10         which is sharing its backing store first paints itself, and then some set of layers which come
11         later in paint order in the same stacking context. This reduces the composited layer count in
12         some overflow scrolling scenarios, thereby also simplifying the scrolling tree.
13         
14         A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At
15         paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the
16         painting root so that positioning and clipping just work.
17         
18         Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements().
19         We track the last layer which was composited in paint order as a shared candidate. If a later layer
20         would composite for overlap (and no other reasons), then we allow it to share with the candidate
21         if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers
22         in the same stacking context.
23         
24         isComposited() returns false for sharing layers, but they are like composited layers in that
25         they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them,
26         and repaints in shared layers have to be directed to their shared layer, hence
27         changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint().
28         
29         The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that
30         all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use
31         TemporaryClipRects in that case.
32
33         Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html
34                compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html
35                compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html
36                compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html
37                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html
38                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html
39                compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html
40                compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html
41                compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html
42                compositing/shared-backing/overflow-scroll/shared-layer-clipping.html
43                compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html
44                compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html
45                compositing/shared-backing/overflow-scroll/shared-layer-repaint.html
46                compositing/shared-backing/partial-compositing-update.html
47                compositing/shared-backing/partial-compositing-update2.html
48                compositing/shared-backing/remove-sharing-layer.html
49                compositing/shared-backing/sharing-cached-clip-rects.html
50
51         * rendering/RenderLayer.cpp:
52         (WebCore::RenderLayer::~RenderLayer):
53         (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const):
54         (WebCore::RenderLayer::setBackingProviderLayer):
55         (WebCore::RenderLayer::disconnectFromBackingProviderLayer):
56         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
57         (WebCore::RenderLayer::clippingRootForPainting const):
58         (WebCore::RenderLayer::clipToRect):
59         (WebCore::RenderLayer::paintLayer):
60         (WebCore::RenderLayer::updateClipRects):
61         (WebCore::RenderLayer::clipCrossesPaintingBoundary const):
62         (WebCore::RenderLayer::calculateClipRects const):
63         (WebCore::outputPaintOrderTreeLegend):
64         (WebCore::outputPaintOrderTreeRecursive):
65         (WebCore::inContainingBlockChain): Deleted.
66         * rendering/RenderLayer.h:
67         * rendering/RenderLayerBacking.cpp:
68         (WebCore::RenderLayerBacking::willBeDestroyed):
69         (WebCore::clearBackingSharingLayerProviders):
70         (WebCore::RenderLayerBacking::setBackingSharingLayers):
71         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
72         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
73         (WebCore::RenderLayerBacking::updateCompositedBounds):
74         (WebCore::RenderLayerBacking::updateDrawsContent):
75         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
76         (WebCore::RenderLayerBacking::paintIntoLayer):
77         (WebCore::RenderLayerBacking::paintContents):
78         * rendering/RenderLayerBacking.h:
79         * rendering/RenderLayerCompositor.cpp:
80         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
81         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren):
82         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree):
83         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate):
84         (WebCore::RenderLayerCompositor::updateCompositingLayers):
85         (WebCore::backingProviderLayerCanIncludeLayer):
86         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
87         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
88         (WebCore::RenderLayerCompositor::updateBacking):
89         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
90         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
91         * rendering/RenderLayerCompositor.h:
92         * rendering/RenderTreeAsText.cpp:
93
94 2019-05-08  Brent Fulgham  <bfulgham@apple.com>
95
96         Correct delayed load event handling
97         https://bugs.webkit.org/show_bug.cgi?id=197679
98         <rdar://problem/50423334>
99
100         Reviewed by Alex Christensen.
101
102         We need to properly account for the fact that JavaScript might run
103         while performing loads.
104
105         * dom/Document.cpp:
106         (WebCore::Document::loadEventDelayTimerFired):
107
108 2019-05-08  Philippe Normand  <pnormand@igalia.com>
109
110         REGRESSION(r243197): [GStreamer] Error playing redirected streams
111         https://bugs.webkit.org/show_bug.cgi?id=197410
112
113         Reviewed by Carlos Garcia Campos.
114
115         Revert the change introduced in r243197 that was checking the
116         redirected URI instead of the original URI. Non-main URIs should
117         be ignored only when they are HLS (or similar) fragments.
118
119         Test http/tests/security/canvas-remote-read-remote-video-hls.html still passes.
120
121         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
122         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
123
124 2019-05-08  Rob Buis  <rbuis@igalia.com>
125
126         Link prefetch not useful for top-level navigation
127         https://bugs.webkit.org/show_bug.cgi?id=195623
128
129         Reviewed by Youenn Fablet.
130
131         Cache cross-domain top-level prefetches in a dedicated cache and not in the
132         memory cache.
133
134         Tests: http/tests/cache/link-prefetch-main-resource-iframe.html
135                http/tests/cache/link-prefetch-main-resource.html
136                http/tests/contentextensions/prefetch-blocked.html
137
138         * loader/LinkLoader.cpp:
139         (WebCore::LinkLoader::prefetchIfNeeded):
140         * loader/ResourceLoadInfo.cpp:
141         (WebCore::toResourceType):
142
143 2019-05-07  Don Olmstead  <don.olmstead@sony.com>
144
145         Fix !HAVE(ACCESSIBILITY) build
146         https://bugs.webkit.org/show_bug.cgi?id=197680
147
148         Reviewed by Fujii Hironori.
149
150         * accessibility/AXObjectCache.h:
151         (WebCore::AXObjectCache::focusedUIElementForPage):
152         Update declaration for !HAVE(ACCESSIBILITY)
153         * accessibility/AccessibilityObject.h:
154         Add wrapper implementation for !HAVE(ACCESSIBILITY)
155         * accessibility/AccessibilityProgressIndicator.cpp:
156         (WebCore::AccessibilityProgressIndicator::roleValue const):
157         Add ENABLE(METER_ELEMENT) guard.
158
159 2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>
160
161         Unreviewed, rolling out r245038.
162
163         Breaks internal builds.
164
165         Reverted changeset:
166
167         "Add SPI to set a list of hosts to which to send custom header
168         fields cross-origin"
169         https://bugs.webkit.org/show_bug.cgi?id=197397
170         https://trac.webkit.org/changeset/245038
171
172 2019-05-07  Jiewen Tan  <jiewen_tan@apple.com>
173
174         [WebAuthN] A new request should always suppress the pending request if any
175         https://bugs.webkit.org/show_bug.cgi?id=191517
176         <rdar://problem/46888222>
177
178         Reviewed by Brent Fulgham.
179
180         Blocking new requests from the same page when there is a pending request could DoS the
181         WebAuthN API in the period between [the page is refreshed, the pending request is
182         hanedled/timeout]. Therefore, the policy will be to always cancel any pending requests
183         whenever a new request is made. This will enforce the policy of handling only one
184         request at a time.
185
186         Covered by new tests in existing files.
187
188         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
189         (WebCore::AuthenticatorCoordinatorClient::requestReply):
190         (WebCore::AuthenticatorCoordinatorClient::setRequestCompletionHandler):
191         (WebCore::AuthenticatorCoordinatorClient::addQueryCompletionHandler):
192         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
193
194 2019-05-07  Eric Carlson  <eric.carlson@apple.com>
195
196         Define media buffering policy
197         https://bugs.webkit.org/show_bug.cgi?id=196979
198         <rdar://problem/28383861>
199
200         Reviewed by Jer Noble.
201
202         Test: MediaBufferingPolicy API test.
203
204         * html/HTMLMediaElement.cpp:
205         (WebCore::HTMLMediaElement::HTMLMediaElement):
206         (WebCore::HTMLMediaElement::suspend):
207         (WebCore::HTMLMediaElement::resume):
208         (WebCore::HTMLMediaElement::createMediaPlayer):
209         (WebCore::HTMLMediaElement::setBufferingPolicy):
210         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
211         (WebCore::HTMLMediaElement::bufferingPolicy const):
212         (WebCore::HTMLMediaElement::setShouldBufferData): Deleted.
213         * html/HTMLMediaElement.h:
214         (WebCore::HTMLMediaElement::shouldBufferData const): Deleted.
215         * html/MediaElementSession.cpp:
216         (WebCore::MediaElementSession::updateClientDataBuffering):
217         (WebCore::MediaElementSession::preferredBufferingPolicy const):
218         (WebCore::MediaElementSession::dataBufferingPermitted const): Deleted.
219         * html/MediaElementSession.h:
220         * platform/graphics/MediaPlayer.cpp:
221         (WebCore::MediaPlayer::setBufferingPolicy):
222         (WebCore::convertEnumerationToString):
223         (WebCore::MediaPlayer::setShouldBufferData): Deleted.
224         * platform/graphics/MediaPlayer.h:
225         * platform/graphics/MediaPlayerEnums.h:
226         (WTF::LogArgument<WebCore::MediaPlayerEnums::BufferingPolicy>::toString):
227         * platform/graphics/MediaPlayerPrivate.h:
228         (WebCore::MediaPlayerPrivateInterface::setBufferingPolicy):
229         (WebCore::MediaPlayerPrivateInterface::setShouldBufferData): Deleted.
230         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
231         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
232         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
233         (WebCore::MediaPlayerPrivateAVFoundationObjC::setBufferingPolicy):
234         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): Deleted.
235         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
236         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
237         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setBufferingPolicy):
238         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers): Deleted.
239         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setShouldBufferData): Deleted.
240         * testing/Internals.cpp:
241         (WebCore::Internals::elementShouldBufferData):
242         (WebCore::Internals::elementBufferingPolicy):
243         * testing/Internals.h:
244         * testing/Internals.idl:
245
246 2019-05-07  Alex Christensen  <achristensen@webkit.org>
247
248         Add SPI to set a list of hosts to which to send custom header fields cross-origin
249         https://bugs.webkit.org/show_bug.cgi?id=197397
250
251         Reviewed by Geoff Garen.
252
253         In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document.
254         We need the ability to specify what origins to send these headers to even if they are not first party requests.
255         We get this information in a list of strings which are the hosts to send the headers to.  Some of the strings have an asterisk at the beginning,
256         indicating that the headers are to be sent to all subdomains.
257
258         I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
259         I also added some new API tests for the new behavior.
260
261         * Sources.txt:
262         * WebCore.xcodeproj/project.pbxproj:
263         * loader/CustomHeaderFields.cpp: Added.
264         (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
265         * loader/CustomHeaderFields.h: Added.
266         (WebCore::CustomHeaderFields::encode const):
267         (WebCore::CustomHeaderFields::decode):
268         * loader/DocumentLoader.cpp:
269         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
270         * loader/DocumentLoader.h:
271         (WebCore::DocumentLoader::setCustomHeaderFields):
272         (WebCore::DocumentLoader::customHeaderFields const):
273         (WebCore::DocumentLoader::customHeaderFields): Deleted.
274         * loader/cache/CachedResourceLoader.cpp:
275         (WebCore::CachedResourceLoader::requestResource):
276
277 2019-05-07  Andy Estes  <aestes@apple.com>
278
279         run-bindings-tests should test global scope constructor generation
280         https://bugs.webkit.org/show_bug.cgi?id=197669
281
282         Reviewed by Alex Christensen.
283
284         For interfaces that are exposed on a global object, preprocess-idls.pl generates a partial
285         interface for the global object defining attributes for the interfaces' constructors. Most
286         interfaces don't specify a global object, so preprocess-idls.pl defaults to DOMWindow.
287         Since there is no DOMWindow.idl test case, we never generate the code for exposed interface
288         constructors when running bindings tests. This means that we can't test changes to how these
289         constructors are generated.
290
291         To fix this, teach preprocess-idls.pl to treat 'TestGlobalObject' as the default global
292         object when running bindings tests. This means that all exposed interface test cases will
293         generate their constructors as part of JSTestGlobalObject (unless otherwise specified
294         by the 'Exposed' extended attribute).
295
296         * bindings/scripts/preprocess-idls.pl:
297         Added --testGlobalContextName and --testGlobalScopeConstructorsFile arguments for use by
298         run-bindings-tests.
299
300         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
301         Updated expected results.
302
303 2019-05-07  Youenn Fablet  <youenn@apple.com>
304
305         Video stream freeze on front camera orientation changing
306         https://bugs.webkit.org/show_bug.cgi?id=197227
307         <rdar://problem/50175498>
308
309         Reviewed by Eric Carlson.
310
311         Use m_currentRotationSessionAngle instead of m_currentRotation to create or not a new rotation session.
312         Covered by updated test.
313
314         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
315         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
316         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
317
318 2019-05-07  Youenn Fablet  <youenn@apple.com>
319
320         getUserMedia framerate unusable under low light in iOS 12.2
321         https://bugs.webkit.org/show_bug.cgi?id=196214
322         <rdar://problem/49232193>
323
324         Reviewed by Geoffrey Garen.
325
326         When setting the frame rate, set it to the exact value instead of a range.
327         Otherwise, the capture device might use the lowest frame rate according the light conditions
328         for best picture quality which is not what is expected by most web pages.
329
330         Move frame rate range computation to closer where actually used.
331         Since frame rate matching is fuzzy, add some checks in case the expected frame rate is slightly out of min/max range.
332
333         Manually tested on a real device.
334
335         * platform/mediastream/mac/AVVideoCaptureSource.mm:
336         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
337
338 2019-05-07  Robin Morisset  <rmorisset@apple.com>
339
340         All prototypes should call didBecomePrototype()
341         https://bugs.webkit.org/show_bug.cgi?id=196315
342
343         Reviewed by Saam Barati.
344
345         It was found by existing tests, with the new assert in JSC::Structure
346
347         * bindings/js/JSWindowProxy.cpp:
348         (WebCore::JSWindowProxy::setWindow):
349         * bindings/scripts/CodeGeneratorJS.pm:
350         (GeneratePrototypeDeclaration):
351         (GenerateConstructorHelperMethods):
352
353 2019-05-07  John Wilander  <wilander@apple.com>
354
355         Storage Access API: Make two changes requested by developers and complete refactoring and cleanup
356         https://bugs.webkit.org/show_bug.cgi?id=197648
357         <rdar://problem/50527493>
358
359         Reviewed by Chris Dumez.
360
361         Developers have requested two minor changes to the Storage Access API:
362         - Only consume the user gesture when the user explicitly denies access.
363         - Make document.hasStorageAccess() return true instead of false when the feature is off.
364
365         In addition to this, we have refactoring and cleanup to do. Namely:
366         - Make use of WebCore::RegistrableDomain all the way.
367         - Remove dead code in WebKit::NetworkProcess since the calls now go through NetworkConnectionToWebProcess.
368         - Introduce boolean enums for state handling.
369         - Break out the Storage Access API functionality into a supplement of WebCore::Document.
370
371         Reviewed by Chris Dumez.
372
373         Tests: http/tests/storageAccess/deny-with-prompt-does-not-preserve-gesture.html
374                http/tests/storageAccess/deny-without-prompt-preserves-gesture.html
375                http/tests/storageAccess/grant-with-prompt-preserves-gesture.html
376                http/tests/storageAccess/has-storage-access-true-if-feature-off.html
377
378         * DerivedSources-input.xcfilelist:
379         * DerivedSources-output.xcfilelist:
380         * DerivedSources.make:
381         * Headers.cmake:
382         * Sources.txt:
383         * WebCore.xcodeproj/project.pbxproj:
384         * dom/Document.cpp:
385         (WebCore::Document::hasStorageAccess): Deleted.
386         (WebCore::Document::requestStorageAccess): Deleted.
387         (WebCore::Document::enableTemporaryTimeUserGesture): Deleted.
388         (WebCore::Document::consumeTemporaryTimeUserGesture): Deleted.
389         (WebCore::Document::hasFrameSpecificStorageAccess const): Deleted.
390         (WebCore::Document::setHasFrameSpecificStorageAccess): Deleted.
391         * dom/Document.h:
392         (WebCore::Document::setUserGrantsStorageAccessOverride): Deleted.
393             All of this has been moved to the supplement WebCore::DocumentStorageAccess.
394         * dom/Document.idl:
395             The Storage Access API has been moved to DocumentStorageAccess.idl.
396         * dom/DocumentStorageAccess.cpp: Added.
397         (WebCore::DocumentStorageAccess::from):
398         (WebCore::DocumentStorageAccess::supplementName):
399         (WebCore::DocumentStorageAccess::hasStorageAccess):
400         (WebCore::DocumentStorageAccess::requestStorageAccess):
401         (WebCore::DocumentStorageAccess::enableTemporaryTimeUserGesture):
402         (WebCore::DocumentStorageAccess::consumeTemporaryTimeUserGesture):
403         (WebCore::DocumentStorageAccess::hasFrameSpecificStorageAccess const):
404         (WebCore::DocumentStorageAccess::setHasFrameSpecificStorageAccess):
405         * dom/DocumentStorageAccess.h: Added.
406         * dom/DocumentStorageAccess.idl: Added.
407         * page/ChromeClient.h:
408         * testing/Internals.cpp:
409         (WebCore::Internals::setUserGrantsStorageAccess): Deleted.
410             This was dead code.
411         * testing/Internals.h:
412         * testing/Internals.idl:
413
414 2019-05-07  Antoine Quint  <graouts@apple.com>
415
416         [Pointer Events] isPrimary property of pointercancel events should match previous events for that pointer
417         https://bugs.webkit.org/show_bug.cgi?id=197665
418
419         Reviewed by Dean Jackson.
420
421         The test at web-platform-tests/pointerevents/pointerevent_pointercancel_touch.html would fail early because one of the first assertions
422         would check that isPrimary for a pointercancel event would match the isPrimary property of the previous pointer event dispatched for that
423         pointer id. This prevented many further assertions from passing and also was the cause of flakiness for the next test since this test was
424         ended early and the state of touches created using UIScriptController were not in a clean state.
425
426         We now track the isPrimary state for a given pointer using the CapturingData and use that value when dispatching a pointercancel event.
427
428         * dom/PointerEvent.cpp:
429         (WebCore::PointerEvent::create):
430         (WebCore::PointerEvent::PointerEvent):
431         * dom/PointerEvent.h:
432         * page/PointerCaptureController.cpp:
433         (WebCore::PointerCaptureController::pointerEventWasDispatched):
434         (WebCore::PointerCaptureController::cancelPointer):
435         * page/PointerCaptureController.h:
436
437 2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>
438
439         Unreviewed, rolling out r244900.
440
441         Caused media/track/track-cue-missing.html to fail on debug
442         queues
443
444         Reverted changeset:
445
446         "Add logging for RenderLayer clip rects"
447         https://bugs.webkit.org/show_bug.cgi?id=197547
448         https://trac.webkit.org/changeset/244900
449
450 2019-05-07  Antti Koivisto  <antti@apple.com>
451
452         <body> with overflow:hidden CSS is scrollable on iOS
453         https://bugs.webkit.org/show_bug.cgi?id=153852
454         <rdar://problem/38715356>
455
456         Reviewed by Antoine Quint.
457
458         Tests: fast/scrolling/ios/body-overflow-hidden-frame.html
459                fast/scrolling/ios/body-overflow-hidden.html
460
461         * page/scrolling/ScrollingTreeScrollingNode.h:
462
463 2019-05-07  Antoine Quint  <graouts@apple.com>
464
465         Mouse event simulation should be limited to the graphing calculator on Desmos.com
466         https://bugs.webkit.org/show_bug.cgi?id=197652
467         <rdar://problem/47068176>
468
469         Reviewed by Antti Koivisto.
470
471         * page/Quirks.cpp:
472         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
473
474 2019-05-06  James Savage  <james.savage@apple.com>
475
476         Improve coordination for creating UIWindow instances.
477         https://bugs.webkit.org/show_bug.cgi?id=197578.
478         <rdar://problem/50456965>.
479
480         Reviewed by Wenson Hsieh.
481
482         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
483         (makeWindowFromView): Pull out window creation.
484         (VideoFullscreenInterfaceAVKit::doSetup): Call new helper function.
485
486 2019-05-06  Tim Horton  <timothy_horton@apple.com>
487
488         _overrideViewportWithArguments does not work when called before loading
489         https://bugs.webkit.org/show_bug.cgi?id=197638
490         <rdar://problem/50505111>
491
492         Reviewed by Wenson Hsieh.
493
494         * dom/Document.cpp:
495         (WebCore::Document::viewportArguments const):
496         (WebCore::Document::updateViewportArguments):
497         (WebCore::Document::setOverrideViewportArguments): Deleted.
498         * dom/Document.h:
499         (WebCore::Document::viewportArguments const): Deleted.
500         * page/Page.cpp:
501         (WebCore::Page::setOverrideViewportArguments):
502         * page/Page.h:
503         (WebCore::Page::overrideViewportArguments const):
504         * page/ViewportConfiguration.cpp:
505         (WebCore::ViewportConfiguration::setViewportArguments):
506         Move overrideViewportArguments to Page, since it is view-global in the API.
507
508 2019-05-06  Chris Dumez  <cdumez@apple.com>
509
510         Add assertions to JSLazyEventListener to help catch the cause of a crash
511         https://bugs.webkit.org/show_bug.cgi?id=197617
512
513         Reviewed by Alexey Proskuryakov.
514
515         Add assertions to JSLazyEventListener to help catch the cause of <rdar://problem/24314027>.
516
517         * bindings/js/JSLazyEventListener.cpp:
518         (WebCore::JSLazyEventListener::checkValidityForEventTarget):
519         * bindings/js/JSLazyEventListener.h:
520         * dom/EventListener.h:
521         (WebCore::EventListener::checkValidityForEventTarget):
522         * dom/EventTarget.cpp:
523         (WebCore::EventTarget::addEventListener):
524         (WebCore::EventTarget::setAttributeEventListener):
525         (WebCore::EventTarget::innerInvokeEventListeners):
526
527 2019-05-04  Per Arne Vollan  <pvollan@apple.com>
528
529         -[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
530         https://bugs.webkit.org/show_bug.cgi?id=197510
531         <rdar://problem/50372338>
532
533         Reviewed by Alex Christensen.
534
535         This patch implements deletion of non persistent credentials for a set of origins. In order for this to work, fetching
536         credentials from the credential storage needs to return a set of SecurityOriginData objects, instead of a set of origin
537         strings. This is implemented by iterating over all the elements in the credential map, and creating a SecurityOriginData
538         object for each credential based on the protection space.
539
540         API test: WKWebsiteDataStore.RemoveNonPersistentCredentials
541
542         * platform/network/CredentialStorage.cpp:
543         (WebCore::CredentialStorage::removeCredentialsWithOrigin):
544         (WebCore::CredentialStorage::originsWithCredentials const):
545         * platform/network/CredentialStorage.h:
546         (WebCore::CredentialStorage::originsWithCredentials const): Deleted.
547
548 2019-05-06  Keith Rollin  <krollin@apple.com>
549
550         Temporarily disable generate-xcfilelists
551         https://bugs.webkit.org/show_bug.cgi?id=197619
552         <rdar://problem/50507392>
553
554         Reviewed by Alex Christensen.
555
556         We need to perform a significant update to the generate-xcfilelist
557         scripts. This work involves coordinated work with another facility. If
558         the work does not occur in tandem, the build will be broken. To avoid
559         this, disable the invoking of the scripts during the transition. The
560         checking will be restored once the new scripts are in place.
561
562         No new tests -- no change in user-visible functionality.
563
564         * Scripts/check-xcfilelists.sh:
565
566 2019-05-06  Andres Gonzalez  <andresg_22@apple.com>
567
568         Hitpoint for link which spans two lines in web content is incorrect
569         https://bugs.webkit.org/show_bug.cgi?id=197511
570         <rdar://problem/49971483>
571
572         Reviewed by Chris Fleizach.
573
574         - Special case for links to return first char location as clickPoint instead of middle point of bounding rect.
575         - Modified iOS ActivationPoint to use clickPoint. This way all code paths go through the same function.
576         - Made boundsForRects to return content coordinates in all platforms. Adjusted all callers, directly or indirectly, appropriately.
577
578         Tests: accessibility/ios-simulator/links-activation.html
579                accessibility/links-activation.html
580
581         * accessibility/AccessibilityRenderObject.cpp:
582         (WebCore::AccessibilityRenderObject::clickPoint):
583         (WebCore::AccessibilityRenderObject::boundsForRects):
584         (WebCore::AccessibilityRenderObject::boundsForRects const): Deleted.
585         * accessibility/AccessibilityRenderObject.h:
586         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
587         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
588         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
589         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
590
591 2019-05-06  Jer Noble  <jer.noble@apple.com>
592
593         Adopt AVStreamDataParser.audiovisualMIMETypes
594         https://bugs.webkit.org/show_bug.cgi?id=197581
595         <rdar://problem/50458981>
596
597         Reviewed by Eric Carlson.
598
599         Add a new singleton class, AVStreamDataParserMIMETypeCache, and rename AVFoundationMIMETypeCache to the more precise
600         AVAssetMIMETypeCache.  Update all the old AVFoundationMIMETypeCache with the new name.
601
602         * SourcesCocoa.txt:
603         * WebCore.xcodeproj/project.pbxproj:
604         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h.
605         (WebCore::AVAssetMIMETypeCache::setCacheMIMETypesCallback):
606         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm.
607         (WebCore::AVAssetMIMETypeCache::singleton):
608         (WebCore::AVAssetMIMETypeCache::setSupportedTypes):
609         (WebCore::AVAssetMIMETypeCache::types):
610         (WebCore::AVAssetMIMETypeCache::supportsContentType):
611         (WebCore::AVAssetMIMETypeCache::canDecodeType):
612         (WebCore::AVAssetMIMETypeCache::isAvailable const):
613         (WebCore::AVAssetMIMETypeCache::loadMIMETypes):
614         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h: Added.
615         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm: Added.
616         (WebCore::AVStreamDataParserMIMETypeCache::singleton):
617         (WebCore::AVStreamDataParserMIMETypeCache::types):
618         (WebCore::AVStreamDataParserMIMETypeCache::supportsContentType):
619         (WebCore::AVStreamDataParserMIMETypeCache::canDecodeType):
620         (WebCore::AVStreamDataParserMIMETypeCache::isAvailable const):
621         (WebCore::AVStreamDataParserMIMETypeCache::loadMIMETypes):
622         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
623         (WebCore::ImageDecoderAVFObjC::create):
624         (WebCore::ImageDecoderAVFObjC::supportsMediaType):
625         (WebCore::ImageDecoderAVFObjC::supportsContentType):
626         (WebCore::ImageDecoderAVFObjC::canDecodeType):
627         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
628         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
629         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
630         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
631         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
632         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
633         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine):
634         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes):
635         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
636
637 2019-05-06  Youenn Fablet  <youenn@apple.com>
638
639         WebAudio Node JS wrappers should not be collected if events can be fired
640         https://bugs.webkit.org/show_bug.cgi?id=197533
641
642         Reviewed by Jer Noble.
643
644         Before the patch, some web audio nodes could fire event listeners, but were not protected from GC.
645         Use CustomIsReachable to ensure theses nodes can be collected if:
646         - their AudioContext is stopped (typically due to document being navigated away).
647         - their AudioContext is closed.
648         - nodes do not have event listeners.
649
650         Covered by WPT mediacapture-streams/MediaStreamTrack-MediaElement-disabled-audio-is-silence.https.html and
651         WPT webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html
652         and web audio WebRTC tests.
653         Specific newly added test: webaudio/webaudio-gc.html
654
655         * Modules/webaudio/AudioContext.h:
656         (WebCore::AudioContext::isClosed const):
657         * Modules/webaudio/AudioNode.idl:
658         * Sources.txt:
659         * WebCore.xcodeproj/project.pbxproj:
660         * bindings/js/JSAudioNodeCustom.cpp: Added.
661         (WebCore::JSAudioNodeOwner::isReachableFromOpaqueRoots):
662
663 2019-05-06  Daniel Bates  <dabates@apple.com>
664
665         Google Docs & Yahoo! Japan: Can’t compose characters with Chinese or Japanese keyboard
666         https://bugs.webkit.org/show_bug.cgi?id=197474
667         <rdar://problem/47219324>
668
669         Reviewed by Ryosuke Niwa.
670
671         Fix up some #if defs to compile more Mac code when building on iOS.
672
673         * dom/KeyboardEvent.cpp:
674         (WebCore::KeyboardEvent::KeyboardEvent):
675         * platform/PlatformKeyboardEvent.h:
676         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
677
678 2019-05-06  Chris Dumez  <cdumez@apple.com>
679
680         Add assertions to CachedFrame to help figure out crash in CachedFrame constructor
681         https://bugs.webkit.org/show_bug.cgi?id=197621
682
683         Reviewed by Geoffrey Garen.
684
685         Add release assertions to try and figure out who is sometimes detaching the document from its
686         frame while constructing CachedFrames for its descendants.
687
688         * dom/Document.cpp:
689         (WebCore::Document::detachFromFrame):
690         * dom/Document.h:
691         (WebCore::Document::setMayBeDetachedFromFrame):
692         * history/CachedFrame.cpp:
693         (WebCore::CachedFrame::CachedFrame):
694
695 2019-05-06  Zan Dobersek  <zdobersek@igalia.com>
696
697         [GLib] WebCore::MainThreadSharedTimer should use the appropriate GSource priority, name
698         https://bugs.webkit.org/show_bug.cgi?id=197606
699
700         Reviewed by Carlos Garcia Campos.
701
702         * platform/MainThreadSharedTimer.cpp:
703         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
704         Use the MainThreadSharedTimer GLib priority for this timer. The name is
705         also adjusted accordingly.
706
707 2019-05-05  Wenson Hsieh  <wenson_hsieh@apple.com>
708
709         fast/attachment/attachment-folder-icon.html is an Image Only failure on recent macOS builds
710         https://bugs.webkit.org/show_bug.cgi?id=197593
711         <rdar://problem/50379267>
712
713         Reviewed by Tim Horton.
714
715         On recent versions of macOS, -[NSWorkspace iconForFileType:] returns the generic document icon for
716         "public.directory". Instead of using this UTI to generate attachment icons for "multipart/x-folder" and
717         "application/vnd.apple.folder", we should instead be using "public.folder", which has a folder icon. This fixes
718         the existing test fast/attachment/attachment-folder-icon.html, which currently results in an image diff on these
719         builds of macOS.
720
721         * rendering/RenderThemeMac.mm:
722         (WebCore::iconForAttachment):
723
724 2019-05-04  Alex Christensen  <achristensen@webkit.org>
725
726         Revert r244953 and r244954 because they broke internal builds.
727         https://bugs.webkit.org/show_bug.cgi?id=197534
728
729         * platform/ios/PlatformPasteboardIOS.mm:
730         (WebCore::PlatformPasteboard::changeCount const):
731         (WebCore::PlatformPasteboard::write):
732
733 2019-05-04  Alex Christensen  <achristensen@webkit.org>
734
735         Merge the three UIKitSPI.h files into a single one in PAL
736         https://bugs.webkit.org/show_bug.cgi?id=197534
737
738         Reviewed by Darin Adler.
739
740         * platform/ios/PlatformPasteboardIOS.mm:
741         (WebCore::PlatformPasteboard::changeCount const):
742         (WebCore::PlatformPasteboard::write):
743
744 2019-05-04  Youenn Fablet  <youenn@apple.com>
745
746         Convert some RealtimeOutgoingVideoSourceCocoa logging to ERROR_LOG
747         https://bugs.webkit.org/show_bug.cgi?id=197549
748
749         Reviewed by Eric Carlson.
750
751         No change of behavior.
752
753         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
754         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
755
756 2019-05-03  Simon Fraser  <simon.fraser@apple.com>
757
758         [macOS] Fix programmatic scrolling with async overflow scroll
759         https://bugs.webkit.org/show_bug.cgi?id=197590
760
761         Reviewed by Sam Weinig.
762         
763         ScrollingTreeOverflowScrollingNodeMac needs to handle RequestedScrollPosition.
764
765         Tests: scrollingcoordinator/mac/programmatic-frame-scroll.html
766                scrollingcoordinator/mac/programmatic-overflow-scroll.html
767
768         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
769         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
770
771 2019-05-03  Zalan Bujtas  <zalan@apple.com>
772
773         [iOS] outlook.live.com: Compose email frame not fully visible and not scrollable
774         https://bugs.webkit.org/show_bug.cgi?id=197573
775         <rdar://problem/48008441>
776
777         Reviewed by Wenson Hsieh.
778
779         The outlook mail view's flex column setup produces a somewhat unfortunate layout at certain viewport widths.
780         This patch addresses the issue by ensuring that we never fall into that range.
781
782         * page/Quirks.cpp:
783         (WebCore::Quirks::shouldIgnoreShrinkToFitContent const):
784         (WebCore::Quirks::overriddenViewportLayoutWidth const):
785         * page/Quirks.h:
786
787 2019-05-02  Jiewen Tan  <jiewen_tan@apple.com>
788
789         [WebAuthN] A focused document should be required
790         https://bugs.webkit.org/show_bug.cgi?id=197543
791         <rdar://problem/50430989>
792
793         Reviewed by Brent Fulgham.
794
795         This patch adds a check to see if the invoking document is focused before
796         calling into WebAuthN. This patch also removes some out-to-dated comments.
797
798         Test: http/wpt/webauthn/public-key-credential-unfocused-document.https.html
799
800         * Modules/credentialmanagement/CredentialsContainer.cpp:
801         (WebCore::CredentialsContainer::get):
802         (WebCore::CredentialsContainer::isCreate):
803         * Modules/webauthn/AuthenticatorCoordinator.cpp:
804         (WebCore::AuthenticatorCoordinator::create const):
805         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
806
807 2019-05-03  Devin Rousso  <drousso@apple.com>
808
809         Web Inspector: DOM: rename "low power" to "display composited"
810         https://bugs.webkit.org/show_bug.cgi?id=197296
811
812         Reviewed by Joseph Pecoraro.
813
814         Removed specific ChangeLog entries since it is almost entirely mechanical changes.
815
816         * inspector/agents/InspectorDOMAgent.h:
817         * inspector/agents/InspectorDOMAgent.cpp:
818
819 2019-05-03  Daniel Bates  <dabates@apple.com>
820
821         Pass KeyboardEvent by reference in more places
822         https://bugs.webkit.org/show_bug.cgi?id=197480
823
824         Reviewed by Wenson Hsieh.
825
826         * editing/Editor.cpp:
827         (WebCore::Editor::handleKeyboardEvent):
828         (WebCore::Editor::handleInputMethodKeydown):
829         * loader/EmptyClients.cpp:
830         * page/EditorClient.h:
831
832 2019-05-03  Chris Dumez  <cdumez@apple.com>
833
834         [iOS Sim Debug] ASSERTION FAILED The atomic string comes from an other thread! Layout Test imported/w3c/web-platform-tests/workers/WorkerNavigator_appName.htm is a flaky crash
835         https://bugs.webkit.org/show_bug.cgi?id=197530
836         <rdar://problem/50448285>
837
838         Reviewed by Geoffrey Garen.
839
840         The issue is that NavigatorBase::platform() was not thread safe but was called by both Navigator on
841         the main thread and WorkerNavigator on worker threads.
842
843         No new tests, covered by existing tests.
844
845         * page/Navigator.cpp:
846         (WebCore::Navigator::platform const):
847         * page/Navigator.h:
848
849         * page/NavigatorBase.cpp:
850         (WebCore::NavigatorBase::platform const):
851         * page/NavigatorBase.h:
852         Make NavigatorBase::platform() thread safe.
853
854         * platform/ios/Device.cpp:
855         (WebCore::deviceName):
856         * platform/ios/Device.h:
857         Make WebCore::deviceName() thread safe.
858
859         * platform/ios/UserAgentIOS.mm:
860         (WebCore::deviceNameForUserAgent):
861         Cache value returned by WebCore::deviceName() for performance.
862
863 2019-05-03  Chris Dumez  <cdumez@apple.com>
864
865         Use WeakPtr for JSLazyEventListener::m_originalNode for safety
866         https://bugs.webkit.org/show_bug.cgi?id=197576
867         <rdar://problem/24314027>
868
869         Reviewed by Alex Christensen.
870
871         * bindings/js/JSLazyEventListener.cpp:
872         (WebCore::JSLazyEventListener::JSLazyEventListener):
873         (WebCore::JSLazyEventListener::create):
874         * bindings/js/JSLazyEventListener.h:
875
876 2019-05-03  Eric Carlson  <eric.carlson@apple.com>
877
878         AVFoundation framework isn't always installed
879         https://bugs.webkit.org/show_bug.cgi?id=197577
880         <rdar://problem/50447841>
881
882         Reviewed by Jer Noble.
883         
884         Use PAL::isAVFoundationFrameworkAvailable() to check to see if AVFoundation is
885         installed, not PAL::AVFoundationLibrary().
886
887         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
888         (WebCore::AVFoundationMIMETypeCache::isAvailable const):
889         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
890         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
891         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
892         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
893         (WebCore::exernalDeviceDisplayNameForPlayer):
894         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
895         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
896         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
897         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
898         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
899         (WebCore::validateHEVCParameters):
900         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
901         (WebCore::AVCaptureDeviceManager::isAvailable):
902
903 2019-05-03  Sihui Liu  <sihui_liu@apple.com>
904
905         Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
906         https://bugs.webkit.org/show_bug.cgi?id=197390
907         <rdar://problem/42685773>
908
909         Reviewed by Geoffrey Garen.
910
911         We have seen crashes about accessing database files after device is locked. We are suspecting this is because 
912         shm files have wrong data protection class, but shm files should not have Complete class protection when it 
913         is created. It is likely the protection class is changed later. Add an assertion to verify our guess. If the 
914         crash signature changes after this patch, we probably need to change database implementation. If it is not, we
915         have other problem than data protection.
916
917         * platform/sql/SQLiteDatabase.cpp:
918         (WebCore::SQLiteDatabase::open):
919
920 2019-05-03  Youenn Fablet  <youenn@apple.com>
921
922         Cache.add and Cache.addAll should compute a correct response body size
923         https://bugs.webkit.org/show_bug.cgi?id=197464
924
925         Reviewed by Chris Dumez.
926
927         Compute the response body size as we do for regular Cache.put
928
929         Test: http/wpt/cache-storage/cache-quota-add.any.html
930
931         * Modules/cache/CacheStorageConnection.cpp:
932         (WebCore::CacheStorageConnection::computeRecordBodySize):
933         * Modules/cache/CacheStorageConnection.h:
934         * Modules/cache/DOMCache.cpp:
935         (WebCore::FetchTasksHandler::addResponseBody):
936         (WebCore::DOMCache::addAll):
937         Compute the response body size requires getting access to the connection.
938         'this' is added to the lambda which is fine since taskHandler keeps a
939         Ref to 'this' in its completion handler.
940         (WebCore::DOMCache::toConnectionRecord):
941         * Modules/fetch/FetchResponse.h:
942
943 2019-05-03  Tomoki Imai  <Tomoki.Imai@sony.com>
944
945         [Cairo] Improve ShadowBlur performance using tiling optimization
946         https://bugs.webkit.org/show_bug.cgi?id=197308
947         Reviewed by Žan Doberšek.
948
949         Enable tiling tiling-based optimization for drawRectShadow() and drawInsetShadow().
950         Since r228776, cairo ports doesn't have tiling-based optimization.
951
952         For AppleWin, this patch refactors code and it shares almost same code as cairo port.
953         Only the difference is that AppleWin uses ScratchBuffer, but cairo ports doesn't.
954         This should avoid a performance regression for AppleWin.
955
956         No new tests, covered by existing tests.
957
958         * platform/graphics/ShadowBlur.cpp:
959         (WebCore::calculateLobes):
960         Fix stylecheck errors
961
962         (WebCore::ShadowBlur::blurLayerImage):
963         Fix stylecheck errors
964
965         (WebCore::ShadowBlur::calculateLayerBoundingRect):
966         We don't use position of m_sourceRect, so change the type to FloatSize.
967
968         (WebCore::ShadowBlur::drawShadowBuffer):
969         Use m_layerSize instead of m_shadowedResultSize to fillRect, as m_layerSize is always smaller than m_shadowedResultSize.
970         It's because in m_layerSize is equal to m_shadowedResultSize if it's not clipped.
971         Clipping doesn't increase size of m_layerSize, so m_layerSize is always smaller than or equal to m_shadowedResultSize.
972
973         (WebCore::ShadowBlur::templateSize const):
974         Fix stylecheck errors
975
976         (WebCore::ShadowBlur::drawRectShadow):
977         (WebCore::ShadowBlur::drawInsetShadow):
978         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
979         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
980         (WebCore::ShadowBlur::drawRectShadowWithTiling):
981         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
982         Incorporate tile-based drawing.
983         To accomplish it, this patch abstracts GraphicsContext::drawImageBuffer to ShadowBlur::DrawImageCallback,
984         GraphicsContext::fillRect to ShadowBlur::FillRectCallback, drawing rect with hole to  ShadowBlur::FillRectWithHoleCallback.
985
986         Variants which takes GraphicsContext as parameter now just calls another drawRectShadow.
987
988         (WebCore::ShadowBlur::drawLayerPieces):
989         Instead of graphicsContext.drawImageBuffer, call corresponding callback.
990
991         (WebCore::ShadowBlur::drawLayerPiecesAndFillCenter):
992         This function calls drawLayerPieces and fill center for outer shadow.
993         Drawing outer shadow requires another callback for graphicsContext.fillRect.
994
995         (WebCore::ShadowBlur::drawShadowLayer):
996         Use m_layerSize instead of m_shadowedResultSize to fillRect,
997         as m_layerSize is always smaller than m_shadowedResultSize.
998
999         * platform/graphics/ShadowBlur.h:
1000         Rename m_sourceRect to m_shadowedResultSize, and change it to FloatSize from FloatRect.
1001         Remove GraphicsContext usage as much as possible and replace them by corresponding callbacks.
1002
1003         * platform/graphics/cairo/CairoOperations.cpp:
1004         (WebCore::Cairo::drawShadowImage):
1005         This function corresponds to ShadowBlur::DrawImageCallback.
1006
1007         (WebCore::Cairo::fillShadowBuffer):
1008         Erase sourceRect, as it's always bigger than layerSize.
1009
1010         (WebCore::Cairo::drawPathShadow):
1011         (WebCore::Cairo::drawGlyphsShadow):
1012         Erase unused parameter.
1013
1014         (WebCore::Cairo::fillRect):
1015         (WebCore::Cairo::fillRoundedRect):
1016         (WebCore::Cairo::fillRectWithRoundedHole):
1017         For tile-based optimization, add extra arguments to drawRectShadow.
1018
1019         (WebCore::Cairo::drawSurface):
1020         Erase unused parameter.
1021
1022 2019-05-03  Antti Koivisto  <antti@apple.com>
1023
1024         Add a quirk to make youtube navigation bar scrollable without mouse hover on iOS
1025         https://bugs.webkit.org/show_bug.cgi?id=197555
1026         <rdar://problem/49582231>
1027
1028         Reviewed by Brent Fulgham.
1029
1030         * css/StyleResolver.cpp:
1031         (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):
1032
1033         Turn 'overflow:hidden' into 'overflow:auto' on element with id="guide-inner-content".
1034
1035         * page/Quirks.cpp:
1036         (WebCore::Quirks::needsYouTubeOverflowScrollQuirk const):
1037         * page/Quirks.h:
1038
1039 2019-05-03  Devin Rousso  <drousso@apple.com>
1040
1041         Web Inspector: Record actions performed on WebGL2RenderingContext
1042         https://bugs.webkit.org/show_bug.cgi?id=176008
1043         <rdar://problem/34213884>
1044
1045         Reviewed by Joseph Pecoraro.
1046
1047         Tests: inspector/canvas/recording-webgl2.html
1048                inspector/canvas/recording-webgl2-snapshots.html
1049
1050         * html/canvas/WebGL2RenderingContext.idl:
1051
1052         * bindings/js/CallTracerTypes.h:
1053         * inspector/RecordingSwizzleTypes.h:
1054
1055         * inspector/InspectorCanvas.h:
1056         * inspector/InspectorCanvas.cpp:
1057         (WebCore::InspectorCanvas::canvasChanged): Added.
1058         (WebCore::InspectorCanvas::resetRecordingData):
1059         (WebCore::shouldSnapshotWebGL2Action): Added.
1060         (WebCore::InspectorCanvas::recordAction):
1061         (WebCore::InspectorCanvas::releaseObjectForRecording):
1062         (WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
1063         (WebCore::InspectorCanvas::buildAction):
1064         * inspector/agents/InspectorCanvasAgent.h:
1065         * inspector/agents/InspectorCanvasAgent.cpp:
1066         (WebCore::InspectorCanvasAgent::canvasChanged): Added.
1067         (WebCore::InspectorCanvasAgent::startRecording):
1068         Provide an actual implementation of `CanvasObserver::canvasChanged` since it can be used to
1069         determine whether or not an action needs a snapshot.
1070
1071         * page/PageConsoleClient.cpp:
1072         (WebCore::canvasRenderingContext):
1073
1074 2019-05-03  Commit Queue  <commit-queue@webkit.org>
1075
1076         Unreviewed, rolling out r244881.
1077         https://bugs.webkit.org/show_bug.cgi?id=197559
1078
1079         Breaks compilation of jsconly on linux, breaking compilation
1080         for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
1081         guijemont on #webkit).
1082
1083         Reverted changeset:
1084
1085         "[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
1086         WEBKIT_COPY_FILES"
1087         https://bugs.webkit.org/show_bug.cgi?id=197174
1088         https://trac.webkit.org/changeset/244881
1089
1090 2019-05-03  Joonghun Park  <jh718.park@samsung.com>
1091
1092         Resolve the percentage values of inset properties against proper box.
1093         https://bugs.webkit.org/show_bug.cgi?id=189549
1094
1095         Reviewed by Antti Koivisto.
1096
1097         Before this CL, sticky element's layout was executed relative to
1098         a box's overflow container,
1099         but the value returned by getComputedStyle was resolved against
1100         its containing block.
1101
1102         So, the computed value and the actual value used in layout
1103         was different before this change.
1104
1105         Tests: imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-sticky-container-for-abspos.html
1106                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-sticky-pos-percent.html
1107
1108         * css/CSSComputedStyleDeclaration.cpp:
1109         (WebCore::positionOffsetValue):
1110         * rendering/RenderBox.cpp:
1111         (WebCore::RenderBox::enclosingScrollportBox const):
1112         * rendering/RenderBox.h:
1113
1114 2019-05-02  Antti Koivisto  <antti@apple.com>
1115
1116         Add a quirk to make gmail navigation bar scrollable without mouse hover on iOS
1117         https://bugs.webkit.org/show_bug.cgi?id=197529
1118         <rdar://problem/49403416>
1119
1120         Reviewed by Simon Fraser.
1121
1122         * css/StyleResolver.cpp:
1123         (WebCore::StyleResolver::adjustRenderStyle):
1124         (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):
1125
1126         Turn 'overflow:hidden' to 'overflow:auto' on element with role="navigation".
1127         This should be both reasonably targeted and robust.
1128
1129         * css/StyleResolver.h:
1130         * page/Quirks.cpp:
1131         (WebCore::Quirks::needsGMailOverflowScrollQuirk const):
1132         * page/Quirks.h:
1133
1134 2019-05-02  Simon Fraser  <simon.fraser@apple.com>
1135
1136         Add logging for RenderLayer clip rects
1137         https://bugs.webkit.org/show_bug.cgi?id=197547
1138
1139         Reviewed by Zalan Bujtas.
1140
1141         Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
1142
1143         * platform/Logging.h:
1144         * rendering/ClipRect.cpp:
1145         (WebCore::operator<<):
1146         * rendering/ClipRect.h:
1147         * rendering/RenderLayer.cpp:
1148         (WebCore::operator<<):
1149         (WebCore::RenderLayer::calculateClipRects const):
1150         * rendering/RenderLayer.h:
1151
1152 2019-05-02  Youenn Fablet  <youenn@apple.com>
1153
1154         Make AudioContext::scriptExecutionContext() private
1155         https://bugs.webkit.org/show_bug.cgi?id=197512
1156
1157         Reviewed by Eric Carlson.
1158
1159         Refactor code to make audio nodes not rely on AudioContext::scriptExecutionContext.
1160         Instead, let AudioContext provide the necessary API for its nodes.
1161         Covered by existing tests.
1162
1163         * Modules/webaudio/AudioBufferSourceNode.cpp:
1164         (WebCore::AudioBufferSourceNode::looping):
1165         (WebCore::AudioBufferSourceNode::setLooping):
1166         * Modules/webaudio/AudioContext.cpp:
1167         (WebCore::AudioContext::postTask):
1168         (WebCore::AudioContext::origin const):
1169         (WebCore::AudioContext::addConsoleMessage):
1170         * Modules/webaudio/AudioContext.h:
1171         (WebCore::AudioContext::isStopped const):
1172         * Modules/webaudio/AudioNode.cpp:
1173         (WebCore::AudioNode::scriptExecutionContext const):
1174         * Modules/webaudio/AudioNode.h:
1175         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1176         (WebCore::AudioScheduledSourceNode::finish):
1177         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
1178         (WebCore::DefaultAudioDestinationNode::resume):
1179         (WebCore::DefaultAudioDestinationNode::suspend):
1180         (WebCore::DefaultAudioDestinationNode::close):
1181         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
1182         (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
1183         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
1184         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
1185         * Modules/webaudio/ScriptProcessorNode.cpp:
1186         (WebCore::ScriptProcessorNode::fireProcessEvent):
1187
1188 2019-05-02  Ryosuke Niwa  <rniwa@webkit.org>
1189
1190         Disable software keyboard for a math field textarea on desmos.com
1191         https://bugs.webkit.org/show_bug.cgi?id=197488
1192
1193         Reviewed by Wenson Hsieh.
1194
1195         Treat a textarea inside a math field span as if it had inputmode content attribute set to none to suppress
1196         the software keyboard on desmos.com as it interferes with website's own UI.
1197
1198         * html/HTMLElement.cpp:
1199         (WebCore::HTMLElement::canonicalInputMode const):
1200         * page/Quirks.cpp:
1201         (WebCore::Quirks::needsInputModeNoneImplicitly const):
1202         * page/Quirks.h:
1203
1204 2019-05-02  Timothy Hatcher  <timothy@apple.com>
1205
1206         NSAttributedString conversion in a loop returns nil and WKUnknownError every other time.
1207         https://bugs.webkit.org/show_bug.cgi?id=197523
1208
1209         Reviewed by Darin Adler.
1210
1211         * editing/cocoa/HTMLConverter.mm:
1212         (HTMLConverter::convert): Don't return early if m_dataSource is nil. This is already null
1213         checked later and only needed in specific cases, it shouldn't fail the whole conversion.
1214
1215 2019-05-02  Chris Dumez  <cdumez@apple.com>
1216
1217         Setting a frame's src to a javascript URL should not run it synchronously
1218         https://bugs.webkit.org/show_bug.cgi?id=197466
1219
1220         Reviewed by Darin Adler.
1221
1222         When an iframe's src attribute is set to a javascript URL, whether when parsing
1223         or later on via JS, we now execute the URL's JavaScript asynchronously. We used
1224         to execute it synchronously, which was a source of bugs and also did not match
1225         other browsers.
1226
1227         I have verified that our new behavior is aligned with both Firefox and Chrome.
1228
1229         Note that for backward-compatibility and interoperability with Blink
1230         (https://bugs.chromium.org/p/chromium/issues/detail?id=923585), the
1231         "javascript:''" URL will still run synchronously. We should consider dropping
1232         this quirk at some point.
1233
1234         Test: fast/dom/frame-src-javascript-url-async.html
1235
1236         * loader/NavigationScheduler.cpp:
1237         (WebCore::ScheduledLocationChange::ScheduledLocationChange):
1238         (WebCore::ScheduledLocationChange::~ScheduledLocationChange):
1239         (WebCore::NavigationScheduler::scheduleLocationChange):
1240         * loader/NavigationScheduler.h:
1241         (WebCore::NavigationScheduler::scheduleLocationChange):
1242         * loader/SubframeLoader.cpp:
1243         (WebCore::SubframeLoader::requestFrame):
1244
1245 2019-05-02  Gary Katsevman  <git@gkatsev.com>
1246
1247         WebVTT: fix vertical cue alignment.
1248         https://bugs.webkit.org/show_bug.cgi?id=136627.
1249         <rdar://problem/49725538>
1250
1251         Reviewed by Eric Carlson.
1252
1253         Updated existing test results.
1254
1255         * html/track/VTTCue.cpp:
1256         (WebCore::VTTCueBox::applyCSSProperties):
1257
1258 2019-05-02  Don Olmstead  <don.olmstead@sony.com>
1259
1260         [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
1261         https://bugs.webkit.org/show_bug.cgi?id=197174
1262
1263         Reviewed by Alex Christensen.
1264
1265         Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
1266         for framework headers explicit.
1267
1268         * CMakeLists.txt:
1269
1270 2019-05-02  Jiewen Tan  <jiewen_tan@apple.com>
1271
1272         [WebAuthN] Add a quirk for google.com when processing AppID extension
1273         https://bugs.webkit.org/show_bug.cgi?id=196046
1274         <rdar://problem/49088479>
1275
1276         Reviewed by Brent Fulgham.
1277
1278         Relaxing the same site restriction on AppID while in google.com and any
1279         of its subdomains to allow two www.gstatic.com AppIDs to slip in.
1280
1281         Covered by manual tests on Google.com.
1282
1283         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1284         (WebCore::AuthenticatorCoordinatorInternal::needsAppIdQuirks):
1285         (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
1286
1287 2019-05-02  Ross Kirsling  <ross.kirsling@sony.com>
1288
1289         Unreviewed fix for non-unified build after r244853.
1290
1291         * page/SecurityOrigin.cpp:
1292
1293 2019-05-02  Frederic Wang  <fwang@igalia.com>
1294
1295         [GTK][WPE] Disable "thin", "thick", "medium" values of mfrac@linethickness at runtime
1296         https://bugs.webkit.org/show_bug.cgi?id=196142
1297
1298         This patch introduces some experimental runtime flag to let users
1299         disable MathML features that are removed from MathML Core [1]. For now,
1300         these features are only disabled on GTK and WPE ports. This patch also
1301         adds a condition to disable "thin", "thick", "medium" values of
1302         mfrac@linethickness at runtime as agreed in [2].
1303
1304         [1] https://mathml-refresh.github.io/mathml-core/
1305         [2] https://github.com/mathml-refresh/mathml/issues/4
1306
1307         Reviewed by Rob Buis.
1308
1309         No new tests, covered by frac-linethickness-0001.html
1310
1311         * mathml/MathMLFractionElement.cpp:
1312         (WebCore::MathMLFractionElement::lineThickness): Just do standard
1313         parsing for MathML lengths when non-core MathML features are disabled.
1314         * page/Settings.yaml: Add WebCore setting.
1315
1316 2019-05-01  Jiewen Tan  <jiewen_tan@apple.com>
1317
1318         [WebAuthN] Adopt SecurityOrigin::isMatchingRegistrableDomainSuffix()
1319         https://bugs.webkit.org/show_bug.cgi?id=197481
1320
1321         Reviewed by Brent Fulgham.
1322
1323         This patch implements Step 6-7 from:
1324         https://www.w3.org/TR/webauthn/#createCredential,
1325         https://www.w3.org/TR/webauthn/#discover-from-external-source.
1326
1327         Test: http/wpt/webauthn/public-key-credential-ip-address.html
1328
1329         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1330         (WebCore::AuthenticatorCoordinator::create const):
1331         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
1332
1333 2019-05-01  Youenn Fablet  <youenn@apple.com>
1334
1335         Add back hasNullReferences() assert in Document::updateIsPlayingMedia
1336         https://bugs.webkit.org/show_bug.cgi?id=197477
1337
1338         Reviewed by Eric Carlson.
1339
1340         AudioContext had a special scriptExecutionContext() getter
1341         that was returning nullptr when AudioContext is stopped.
1342         Instead, make this getter behave as all other scriptExecutionContext() getters
1343         and make sure existing call sites of the getter are fine with the change.
1344
1345         Covered by existing tests.
1346
1347         * Modules/webaudio/AudioContext.cpp:
1348         (WebCore::AudioContext::AudioContext):
1349         No need to check whether offline since this constructor is for non offline AudioContext.
1350         (WebCore::AudioContext::scriptExecutionContext const):
1351         (WebCore::AudioContext::fireCompletionEvent):
1352         * dom/Document.cpp:
1353         (WebCore::Document::updateIsPlayingMedia):
1354
1355 2019-05-01  Justin Fan  <justin_fan@apple.com>
1356
1357         Update WebGPU class names based on sketch.idl
1358         https://bugs.webkit.org/show_bug.cgi?id=194260
1359
1360         Reviewed by Dean Jackson.
1361
1362         Update all exposed Web GPU interface names to GPU* prefix.
1363
1364         Existing Web GPU tests updated to expect new names.
1365
1366         * Modules/webgpu/WebGPU.idl:
1367         * Modules/webgpu/WebGPUAdapter.idl:
1368         * Modules/webgpu/WebGPUBindGroup.idl:
1369         * Modules/webgpu/WebGPUBindGroupLayout.idl:
1370         * Modules/webgpu/WebGPUBuffer.idl:
1371         * Modules/webgpu/WebGPUDevice.idl:
1372         * Modules/webgpu/WebGPUInputStepMode.h: Removed.
1373         * Modules/webgpu/WebGPUPipelineLayout.idl:
1374         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
1375         * Modules/webgpu/WebGPUQueue.idl:
1376         * Modules/webgpu/WebGPURenderPassEncoder.idl:
1377         * Modules/webgpu/WebGPURenderPipeline.idl:
1378         * Modules/webgpu/WebGPUSampler.idl:
1379         * Modules/webgpu/WebGPUTexture.idl:
1380         * Modules/webgpu/WebGPUTextureView.idl:
1381         * WebCore.xcodeproj/project.pbxproj:
1382         * bindings/js/WebCoreBuiltinNames.h:
1383
1384 2019-05-01  Jiewen Tan  <jiewen_tan@apple.com>
1385
1386         Move Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
1387         https://bugs.webkit.org/show_bug.cgi?id=181950
1388         <rdar://problem/43357371>
1389
1390         Reviewed by Brent Fulgham.
1391
1392         This patch moves Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
1393         to be more aligned with the HTML standard:
1394         https://html.spec.whatwg.org/multipage/origin.html#is-a-registrable-domain-suffix-of-or-is-equal-to.
1395         Besides that, it also removes redundant codes within the original method that is also done in
1396         OriginAccessEntry::matchesOrigin.
1397
1398         Covered by new API tests.
1399
1400         * dom/Document.cpp:
1401         (WebCore::Document::setDomain):
1402         (WebCore::Document::domainIsRegisterable const): Deleted.
1403         * dom/Document.h:
1404         * page/SecurityOrigin.cpp:
1405         (WebCore::SecurityOrigin::isMatchingRegistrableDomainSuffix const):
1406         * page/SecurityOrigin.h:
1407
1408 2019-05-01  Ryosuke Niwa  <rniwa@webkit.org>
1409
1410         [iOS] Element::focus and Element::scrollIntoView do not clamp scroll positions
1411         https://bugs.webkit.org/show_bug.cgi?id=197211
1412
1413         Reviewed by Simon Fraser.
1414
1415         Fixed the bug that Element::focus and Element::scrollIntoView were not clamping scroll offsets,
1416         which causes scrollTop etc... to return a bogus negative scrolling offset.
1417
1418         Unfortunately, we can't just use FrameView's ScrollableArea::constrainScrollPosition since
1419         scrollRectToVisible relies on the visible rect being expanded by the content insets in order to scroll to
1420         a position within the content insets of UIScrollView; e.g. revealing the top of the page as the center.
1421         We manually expand minimumScrollPosition() and maximumScrollPosition() by the content insets instead.
1422
1423         Tests: fast/scrolling/ios/programmatic-scroll-via-focus-should-clamp-top.html
1424                fast/scrolling/ios/programmatic-scroll-via-scrollIntoView-inside-iframe-should-clamp-top.html
1425                fast/scrolling/ios/programmatic-scroll-via-scrollIntoView-should-clamp-top.html
1426
1427         * rendering/RenderLayer.cpp:
1428         (WebCore::RenderLayer::scrollRectToVisible):
1429
1430 2019-05-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1431
1432         [iOS] Add a version of viewport shrink-to-fit heuristics that preserves page layout
1433         https://bugs.webkit.org/show_bug.cgi?id=197342
1434         <rdar://problem/50063091>
1435
1436         Reviewed by Tim Horton.
1437
1438         Adds support for a new shrink-to-fit heuristic that attempts to lay out the contents of the page at a larger
1439         width in order to shrink content to fit the viewport. See WebKit ChangeLog for more details.
1440
1441         Tests: fast/viewport/ios/shrink-to-fit-content-constant-width.html
1442                fast/viewport/ios/shrink-to-fit-content-large-width-breakpoint.html
1443                fast/viewport/ios/shrink-to-fit-content-no-viewport.html
1444                fast/viewport/ios/shrink-to-fit-content-responsive-viewport-with-horizontal-overflow.html
1445                fast/viewport/ios/shrink-to-fit-content-temporary-overflow.html
1446
1447         * page/ViewportConfiguration.cpp:
1448         (WebCore::ViewportConfiguration::setMinimumEffectiveDeviceWidth):
1449         (WebCore::ViewportConfiguration::setIsKnownToLayOutWiderThanViewport):
1450         (WebCore::ViewportConfiguration::description const):
1451         * page/ViewportConfiguration.h:
1452         (WebCore::ViewportConfiguration::canIgnoreScalingConstraints const):
1453         (WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const):
1454
1455         Add several new getters and setters in ViewportConfiguration.
1456
1457         (WebCore::ViewportConfiguration::isKnownToLayOutWiderThanViewport const):
1458         (WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const):
1459
1460         Importantly, only allow ignoring the minimum effective device width in webpages with responsive viewports, if
1461         they also have *not* laid out wider than the viewport.
1462
1463         (WebCore::ViewportConfiguration::setForceAlwaysUserScalable):
1464
1465 2019-05-01  Zalan Bujtas  <zalan@apple.com>
1466
1467         [iOS] Star rating is covered with a black circle when writing a review on Yelp
1468         https://bugs.webkit.org/show_bug.cgi?id=197469
1469         <rdar://problem/48094446>
1470
1471         Reviewed by Dean Jackson.
1472
1473         This patch moves the background painting of the radio/checkbox form controls in checked state to RenderTheme.
1474         It enables content authors to disable default appearance using -webkit-appearance: none (it is also inline with what we do on macOS).
1475
1476         Test: fast/forms/radio-and-checkbox-checked-with-no-appearance.html
1477
1478         * css/html.css:
1479         (input:matches([type="checkbox"], [type="radio"]):checked):
1480         * rendering/RenderThemeIOS.mm:
1481         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
1482         (WebCore::RenderThemeIOS::paintRadioDecorations):
1483
1484 2019-05-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
1485
1486         REGRESSION (r244182): RenderingUpdate should not be scheduled for invisible pages
1487         https://bugs.webkit.org/show_bug.cgi?id=197451
1488
1489         Reviewed by Simon Fraser.
1490
1491         Before r244182, some web pages never need to schedule a RenderingUpdate.
1492         Only pages with rAF callbacks, web animations, intersection and resize 
1493         observers needed to do so. After r244182, all pages have to schedule a
1494         RenderingUpdate when a page rendering update is required.
1495
1496         When Safari opens, it create a 'blank' web page. The blank page will not
1497         be visible unless the user selects to show the 'Empty page' in the new
1498         tab. Although the blank page is not visible, the loader needs to resolveStyle()
1499         which requires to scheduleLayerFlushNow(). 
1500
1501         We need to optimize this case: calling scheduleLayerFlushNow() for invisible
1502         pages. We do that by checking if the page is visible before scheduling
1503         the RenderingUpdate.
1504
1505         Also we need to change or get rid of scheduleLayerFlushNow() since its name
1506         has become confusing. It suggests that it is going to schedule flushing
1507         the layer 'now'. But after r244182, it does scheduleRenderingUpdate() first.
1508         And when it fires, scheduleCompositingLayerFlush() will be called.
1509
1510         * page/RenderingUpdateScheduler.cpp:
1511         (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
1512         * rendering/RenderLayerCompositor.cpp:
1513         (WebCore::RenderLayerCompositor::scheduleLayerFlush):
1514         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
1515         (WebCore::RenderLayerCompositor::frameViewDidScroll):
1516         (WebCore::RenderLayerCompositor::attachRootLayer):
1517         (WebCore::RenderLayerCompositor::setLayerFlushThrottlingEnabled):
1518         (WebCore::RenderLayerCompositor::layerFlushTimerFired):
1519         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow): Deleted.
1520         * rendering/RenderLayerCompositor.h:
1521
1522 2019-05-01  Darin Adler  <darin@apple.com>
1523
1524         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
1525         https://bugs.webkit.org/show_bug.cgi?id=195535
1526
1527         Reviewed by Alexey Proskuryakov.
1528
1529         * platform/SharedBuffer.cpp:
1530         (WebCore::utf8Buffer): Removed unnecessary "strict" argument to convertUTF16ToUTF8 since
1531         that is the default behavior. Also updated for changes to return values.
1532
1533         * xml/XSLTProcessorLibxslt.cpp:
1534         (WebCore::writeToStringBuilder): Removed unnecessary use of StringBuffer for a temporary
1535         buffer for characters. Rewrote to use U8_NEXT and U16_APPEND directly.
1536
1537         * xml/parser/XMLDocumentParserLibxml2.cpp:
1538         (WebCore::convertUTF16EntityToUTF8): Updated for changes to CompletionResult.
1539
1540 2019-05-01  Shawn Roberts  <sroberts@apple.com>
1541
1542         Unreviewed, rolling out r244821.
1543
1544         Causing
1545
1546         Reverted changeset:
1547
1548         "WebKit has too much of its own UTF-8 code and should rely
1549         more on ICU's UTF-8 support"
1550         https://bugs.webkit.org/show_bug.cgi?id=195535
1551         https://trac.webkit.org/changeset/244821
1552
1553 2019-05-01  Shawn Roberts  <sroberts@apple.com>
1554
1555         Unreviewed, rolling out r244822.
1556
1557         Causing
1558
1559         Reverted changeset:
1560
1561         https://trac.webkit.org/changeset/244822
1562
1563 2019-05-01  Youenn Fablet  <youenn@apple.com>
1564
1565         Reject/throw when calling AudioContext methods on a stopped AudioContext
1566         https://bugs.webkit.org/show_bug.cgi?id=197391
1567
1568         Reviewed by Eric Carlson.
1569
1570         Return InvalidStateError in that case.
1571         ASSERT that we do not call lazyInitialize after being stopped
1572         since this would mean we are doing unneeded processing.
1573
1574         Test: http/wpt/webaudio/audiocontext-stopped.html
1575
1576         * Modules/webaudio/AudioContext.cpp:
1577         (WebCore::AudioContext::lazyInitialize):
1578         (WebCore::AudioContext::createBufferSource):
1579         (WebCore::AudioContext::createMediaElementSource):
1580         (WebCore::AudioContext::createMediaStreamSource):
1581         (WebCore::AudioContext::createMediaStreamDestination):
1582         (WebCore::AudioContext::createScriptProcessor):
1583         (WebCore::AudioContext::createBiquadFilter):
1584         (WebCore::AudioContext::createWaveShaper):
1585         (WebCore::AudioContext::createPanner):
1586         (WebCore::AudioContext::createConvolver):
1587         (WebCore::AudioContext::createDynamicsCompressor):
1588         (WebCore::AudioContext::createAnalyser):
1589         (WebCore::AudioContext::createGain):
1590         (WebCore::AudioContext::createDelay):
1591         (WebCore::AudioContext::createChannelSplitter):
1592         (WebCore::AudioContext::createChannelMerger):
1593         (WebCore::AudioContext::createOscillator):
1594         (WebCore::AudioContext::createPeriodicWave):
1595         (WebCore::AudioContext::startRendering):
1596         (WebCore::AudioContext::suspend):
1597         (WebCore::AudioContext::resume):
1598         (WebCore::AudioContext::close):
1599         * Modules/webaudio/AudioContext.h:
1600         * Modules/webaudio/AudioContext.idl:
1601
1602 2019-05-01  Eric Carlson  <eric.carlson@apple.com>
1603
1604         XMLHttpRequest should propagate user gestures for media playback
1605         https://bugs.webkit.org/show_bug.cgi?id=197428
1606         <rdar://problem/46677392>
1607
1608         Reviewed by Jer Noble.
1609
1610         A user gesture the would allow media state change in effect when XMLHttpRequest.send is 
1611         called should be active when the event handlers fire after the transaction completes successfully.
1612
1613         Test: http/tests/media/user-gesture-preserved-across-xmlhttprequest.html
1614
1615         * dom/UserGestureIndicator.cpp:
1616         (WebCore::UserGestureIndicator::UserGestureIndicator): Add a 'scope' parameter to potentially
1617         limit the scope of the gesture to just media.
1618         (WebCore::UserGestureIndicator::~UserGestureIndicator): Clear the scope.
1619         * dom/UserGestureIndicator.h:
1620         (WebCore::UserGestureToken::processingUserGesture const):
1621         (WebCore::UserGestureToken::setScope):
1622         (WebCore::UserGestureToken::resetScope):
1623         (WebCore::UserGestureToken::hasExpired const):
1624
1625         * page/DOMTimer.cpp:
1626         (WebCore::DOMTimerFireState::DOMTimerFireState): Don't need to store the nested timer interval,
1627         UserGestureIndicator knows when it started.
1628         (WebCore::DOMTimer::DOMTimer): Ditto.
1629         (WebCore::DOMTimer::fired): Ditto.
1630         (WebCore::DOMTimerFireState::nestedTimerInterval const): Deleted.
1631         (WebCore::shouldForwardUserGesture): Deleted.
1632         (WebCore::userGestureTokenToForward): Deleted.
1633         (WebCore::currentNestedTimerInterval): Deleted.
1634         * page/DOMTimer.h:
1635
1636         * testing/Internals.cpp:
1637         (WebCore::Internals::setXHRMaximumIntervalForUserGestureForwarding): Override the maximum
1638         user gesture interval for testing.
1639         * testing/Internals.h:
1640         * testing/Internals.idl:
1641
1642         * xml/XMLHttpRequest.cpp:
1643         (WebCore::XMLHttpRequest::XMLHttpRequest): 
1644         (WebCore::XMLHttpRequest::send): Stash the user gesture token.
1645         (WebCore::XMLHttpRequest::dispatchEvent): Clear user gesture token if it has expired. If still
1646         valid, activate it.
1647         * xml/XMLHttpRequest.h:
1648
1649 2019-04-29  Darin Adler  <darin@apple.com>
1650
1651         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
1652         https://bugs.webkit.org/show_bug.cgi?id=195535
1653
1654         Reviewed by Alexey Proskuryakov.
1655
1656         * platform/SharedBuffer.cpp:
1657         (WebCore::utf8Buffer): Removed unnecessary "strict" argument to convertUTF16ToUTF8 since
1658         that is the default behavior. Also updated for changes to return values.
1659
1660         * xml/XSLTProcessorLibxslt.cpp:
1661         (WebCore::writeToStringBuilder): Removed unnecessary use of StringBuffer for a temporary
1662         buffer for characters. Rewrote to use U8_NEXT and U16_APPEND directly.
1663
1664         * xml/parser/XMLDocumentParserLibxml2.cpp:
1665         (WebCore::convertUTF16EntityToUTF8): Updated for changes to CompletionResult.
1666
1667 2019-04-30  John Wilander  <wilander@apple.com>
1668
1669         Add logging of Ad Click Attribution errors and events to a dedicated channel
1670         https://bugs.webkit.org/show_bug.cgi?id=197332
1671         <rdar://problem/49918800>
1672
1673         Reviewed by Youenn Fablet.
1674
1675         This patch adds an experimental Ad Click Attribution debug mode which
1676         logs information.
1677
1678         No new tests.
1679
1680         * loader/AdClickAttribution.cpp:
1681         (WebCore::AdClickAttribution::parseConversionRequest):
1682         (WebCore::AdClickAttribution::debugModeEnabled):
1683         * loader/AdClickAttribution.h:
1684         * page/RuntimeEnabledFeatures.h:
1685         (WebCore::RuntimeEnabledFeatures::adClickAttributionDebugModeEnabled const):
1686         (WebCore::RuntimeEnabledFeatures::setAdClickAttributionDebugModeEnabled):
1687         * platform/Logging.h:
1688
1689 2019-04-30  Myles C. Maxfield  <mmaxfield@apple.com>
1690
1691         font-weight: 1000 is not parsed successfully
1692         https://bugs.webkit.org/show_bug.cgi?id=197427
1693
1694         Reviewed by Dean Jackson.
1695
1696         The spec says:
1697         "Only values greater than or equal to 1, and less than or equal to 1000, are valid"
1698
1699         This change brings us in-line with all the other browsers.
1700
1701         Test: fast/text/font-weight-1-1000.html
1702
1703         * css/parser/CSSPropertyParserHelpers.cpp:
1704         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
1705
1706 2019-04-30  Youenn Fablet  <youenn@apple.com>
1707
1708         Make Document audio producers use WeakPtr
1709         https://bugs.webkit.org/show_bug.cgi?id=197382
1710
1711         Reviewed by Eric Carlson.
1712
1713         Move from a hash set of raw pointers to a hash set of weak pointers.
1714         This helps make the code cleaner.
1715         No observable change of behavior.
1716
1717         * Modules/mediastream/MediaStreamTrack.h:
1718         * dom/Document.cpp:
1719         (WebCore::Document::addAudioProducer):
1720         (WebCore::Document::removeAudioProducer):
1721         (WebCore::Document::updateIsPlayingMedia):
1722         (WebCore::Document::pageMutedStateDidChange):
1723         * dom/Document.h:
1724         * html/HTMLMediaElement.cpp:
1725         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
1726         * html/HTMLMediaElement.h:
1727         * page/MediaProducer.h:
1728
1729 2019-04-30  Youenn Fablet  <youenn@apple.com>
1730
1731         [macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
1732         https://bugs.webkit.org/show_bug.cgi?id=196864
1733         <rdar://problem/49854497>
1734
1735         Reviewed by Alex Christensen.
1736
1737         In case of redirection, it is sometimes not possible to retrieve the form data
1738         from its NSInputStream in case of redirections.
1739         To handle this case, reuse the first request form data if the new request has a body.
1740         We also clear the HTTP content type in such a case if the original request has no content type.
1741
1742         Covered by re-enabled tests.
1743
1744         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1745         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
1746
1747 2019-04-30  Commit Queue  <commit-queue@webkit.org>
1748
1749         Unreviewed, rolling out r244773.
1750         https://bugs.webkit.org/show_bug.cgi?id=197436
1751
1752         Causing assertion failures on debug queues (Requested by
1753         ShawnRoberts on #webkit).
1754
1755         Reverted changeset:
1756
1757         "Make Document audio producers use WeakPtr"
1758         https://bugs.webkit.org/show_bug.cgi?id=197382
1759         https://trac.webkit.org/changeset/244773
1760
1761 2019-04-30  Commit Queue  <commit-queue@webkit.org>
1762
1763         Unreviewed, rolling out r244774.
1764         https://bugs.webkit.org/show_bug.cgi?id=197431
1765
1766         Causing assertion failures on debug queues (Requested by
1767         ShawnRoberts on #webkit).
1768
1769         Reverted changeset:
1770
1771         "Reject/throw when calling AudioContext methods on a stopped
1772         AudioContext"
1773         https://bugs.webkit.org/show_bug.cgi?id=197391
1774         https://trac.webkit.org/changeset/244774
1775
1776 2019-04-30  Alex Christensen  <achristensen@webkit.org>
1777
1778         Add WKContentRuleList ping resource-type
1779         https://bugs.webkit.org/show_bug.cgi?id=197325
1780         <rdar://problem/49841404>
1781
1782         Reviewed by Geoff Garen.
1783
1784         Tests: http/tests/contentextensions/block-ping-resource-type-ping.html and http/tests/contentextensions/block-ping-resource-type-raw.html
1785
1786         * contentextensions/ContentExtensionsBackend.cpp:
1787         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
1788         * contentextensions/ContentExtensionsBackend.h:
1789         * loader/PingLoader.cpp:
1790         (WebCore::processContentRuleListsForLoad):
1791         (WebCore::PingLoader::sendPing):
1792         * loader/ResourceLoadInfo.cpp:
1793         (WebCore::ContentExtensions::readResourceType):
1794         (WebCore::ContentExtensions::ResourceLoadInfo::getResourceFlags const):
1795         * loader/ResourceLoadInfo.h:
1796         * page/UserContentProvider.cpp:
1797         (WebCore::UserContentProvider::processContentRuleListsForLoad):
1798         * page/UserContentProvider.h:
1799
1800 2019-04-30  Justin Fan  <justin_fan@apple.com>
1801
1802         [WebGPU] Move 'gpu' API entry point from DOMWindow to Navigator
1803         https://bugs.webkit.org/show_bug.cgi?id=197348
1804
1805         Reviewed by Myles C. Maxfield.
1806
1807         Latest API provides 'gpu' through Navigator instead of DOMWindow. Replace DOMWindowWebGPU with NavigatorGPU.
1808
1809         Existing tests updated to match. Add test: webgpu-enabled-in-worker.html to ensure workers can access WebGPU.
1810
1811         * CMakeLists.txt:
1812         * DerivedSources.make:
1813         * Modules/webgpu/NavigatorGPU.cpp:
1814         (WebCore::NavigatorGPU::from):
1815         (WebCore::NavigatorGPU::supplementName):
1816         (WebCore::NavigatorGPU::gpu):
1817         (WebCore::NavigatorGPU::gpu const):
1818         * Modules/webgpu/NavigatorGPU.h:
1819         * Modules/webgpu/NavigatorGPU.idl:
1820         * Modules/webgpu/WorkerNavigatorGPU.cpp:
1821         (WebCore::WorkerNavigatorGPU::from):
1822         (WebCore::WorkerNavigatorGPU::supplementName):
1823         (WebCore::WorkerNavigatorGPU::gpu):
1824         (WebCore::WorkerNavigatorGPU::gpu const):
1825         * Modules/webgpu/WorkerNavigatorGPU.h:
1826         * Modules/webgpu/WorkerNavigatorGPU.idl:
1827         * Sources.txt:
1828         * WebCore.xcodeproj/project.pbxproj:
1829
1830 2019-04-30  Zalan Bujtas  <zalan@apple.com>
1831
1832         Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
1833         https://bugs.webkit.org/show_bug.cgi?id=197347
1834         <rdar://problem/49393423>
1835
1836         Reviewed by Wenson Hsieh.
1837
1838         Tests: fast/events/touch/ios/double-tap-for-double-click1.html
1839                fast/events/touch/ios/double-tap-for-double-click2.html
1840
1841         * page/Frame.h:
1842         * page/ios/FrameIOS.mm:
1843         (WebCore::Frame::nodeRespondingToDoubleClickEvent):
1844
1845 2019-04-30  Youenn Fablet  <youenn@apple.com>
1846
1847         Reject/throw when calling AudioContext methods on a stopped AudioContext
1848         https://bugs.webkit.org/show_bug.cgi?id=197391
1849
1850         Reviewed by Eric Carlson.
1851
1852         Return InvalidStateError in that case.
1853         ASSERT that we do not call lazyInitialize after being stopped
1854         since this would mean we are doing unneeded processing.
1855
1856         Test: http/wpt/webaudio/audiocontext-stopped.html
1857
1858         * Modules/webaudio/AudioContext.cpp:
1859         (WebCore::AudioContext::lazyInitialize):
1860         (WebCore::AudioContext::createBufferSource):
1861         (WebCore::AudioContext::createMediaElementSource):
1862         (WebCore::AudioContext::createMediaStreamSource):
1863         (WebCore::AudioContext::createMediaStreamDestination):
1864         (WebCore::AudioContext::createScriptProcessor):
1865         (WebCore::AudioContext::createBiquadFilter):
1866         (WebCore::AudioContext::createWaveShaper):
1867         (WebCore::AudioContext::createPanner):
1868         (WebCore::AudioContext::createConvolver):
1869         (WebCore::AudioContext::createDynamicsCompressor):
1870         (WebCore::AudioContext::createAnalyser):
1871         (WebCore::AudioContext::createGain):
1872         (WebCore::AudioContext::createDelay):
1873         (WebCore::AudioContext::createChannelSplitter):
1874         (WebCore::AudioContext::createChannelMerger):
1875         (WebCore::AudioContext::createOscillator):
1876         (WebCore::AudioContext::createPeriodicWave):
1877         (WebCore::AudioContext::startRendering):
1878         (WebCore::AudioContext::suspend):
1879         (WebCore::AudioContext::resume):
1880         (WebCore::AudioContext::close):
1881         * Modules/webaudio/AudioContext.h:
1882         * Modules/webaudio/AudioContext.idl:
1883
1884 2019-04-30  Youenn Fablet  <youenn@apple.com>
1885
1886         Make Document audio producers use WeakPtr
1887         https://bugs.webkit.org/show_bug.cgi?id=197382
1888
1889         Reviewed by Eric Carlson.
1890
1891         Move from a hash set of raw pointers to a hash set of weak pointers.
1892         This helps make the code cleaner.
1893         No observable change of behavior.
1894
1895         * Modules/mediastream/MediaStreamTrack.h:
1896         * dom/Document.cpp:
1897         (WebCore::Document::addAudioProducer):
1898         (WebCore::Document::removeAudioProducer):
1899         (WebCore::Document::updateIsPlayingMedia):
1900         (WebCore::Document::pageMutedStateDidChange):
1901         * dom/Document.h:
1902         * html/HTMLMediaElement.cpp:
1903         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
1904         * html/HTMLMediaElement.h:
1905         * page/MediaProducer.h:
1906
1907 2019-04-30  Antti Koivisto  <antti@apple.com>
1908
1909         Tighten type of ScrollingTree:rootNode() to ScrollingTreeFrameScrollingNode
1910         https://bugs.webkit.org/show_bug.cgi?id=197414
1911
1912         Reviewed by Frédéric Wang.
1913
1914         * page/scrolling/ScrollingTree.cpp:
1915         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
1916         (WebCore::ScrollingTree::handleWheelEvent):
1917         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
1918         (WebCore::ScrollingTree::updateTreeFromStateNode):
1919         * page/scrolling/ScrollingTree.h:
1920         (WebCore::ScrollingTree::rootNode const):
1921
1922 2019-04-30  Youenn Fablet  <youenn@apple.com>
1923
1924         Refactor AudioContext to register/unregister itself at construction/destruction time
1925         https://bugs.webkit.org/show_bug.cgi?id=197383
1926
1927         Reviewed by Eric Carlson.
1928
1929         Registering/Unregistering is cheap.
1930         Instead of registering/unregistering in initialize/uninitialize,
1931         move this code to constructor/destructor.
1932         No observable change of behavior.
1933
1934         * Modules/webaudio/AudioContext.cpp:
1935         (WebCore::AudioContext::AudioContext):
1936         (WebCore::AudioContext::~AudioContext):
1937         (WebCore::AudioContext::lazyInitialize):
1938         (WebCore::AudioContext::uninitialize):
1939         (WebCore::AudioContext::visibilityStateChanged):
1940
1941 2019-04-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1942
1943         WebCore::StyleColorScheme should not have explicitly-declared copy constructor
1944         https://bugs.webkit.org/show_bug.cgi?id=197412
1945
1946         Reviewed by Don Olmstead.
1947
1948         Either we need to explicitly declare a copy assignment operator here, or the copy
1949         constructor needs to be removed. Having one without the other causes a huge warning spam
1950         with GCC 9. In this case, the copy constructor is redundant because it's identical to an
1951         implicitly-declared copy constructor, so let's just remove it.
1952
1953         * rendering/style/StyleColorScheme.h:
1954
1955 2019-04-30  Carlos Garcia Campos  <cgarcia@igalia.com>
1956
1957         [GTK] Support prefers-color-scheme media query
1958         https://bugs.webkit.org/show_bug.cgi?id=196685
1959
1960         Reviewed by Michael Catanzaro.
1961
1962         Change the gtk-application-prefer-dark-theme setting when tests change the useDarkModeAppearance setting.
1963
1964         * PlatformGTK.cmake:
1965         * testing/InternalSettings.cpp:
1966         (WebCore::InternalSettings::resetToConsistentState):
1967         (WebCore::InternalSettings::setUseDarkAppearanceInternal):
1968         (WebCore::InternalSettings::setUseDarkAppearance):
1969         * testing/InternalSettings.h:
1970
1971 2019-04-29  Truitt Savell  <tsavell@apple.com>
1972
1973         Unreviewed, rolling out r244755.
1974
1975         Casued several test failures on iOS
1976
1977         Reverted changeset:
1978
1979         "Double-tapping a post to like doesn't work on Instagram.com
1980         (needs 'dblclick' event)"
1981         https://bugs.webkit.org/show_bug.cgi?id=197347
1982         https://trac.webkit.org/changeset/244755
1983
1984 2019-04-29  Alex Christensen  <achristensen@webkit.org>
1985
1986         <rdar://problem/50299396> Fix internal High Sierra build
1987         https://bugs.webkit.org/show_bug.cgi?id=197388
1988
1989         * Configurations/Base.xcconfig:
1990
1991 2019-04-29  Zalan Bujtas  <zalan@apple.com>
1992
1993         Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
1994         https://bugs.webkit.org/show_bug.cgi?id=197347
1995         <rdar://problem/49393423>
1996
1997         Reviewed by Wenson Hsieh.
1998
1999         Tests: fast/events/touch/ios/double-tap-for-double-click1.html
2000                fast/events/touch/ios/double-tap-for-double-click2.html
2001
2002         * page/Frame.h:
2003         * page/ios/FrameIOS.mm:
2004         (WebCore::Frame::nodeRespondingToDoubleClickEvent):
2005
2006 2019-04-30  Simon Fraser  <simon.fraser@apple.com>
2007
2008         Transform is sometimes left in a bad state after an animation
2009         https://bugs.webkit.org/show_bug.cgi?id=197401
2010         rdar://problem/48179186
2011
2012         Reviewed by Dean Jackson.
2013         
2014         In some more complex compositing scenarios, at the end of an animation we'd
2015         fail to push a new transform onto a layer, because updateGeometry() would
2016         think there's an animation running (which there is, but in the "Ending" state).
2017
2018         It's simpler in this code to just always push transform and opacity to the layer;
2019         they will get overridden by the animation while it's running. The current code
2020         dates from the first landing of the file, and the reason for the if (!isRunningAcceleratedTransformAnimation)
2021         check is lost in the sands of time.
2022
2023         I was not able to get a reliable ref or layer tree test for this, because the next compositing update
2024         fixes it, and WTR seems to trigger one.  But the added test does show the bug
2025         in Safari, and is a good test to have.
2026
2027         Test: compositing/animation/transform-after-animation.html
2028
2029         * rendering/RenderLayerBacking.cpp:
2030         (WebCore::RenderLayerBacking::updateGeometry):
2031
2032 2019-04-29  Youenn Fablet  <youenn@apple.com>
2033
2034         getDisplayMedia should be called on user gesture
2035         https://bugs.webkit.org/show_bug.cgi?id=197356
2036
2037         Reviewed by Eric Carlson.
2038
2039         Allow getDisplayMedia on user gesture only.
2040         Otherwise reject the promise.
2041         Minor refactoring to align getDisplayMedia, getUserMedia and
2042         enumerateDevices when called with no document.
2043
2044         Test: fast/mediastream/screencapture-user-gesture.html
2045
2046         * Modules/mediastream/MediaDevices.cpp:
2047         (WebCore::MediaDevices::getUserMedia const):
2048         * Modules/mediastream/MediaDevices.h:
2049         * Modules/mediastream/NavigatorMediaDevices.h:
2050         * page/DOMWindow.h:
2051         * testing/Internals.cpp:
2052         (WebCore::Internals::setDisableGetDisplayMediaUserGestureConstraint):
2053         * testing/Internals.h:
2054         * testing/Internals.idl:
2055
2056 2019-04-29  Javier Fernandez  <jfernandez@igalia.com>
2057
2058         line should not be broken before the first space after a word
2059         https://bugs.webkit.org/show_bug.cgi?id=197278
2060
2061         Reviewed by Myles C. Maxfield.
2062
2063         The 'white-space: break-spaces' only adds breaking opportunities after
2064         a white space character. However, it's possible to break before the
2065         first space after a word when the feature is used in combination with
2066         other properties, like overflow-wrap.
2067
2068         However, breaking before the first space should not be allowed if
2069         there are previous opportunities. We wrongly assumed that we had to
2070         consider these previous breaking opportunities if the proper combination
2071         of line breaking properties is being used, so that breaking before the
2072         first space after a word is allowed.
2073
2074         This wrong assumption caused several issues, like the one described in
2075         the bug, that lead to incorrectly break before the first space even
2076         though there are previous opportunities, either white spaces or between
2077         letters.
2078
2079         Theses issues have been analyzed [1] by the CSS WG and finally agreed on a
2080         expected behavior, represented in the Web Platform tests added in this
2081         patch.
2082
2083         For the later case, of considering previous opportunities between
2084         letters, we have a seperated issue #952254, so the tests covering such
2085         cases will be added to the TestExpecations as Failure entries.
2086
2087         [1] https://github.com/w3c/csswg-drafts/issues/3701
2088
2089         Tests: imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-001.html
2090                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-002.html
2091                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-003.html
2092                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-004.html
2093                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-005.html
2094                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-006.html
2095                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-007.html
2096                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-008.html
2097                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-009.html
2098                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-010.html
2099                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-011.html
2100                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-012.html
2101                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-013.html
2102
2103         * rendering/line/BreakingContext.h:
2104         (WebCore::BreakingContext::handleText):
2105         (WebCore::BreakingContext::trailingSpacesHang):
2106
2107 2019-04-29  Simon Fraser  <simon.fraser@apple.com>
2108
2109         REGRESSION (r238090): animation on https://www.robotodyssey.online gets stuck; site broken
2110         https://bugs.webkit.org/show_bug.cgi?id=197381
2111
2112         Reviewed by Zalan Bujtas.
2113
2114         When -webkit-clip-path changes on a composited layer, we need to trigger a backing geometry update
2115         to push the changes to GraphicsLayers.
2116
2117         Test: compositing/style-change/clip-path-change.html
2118
2119         * rendering/RenderLayerCompositor.cpp:
2120         (WebCore::recompositeChangeRequiresGeometryUpdate):
2121
2122 2019-04-29  Chris Dumez  <cdumez@apple.com>
2123
2124         User-facing strings should use curly quotes instead of straight
2125         https://bugs.webkit.org/show_bug.cgi?id=197370
2126
2127         Reviewed by Geoffrey Garen.
2128
2129         Update localizable strings.
2130
2131         * en.lproj/Localizable.strings:
2132
2133 2019-04-29  Ross Kirsling  <ross.kirsling@sony.com>
2134
2135         Unreviewed fix for non-unified build after r244687.
2136
2137         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2138
2139 2019-04-29  Youenn Fablet  <youenn@apple.com>
2140
2141         RTCTrackEvent should be delayed until the whole remote description is set
2142         https://bugs.webkit.org/show_bug.cgi?id=196808
2143         <rdar://problem/49802649>
2144
2145         Reviewed by Eric Carlson.
2146
2147         As per https://w3c.github.io/webrtc-pc/#set-description,
2148         fire events just before resolving the setRemoteDescription promise.
2149         This ensures that the exposed stream has all necessary tracks from the beginning.
2150         Pending track events are created in LibWebRTCMediaEndpoint and stored in PeerConnectionBackend.
2151
2152         Covered by updated test.
2153
2154         * Modules/mediastream/PeerConnectionBackend.cpp:
2155         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
2156         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
2157         (WebCore::PeerConnectionBackend::addPendingTrackEvent):
2158         (WebCore::PeerConnectionBackend::stop):
2159         * Modules/mediastream/PeerConnectionBackend.h:
2160         * Modules/mediastream/RTCPeerConnection.cpp:
2161         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2162         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
2163         (WebCore::LibWebRTCMediaEndpoint::addPendingTrackEvent):
2164         (WebCore::LibWebRTCMediaEndpoint::newTransceiver):
2165         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2166
2167 2019-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2168
2169         REGRESSION(r244635): [GTK] Wrong background color used in non-dark mode
2170         https://bugs.webkit.org/show_bug.cgi?id=197276
2171
2172         Reviewed by Michael Catanzaro.
2173
2174         Since r244635, we are now getting the frame view background color from the theme. That's correct for dark mode,
2175         but in non-dark mode we still want to use white backgrounds by default. This made a lot of tests to fail.
2176
2177         * css/CSSValueKeywords.in: Add -webkit-control-background when HAVE(OS_DARK_MODE_SUPPORT).
2178         * css/html.css: Use -webkit-control-background instead of -apple-system-control-background.
2179         * page/FrameView.cpp:
2180         (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindow instead of CSSValueWindowframe.
2181         * rendering/RenderThemeGtk.cpp:
2182         (WebCore::RenderThemeGtk::systemColor const): Only get the window background from the theme in dark mode. Handle
2183         also CSSValueWebkitControlBackground.
2184         * rendering/RenderThemeMac.mm:
2185         (WebCore::RenderThemeMac::systemColor const): Handle CSSValueWebkitControlBackground when HAVE(OS_DARK_MODE_SUPPORT).
2186
2187 2019-04-28  Andy Estes  <aestes@apple.com>
2188
2189         [Apple Pay] Increment the API version from 6 to 7
2190         https://bugs.webkit.org/show_bug.cgi?id=197041
2191         <rdar://problem/49986625>
2192
2193         Reviewed by Geoffrey Garen.
2194
2195         * Modules/applepay/PaymentCoordinatorClient.cpp:
2196         (WebCore::PaymentCoordinatorClient::supportsVersion):
2197
2198 2019-04-28  Andy Estes  <aestes@apple.com>
2199
2200         Fix the watchOS engineering build.
2201
2202         * Modules/webgpu/WebGPUComputePassEncoder.cpp: Included Logging.h.
2203
2204 2019-04-28  Youenn Fablet  <youenn@apple.com>
2205
2206         Remove no longer needed mDNS ICE candidate resolution code
2207         https://bugs.webkit.org/show_bug.cgi?id=197315
2208
2209         Reviewed by Eric Carlson.
2210
2211         No change of behavior.
2212         Removed code is no longer exercised as mDNS resolution happens inside libwebrtc
2213         using the same resolution mechanism as for TURN/STUN server names.
2214
2215         * Modules/mediastream/PeerConnectionBackend.cpp:
2216         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
2217         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
2218         * Modules/mediastream/PeerConnectionBackend.h:
2219
2220 2019-04-27  Simon Fraser  <simon.fraser@apple.com>
2221
2222         Move some Compositing logging to the Layers log channel
2223         https://bugs.webkit.org/show_bug.cgi?id=197345
2224
2225         Reviewed by Sam Weinig.
2226
2227         Make Compositing logging a bit less verbose by moving the GraphicsLayer tree dump
2228         to the Layers log channel. Also log GraphicsLayers after flushing, when we'll have
2229         accurate visible rects. 
2230
2231         * platform/graphics/ca/GraphicsLayerCA.cpp:
2232         (WebCore::GraphicsLayerCA::updateCoverage):
2233         * rendering/RenderLayerCompositor.cpp:
2234         (WebCore::layersLogEnabled):
2235         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2236         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2237
2238 2019-04-27  Megan Gardner  <megan_gardner@apple.com>
2239
2240         Lookup only looking up the first word in selection
2241         https://bugs.webkit.org/show_bug.cgi?id=197341
2242         <rdar://problem/48221414>
2243
2244         Reviewed by Wenson Hsieh.
2245
2246         Lookup is not testable.
2247
2248         Reveal needs the full range in order to correctly create the item for the popover.
2249
2250         * editing/cocoa/DictionaryLookup.mm:
2251         (WebCore::showPopupOrCreateAnimationController):
2252
2253 2019-04-26  Jer Noble  <jer.noble@apple.com>
2254
2255         Reduce the number of copies made during SourceBufferPrivateAVFObjC::append() using SharedBuffer
2256         https://bugs.webkit.org/show_bug.cgi?id=197335
2257         <rdar://problem/49175604>
2258
2259         Rubber-stamped by Alex Christensen.
2260
2261         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2262         (WebCore::SourceBufferPrivateAVFObjC::append):
2263
2264 2019-04-26  Jessie Berlin  <jberlin@webkit.org>
2265
2266         Add new mac target numbers
2267         https://bugs.webkit.org/show_bug.cgi?id=197313
2268
2269         Reviewed by Alex Christensen.
2270
2271         * Configurations/Version.xcconfig:
2272         * Configurations/WebKitTargetConditionals.xcconfig:
2273
2274 2019-04-26  Commit Queue  <commit-queue@webkit.org>
2275
2276         Unreviewed, rolling out r244708.
2277         https://bugs.webkit.org/show_bug.cgi?id=197334
2278
2279         "Broke the debug build" (Requested by rmorisset on #webkit).
2280
2281         Reverted changeset:
2282
2283         "All prototypes should call didBecomePrototype()"
2284         https://bugs.webkit.org/show_bug.cgi?id=196315
2285         https://trac.webkit.org/changeset/244708
2286
2287 2019-04-26  Robin Morisset  <rmorisset@apple.com>
2288
2289         All prototypes should call didBecomePrototype()
2290         https://bugs.webkit.org/show_bug.cgi?id=196315
2291
2292         Reviewed by Saam Barati.
2293
2294         It was found by existing tests, with the new assert in JSC::Structure
2295
2296         * bindings/js/JSWindowProxy.cpp:
2297         (WebCore::JSWindowProxy::setWindow):
2298         * bindings/scripts/CodeGeneratorJS.pm:
2299         (GeneratePrototypeDeclaration):
2300         (GenerateConstructorHelperMethods):
2301
2302 2019-04-26  Eric Carlson  <eric.carlson@apple.com>
2303
2304         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
2305         https://bugs.webkit.org/show_bug.cgi?id=197171
2306         <rdar://problem/47454979>
2307
2308         Reviewed by Youenn Fablet.
2309
2310         Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
2311
2312         * Modules/plugins/QuickTimePluginReplacement.mm:
2313         (WebCore::jsValueWithValueInContext):
2314         (WebCore::jsValueWithAVMetadataItemInContext):
2315         * WebCore.xcodeproj/project.pbxproj:
2316         * platform/audio/ios/AudioSessionIOS.mm:
2317         (WebCore::AudioSession::setCategory):
2318         (WebCore::AudioSession::category const):
2319         (WebCore::AudioSession::routeSharingPolicy const):
2320         (WebCore::AudioSession::routingContextUID const):
2321         (WebCore::AudioSession::sampleRate const):
2322         (WebCore::AudioSession::bufferSize const):
2323         (WebCore::AudioSession::numberOfOutputChannels const):
2324         (WebCore::AudioSession::tryToSetActiveInternal):
2325         (WebCore::AudioSession::preferredBufferSize const):
2326         (WebCore::AudioSession::setPreferredBufferSize):
2327         * platform/audio/ios/MediaSessionManagerIOS.mm:
2328         (-[WebMediaSessionHelper initWithCallback:]):
2329         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
2330         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
2331         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
2332         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
2333         (WebCore::AVTrackPrivateAVFObjCImpl::label const):
2334         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2335         (WebCore::AudioSourceProviderAVFObjC::createMix):
2336         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
2337         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
2338         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
2339         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
2340         (WebCore::AVFoundationMIMETypeCache::canDecodeType):
2341         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
2342         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2343         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
2344         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
2345         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
2346         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
2347         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
2348         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
2349         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
2350         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
2351         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2352         (WebCore::CDMSessionAVContentKeySession::isAvailable):
2353         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
2354         (WebCore::CDMSessionAVContentKeySession::update):
2355         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
2356         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
2357         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
2358         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2359         (WebCore::CDMSessionAVStreamSession::releaseKeys):
2360         (WebCore::CDMSessionAVStreamSession::update):
2361         (WebCore::CDMSessionAVStreamSession::setStreamSession):
2362         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
2363         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2364         (WebCore::imageDecoderAssetOptions):
2365         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
2366         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
2367         (WebCore::ImageDecoderAVFObjC::readSamples):
2368         (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
2369         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
2370         (WebCore::InbandTextTrackPrivateAVFObjC::label const):
2371         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
2372         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
2373         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2374         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
2375         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2376         (WebCore::assetCacheForPath):
2377         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
2378         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
2379         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
2380         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
2381         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2382         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
2383         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2384         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
2385         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
2386         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
2387         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
2388         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
2389         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
2390         (WebCore::determineChangedTracksFromNewTracksAndOldItems):
2391         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
2392         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
2393         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
2394         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
2395         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
2396         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
2397         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
2398         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
2399         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
2400         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
2401         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
2402         (WebCore::exernalDeviceDisplayNameForPlayer):
2403         (WebCore::metadataType):
2404         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
2405         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2406         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
2407         (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
2408         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
2409         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2410         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2411         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
2412         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
2413         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
2414         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
2415         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2416         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
2417         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
2418         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
2419         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2420         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
2421         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
2422         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
2423         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2424         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2425         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2426         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
2427         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
2428         (WebCore::PlatformCALayerCocoa::clone const):
2429         (WebCore::PlatformCALayerCocoa::avPlayerLayer const):
2430         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
2431         (WebCore::validateHEVCParameters):
2432         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
2433         (getAVSpeechUtteranceDefaultSpeechRate):
2434         (getAVSpeechUtteranceMaximumSpeechRate):
2435         (-[WebSpeechSynthesisWrapper speakUtterance:]):
2436         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
2437         (SOFT_LINK_CONSTANT): Deleted.
2438         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2439         (-[WebAVPlayerLayer init]):
2440         (-[WebAVPlayerLayer layoutSublayers]):
2441         (-[WebAVPlayerLayer setVideoGravity:]):
2442         (-[WebAVPlayerLayer videoRect]):
2443         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
2444         * platform/mac/SerializedPlatformRepresentationMac.mm:
2445         (WebCore::jsValueWithValueInContext):
2446         (WebCore::jsValueWithAVMetadataItemInContext):
2447         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
2448         (WebCore::getAVFormatIDKeyWithFallback):
2449         (WebCore::getAVNumberOfChannelsKeyWithFallback):
2450         (WebCore::getAVSampleRateKeyWithFallback):
2451         (WebCore::getAVEncoderBitRateKeyWithFallback):
2452         (WebCore::MediaRecorderPrivateWriter::create):
2453         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
2454         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
2455         * platform/mediastream/RealtimeVideoSource.h:
2456         * platform/mediastream/VideoPreset.h:
2457         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
2458         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
2459         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
2460         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
2461         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
2462         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2463         (WebCore::deviceIsAvailable):
2464         (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices):
2465         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
2466         (WebCore::AVCaptureDeviceManager::isAvailable):
2467         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager):
2468         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2469         (WebCore::AVVideoPreset::create):
2470         (WebCore::AVVideoPreset::AVVideoPreset):
2471         (WebCore::AVVideoCaptureSource::create):
2472         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
2473         (WebCore::AVVideoCaptureSource::capabilities):
2474         (WebCore::sensorOrientationFromVideoOutput):
2475         (WebCore::AVVideoCaptureSource::setupSession):
2476         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
2477         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2478         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
2479         (WebCore::AVVideoCaptureSource::generatePresets):
2480         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
2481         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
2482
2483 2019-04-26  Commit Queue  <commit-queue@webkit.org>
2484
2485         Unreviewed, rolling out r244683.
2486         https://bugs.webkit.org/show_bug.cgi?id=197320
2487
2488         Causing crash on iOS Simulator and EWS failures (Requested by
2489         sroberts on #webkit).
2490
2491         Reverted changeset:
2492
2493         "[iOS] Add internal setting to force -webkit-text-size-adjust
2494         to "auto""
2495         https://bugs.webkit.org/show_bug.cgi?id=197275
2496         https://trac.webkit.org/changeset/244683
2497
2498 2019-04-26  Youenn Fablet  <youenn@apple.com>
2499
2500         Use normal loading path for ping loads
2501         https://bugs.webkit.org/show_bug.cgi?id=196807
2502
2503         Reviewed by Alex Christensen.
2504
2505         Make use of regular code path for ping loads and beacon.
2506         This is done conditionally on KeepAlive flag.
2507         The benefits are a single loading code path and service worker interception.
2508
2509         For that purpose, introduce a LoaderStrategy switch based on KeepAlive runtime flag.
2510         This switch is used to use ping loads when keepAlive is set or regular loads.
2511         In case of regular loads, the keepAlive flag should be used to extend the lifetime of the load.
2512
2513         Migrate ping loads to use CachedResourceLoader instead of PingLoad.
2514         For that purpose, introduce a new Ping CachedResource type.
2515
2516         Covered by existing tests.
2517
2518         * Modules/beacon/NavigatorBeacon.cpp:
2519         (WebCore::NavigatorBeacon::sendBeacon):
2520         * inspector/agents/InspectorPageAgent.cpp:
2521         (WebCore::InspectorPageAgent::inspectorResourceType):
2522         * loader/LinkLoader.cpp:
2523         (WebCore::createLinkPreloadResourceClient):
2524         * loader/LoaderStrategy.h:
2525         * loader/PingLoader.cpp:
2526         (WebCore::PingLoader::loadImage):
2527         (WebCore::PingLoader::sendPing):
2528         (WebCore::PingLoader::sendViolationReport):
2529         (WebCore::PingLoader::startPingLoad):
2530         * loader/PingLoader.h:
2531         * loader/ResourceLoadInfo.cpp:
2532         (WebCore::toResourceType):
2533         * loader/SubresourceLoader.cpp:
2534         (WebCore::logResourceLoaded):
2535         * loader/cache/CachedResource.cpp:
2536         (WebCore::CachedResource::defaultPriorityForResourceType):
2537         (WebCore::CachedResource::load):
2538         (WebCore::CachedResource::cancelLoad):
2539         * loader/cache/CachedResource.h:
2540         (WebCore::CachedResource::shouldUsePingLoad):
2541         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
2542         * loader/cache/CachedResourceLoader.cpp:
2543         (WebCore::createResource):
2544         (WebCore::CachedResourceLoader::requestPingResource):
2545         (WebCore::contentTypeFromResourceType):
2546         (WebCore::CachedResourceLoader::checkInsecureContent const):
2547         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
2548         (WebCore::CachedResourceLoader::canRequest):
2549         (WebCore::isResourceSuitableForDirectReuse):
2550         (WebCore::destinationForType):
2551         * loader/cache/CachedResourceLoader.h:
2552
2553 2019-04-26  Alex Christensen  <achristensen@webkit.org>
2554
2555         Fix Windows build after r244695
2556        ​https://bugs.webkit.org/show_bug.cgi?id=197165
2557
2558         * loader/PingLoader.cpp:
2559
2560 2019-04-26  Alex Christensen  <achristensen@webkit.org>
2561
2562         Fix internal High Sierra build after r244653
2563         https://bugs.webkit.org/show_bug.cgi?id=197131
2564
2565         * DerivedSources.make:
2566         -std=gnu++17 didn't exist yet.  -std=gnu++1z did.
2567
2568 2019-04-26  Alex Christensen  <achristensen@webkit.org>
2569
2570         Add ENABLE(CONTENT_EXTENSIONS) and namespace ContentExtensions to ResourceLoadInfo.h
2571         https://bugs.webkit.org/show_bug.cgi?id=197165
2572
2573         Reviewed by Youenn Fablet.
2574
2575         No change in behavior.  This will just make it harder for people working on the loader to mistake
2576         these ContentExtension specific structures for other structures general to loading.
2577         One such mistake was made in r244248.
2578
2579         * Modules/websockets/WebSocketChannel.cpp:
2580         (WebCore::WebSocketChannel::connect):
2581         * contentextensions/ContentExtensionsBackend.h:
2582         * css/StyleSheetContents.cpp:
2583         (WebCore::StyleSheetContents::subresourcesAllowReuse const):
2584         * html/HTMLMediaElement.cpp:
2585         (WebCore::HTMLMediaElement::loadResource):
2586         * loader/FrameLoader.cpp:
2587         (WebCore::FrameLoader::loadResourceSynchronously):
2588         * loader/NetscapePlugInStreamLoader.cpp:
2589         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
2590         * loader/PingLoader.cpp:
2591         (WebCore::processContentRuleListsForLoad):
2592         (WebCore::PingLoader::loadImage):
2593         (WebCore::PingLoader::sendPing):
2594         (WebCore::PingLoader::sendViolationReport):
2595         * loader/ResourceLoadInfo.cpp:
2596         (WebCore::toResourceType): Deleted.
2597         (WebCore::readResourceType): Deleted.
2598         (WebCore::readLoadType): Deleted.
2599         (WebCore::ResourceLoadInfo::isThirdParty const): Deleted.
2600         (WebCore::ResourceLoadInfo::getResourceFlags const): Deleted.
2601         * loader/ResourceLoadInfo.h:
2602         * loader/ResourceLoader.cpp:
2603         (WebCore::ResourceLoader::willSendRequestInternal):
2604         * loader/ResourceLoader.h:
2605         * loader/SubresourceLoader.cpp:
2606         (WebCore::SubresourceLoader::SubresourceLoader):
2607         * loader/cache/CachedResourceLoader.cpp:
2608         (WebCore::CachedResourceLoader::requestResource):
2609         * page/DOMWindow.cpp:
2610         (WebCore::DOMWindow::open):
2611         * page/UserContentProvider.cpp:
2612         (WebCore::UserContentProvider::processContentRuleListsForLoad):
2613         (WebCore::UserContentProvider::actionsForResourceLoad):
2614         * page/UserContentProvider.h:
2615
2616 2019-04-26  Alex Christensen  <achristensen@webkit.org>
2617
2618         Fix an internal High Sierra build after r244653
2619        ​https://bugs.webkit.org/show_bug.cgi?id=197131
2620
2621         * DerivedSources.make:
2622         Apparently we can't use gnu++17 when preprocessing Platform.h in the makefile.
2623
2624 2019-04-26  Chris Fleizach  <cfleizach@apple.com>
2625
2626         AX: Provide iOS method for setting focus
2627         https://bugs.webkit.org/show_bug.cgi?id=197200
2628         <rdar://problem/50131679>
2629
2630         Reviewed by Alex Christensen.
2631
2632         Put the focus setting code in a place that iOS and macOS can access.
2633         Override a platform level method for setting focus on iOS.
2634
2635         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2636         (-[WebAccessibilityObjectWrapper _accessibilitySetFocus:]):
2637         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
2638         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2639         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySetFocus:]):
2640         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2641         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2642
2643 2019-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
2644
2645         propertyRegistry() was not overridden for SVGFEFloodElement and SVGFEMergeElement
2646         https://bugs.webkit.org/show_bug.cgi?id=197303
2647
2648         Reviewed by Alex Christensen.
2649
2650         Therefore SVGElement::propertyRegistry() was called instead. This means
2651         these two elements will not have access to the properties of the base
2652         class SVGFilterPrimitiveStandardAttributes.
2653
2654         Tests: svg/dom/SVGFEFloodElement-filter-standard-attributes.svg
2655
2656         * svg/SVGElement.cpp:
2657         (WebCore::SVGElement::commitPropertyChange):
2658         * svg/SVGFEFloodElement.h:
2659         * svg/SVGFEMergeElement.h:
2660
2661 2019-04-26  Youenn Fablet  <youenn@apple.com>
2662
2663         [Mac WK2 iOS Sim] Layout Test imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html is a flaky failure
2664         https://bugs.webkit.org/show_bug.cgi?id=196633
2665         <rdar://problem/49627667>
2666
2667         Reviewed by Alex Christensen.
2668
2669         Use formula defined in https://w3c.github.io/webrtc-stats/#dom-rtcrtpcontributingsourcestats-audiolevel
2670         to compute the audio level from the RTP header information.
2671         Covered by rebased test.
2672
2673         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
2674         (WebCore::fillRTCRtpContributingSource):
2675
2676 2019-04-26  Sihui Liu  <sihui_liu@apple.com>
2677
2678         Stop IDB transactions to release locked database files when network process is ready to suspend
2679         https://bugs.webkit.org/show_bug.cgi?id=196372
2680         <rdar://problem/48930116>
2681
2682         Reviewed by Brady Eidson.
2683
2684         Suspend IDB database thread and finish ongoing IDB transactions on the main thread before suspending network 
2685         process.
2686
2687         API test: IndexedDB.IndexedDBSuspendImminently
2688
2689         * Modules/indexeddb/server/IDBBackingStore.h:
2690         * Modules/indexeddb/server/IDBServer.cpp:
2691         (WebCore::IDBServer::IDBServer::tryStop):
2692         (WebCore::IDBServer::IDBServer::resume):
2693         * Modules/indexeddb/server/IDBServer.h:
2694         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2695         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Remove some error log messages, because now we may try
2696         performing database operations without an active transaction if the transaction is finished on the main thread.
2697         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
2698         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
2699         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
2700         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
2701         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
2702         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
2703         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
2704         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
2705         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
2706         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
2707         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
2708         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
2709         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
2710         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
2711         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
2712         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
2713         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
2714         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
2715         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
2716         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
2717         (WebCore::IDBServer::SQLiteIDBBackingStore::hasTransaction const):
2718         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2719         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2720         (WebCore::IDBServer::UniqueIDBDatabase::prepareToFinishTransaction):
2721         (WebCore::IDBServer::UniqueIDBDatabase::commitTransactionAfterQuotaCheck):
2722         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
2723         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
2724         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
2725         (WebCore::IDBServer::UniqueIDBDatabase::abortTransactionOnMainThread):
2726         (WebCore::IDBServer::UniqueIDBDatabase::commitTransactionOnMainThread):
2727         (WebCore::IDBServer::UniqueIDBDatabase::finishActiveTransactions):
2728         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2729         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2730         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setState):
2731         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::state const):
2732         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setResult):
2733         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::result const):
2734         * platform/sql/SQLiteDatabaseTracker.cpp:
2735         (WebCore::SQLiteDatabaseTracker::hasTransactionInProgress):
2736         * platform/sql/SQLiteDatabaseTracker.h:
2737
2738 2019-04-26  Takashi Komori  <Takashi.Komori@sony.com>
2739
2740         [Curl] Fix Curl Request Scheduler not to release wrong Curl handle when request is cancelled.
2741         https://bugs.webkit.org/show_bug.cgi?id=191650
2742
2743         Reviewed by Fujii Hironori.
2744
2745         Test: http/tests/misc/repeat-open-cancel.html
2746
2747         * platform/network/curl/CurlRequest.cpp:
2748         (WebCore::CurlRequest::cancel):
2749         (WebCore::CurlRequest::isCancelled):
2750         (WebCore::CurlRequest::isCompletedOrCancelled):
2751         (WebCore::CurlRequest::didCompleteTransfer):
2752         (WebCore::CurlRequest::completeDidReceiveResponse):
2753         (WebCore::CurlRequest::pausedStatusChanged):
2754         * platform/network/curl/CurlRequest.h:
2755         (WebCore::CurlRequest::isCompleted const): Deleted.
2756         (WebCore::CurlRequest::isCancelled const): Deleted.
2757         (WebCore::CurlRequest::isCompletedOrCancelled const): Deleted.
2758         * platform/network/curl/CurlRequestScheduler.cpp:
2759         (WebCore::CurlRequestScheduler::cancel):
2760         (WebCore::CurlRequestScheduler::callOnWorkerThread):
2761         (WebCore::CurlRequestScheduler::startThreadIfNeeded):
2762         (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
2763         (WebCore::CurlRequestScheduler::stopThread):
2764         (WebCore::CurlRequestScheduler::executeTasks):
2765         (WebCore::CurlRequestScheduler::workerThread):
2766         (WebCore::CurlRequestScheduler::startTransfer):
2767         (WebCore::CurlRequestScheduler::completeTransfer):
2768         (WebCore::CurlRequestScheduler::cancelTransfer):
2769         (WebCore::CurlRequestScheduler::finalizeTransfer):
2770         * platform/network/curl/CurlRequestScheduler.h:
2771
2772 2019-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
2773
2774         [iOS] Add internal setting to force -webkit-text-size-adjust to "auto"
2775         https://bugs.webkit.org/show_bug.cgi?id=197275
2776         <rdar://problem/50211019>
2777
2778         Reviewed by Simon Fraser.
2779
2780         This setting makes it easier to investigate the autosizing work we've been doing
2781         in https://bugs.webkit.org/show_bug.cgi?id=197250.
2782
2783         * page/Settings.yaml:
2784         * rendering/RenderBlockFlow.cpp:
2785         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
2786         * rendering/TextAutoSizing.cpp:
2787         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
2788
2789 2019-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
2790
2791         [iOS] Implement idempotent mode for text autosizing
2792         https://bugs.webkit.org/show_bug.cgi?id=197250
2793         <rdar://problem/50211034>
2794
2795         Reviewed by Jon Lee.
2796
2797         Our text autosizing code has this interesting behavior where it is sensitive to the width of the text's container
2798         and the number of lines of text inside the element. Not only is it sensitive to those things, but as those things
2799         change, their values are stored inside the RenderObject itself and then never recomputed. This means that the text
2800         autosizing parameters are sensitive to the entire history of an element. So, a newly created element with the same
2801         style as an existing element can have dramatically different results.
2802
2803         This patch adds a new mode for text autosizing, which isn't sensitive to either of those things, and therefore
2804         maintains the invariant that a newly created element will behave the same as an existing element with the same style.
2805         Instead of using container size, it instead uses the viewport's initial scale. As the viewport's initial scale
2806         changes, new layouts will be triggered, which will cause the autosizing code to use the new value.
2807
2808         Tests: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-identity.html
2809                fast/text-autosizing/ios/idempotentmode/idempotent-autosizing.html
2810
2811         * page/FrameViewLayoutContext.cpp:
2812         (WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded):
2813         * page/Page.cpp:
2814         (WebCore::Page::setInitialScale): WebKit will push the initial scale down into the page.
2815         * page/Page.h:
2816         (WebCore::Page::initialScale const):
2817         * page/SettingsBase.h:
2818         * page/cocoa/SettingsBaseCocoa.mm:
2819         (WebCore::SettingsBase::textAutosizingUsesIdempotentMode):
2820         (WebCore::SettingsBase::defaultTextAutosizingEnabled):
2821         * rendering/RenderBlockFlow.cpp:
2822         (WebCore::idempotentTextSize): Describe a piecewise-linear curve for the text size to follow. The curve scales
2823         depending on the viewport's initial scale.
2824         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
2825         * rendering/RenderBlockFlow.h:
2826         * rendering/RenderElement.cpp:
2827         (WebCore::includeNonFixedHeight): This new mode should consider max-height as well as height when determining if
2828         content overflows.
2829         (WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
2830         (WebCore::RenderElement::resetTextAutosizing):
2831         * rendering/RenderElement.h:
2832         * rendering/RenderObject.h:
2833
2834 2019-04-25  Simon Fraser  <simon.fraser@apple.com>
2835
2836         REGRESSION (r234330): 3 legacy-animation-engine/compositing tests are flaky failures
2837         https://bugs.webkit.org/show_bug.cgi?id=188357
2838         <rdar://problem/42986633>
2839
2840         Reviewed by Dean Jackson.
2841
2842         DumpRenderTree had no code that set page.setCompositingPolicyOverride() to Normal, so some
2843         tests would fall into low memory mode and have different behavior.
2844         
2845         Fix by moving the code that calls setCompositingPolicyOverride(Normal) from the WK2 layer
2846         to Internals, so it's shared by DRT and WTR.
2847         
2848         We no longer need the WK2 C SPI glue.
2849
2850         * testing/Internals.cpp:
2851         (WebCore::Internals::resetToConsistentState):
2852
2853 2019-04-25  Sihui Liu  <sihui_liu@apple.com>
2854
2855         [ iOS Sim ] REGRESSION (r242986) Layout Test storage/indexeddb/modern/idbtransaction-objectstore-failures-private.html is a flaky failure
2856         https://bugs.webkit.org/show_bug.cgi?id=196357
2857         <rdar://problem/49386836>
2858
2859         Reviewed by Geoffrey Garen.
2860
2861         Dispatch IDBRequest event to IDBTransaction if event of IDBTransaction has not been dispatched.
2862
2863         Covered by existing tests.
2864
2865         * Modules/indexeddb/IDBRequest.cpp:
2866         (WebCore::IDBRequest::dispatchEvent):
2867         * Modules/indexeddb/IDBTransaction.cpp:
2868         (WebCore::IDBTransaction::dispatchEvent):
2869         * Modules/indexeddb/IDBTransaction.h:
2870
2871 2019-04-25  Chris Dumez  <cdumez@apple.com>
2872
2873         ASSERT(scriptExecutionContext()) in Performance::resourceTimingBufferFullTimerFired()
2874         https://bugs.webkit.org/show_bug.cgi?id=197300
2875         <rdar://problem/49965990>
2876
2877         Reviewed by Youenn Fablet.
2878
2879         We crash because the scriptExecutionContext has been destroyed by the time the m_resourceTimingBufferFullTimer
2880         timer fires. However, r241598 already makes sure that we stop the timer when the script execution context
2881         is destroyed. This makes me think that somebody restarts the timer *after* the script execution context has
2882         been destroyed. The thing is that we only start the timer in Performance::addResourceTiming() and there are
2883         only 2 call sites for this method. Both call sites get the Performance object from the Window object, which
2884         they get from the Document object. As a result, I would believe that the Window's document is alive, even
2885         though the Performance object's scriptExecutionContext is not. This could indicate that the Performance
2886         object's scriptExecutionContext gets out of sync with its Window's document. I have found one place where
2887         it could happen in theory (DOMWindow::didSecureTransitionTo()). I have not been able to write a test
2888         confirming my theory though so this is a speculative fix. I have also added a few assertions to help us
2889         track down the issue if my speculative fix turns out to be ineffective.
2890
2891         No new tests, we do not know how to reproduce.
2892
2893         * page/DOMWindow.cpp:
2894         (WebCore::DOMWindow::didSecureTransitionTo):
2895         This is a speculative fix for the crash. When a DOMWindow transitions from one document to
2896         another, reset its data members which store the DOMWindow's document to make sure that they
2897         do not get out of sync.
2898
2899         (WebCore::DOMWindow::crypto const):
2900         (WebCore::DOMWindow::navigator):
2901         (WebCore::DOMWindow::performance const):
2902         Add assertions to make sure that the member's scriptExecutionContext is in sync with
2903         the window's.
2904
2905         * page/Performance.cpp:
2906         (WebCore::Performance::addResourceTiming):
2907         Add assertion to make sure that the scriptExecutionContext() is non-null when calling this
2908         as this may start the m_resourceTimingBufferFullTimer timer. If my speculative fix above
2909         does not work, we should hit this and this should tell us which call site is causing this.
2910
2911 2019-04-25  Timothy Hatcher  <timothy@apple.com>
2912
2913         Disable ContentChangeObserver on iOSMac.
2914         https://bugs.webkit.org/show_bug.cgi?id=197292
2915         rdar://problem/49039957
2916
2917         Reviewed by Zalan Bujtas.
2918
2919         We don’t need to run any of ContentChangeObserver, because we have hover events on iOSMac.
2920         Disabling it skips the synthetic mouse move events and speeds up clicks.
2921
2922         * page/SettingsBase.cpp:
2923         (WebCore::SettingsBase::defaultContentChangeObserverEnabled): Return false for PLATFORM(IOSMAC).
2924
2925 2019-04-25  Timothy Hatcher  <timothy@apple.com>
2926
2927         Disable date and time inputs on iOSMac.
2928         https://bugs.webkit.org/show_bug.cgi?id=197287
2929         rdar://problem/46794376
2930
2931         Reviewed by Wenson Hsieh.
2932
2933         * Configurations/FeatureDefines.xcconfig:
2934         * platform/text/mac/LocaleMac.h:
2935         * platform/text/mac/LocaleMac.mm:
2936         (WebCore::LocaleMac::formatDateTime):
2937
2938 2019-04-25  Alex Christensen  <achristensen@webkit.org>
2939
2940         Fix more Windows builds after r244653
2941         https://bugs.webkit.org/show_bug.cgi?id=197131
2942
2943         * svg/properties/SVGAnimatedPropertyList.h:
2944         * svg/properties/SVGProperty.h:
2945         * svg/properties/SVGPropertyList.h:
2946
2947 2019-04-25  Alex Christensen  <achristensen@webkit.org>
2948
2949         Fix more builds after r244653
2950         https://bugs.webkit.org/show_bug.cgi?id=197131
2951
2952         * svg/properties/SVGValuePropertyList.h:
2953         Something is preventing MSVC from seeing protected constructors from subclasses.
2954
2955 2019-04-25  Per Arne Vollan  <pvollan@apple.com>
2956
2957         -[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:] never returns _WKWebsiteDataTypeCredentials
2958         https://bugs.webkit.org/show_bug.cgi?id=196991
2959         <rdar://problem/45507423>
2960
2961         Reviewed by Alex Christensen.
2962
2963         Add method to get all origins with persistent credentials from credential storage.
2964
2965         API tests: WKWebsiteDataStore.FetchNonPersistentCredentials
2966                    WKWebsiteDataStore.FetchPersistentCredentials
2967
2968         * platform/network/CredentialStorage.h:
2969         * platform/network/mac/CredentialStorageMac.mm:
2970         (WebCore::CredentialStorage::originsWithPersistentCredentials):
2971
2972 2019-04-25  Alex Christensen  <achristensen@webkit.org>
2973
2974         Fix MSVC build after r244653
2975         https://bugs.webkit.org/show_bug.cgi?id=197131
2976
2977         * svg/properties/SVGValueProperty.h:
2978         MSVC doesn't think it can access these protected constructors from subclasses.
2979         Make the build work and investigate this later.
2980
2981 2019-04-25  Alex Christensen  <achristensen@webkit.org>
2982
2983         Start using C++17
2984         https://bugs.webkit.org/show_bug.cgi?id=197131
2985
2986         Reviewed by Darin Adler.
2987
2988         * Configurations/Base.xcconfig:
2989         * DerivedSources.make:
2990
2991 2019-04-25  Commit Queue  <commit-queue@webkit.org>
2992
2993         Unreviewed, rolling out r244627.
2994         https://bugs.webkit.org/show_bug.cgi?id=197282
2995
2996         Causing internal build failures (Requested by ShawnRoberts on
2997         #webkit).
2998
2999         Reverted changeset:
3000
3001         "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
3002         https://bugs.webkit.org/show_bug.cgi?id=197171
3003         https://trac.webkit.org/changeset/244627
3004
3005 2019-04-25  Antti Koivisto  <antti@apple.com>
3006
3007         redefinition of enumerator 'NSAttachmentCharacter' with Apple internal build
3008         https://bugs.webkit.org/show_bug.cgi?id=197279
3009
3010         Reviewed by Antoine Quint.
3011
3012         Try to fix the build.
3013
3014         * platform/mac/WebNSAttributedStringExtras.mm:
3015
3016 2019-04-25  Antti Koivisto  <antti@apple.com>
3017
3018         Visited link hash should be computed only once
3019         https://bugs.webkit.org/show_bug.cgi?id=197229
3020         <rdar://problem/48438924>
3021
3022         Reviewed by Alex Christensen.
3023
3024         Test: fast/history/visited-href-mutation.html
3025
3026         Visited link style is now based on the first target URL of the link element. Further href mutations don't affect styling.
3027
3028         * dom/Document.cpp:
3029         (WebCore::Document::updateBaseURL):
3030         * dom/VisitedLinkState.cpp:
3031         (WebCore::linkAttribute):
3032         (WebCore::linkHashForElement):
3033
3034         Visited link support is now limited to HTML and SVG <a> elements.
3035
3036         (WebCore::VisitedLinkState::invalidateStyleForLink):
3037         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
3038         * html/HTMLAnchorElement.cpp:
3039         (WebCore::HTMLAnchorElement::HTMLAnchorElement):
3040         (WebCore::HTMLAnchorElement::parseAttribute):
3041         * html/HTMLAnchorElement.h:
3042         (WebCore::HTMLAnchorElement::visitedLinkHash const):
3043         (WebCore::HTMLAnchorElement::invalidateCachedVisitedLinkHash): Deleted.
3044         * svg/SVGAElement.cpp:
3045         (WebCore::SVGAElement::visitedLinkHash const):
3046         * svg/SVGAElement.h:
3047
3048 2019-04-25  Philippe Normand  <pnormand@igalia.com>
3049
3050         [GStreamer] gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed in WebCore::MediaPlayerPrivateGStreamer::paused
3051         https://bugs.webkit.org/show_bug.cgi?id=196691
3052
3053         Reviewed by Eric Carlson.
3054
3055         For gif assets, fail media loading early and notify the
3056         MediaPlayer by setting both network and ready states, so that the
3057         MediaPlayer will try with with the next media engine or pass the
3058         error to HTMLMediaElement if there are none.
3059
3060         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3061         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
3062         (WebCore::MediaPlayerPrivateGStreamer::loadingFailed):
3063         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3064
3065 2019-04-25  Philippe Normand  <pnormand@igalia.com>
3066
3067         [REGRESSION(r243197)][GStreamer] http/tests/media/clearkey/collect-webkit-media-session.html hits an ASSERT
3068         https://bugs.webkit.org/show_bug.cgi?id=197230
3069
3070         Reviewed by Xabier Rodriguez-Calvar.
3071
3072         Perform the resource loader disposal and destruction from the main
3073         thread. Also ensure there's no circular reference between the
3074         CachedResourceStreamingClient and WebKitWebSrc when disposing of
3075         the private WebKitWebSrc storage.
3076
3077         * platform/graphics/gstreamer/MainThreadNotifier.h:
3078         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3079         (_WebKitWebSrcPrivate::~_WebKitWebSrcPrivate):
3080         (webkit_web_src_class_init):
3081         (webKitWebSrcDispose):
3082         (webKitWebSrcCloseSession):
3083         (webKitWebSrcFinalize): Deleted.
3084
3085 2019-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3086
3087         [GTK] Hardcoded text color in input fields
3088         https://bugs.webkit.org/show_bug.cgi?id=126907
3089
3090         Reviewed by Michael Catanzaro.
3091
3092         Enable HAVE_OS_DARK_MODE_SUPPORT for GTK port to ensure that dark mode is used when Page::useDarkAppearance()
3093         returns true. This patch reverts r232913, I'll reopen the bug, I think we need to find a better solution for
3094         that.
3095
3096         * CMakeLists.txt: Add HAVE_OS_DARK_MODE_SUPPORT to FEATURE_DEFINES_WITH_SPACE_SEPARATOR if enabled.
3097         * css/CSSDefaultStyleSheets.cpp: Ensure html{color:text} is used in simple style sheet when
3098         HAVE_OS_DARK_MODE_SUPPORT is enabled.
3099         * page/FrameView.cpp:
3100         (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindowframe to get the frame view background
3101         color when HAVE_OS_DARK_MODE_SUPPORT is enabled for non-mac ports.
3102         * platform/gtk/RenderThemeWidget.cpp:
3103         (WebCore::RenderThemeWidget::getOrCreate): Create window widget.
3104         (WebCore::RenderThemeWindow::RenderThemeWindow): Add window widget.
3105         * platform/gtk/RenderThemeWidget.h:
3106         * rendering/RenderThemeGtk.cpp:
3107         (WebCore::RenderThemeGtk::disabledTextColor const): Always use the color from the theme for consistency with
3108         other form controls.
3109         (WebCore::RenderThemeGtk::systemColor const): Get the color from the theme for CSSValueText, CSSValueGraytext
3110         and CSSValueWindowframe.
3111         * rendering/RenderThemeGtk.h:
3112
3113 2019-04-24  Zalan Bujtas  <zalan@apple.com>
3114
3115         Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
3116         https://bugs.webkit.org/show_bug.cgi?id=196948
3117         <rdar://problem/49927131>
3118
3119         Reviewed by Tim Horton.
3120
3121         Covered by existing tests.
3122
3123         * loader/EmptyClients.h:
3124         * page/ChromeClient.h:
3125         * page/FrameView.cpp:
3126         (WebCore::FrameView::autoSizeIfEnabled):
3127         (WebCore::FrameView::enableAutoSizeMode):
3128         * page/FrameView.h:
3129
3130 2019-04-24  Youenn Fablet  <youenn@apple.com>
3131
3132         Do not restart WebRTC stats timer if backend is stopped
3133         https://bugs.webkit.org/show_bug.cgi?id=197257
3134         <rdar://problem/50095879>
3135
3136         Reviewed by Eric Carlson.
3137
3138         We used to stop and reschedule the stat gathering timer in case the
3139         gathering delay is changing. Timer should not be rescheduled if the backend is stopped.
3140
3141         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3142         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
3143
3144 2019-04-24  Andres Gonzalez  <andresg_22@apple.com>
3145
3146         Flaky crash under WebCore::AXObjectCache::stopCachingComputedObjectAttributes()
3147         https://bugs.webkit.org/show_bug.cgi?id=187391
3148         <rdar://problem/40681396
3149
3150         Check for null value returned by AccessibilityObject::axObjectCache.
3151
3152         Reviewed by Chris Fleizach.
3153
3154         No need for new test since existing tests caught this problem.
3155
3156         * accessibility/AccessibilityNodeObject.cpp:
3157         (WebCore::AccessibilityNodeObject::firstChild const):
3158         (WebCore::AccessibilityNodeObject::lastChild const):
3159         (WebCore::AccessibilityNodeObject::previousSibling const):
3160         (WebCore::AccessibilityNodeObject::nextSibling const):
3161         (WebCore::AccessibilityNodeObject::addChildren):
3162         (WebCore::AccessibilityNodeObject::anchorElement const):
3163         (WebCore::AccessibilityNodeObject::changeValueByStep):
3164         (WebCore::AccessibilityNodeObject::changeValueByPercent):
3165         (WebCore::AccessibilityNodeObject::textForLabelElement const):
3166         (WebCore::AccessibilityNodeObject::titleElementText const):
3167         (WebCore::AccessibilityNodeObject::alternativeText const):
3168         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
3169         (WebCore::AccessibilityNodeObject::helpText const):
3170
3171 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
3172
3173         REGRESSION (r242132): Nested position:sticky elements move incorrectly
3174         https://bugs.webkit.org/show_bug.cgi?id=197255
3175         rdar://problem/50137744
3176
3177         Reviewed by Zalan Bujtas.
3178         
3179         Revert to the behavior of the code before r242132, where we looked at the direct parent
3180         scrolling tree node instead of walking up the ancestor chain to find an enclosing scrolling node.
3181         This fixes nested sticky behavior.
3182
3183         Test: scrollingcoordinator/mac/nested-sticky.html
3184
3185         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
3186         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
3187
3188 2019-04-24  Eric Carlson  <eric.carlson@apple.com>
3189
3190         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
3191         https://bugs.webkit.org/show_bug.cgi?id=197171
3192         <rdar://problem/47454979>
3193
3194         Reviewed by Youenn Fablet.
3195
3196         Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
3197
3198         * Modules/plugins/QuickTimePluginReplacement.mm:
3199         (WebCore::jsValueWithValueInContext):
3200         (WebCore::jsValueWithAVMetadataItemInContext):
3201         * WebCore.xcodeproj/project.pbxproj:
3202         * platform/audio/ios/AudioSessionIOS.mm:
3203         (WebCore::AudioSession::setCategory):
3204         (WebCore::AudioSession::category const):
3205         (WebCore::AudioSession::routeSharingPolicy const):
3206         (WebCore::AudioSession::routingContextUID const):
3207         (WebCore::AudioSession::sampleRate const):
3208         (WebCore::AudioSession::bufferSize const):
3209         (WebCore::AudioSession::numberOfOutputChannels const):
3210         (WebCore::AudioSession::tryToSetActiveInternal):
3211         (WebCore::AudioSession::preferredBufferSize const):
3212         (WebCore::AudioSession::setPreferredBufferSize):
3213         * platform/audio/ios/MediaSessionManagerIOS.mm:
3214         (-[WebMediaSessionHelper initWithCallback:]):
3215         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
3216         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3217         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
3218         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
3219         (WebCore::AVTrackPrivateAVFObjCImpl::label const):
3220         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3221         (WebCore::AudioSourceProviderAVFObjC::createMix):
3222         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
3223         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
3224         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
3225         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
3226         (WebCore::AVFoundationMIMETypeCache::canDecodeType):
3227         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
3228         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3229         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
3230         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
3231         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
3232         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
3233         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
3234         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
3235         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
3236         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
3237         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
3238         (WebCore::CDMSessionAVContentKeySession::isAvailable):
3239         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
3240         (WebCore::CDMSessionAVContentKeySession::update):
3241         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
3242         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
3243         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
3244         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3245         (WebCore::CDMSessionAVStreamSession::releaseKeys):
3246         (WebCore::CDMSessionAVStreamSession::update):
3247         (WebCore::CDMSessionAVStreamSession::setStreamSession):
3248         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
3249         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3250         (WebCore::imageDecoderAssetOptions):
3251         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
3252         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
3253         (WebCore::ImageDecoderAVFObjC::readSamples):
3254         (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
3255         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
3256         (WebCore::InbandTextTrackPrivateAVFObjC::label const):
3257         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
3258         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
3259         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3260         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
3261         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3262         (WebCore::assetCacheForPath):
3263         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
3264         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
3265         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
3266         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
3267         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
3268         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
3269         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
3270         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
3271         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
3272         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
3273         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
3274         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
3275         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
3276         (WebCore::determineChangedTracksFromNewTracksAndOldItems):
3277         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
3278         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
3279         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
3280         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
3281         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
3282         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
3283         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
3284         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
3285         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
3286         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
3287         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
3288         (WebCore::exernalDeviceDisplayNameForPlayer):
3289         (WebCore::metadataType):
3290         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
3291         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3292         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
3293         (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
3294         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
3295         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3296         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
3297         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
3298         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
3299         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
3300         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
3301         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3302         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
3303         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
3304         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
3305         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3306         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
3307         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
3308         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
3309         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
3310         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
3311         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3312         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
3313         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
3314         (WebCore::PlatformCALayerCocoa::clone const):
3315         (WebCore::PlatformCALayerCocoa::avPlayerLayer const):
3316         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
3317         (WebCore::validateHEVCParameters):
3318         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
3319         (getAVSpeechUtteranceDefaultSpeechRate):
3320         (getAVSpeechUtteranceMaximumSpeechRate):
3321         (-[WebSpeechSynthesisWrapper speakUtterance:]):
3322         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
3323         (SOFT_LINK_CONSTANT): Deleted.
3324         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3325         (-[WebAVPlayerLayer init]):
3326         (-[WebAVPlayerLayer layoutSublayers]):
3327         (-[WebAVPlayerLayer setVideoGravity:]):
3328         (-[WebAVPlayerLayer videoRect]):
3329         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
3330         * platform/mac/SerializedPlatformRepresentationMac.mm:
3331         (WebCore::jsValueWithValueInContext):
3332         (WebCore::jsValueWithAVMetadataItemInContext):
3333         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
3334         (WebCore::getAVFormatIDKeyWithFallback):
3335         (WebCore::getAVNumberOfChannelsKeyWithFallback):
3336         (WebCore::getAVSampleRateKeyWithFallback):
3337         (WebCore::getAVEncoderBitRateKeyWithFallback):
3338         (WebCore::MediaRecorderPrivateWriter::create):
3339         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
3340         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
3341         * platform/mediastream/RealtimeVideoSource.h:
3342         * platform/mediastream/VideoPreset.h:
3343         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
3344         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
3345         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
3346         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
3347         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
3348         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3349         (WebCore::deviceIsAvailable):
3350         (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices):
3351         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
3352         (WebCore::AVCaptureDeviceManager::isAvailable):
3353         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager):
3354         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3355         (WebCore::AVVideoPreset::create):
3356         (WebCore::AVVideoPreset::AVVideoPreset):
3357         (WebCore::AVVideoCaptureSource::create):
3358         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
3359         (WebCore::AVVideoCaptureSource::capabilities):
3360         (WebCore::sensorOrientationFromVideoOutput):
3361         (WebCore::AVVideoCaptureSource::setupSession):
3362         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
3363         (WebCore::AVVideoCaptureSource::setupCaptureSession):
3364         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
3365         (WebCore::AVVideoCaptureSource::generatePresets):
3366         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
3367         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
3368
3369 2019-04-24  Brady Eidson  <beidson@apple.com>
3370
3371         XMLHTTPRequest POSTs to a custom WKURLSchemeHandler protocol are missing the HTTP body.
3372         https://bugs.webkit.org/show_bug.cgi?id=191362
3373
3374         Reviewed by Alex Christensen.
3375
3376         Covered by new API tests.
3377
3378         In 2008 some refactoring added an HTTP(S)-only restriction to copying the form body for
3379         XHRs that POST, and it added that restriction with no explanation.
3380
3381         We definitely want to allow that.
3382
3383         Blobs are broken at this time (covered by bug 197237)
3384
3385         * xml/XMLHttpRequest.cpp:
3386         (WebCore::XMLHttpRequest::send):
3387         (WebCore::XMLHttpRequest::sendBytesData):
3388
3389 2019-04-24  John Wilander  <wilander@apple.com>
3390
3391         Age out unconverted Ad Click Attributions after one week.
3392         https://bugs.webkit.org/show_bug.cgi?id=197238
3393         <rdar://problem/50177349>
3394
3395         Reviewed by Chris Dumez.
3396
3397         This patch adds the two functions AdClickAttribution::markAsExpired()
3398         and AdClickAttribution::hasExpired() which make use of the existing
3399         m_timeOfAdClick member.
3400
3401         Test: http/tests/adClickAttribution/expired-attributions-removed.html
3402
3403         * loader/AdClickAttribution.cpp:
3404         (WebCore::AdClickAttribution::markAsExpired):
3405         (WebCore::AdClickAttribution::hasExpired const):
3406         * loader/AdClickAttribution.h:
3407
3408 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
3409
3410         REGRESSION (iOS 12.2): CSS perspective property value can only be set correctly once
3411         https://bugs.webkit.org/show_bug.cgi?id=197105
3412         rdar://problem/50068230
3413
3414         Reviewed by Zalan Bujtas.
3415
3416         Make sure we trigger a geometry update when style properties change that
3417         result in a StyleDifference::RecompositeLayer, and which are updated on layers
3418         via RenderLayerBacking::updateGeometry().
3419
3420         Tests: compositing/style-change/backface-visibility-change.html
3421                compositing/style-change/perspective-change.html
3422                compositing/style-change/perspective-origin-change.html
3423                compositing/style-change/transform-origin-change.html
3424                compositing/style-change/transform-style-change.html
3425
3426         * rendering/RenderLayerCompositor.cpp:
3427         (WebCore::recompositeChangeRequiresGeometryUpdate):
3428         (WebCore::RenderLayerCompositor::layerStyleChanged):
3429
3430 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
3431
3432         Make it possible to control the renderTreeAsText output by setting options on testRunner
3433         https://bugs.webkit.org/show_bug.cgi?id=197133
3434
3435         Reviewed by Sam Weinig.
3436
3437         Add testRunner.setRenderTreeDumpOptions() and expose the subset of RenderAsTextFlag flags
3438         that make sense in testing (those that don't dump unstable data like addresses), and plumb
3439         these flags through the various framework layers.
3440
3441         Convert RenderAsTextBehavior to an OptionSet<RenderAsTextFlag>.
3442
3443         Fix code generation in WebKitTestRunner to generate bindings for IDL const values,
3444         and hand-code DumpRenderTree bindings.
3445
3446         Some cleanup of the TestRunners, using member initializers.
3447
3448         Test: fast/harness/render-tree-as-text-options.html
3449
3450         * rendering/RenderLayer.