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