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