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