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