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