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