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