[iOS] Implement idempotent mode for text autosizing
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
2
3         [iOS] Implement idempotent mode for text autosizing
4         https://bugs.webkit.org/show_bug.cgi?id=197250
5         <rdar://problem/50211034>
6
7         Reviewed by Jon Lee.
8
9         Our text autosizing code has this interesting behavior where it is sensitive to the width of the text's container
10         and the number of lines of text inside the element. Not only is it sensitive to those things, but as those things
11         change, their values are stored inside the RenderObject itself and then never recomputed. This means that the text
12         autosizing parameters are sensitive to the entire history of an element. So, a newly created element with the same
13         style as an existing element can have dramatically different results.
14
15         This patch adds a new mode for text autosizing, which isn't sensitive to either of those things, and therefore
16         maintains the invariant that a newly created element will behave the same as an existing element with the same style.
17         Instead of using container size, it instead uses the viewport's initial scale. As the viewport's initial scale
18         changes, new layouts will be triggered, which will cause the autosizing code to use the new value.
19
20         Tests: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-identity.html
21                fast/text-autosizing/ios/idempotentmode/idempotent-autosizing.html
22
23         * page/FrameViewLayoutContext.cpp:
24         (WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded):
25         * page/Page.cpp:
26         (WebCore::Page::setInitialScale): WebKit will push the initial scale down into the page.
27         * page/Page.h:
28         (WebCore::Page::initialScale const):
29         * page/SettingsBase.h:
30         * page/cocoa/SettingsBaseCocoa.mm:
31         (WebCore::SettingsBase::textAutosizingUsesIdempotentMode):
32         (WebCore::SettingsBase::defaultTextAutosizingEnabled):
33         * rendering/RenderBlockFlow.cpp:
34         (WebCore::idempotentTextSize): Describe a piecewise-linear curve for the text size to follow. The curve scales
35         depending on the viewport's initial scale.
36         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
37         * rendering/RenderBlockFlow.h:
38         * rendering/RenderElement.cpp:
39         (WebCore::includeNonFixedHeight): This new mode should consider max-height as well as height when determining if
40         content overflows.
41         (WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
42         (WebCore::RenderElement::resetTextAutosizing):
43         * rendering/RenderElement.h:
44         * rendering/RenderObject.h:
45
46 2019-04-25  Simon Fraser  <simon.fraser@apple.com>
47
48         REGRESSION (r234330): 3 legacy-animation-engine/compositing tests are flaky failures
49         https://bugs.webkit.org/show_bug.cgi?id=188357
50         <rdar://problem/42986633>
51
52         Reviewed by Dean Jackson.
53
54         DumpRenderTree had no code that set page.setCompositingPolicyOverride() to Normal, so some
55         tests would fall into low memory mode and have different behavior.
56         
57         Fix by moving the code that calls setCompositingPolicyOverride(Normal) from the WK2 layer
58         to Internals, so it's shared by DRT and WTR.
59         
60         We no longer need the WK2 C SPI glue.
61
62         * testing/Internals.cpp:
63         (WebCore::Internals::resetToConsistentState):
64
65 2019-04-25  Sihui Liu  <sihui_liu@apple.com>
66
67         [ iOS Sim ] REGRESSION (r242986) Layout Test storage/indexeddb/modern/idbtransaction-objectstore-failures-private.html is a flaky failure
68         https://bugs.webkit.org/show_bug.cgi?id=196357
69         <rdar://problem/49386836>
70
71         Reviewed by Geoffrey Garen.
72
73         Dispatch IDBRequest event to IDBTransaction if event of IDBTransaction has not been dispatched.
74
75         Covered by existing tests.
76
77         * Modules/indexeddb/IDBRequest.cpp:
78         (WebCore::IDBRequest::dispatchEvent):
79         * Modules/indexeddb/IDBTransaction.cpp:
80         (WebCore::IDBTransaction::dispatchEvent):
81         * Modules/indexeddb/IDBTransaction.h:
82
83 2019-04-25  Chris Dumez  <cdumez@apple.com>
84
85         ASSERT(scriptExecutionContext()) in Performance::resourceTimingBufferFullTimerFired()
86         https://bugs.webkit.org/show_bug.cgi?id=197300
87         <rdar://problem/49965990>
88
89         Reviewed by Youenn Fablet.
90
91         We crash because the scriptExecutionContext has been destroyed by the time the m_resourceTimingBufferFullTimer
92         timer fires. However, r241598 already makes sure that we stop the timer when the script execution context
93         is destroyed. This makes me think that somebody restarts the timer *after* the script execution context has
94         been destroyed. The thing is that we only start the timer in Performance::addResourceTiming() and there are
95         only 2 call sites for this method. Both call sites get the Performance object from the Window object, which
96         they get from the Document object. As a result, I would believe that the Window's document is alive, even
97         though the Performance object's scriptExecutionContext is not. This could indicate that the Performance
98         object's scriptExecutionContext gets out of sync with its Window's document. I have found one place where
99         it could happen in theory (DOMWindow::didSecureTransitionTo()). I have not been able to write a test
100         confirming my theory though so this is a speculative fix. I have also added a few assertions to help us
101         track down the issue if my speculative fix turns out to be ineffective.
102
103         No new tests, we do not know how to reproduce.
104
105         * page/DOMWindow.cpp:
106         (WebCore::DOMWindow::didSecureTransitionTo):
107         This is a speculative fix for the crash. When a DOMWindow transitions from one document to
108         another, reset its data members which store the DOMWindow's document to make sure that they
109         do not get out of sync.
110
111         (WebCore::DOMWindow::crypto const):
112         (WebCore::DOMWindow::navigator):
113         (WebCore::DOMWindow::performance const):
114         Add assertions to make sure that the member's scriptExecutionContext is in sync with
115         the window's.
116
117         * page/Performance.cpp:
118         (WebCore::Performance::addResourceTiming):
119         Add assertion to make sure that the scriptExecutionContext() is non-null when calling this
120         as this may start the m_resourceTimingBufferFullTimer timer. If my speculative fix above
121         does not work, we should hit this and this should tell us which call site is causing this.
122
123 2019-04-25  Timothy Hatcher  <timothy@apple.com>
124
125         Disable ContentChangeObserver on iOSMac.
126         https://bugs.webkit.org/show_bug.cgi?id=197292
127         rdar://problem/49039957
128
129         Reviewed by Zalan Bujtas.
130
131         We don’t need to run any of ContentChangeObserver, because we have hover events on iOSMac.
132         Disabling it skips the synthetic mouse move events and speeds up clicks.
133
134         * page/SettingsBase.cpp:
135         (WebCore::SettingsBase::defaultContentChangeObserverEnabled): Return false for PLATFORM(IOSMAC).
136
137 2019-04-25  Timothy Hatcher  <timothy@apple.com>
138
139         Disable date and time inputs on iOSMac.
140         https://bugs.webkit.org/show_bug.cgi?id=197287
141         rdar://problem/46794376
142
143         Reviewed by Wenson Hsieh.
144
145         * Configurations/FeatureDefines.xcconfig:
146         * platform/text/mac/LocaleMac.h:
147         * platform/text/mac/LocaleMac.mm:
148         (WebCore::LocaleMac::formatDateTime):
149
150 2019-04-25  Alex Christensen  <achristensen@webkit.org>
151
152         Fix more Windows builds after r244653
153         https://bugs.webkit.org/show_bug.cgi?id=197131
154
155         * svg/properties/SVGAnimatedPropertyList.h:
156         * svg/properties/SVGProperty.h:
157         * svg/properties/SVGPropertyList.h:
158
159 2019-04-25  Alex Christensen  <achristensen@webkit.org>
160
161         Fix more builds after r244653
162         https://bugs.webkit.org/show_bug.cgi?id=197131
163
164         * svg/properties/SVGValuePropertyList.h:
165         Something is preventing MSVC from seeing protected constructors from subclasses.
166
167 2019-04-25  Per Arne Vollan  <pvollan@apple.com>
168
169         -[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:] never returns _WKWebsiteDataTypeCredentials
170         https://bugs.webkit.org/show_bug.cgi?id=196991
171         <rdar://problem/45507423>
172
173         Reviewed by Alex Christensen.
174
175         Add method to get all origins with persistent credentials from credential storage.
176
177         API tests: WKWebsiteDataStore.FetchNonPersistentCredentials
178                    WKWebsiteDataStore.FetchPersistentCredentials
179
180         * platform/network/CredentialStorage.h:
181         * platform/network/mac/CredentialStorageMac.mm:
182         (WebCore::CredentialStorage::originsWithPersistentCredentials):
183
184 2019-04-25  Alex Christensen  <achristensen@webkit.org>
185
186         Fix MSVC build after r244653
187         https://bugs.webkit.org/show_bug.cgi?id=197131
188
189         * svg/properties/SVGValueProperty.h:
190         MSVC doesn't think it can access these protected constructors from subclasses.
191         Make the build work and investigate this later.
192
193 2019-04-25  Alex Christensen  <achristensen@webkit.org>
194
195         Start using C++17
196         https://bugs.webkit.org/show_bug.cgi?id=197131
197
198         Reviewed by Darin Adler.
199
200         * Configurations/Base.xcconfig:
201         * DerivedSources.make:
202
203 2019-04-25  Commit Queue  <commit-queue@webkit.org>
204
205         Unreviewed, rolling out r244627.
206         https://bugs.webkit.org/show_bug.cgi?id=197282
207
208         Causing internal build failures (Requested by ShawnRoberts on
209         #webkit).
210
211         Reverted changeset:
212
213         "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
214         https://bugs.webkit.org/show_bug.cgi?id=197171
215         https://trac.webkit.org/changeset/244627
216
217 2019-04-25  Antti Koivisto  <antti@apple.com>
218
219         redefinition of enumerator 'NSAttachmentCharacter' with Apple internal build
220         https://bugs.webkit.org/show_bug.cgi?id=197279
221
222         Reviewed by Antoine Quint.
223
224         Try to fix the build.
225
226         * platform/mac/WebNSAttributedStringExtras.mm:
227
228 2019-04-25  Antti Koivisto  <antti@apple.com>
229
230         Visited link hash should be computed only once
231         https://bugs.webkit.org/show_bug.cgi?id=197229
232         <rdar://problem/48438924>
233
234         Reviewed by Alex Christensen.
235
236         Test: fast/history/visited-href-mutation.html
237
238         Visited link style is now based on the first target URL of the link element. Further href mutations don't affect styling.
239
240         * dom/Document.cpp:
241         (WebCore::Document::updateBaseURL):
242         * dom/VisitedLinkState.cpp:
243         (WebCore::linkAttribute):
244         (WebCore::linkHashForElement):
245
246         Visited link support is now limited to HTML and SVG <a> elements.
247
248         (WebCore::VisitedLinkState::invalidateStyleForLink):
249         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
250         * html/HTMLAnchorElement.cpp:
251         (WebCore::HTMLAnchorElement::HTMLAnchorElement):
252         (WebCore::HTMLAnchorElement::parseAttribute):
253         * html/HTMLAnchorElement.h:
254         (WebCore::HTMLAnchorElement::visitedLinkHash const):
255         (WebCore::HTMLAnchorElement::invalidateCachedVisitedLinkHash): Deleted.
256         * svg/SVGAElement.cpp:
257         (WebCore::SVGAElement::visitedLinkHash const):
258         * svg/SVGAElement.h:
259
260 2019-04-25  Philippe Normand  <pnormand@igalia.com>
261
262         [GStreamer] gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed in WebCore::MediaPlayerPrivateGStreamer::paused
263         https://bugs.webkit.org/show_bug.cgi?id=196691
264
265         Reviewed by Eric Carlson.
266
267         For gif assets, fail media loading early and notify the
268         MediaPlayer by setting both network and ready states, so that the
269         MediaPlayer will try with with the next media engine or pass the
270         error to HTMLMediaElement if there are none.
271
272         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
273         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
274         (WebCore::MediaPlayerPrivateGStreamer::loadingFailed):
275         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
276
277 2019-04-25  Philippe Normand  <pnormand@igalia.com>
278
279         [REGRESSION(r243197)][GStreamer] http/tests/media/clearkey/collect-webkit-media-session.html hits an ASSERT
280         https://bugs.webkit.org/show_bug.cgi?id=197230
281
282         Reviewed by Xabier Rodriguez-Calvar.
283
284         Perform the resource loader disposal and destruction from the main
285         thread. Also ensure there's no circular reference between the
286         CachedResourceStreamingClient and WebKitWebSrc when disposing of
287         the private WebKitWebSrc storage.
288
289         * platform/graphics/gstreamer/MainThreadNotifier.h:
290         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
291         (_WebKitWebSrcPrivate::~_WebKitWebSrcPrivate):
292         (webkit_web_src_class_init):
293         (webKitWebSrcDispose):
294         (webKitWebSrcCloseSession):
295         (webKitWebSrcFinalize): Deleted.
296
297 2019-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
298
299         [GTK] Hardcoded text color in input fields
300         https://bugs.webkit.org/show_bug.cgi?id=126907
301
302         Reviewed by Michael Catanzaro.
303
304         Enable HAVE_OS_DARK_MODE_SUPPORT for GTK port to ensure that dark mode is used when Page::useDarkAppearance()
305         returns true. This patch reverts r232913, I'll reopen the bug, I think we need to find a better solution for
306         that.
307
308         * CMakeLists.txt: Add HAVE_OS_DARK_MODE_SUPPORT to FEATURE_DEFINES_WITH_SPACE_SEPARATOR if enabled.
309         * css/CSSDefaultStyleSheets.cpp: Ensure html{color:text} is used in simple style sheet when
310         HAVE_OS_DARK_MODE_SUPPORT is enabled.
311         * page/FrameView.cpp:
312         (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindowframe to get the frame view background
313         color when HAVE_OS_DARK_MODE_SUPPORT is enabled for non-mac ports.
314         * platform/gtk/RenderThemeWidget.cpp:
315         (WebCore::RenderThemeWidget::getOrCreate): Create window widget.
316         (WebCore::RenderThemeWindow::RenderThemeWindow): Add window widget.
317         * platform/gtk/RenderThemeWidget.h:
318         * rendering/RenderThemeGtk.cpp:
319         (WebCore::RenderThemeGtk::disabledTextColor const): Always use the color from the theme for consistency with
320         other form controls.
321         (WebCore::RenderThemeGtk::systemColor const): Get the color from the theme for CSSValueText, CSSValueGraytext
322         and CSSValueWindowframe.
323         * rendering/RenderThemeGtk.h:
324
325 2019-04-24  Zalan Bujtas  <zalan@apple.com>
326
327         Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
328         https://bugs.webkit.org/show_bug.cgi?id=196948
329         <rdar://problem/49927131>
330
331         Reviewed by Tim Horton.
332
333         Covered by existing tests.
334
335         * loader/EmptyClients.h:
336         * page/ChromeClient.h:
337         * page/FrameView.cpp:
338         (WebCore::FrameView::autoSizeIfEnabled):
339         (WebCore::FrameView::enableAutoSizeMode):
340         * page/FrameView.h:
341
342 2019-04-24  Youenn Fablet  <youenn@apple.com>
343
344         Do not restart WebRTC stats timer if backend is stopped
345         https://bugs.webkit.org/show_bug.cgi?id=197257
346         <rdar://problem/50095879>
347
348         Reviewed by Eric Carlson.
349
350         We used to stop and reschedule the stat gathering timer in case the
351         gathering delay is changing. Timer should not be rescheduled if the backend is stopped.
352
353         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
354         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
355
356 2019-04-24  Andres Gonzalez  <andresg_22@apple.com>
357
358         Flaky crash under WebCore::AXObjectCache::stopCachingComputedObjectAttributes()
359         https://bugs.webkit.org/show_bug.cgi?id=187391
360         <rdar://problem/40681396
361
362         Check for null value returned by AccessibilityObject::axObjectCache.
363
364         Reviewed by Chris Fleizach.
365
366         No need for new test since existing tests caught this problem.
367
368         * accessibility/AccessibilityNodeObject.cpp:
369         (WebCore::AccessibilityNodeObject::firstChild const):
370         (WebCore::AccessibilityNodeObject::lastChild const):
371         (WebCore::AccessibilityNodeObject::previousSibling const):
372         (WebCore::AccessibilityNodeObject::nextSibling const):
373         (WebCore::AccessibilityNodeObject::addChildren):
374         (WebCore::AccessibilityNodeObject::anchorElement const):
375         (WebCore::AccessibilityNodeObject::changeValueByStep):
376         (WebCore::AccessibilityNodeObject::changeValueByPercent):
377         (WebCore::AccessibilityNodeObject::textForLabelElement const):
378         (WebCore::AccessibilityNodeObject::titleElementText const):
379         (WebCore::AccessibilityNodeObject::alternativeText const):
380         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
381         (WebCore::AccessibilityNodeObject::helpText const):
382
383 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
384
385         REGRESSION (r242132): Nested position:sticky elements move incorrectly
386         https://bugs.webkit.org/show_bug.cgi?id=197255
387         rdar://problem/50137744
388
389         Reviewed by Zalan Bujtas.
390         
391         Revert to the behavior of the code before r242132, where we looked at the direct parent
392         scrolling tree node instead of walking up the ancestor chain to find an enclosing scrolling node.
393         This fixes nested sticky behavior.
394
395         Test: scrollingcoordinator/mac/nested-sticky.html
396
397         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
398         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
399
400 2019-04-24  Eric Carlson  <eric.carlson@apple.com>
401
402         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
403         https://bugs.webkit.org/show_bug.cgi?id=197171
404         <rdar://problem/47454979>
405
406         Reviewed by Youenn Fablet.
407
408         Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
409
410         * Modules/plugins/QuickTimePluginReplacement.mm:
411         (WebCore::jsValueWithValueInContext):
412         (WebCore::jsValueWithAVMetadataItemInContext):
413         * WebCore.xcodeproj/project.pbxproj:
414         * platform/audio/ios/AudioSessionIOS.mm:
415         (WebCore::AudioSession::setCategory):
416         (WebCore::AudioSession::category const):
417         (WebCore::AudioSession::routeSharingPolicy const):
418         (WebCore::AudioSession::routingContextUID const):
419         (WebCore::AudioSession::sampleRate const):
420         (WebCore::AudioSession::bufferSize const):
421         (WebCore::AudioSession::numberOfOutputChannels const):
422         (WebCore::AudioSession::tryToSetActiveInternal):
423         (WebCore::AudioSession::preferredBufferSize const):
424         (WebCore::AudioSession::setPreferredBufferSize):
425         * platform/audio/ios/MediaSessionManagerIOS.mm:
426         (-[WebMediaSessionHelper initWithCallback:]):
427         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
428         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
429         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
430         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
431         (WebCore::AVTrackPrivateAVFObjCImpl::label const):
432         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
433         (WebCore::AudioSourceProviderAVFObjC::createMix):
434         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
435         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
436         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
437         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
438         (WebCore::AVFoundationMIMETypeCache::canDecodeType):
439         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
440         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
441         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
442         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
443         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
444         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
445         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
446         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
447         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
448         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
449         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
450         (WebCore::CDMSessionAVContentKeySession::isAvailable):
451         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
452         (WebCore::CDMSessionAVContentKeySession::update):
453         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
454         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
455         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
456         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
457         (WebCore::CDMSessionAVStreamSession::releaseKeys):
458         (WebCore::CDMSessionAVStreamSession::update):
459         (WebCore::CDMSessionAVStreamSession::setStreamSession):
460         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
461         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
462         (WebCore::imageDecoderAssetOptions):
463         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
464         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
465         (WebCore::ImageDecoderAVFObjC::readSamples):
466         (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
467         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
468         (WebCore::InbandTextTrackPrivateAVFObjC::label const):
469         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
470         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
471         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
472         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
473         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
474         (WebCore::assetCacheForPath):
475         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
476         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
477         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
478         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
479         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
480         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
481         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
482         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
483         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
484         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
485         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
486         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
487         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
488         (WebCore::determineChangedTracksFromNewTracksAndOldItems):
489         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
490         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
491         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
492         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
493         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
494         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
495         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
496         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
497         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
498         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
499         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
500         (WebCore::exernalDeviceDisplayNameForPlayer):
501         (WebCore::metadataType):
502         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
503         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
504         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
505         (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
506         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
507         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
508         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
509         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
510         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
511         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
512         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
513         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
514         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
515         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
516         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
517         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
518         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
519         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
520         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
521         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
522         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
523         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
524         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
525         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
526         (WebCore::PlatformCALayerCocoa::clone const):
527         (WebCore::PlatformCALayerCocoa::avPlayerLayer const):
528         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
529         (WebCore::validateHEVCParameters):
530         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
531         (getAVSpeechUtteranceDefaultSpeechRate):
532         (getAVSpeechUtteranceMaximumSpeechRate):
533         (-[WebSpeechSynthesisWrapper speakUtterance:]):
534         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
535         (SOFT_LINK_CONSTANT): Deleted.
536         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
537         (-[WebAVPlayerLayer init]):
538         (-[WebAVPlayerLayer layoutSublayers]):
539         (-[WebAVPlayerLayer setVideoGravity:]):
540         (-[WebAVPlayerLayer videoRect]):
541         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
542         * platform/mac/SerializedPlatformRepresentationMac.mm:
543         (WebCore::jsValueWithValueInContext):
544         (WebCore::jsValueWithAVMetadataItemInContext):
545         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
546         (WebCore::getAVFormatIDKeyWithFallback):
547         (WebCore::getAVNumberOfChannelsKeyWithFallback):
548         (WebCore::getAVSampleRateKeyWithFallback):
549         (WebCore::getAVEncoderBitRateKeyWithFallback):
550         (WebCore::MediaRecorderPrivateWriter::create):
551         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
552         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
553         * platform/mediastream/RealtimeVideoSource.h:
554         * platform/mediastream/VideoPreset.h:
555         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
556         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
557         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
558         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
559         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
560         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
561         (WebCore::deviceIsAvailable):
562         (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices):
563         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
564         (WebCore::AVCaptureDeviceManager::isAvailable):
565         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager):
566         * platform/mediastream/mac/AVVideoCaptureSource.mm:
567         (WebCore::AVVideoPreset::create):
568         (WebCore::AVVideoPreset::AVVideoPreset):
569         (WebCore::AVVideoCaptureSource::create):
570         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
571         (WebCore::AVVideoCaptureSource::capabilities):
572         (WebCore::sensorOrientationFromVideoOutput):
573         (WebCore::AVVideoCaptureSource::setupSession):
574         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
575         (WebCore::AVVideoCaptureSource::setupCaptureSession):
576         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
577         (WebCore::AVVideoCaptureSource::generatePresets):
578         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
579         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
580
581 2019-04-24  Brady Eidson  <beidson@apple.com>
582
583         XMLHTTPRequest POSTs to a custom WKURLSchemeHandler protocol are missing the HTTP body.
584         https://bugs.webkit.org/show_bug.cgi?id=191362
585
586         Reviewed by Alex Christensen.
587
588         Covered by new API tests.
589
590         In 2008 some refactoring added an HTTP(S)-only restriction to copying the form body for
591         XHRs that POST, and it added that restriction with no explanation.
592
593         We definitely want to allow that.
594
595         Blobs are broken at this time (covered by bug 197237)
596
597         * xml/XMLHttpRequest.cpp:
598         (WebCore::XMLHttpRequest::send):
599         (WebCore::XMLHttpRequest::sendBytesData):
600
601 2019-04-24  John Wilander  <wilander@apple.com>
602
603         Age out unconverted Ad Click Attributions after one week.
604         https://bugs.webkit.org/show_bug.cgi?id=197238
605         <rdar://problem/50177349>
606
607         Reviewed by Chris Dumez.
608
609         This patch adds the two functions AdClickAttribution::markAsExpired()
610         and AdClickAttribution::hasExpired() which make use of the existing
611         m_timeOfAdClick member.
612
613         Test: http/tests/adClickAttribution/expired-attributions-removed.html
614
615         * loader/AdClickAttribution.cpp:
616         (WebCore::AdClickAttribution::markAsExpired):
617         (WebCore::AdClickAttribution::hasExpired const):
618         * loader/AdClickAttribution.h:
619
620 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
621
622         REGRESSION (iOS 12.2): CSS perspective property value can only be set correctly once
623         https://bugs.webkit.org/show_bug.cgi?id=197105
624         rdar://problem/50068230
625
626         Reviewed by Zalan Bujtas.
627
628         Make sure we trigger a geometry update when style properties change that
629         result in a StyleDifference::RecompositeLayer, and which are updated on layers
630         via RenderLayerBacking::updateGeometry().
631
632         Tests: compositing/style-change/backface-visibility-change.html
633                compositing/style-change/perspective-change.html
634                compositing/style-change/perspective-origin-change.html
635                compositing/style-change/transform-origin-change.html
636                compositing/style-change/transform-style-change.html
637
638         * rendering/RenderLayerCompositor.cpp:
639         (WebCore::recompositeChangeRequiresGeometryUpdate):
640         (WebCore::RenderLayerCompositor::layerStyleChanged):
641
642 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
643
644         Make it possible to control the renderTreeAsText output by setting options on testRunner
645         https://bugs.webkit.org/show_bug.cgi?id=197133
646
647         Reviewed by Sam Weinig.
648
649         Add testRunner.setRenderTreeDumpOptions() and expose the subset of RenderAsTextFlag flags
650         that make sense in testing (those that don't dump unstable data like addresses), and plumb
651         these flags through the various framework layers.
652
653         Convert RenderAsTextBehavior to an OptionSet<RenderAsTextFlag>.
654
655         Fix code generation in WebKitTestRunner to generate bindings for IDL const values,
656         and hand-code DumpRenderTree bindings.
657
658         Some cleanup of the TestRunners, using member initializers.
659
660         Test: fast/harness/render-tree-as-text-options.html
661
662         * rendering/RenderLayer.cpp:
663         (WebCore::showLayerTree):
664         * rendering/RenderTreeAsText.cpp:
665         (WebCore::RenderTreeAsText::writeRenderObject):
666         (WebCore::writeDebugInfo):
667         (WebCore::write):
668         (WebCore::writeLayer):
669         (WebCore::writeLayerRenderers):
670         (WebCore::writeLayers):
671         (WebCore::externalRepresentation):
672         * rendering/RenderTreeAsText.h:
673         (WebCore::externalRepresentation):
674         (WebCore::write):
675         (WebCore::writeDebugInfo):
676         (): Deleted.
677         * rendering/svg/SVGRenderTreeAsText.cpp:
678         (WebCore::writePositionAndStyle):
679         (WebCore::writeStandardPrefix):
680         (WebCore::writeChildren):
681         (WebCore::writeSVGResourceContainer):
682         (WebCore::writeSVGContainer):
683         (WebCore::write):
684         (WebCore::writeSVGText):
685         (WebCore::writeSVGInlineText):
686         (WebCore::writeSVGImage):
687         (WebCore::writeSVGGradientStop):
688         (WebCore::writeResources):
689         * rendering/svg/SVGRenderTreeAsText.h:
690
691 2019-04-24  Antoine Quint  <graouts@apple.com>
692
693         [iOS] Calling preventDefault() when handling a pointerdown event should not prevent panning, zooming or click event dispatch
694         https://bugs.webkit.org/show_bug.cgi?id=195839
695         <rdar://problem/48946154>
696
697         Reviewed by Brent Fulgham.
698
699         Tests: pointerevents/ios/pointer-events-prevent-default-allows-click-event.html
700                pointerevents/ios/pointer-events-prevent-default-allows-scrolling.html
701
702         The Pointer Events specification defines that the default action of any and all pointer events MUST NOT
703         be a manipulation of the viewport (e.g. panning or zooming). In practice, this means that calling
704         preventDefault() while handling a Pointer Event has no effect on the inner workings of the user agent,
705         so we change the method signature of PointerCaptureController::dispatchEventForTouchAtIndex() to return
706         void since we don't need to know whether preventDefault() was called.
707
708         https://www.w3.org/TR/pointerevents/#declaring-candidate-regions-for-default-touch-behaviors
709
710         * page/PointerCaptureController.cpp:
711         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
712         * page/PointerCaptureController.h:
713
714 2019-04-24  Frederic Wang  <fwang@igalia.com>
715
716         With async scrolling enabled, this MathML test asserts
717         https://bugs.webkit.org/show_bug.cgi?id=196123
718
719         This patch ensures that updateScrollInfoAfterLayout() is called during MathML layout. This
720         fixes assertions when async scrolling is enabled and MathML elements have non-visible overflow.
721
722         Reviewed by Rob Buis.
723
724         Test: mathml/mathml-overflow-crash.html
725
726         * rendering/mathml/RenderMathMLBlock.cpp:
727         (WebCore::RenderMathMLBlock::layoutBlock):
728         (WebCore::RenderMathMLBlock::layoutInvalidMarkup):
729         * rendering/mathml/RenderMathMLFraction.cpp:
730         (WebCore::RenderMathMLFraction::layoutBlock):
731         * rendering/mathml/RenderMathMLMath.cpp:
732         (WebCore::RenderMathMLMath::layoutBlock):
733         * rendering/mathml/RenderMathMLMenclose.cpp:
734         (WebCore::RenderMathMLMenclose::layoutBlock):
735         * rendering/mathml/RenderMathMLOperator.cpp:
736         (WebCore::RenderMathMLOperator::layoutBlock):
737         * rendering/mathml/RenderMathMLPadded.cpp:
738         (WebCore::RenderMathMLPadded::layoutBlock):
739         * rendering/mathml/RenderMathMLRoot.cpp:
740         (WebCore::RenderMathMLRoot::layoutBlock):
741         * rendering/mathml/RenderMathMLRow.cpp:
742         (WebCore::RenderMathMLRow::layoutBlock):
743         * rendering/mathml/RenderMathMLScripts.cpp:
744         (WebCore::RenderMathMLScripts::layoutBlock):
745         * rendering/mathml/RenderMathMLSpace.cpp:
746         (WebCore::RenderMathMLSpace::layoutBlock):
747         * rendering/mathml/RenderMathMLToken.cpp:
748         (WebCore::RenderMathMLToken::layoutBlock):
749         * rendering/mathml/RenderMathMLUnderOver.cpp:
750         (WebCore::RenderMathMLUnderOver::layoutBlock):
751
752 2019-04-24  Greg V  <greg@unrelenting.technology>
753
754         Fix -Wc++11-narrowing on unsigned char platforms like FreeBSD/aarch64
755         https://bugs.webkit.org/show_bug.cgi?id=197148
756
757         Reviewed by Alex Christensen.
758
759         * contentextensions/DFACombiner.cpp:
760         * contentextensions/NFAToDFA.cpp:
761
762 2019-04-24  Chris Dumez  <cdumez@apple.com>
763
764         X-Frame-Options header should be ignored when frame-ancestors CSP directive is present
765         https://bugs.webkit.org/show_bug.cgi?id=197226
766         <rdar://problem/50155649>
767
768         Reviewed by Alex Christensen.
769
770         X-Frame-Options header should be ignored when frame-ancestors CSP directive is present:
771         - https://www.w3.org/TR/CSP3/#frame-ancestors-and-frame-options
772
773         Specification says:
774         """
775         In order to allow backwards-compatible deployment, the frame-ancestors directive _obsoletes_ the
776         X-Frame-Options header. If a resource is delivered with an policy that includes a directive named
777         frame-ancestors and whose disposition is "enforce", then the X-Frame-Options header MUST be ignored.
778         """
779
780         Gecko and Blink follow the specification, WebKit does not. As a result, page [1] is broken with
781         WebKit-only on Schwab.com. The page height is wrong and you cannot see all the ETFs as a result.
782
783         [1] https://www.schwab.com/public/schwab/investing/investment_help/investment_research/etf_research/etfs.html?&path=/Prospect/Research/etfs/overview/oneSourceETFs.asp
784
785         Test: http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-overrides-X-Frames-Options.html
786
787         * loader/DocumentLoader.cpp:
788         (WebCore::DocumentLoader::responseReceived):
789         * page/csp/ContentSecurityPolicy.cpp:
790         (WebCore::ContentSecurityPolicy::overridesXFrameOptions const):
791         * page/csp/ContentSecurityPolicy.h:
792         * page/csp/ContentSecurityPolicyDirectiveList.h:
793         (WebCore::ContentSecurityPolicyDirectiveList::hasFrameAncestorsDirective const):
794
795 2019-04-24  Zalan Bujtas  <zalan@apple.com>
796
797         [ContentChangeObserver] Do not use the global _WKContentChange in WebKitLegacy
798         https://bugs.webkit.org/show_bug.cgi?id=196286
799         <rdar://problem/49364417>
800
801         Reviewed by Simon Fraser.
802
803         By reporting WKContentIndeterminateChange in sendMouseMoveEvent enables us to remove the global _WKContentChange state.
804         Using _WKContentChange is fine as long as only the observed frame reports content change during the synthetic click event.
805         In case of multiple frames, we should really consult the local state instead.
806         Unfortunately sendMouseMoveEvent has no access to the observed Document object so we can't really identify the observed content change.
807         WKContentIndeterminateChange triggers asynchronous decision making at the callsite and in the callback we have access
808         to the active Document/ContentChangeObverver object and can report the correct state.
809         This is inline with current WebKit(WK2) behaviour.
810
811         Manually tested with a WebKitLegacy test app.
812
813         * SourcesCocoa.txt:
814         * WebCore.xcodeproj/project.pbxproj:
815         * page/ios/ContentChangeObserver.h:
816         (WebCore::ContentChangeObserver::setHasNoChangeState):
817         (WebCore::ContentChangeObserver::setHasIndeterminateState):
818         (WebCore::ContentChangeObserver::setHasVisibleChangeState):
819         (WebCore::ContentChangeObserver::setObservedContentState): Deleted.
820         * page/ios/EventHandlerIOS.mm:
821         (WebCore::EventHandler::mouseMoved):
822         * platform/ios/wak/WAKWindow.mm:
823         (-[WAKWindow sendMouseMoveEvent:contentChange:]):
824         * platform/ios/wak/WKContentObservation.cpp: Removed.
825         * platform/ios/wak/WKContentObservation.h:
826
827 2019-04-24  Philippe Normand  <pnormand@igalia.com>
828
829         [GTK][GStreamer] Flaky ASSERTION FAILED: m_lock.isHeld() in TextureMapperPlatformLayerProxy
830         https://bugs.webkit.org/show_bug.cgi?id=196739
831
832         Reviewed by Xabier Rodriguez-Calvar.
833
834         The crash was triggered because m_videoDecoderPlatform not being
835         explicitely set, its value would be inferred as one of the enum
836         class values. Making it Optional avoids this issue.
837
838         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
839
840 2019-04-24  Philippe Normand  <pnormand@igalia.com>
841
842         [GStreamer] Crash in AudioTrackPrivate with playbin3 enabled
843         https://bugs.webkit.org/show_bug.cgi?id=196913
844
845         Reviewed by Xabier Rodriguez-Calvar.
846
847         The crash was due to a playbin3 code path being triggered during
848         MSE playback, which is not supposed to work in playbin3 anyway.
849         The problem is that setting the USE_PLAYBIN3 environment variable
850         to "1" makes the GStreamer playback plugin register the playbin3
851         element under the playbin name. So that leads to playbin3 being
852         used everywhere in WebKit where we assume the playbin element is
853         used. So the proposed solution is to:
854
855         - use a WebKit-specific environment variable instead of the
856         GStreamer USE_PLAYBIN3 variable.
857         - emit a warning if the USE_PLAYBIN3 environment variable is
858         detected. We can't unset it ourselves for security reasons.
859
860         The patch also includes a code cleanup of the player method
861         handling the pipeline creation. The previous code had a bug
862         leading to playbin3 being used for MSE.
863
864         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
865         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
866
867 2019-04-24  chris fleizach  <cfleizach@apple.com>
868
869         AX: Remove deprecated Accessibility Object Model events
870         https://bugs.webkit.org/show_bug.cgi?id=197073
871         <rdar://problem/50027819>
872
873         Reviewed by Ryosuke Niwa.
874
875         Test: accessibility/mac/replace-text-with-range.html
876
877         * DerivedSources.make:
878         * Sources.txt:
879         * WebCore.xcodeproj/project.pbxproj:
880         * accessibility/AccessibilityListBoxOption.cpp:
881         (WebCore::AccessibilityListBoxOption::setSelected):
882         * accessibility/AccessibilityMediaObject.cpp:
883         (WebCore::AccessibilityMediaObject::increment):
884         (WebCore::AccessibilityMediaObject::decrement):
885         * accessibility/AccessibilityMenuListOption.cpp:
886         (WebCore::AccessibilityMenuListOption::setSelected):
887         * accessibility/AccessibilityNodeObject.cpp:
888         (WebCore::AccessibilityNodeObject::increment):
889         (WebCore::AccessibilityNodeObject::decrement):
890         * accessibility/AccessibilityObject.cpp:
891         (WebCore::AccessibilityObject::press):
892         (WebCore::AccessibilityObject::replaceTextInRange):
893         (WebCore::AccessibilityObject::scrollToMakeVisible const):
894         (WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const): Deleted.
895         (WebCore::AccessibilityObject::dispatchAccessibilityEvent const): Deleted.
896         (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const): Deleted.
897         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent const): Deleted.
898         * accessibility/AccessibilityObject.h:
899         * accessibility/AccessibilityRenderObject.cpp:
900         (WebCore::AccessibilityRenderObject::setFocused):
901         (WebCore::AccessibilityRenderObject::setValue):
902         * accessibility/AccessibilityScrollbar.cpp:
903         (WebCore::AccessibilityScrollbar::setValue):
904         * accessibility/AccessibilitySlider.cpp:
905         (WebCore::AccessibilitySlider::setValue):
906         * accessibility/ios/AccessibilityObjectIOS.mm:
907         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
908         (WebCore::AccessibilityObject::hasAccessibleDismissEventListener const): Deleted.
909         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
910         (-[WebAccessibilityObjectWrapper accessibilityPerformEscape]): Deleted.
911         (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]): Deleted.
912         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
913         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
914         * dom/Element.idl:
915         * dom/EventNames.h:
916         * dom/EventNames.in:
917         * html/HTMLAttributeNames.in:
918         * html/HTMLElement.cpp:
919         (WebCore::HTMLElement::createEventHandlerNameMap):
920         * page/Settings.yaml:
921         * testing/InternalSettings.cpp:
922         (WebCore::InternalSettings::Backup::Backup):
923         (WebCore::InternalSettings::Backup::restoreTo):
924         (WebCore::InternalSettings::setAccessibilityEventsEnabled): Deleted.
925         * testing/InternalSettings.h:
926         * testing/InternalSettings.idl:
927
928 2019-04-23  Andy Estes  <aestes@apple.com>
929
930         [iOS] QuickLook documents loaded from file: URLs should be allowed to perform same-document navigations
931         https://bugs.webkit.org/show_bug.cgi?id=196749
932         <rdar://problem/35773454>
933
934         Reviewed by Daniel Bates.
935
936         QuickLook previews are in a non-local origin defined by a unique x-apple-ql-id: URL, which
937         isolates the origin that hosted the document from the document preview itself. When a
938         QuickLook document is loaded as a file: URL, SecurityOrigin's protections against loading
939         local resources from non-local origins prevented navigations like location.reload() and
940         fragment navigations.
941
942         To allow reloads and same-document navigations in QuickLook documents loaded from file: URLs,
943         we should grant the QuickLook document's SecurityOrigin access to the file path that loaded
944         the preview.
945
946         Added a new API test.
947
948         * dom/Document.cpp:
949         (WebCore::Document::applyQuickLookSandbox):
950         * page/SecurityOrigin.cpp:
951         (WebCore::SecurityOrigin::createNonLocalWithAllowedFilePath):
952         (WebCore::SecurityOrigin::canDisplay const):
953         * page/SecurityOrigin.h:
954
955 2019-04-23  Devin Rousso  <drousso@apple.com>
956
957         Web Inspector: Debugger: remove ASSERT_NOT_REACHED where it's possible to reach
958         https://bugs.webkit.org/show_bug.cgi?id=197210
959         <rdar://problem/48462912>
960
961         Reviewed by Joseph Pecoraro.
962
963         * inspector/agents/page/PageDebuggerAgent.cpp:
964         (WebCore::PageDebuggerAgent::didAddEventListener):
965         (WebCore::PageDebuggerAgent::didPostMessage):
966
967         * inspector/InspectorInstrumentation.cpp:
968         (WebCore::InspectorInstrumentation::consoleAgentEnabled):
969         (WebCore::InspectorInstrumentation::timelineAgentEnabled):
970         Drive-by: add additional `FAST_RETURN_IF_NO_FRONTENDS`.
971
972 2019-04-23  Commit Queue  <commit-queue@webkit.org>
973
974         Unreviewed, rolling out r244556.
975         https://bugs.webkit.org/show_bug.cgi?id=197212
976
977         Causing build failures on multiple builders (Requested by
978         ShawnRoberts on #webkit).
979
980         Reverted changeset:
981
982         "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
983         https://bugs.webkit.org/show_bug.cgi?id=197171
984         https://trac.webkit.org/changeset/244556
985
986 2019-04-23  Devin Rousso  <drousso@apple.com>
987
988         Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.ownerDocument.frameIdentifier')
989         https://bugs.webkit.org/show_bug.cgi?id=196420
990         <rdar://problem/49444205>
991
992         Reviewed by Timothy Hatcher.
993
994         Modify the existing `frameId` to represent the owner frame of the node, rather than the
995         frame it holds (in the case of an `<iframe>`).
996
997         * inspector/agents/InspectorDOMAgent.cpp:
998         (WebCore::InspectorDOMAgent::buildObjectForNode):
999
1000 2019-04-23  Devin Rousso  <drousso@apple.com>
1001
1002         ContentSecurityPolicy::logToConsole should include line/column number and source location
1003         https://bugs.webkit.org/show_bug.cgi?id=114317
1004         <rdar://problem/13614617>
1005
1006         Reviewed by Timothy Hatcher.
1007
1008         No change in functionality.
1009
1010         * page/csp/ContentSecurityPolicy.h:
1011         * page/csp/ContentSecurityPolicy.cpp:
1012         (WebCore::ContentSecurityPolicy::reportViolation const):
1013         (WebCore::ContentSecurityPolicy::logToConsole const):
1014
1015 2019-04-23  Devin Rousso  <drousso@apple.com>
1016
1017         Web Inspector: Canvas: support recording TypedOMCSSImageValue
1018         https://bugs.webkit.org/show_bug.cgi?id=192609
1019
1020         Reviewed by Timothy Hatcher.
1021
1022         * inspector/InspectorCanvas.h:
1023         * inspector/InspectorCanvas.cpp:
1024         (WebCore::InspectorCanvas::indexForData):
1025         (WebCore::InspectorCanvas::buildAction):
1026
1027 2019-04-23  Andres Gonzalez  <andresg_22@apple.com>
1028
1029         Accessibility text search and selection API enhancements.
1030         https://bugs.webkit.org/show_bug.cgi?id=197095
1031         <rdar://problem/48181791>
1032
1033         Reviewed by Chris Fleizach.
1034
1035         - Split the existing SelectTextWithCriteria API into two: search text API (SearchTextWithCriteria) and a text operation API (TextOperation: select, replace, capitalize...).
1036         - This allows for more flexibility and extensibility.
1037         - Added the ability to retrieve text markers for multiple search hits.
1038         - Various code clean up and consolidation.
1039         - Added LayoutTest for search API.
1040         - Previous API is marked with "To be deprecated", and is implemented with new implementation. May be removed in a future change.
1041
1042         Test: accessibility/mac/search-text/search-text.html
1043
1044         * accessibility/AccessibilityObject.cpp:
1045         (WebCore::rangeClosestToRange):
1046         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
1047         (WebCore::AccessibilityObject::findTextRange const):
1048         (WebCore::AccessibilityObject::findTextRanges const):
1049         (WebCore::AccessibilityObject::performTextOperation):
1050         (WebCore::AccessibilityObject::frame const):
1051         (WebCore::AccessibilityObject::selectText): Deleted.
1052         * accessibility/AccessibilityObject.h:
1053         (WebCore::AccessibilitySearchTextCriteria::AccessibilitySearchTextCriteria):
1054         (WebCore::AccessibilityTextOperation::AccessibilityTextOperation):
1055         (WebCore::AccessibilitySelectTextCriteria::AccessibilitySelectTextCriteria): Deleted.
1056         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1057         (accessibilityTextCriteriaForParameterizedAttribute):
1058         (accessibilitySearchTextCriteriaForParameterizedAttribute):
1059         (accessibilityTextOperationForParameterizedAttribute):
1060         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
1061         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1062         (accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute): Deleted.
1063
1064 2019-04-23  Guy Lewin  <guy@lewin.co.il>
1065
1066         Multiple File Input Icon Set Regardless of File List
1067         https://bugs.webkit.org/show_bug.cgi?id=195537
1068
1069         Reviewed by Alexey Proskuryakov.
1070
1071         File input elements display icon with an empty file list after
1072         resetting the file list in 'change' event handler - on iOS
1073
1074         Test: fast/forms/file/file-reset-in-change-using-open-panel-with-icon.html
1075
1076         * html/FileInputType.cpp:
1077         (WebCore::FileInputType::filesChosen):
1078
1079 2019-04-23  Eric Carlson  <eric.carlson@apple.com>
1080
1081         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
1082         https://bugs.webkit.org/show_bug.cgi?id=197171
1083         <rdar://problem/47454979>
1084
1085         Reviewed by Youenn Fablet.
1086
1087         Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
1088
1089         * Modules/plugins/QuickTimePluginReplacement.mm:
1090         (WebCore::jsValueWithValueInContext):
1091         (WebCore::jsValueWithAVMetadataItemInContext):
1092         * WebCore.xcodeproj/project.pbxproj:
1093         * platform/audio/ios/AudioSessionIOS.mm:
1094         (WebCore::AudioSession::setCategory):
1095         (WebCore::AudioSession::category const):
1096         (WebCore::AudioSession::routeSharingPolicy const):
1097         (WebCore::AudioSession::routingContextUID const):
1098         (WebCore::AudioSession::sampleRate const):
1099         (WebCore::AudioSession::bufferSize const):
1100         (WebCore::AudioSession::numberOfOutputChannels const):
1101         (WebCore::AudioSession::tryToSetActiveInternal):
1102         (WebCore::AudioSession::preferredBufferSize const):
1103         (WebCore::AudioSession::setPreferredBufferSize):
1104         * platform/audio/ios/MediaSessionManagerIOS.mm:
1105         (-[WebMediaSessionHelper initWithCallback:]):
1106         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
1107         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1108         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
1109         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
1110         (WebCore::AVTrackPrivateAVFObjCImpl::label const):
1111         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1112         (WebCore::AudioSourceProviderAVFObjC::createMix):
1113         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
1114         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
1115         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
1116         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
1117         (WebCore::AVFoundationMIMETypeCache::canDecodeType):
1118         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
1119         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1120         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
1121         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
1122         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
1123         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
1124         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
1125         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
1126         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
1127         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
1128         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1129         (WebCore::CDMSessionAVContentKeySession::isAvailable):
1130         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
1131         (WebCore::CDMSessionAVContentKeySession::update):
1132         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
1133         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
1134         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1135         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1136         (WebCore::CDMSessionAVStreamSession::releaseKeys):
1137         (WebCore::CDMSessionAVStreamSession::update):
1138         (WebCore::CDMSessionAVStreamSession::setStreamSession):
1139         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
1140         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1141         (WebCore::imageDecoderAssetOptions):
1142         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
1143         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
1144         (WebCore::ImageDecoderAVFObjC::readSamples):
1145         (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
1146         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
1147         (WebCore::InbandTextTrackPrivateAVFObjC::label const):
1148         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
1149         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
1150         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1151         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
1152         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1153         (WebCore::assetCacheForPath):
1154         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
1155         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
1156         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1157         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
1158         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
1159         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
1160         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1161         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
1162         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1163         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1164         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
1165         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
1166         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1167         (WebCore::determineChangedTracksFromNewTracksAndOldItems):
1168         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
1169         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
1170         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
1171         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
1172         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
1173         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
1174         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
1175         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
1176         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
1177         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
1178         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
1179         (WebCore::exernalDeviceDisplayNameForPlayer):
1180         (WebCore::metadataType):
1181         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
1182         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1183         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
1184         (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
1185         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
1186         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1187         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1188         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
1189         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
1190         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
1191         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
1192         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1193         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
1194         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
1195         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
1196         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1197         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
1198         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
1199         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
1200         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1201         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1202         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1203         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
1204         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
1205         (WebCore::PlatformCALayerCocoa::clone const):
1206         (WebCore::PlatformCALayerCocoa::avPlayerLayer const):
1207         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
1208         (WebCore::validateHEVCParameters):
1209         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
1210         (getAVSpeechUtteranceDefaultSpeechRate):
1211         (getAVSpeechUtteranceMaximumSpeechRate):
1212         (-[WebSpeechSynthesisWrapper speakUtterance:]):
1213         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
1214         (SOFT_LINK_CONSTANT): Deleted.
1215         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1216         (-[WebAVPlayerLayer init]):
1217         (-[WebAVPlayerLayer layoutSublayers]):
1218         (-[WebAVPlayerLayer setVideoGravity:]):
1219         (-[WebAVPlayerLayer videoRect]):
1220         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
1221         * platform/mac/SerializedPlatformRepresentationMac.mm:
1222         (WebCore::jsValueWithValueInContext):
1223         (WebCore::jsValueWithAVMetadataItemInContext):
1224         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1225         (WebCore::getAVFormatIDKeyWithFallback):
1226         (WebCore::getAVNumberOfChannelsKeyWithFallback):
1227         (WebCore::getAVSampleRateKeyWithFallback):
1228         (WebCore::getAVEncoderBitRateKeyWithFallback):
1229         (WebCore::MediaRecorderPrivateWriter::create):
1230         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
1231         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
1232         * platform/mediastream/RealtimeVideoSource.h:
1233         * platform/mediastream/VideoPreset.h:
1234         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
1235         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
1236         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
1237         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
1238         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
1239         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1240         (WebCore::deviceIsAvailable):
1241         (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices):
1242         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
1243         (WebCore::AVCaptureDeviceManager::isAvailable):
1244         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager):
1245         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1246         (WebCore::AVVideoPreset::create):
1247         (WebCore::AVVideoPreset::AVVideoPreset):
1248         (WebCore::AVVideoCaptureSource::create):
1249         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
1250         (WebCore::AVVideoCaptureSource::capabilities):
1251         (WebCore::sensorOrientationFromVideoOutput):
1252         (WebCore::AVVideoCaptureSource::setupSession):
1253         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
1254         (WebCore::AVVideoCaptureSource::setupCaptureSession):
1255         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
1256         (WebCore::AVVideoCaptureSource::generatePresets):
1257         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
1258         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
1259
1260 2019-04-23  Timothy Hatcher  <timothy@apple.com>
1261
1262         Speed up RenderTheme::systemColor on Speedometer2.
1263         https://bugs.webkit.org/show_bug.cgi?id=197203
1264         rdar://problem/50056756
1265
1266         Reviewed by Tim Horton.
1267
1268         * rendering/RenderThemeIOS.mm:
1269         (WebCore::RenderThemeIOS::systemColor const): Remove some unused code. And fetch the cache after an early return.
1270         * rendering/RenderThemeMac.mm:
1271         (WebCore::RenderThemeMac::systemColor const): Avoid some allocations in LocalDefaultSystemAppearance
1272         when a CSS color is in the system color cache.
1273
1274 2019-04-23  Ryosuke Niwa  <rniwa@webkit.org>
1275
1276         [iOS] element.focus() sometimes fails to reveal the focused element when it becomes editable dynamically
1277         https://bugs.webkit.org/show_bug.cgi?id=197188
1278
1279         Reviewed by Wenson Hsieh.
1280
1281         The bug was caused by the scroll-to-reveal code triggered by Element::updateFocusAppearance updating
1282         the scroll position via scrolling tree update in a layer tree commit which happens after
1283         _zoomToRevealFocusedElement in WKContentView had already scrolled the frame view.
1284
1285         To fix this problem, we need to defer the editor state update until the layer commit (see r244494),
1286         and update the scrolling tree before invoking WebPageProxy::editorStateChanged which brings up
1287         the keyboard and scroll-to-reveal the caret in the UI process side.
1288
1289         We also avoid revealing the focus for the second time via Document::scheduleScrollToFocusedElement
1290         in Element::updateFocusAppearance as this timer based scrolling also happens after we had already
1291         revealed the caret in _zoomToRevealFocusedElement. This is a bit hacky but works for most cases since
1292         we wouldn't bring up a keyboard if the focused element was not editable anyway.
1293
1294         Test: editing/selection/ios/scrolling-to-focused-element-inside-iframe.html
1295
1296         * dom/Element.cpp:
1297         (WebCore::Element::updateFocusAppearance): Avoid scheduling a timer based reavel of the focused element
1298         when we're already revealing the element via selection change.
1299
1300 2019-04-23  Remy Demarest  <rdemarest@apple.com>
1301
1302         Fix layout issues occuring when entering full screen mode.
1303         https://bugs.webkit.org/show_bug.cgi?id=197086
1304         <rdar://problem/47733671>.
1305
1306         Reviewed by Darin Adler.
1307
1308         This issue is the result of changing the style mask of the window after entering
1309         full screen mode. Safari adds an invisible toolbar to display the URL of the page
1310         which ends up breaking the layout. Having that window use a style that includes a
1311         titlebar fixes the bug.
1312
1313         * platform/mac/WebCoreFullScreenWindow.mm:
1314         (-[WebCoreFullScreenWindow constrainFrameRect:toScreen:]): Ensure that the window
1315         can fill the entire screen including the underlapping the menu bar, so that the
1316         window does not resize when the animation is done.
1317         (-[WebCoreFullScreenWindow canBecomeMainWindow]): Borderless windows cannot become
1318         main by default, adding the titlebar allows it to become main, prevent this from
1319         happening at all to preserve the existing behavior.
1320
1321 2019-04-23  Chris Dumez  <cdumez@apple.com>
1322
1323         [Process-Swap-On-Navigation] WebKit hangs when going back to a form submission's page due to Process-Swap-On-Navigation on iOS 12.2 and higher
1324         https://bugs.webkit.org/show_bug.cgi?id=197097
1325         <rdar://problem/50048318>
1326
1327         Reviewed by Alex Christensen.
1328
1329         * loader/EmptyFrameLoaderClient.h:
1330         * loader/FrameLoader.cpp:
1331         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1332         If we still have a provisional item (new load has been started or we did not clear it because we're about to retry),
1333         then let the client know the load will continue by passing an extra flag with the didFailProvisionalLoad.
1334
1335         * loader/FrameLoaderClient.h:
1336         * loader/FrameLoaderTypes.h:
1337
1338 2019-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1339
1340         [ATK] Implement AtkComponentIface scroll_to methods
1341         https://bugs.webkit.org/show_bug.cgi?id=196856
1342
1343         Reviewed by Michael Catanzaro.
1344
1345         Implement scroll_to and scroll_to_point when ATK >= 2.30.
1346
1347         Fixes: accessibility/scroll-to-global-point-iframe-nested.html
1348                accessibility/scroll-to-global-point-iframe.html
1349                accessibility/scroll-to-global-point-main-window.html
1350                accessibility/scroll-to-global-point-nested.html
1351                accessibility/scroll-to-make-visible-div-overflow.html
1352                accessibility/scroll-to-make-visible-iframe.html
1353                accessibility/scroll-to-make-visible-nested-2.html
1354                accessibility/scroll-to-make-visible-nested.html
1355
1356         * accessibility/AccessibilityObject.cpp:
1357         (WebCore::AccessibilityObject::scrollToMakeVisible const): Add new method receiving the
1358         ScrollRectToVisibleOptions since ATK interface has a parameter to decide how to scroll.
1359         * accessibility/AccessibilityObject.h:
1360         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
1361         (atkToContents):
1362         (webkitAccessibleComponentRefAccessibleAtPoint):
1363         (webkitAccessibleComponentGetExtents):
1364         (webkitAccessibleComponentGrabFocus):
1365         (webkitAccessibleComponentScrollTo):
1366         (webkitAccessibleComponentScrollToPoint):
1367         (webkitAccessibleComponentInterfaceInit):
1368         (core): Deleted.
1369
1370 2019-04-22  Youenn Fablet  <youenn@apple.com>
1371
1372         Update libwebrtc logging when WebCore WebRTC logging is updated
1373         https://bugs.webkit.org/show_bug.cgi?id=197166
1374         <rdar://problem/50107696>
1375
1376         Unreviewed.
1377
1378         Build fix after https://trac.webkit.org/changeset/244511.
1379
1380         * page/Page.cpp:
1381         (WebCore::Page::configureLoggingChannel):
1382
1383 2019-04-22  Youenn Fablet  <youenn@apple.com>
1384
1385         Cache API should return Abort error in case of putting an aborted fetch
1386         https://bugs.webkit.org/show_bug.cgi?id=196757
1387
1388         Reviewed by Darin Adler.
1389
1390         In case of an aborted fetch, call consume callback with an AbortError.
1391         Update the code that handles load cancelling as the loader callback is called.
1392         Covered by rebased tests.
1393
1394         * Modules/fetch/FetchResponse.cpp:
1395         (WebCore::FetchResponse::addAbortSteps):
1396         (WebCore::FetchResponse::BodyLoader::didFail):
1397         (WebCore::FetchResponse::BodyLoader::BodyLoader):
1398         (WebCore::FetchResponse::BodyLoader::~BodyLoader):
1399         (WebCore::FetchResponse::stop):
1400         * Modules/fetch/FetchResponse.h:
1401
1402 2019-04-22  Youenn Fablet  <youenn@apple.com>
1403
1404         Update libwebrtc logging when WebCore WebRTC logging is updated
1405         https://bugs.webkit.org/show_bug.cgi?id=197166
1406
1407         Reviewed by Eric Carlson.
1408
1409         When updating WebRTC logging from Web Inspector, update libwebrtc logging so that no page reload is required.
1410         Manually tested.
1411
1412         * page/Page.cpp:
1413         (WebCore::Page::configureLoggingChannel):
1414
1415 2019-04-22  Simon Fraser  <simon.fraser@apple.com>
1416
1417         Introduce the concept of "opportunistic" stacking contexts
1418         https://bugs.webkit.org/show_bug.cgi?id=197077
1419
1420         Reviewed by Zalan Bujtas.
1421
1422         Bring back a variant of some code removed in r236424, which allows a RenderLayer
1423         to be stacking context for painting, without actually being on in terms of CSS.
1424         
1425         Internally, RenderLayer will call setIsOpportunisticStackingContext() to make a layer
1426         into a stacking context for painting. External callers deal with isStackingContext()
1427         or isCSSStackingContext().
1428
1429         Sadly we can't make m_forcedStackingContext (set on media element layers) trigger a
1430         non-CSS stacking context; media controls use mix-blend-mode, and rely on the fake-stacking
1431         media layer to be the "isolateBlending" ancestor.
1432
1433         No code uses this yet.
1434
1435         * rendering/RenderLayer.cpp:
1436         (WebCore::RenderLayer::RenderLayer):
1437         (WebCore::RenderLayer::shouldBeCSSStackingContext const):
1438         (WebCore::RenderLayer::isStackingContextChanged):
1439         (WebCore::RenderLayer::setIsOpportunisticStackingContext):
1440         (WebCore::RenderLayer::setIsCSSStackingContext):
1441         (WebCore::RenderLayer::updateAncestorChainHasBlendingDescendants):
1442         (WebCore::RenderLayer::dirtyAncestorChainHasBlendingDescendants):
1443         (WebCore::RenderLayer::beginTransparencyLayers):
1444         (WebCore::RenderLayer::calculateClipRects const):
1445         (WebCore::outputPaintOrderTreeLegend):
1446         (WebCore::outputPaintOrderTreeRecursive):
1447         (WebCore::RenderLayer::shouldBeStackingContext const): Deleted.
1448         (WebCore::RenderLayer::setIsStackingContext): Deleted.
1449         * rendering/RenderLayer.h:
1450         * rendering/RenderLayerBacking.cpp:
1451         (WebCore::RenderLayerBacking::compositingOpacity const):
1452
1453 2019-04-22  Justin Fan  <justin_fan@apple.com>
1454
1455         [WebGPU] Move swap chain methods from GPUDevice to GPUCanvasContext
1456         https://bugs.webkit.org/show_bug.cgi?id=197126
1457
1458         Reviewed by Dean Jackson.
1459
1460         GPUSwapChains are now configured via GPUCanvasContext instead of GPUDevice. Covers WebGPU API 
1461         pull request #262.
1462
1463         Existing WebGPU tests updated to match.
1464
1465         * Modules/webgpu/GPUCanvasContext.cpp:
1466         (WebCore::GPUCanvasContext::configureSwapChain):
1467         (WebCore::GPUCanvasContext::replaceSwapChain): Deleted.
1468         * Modules/webgpu/GPUCanvasContext.h:
1469         * Modules/webgpu/GPUCanvasContext.idl:
1470         * Modules/webgpu/WebGPUDevice.cpp:
1471         (WebCore::WebGPUDevice::createSwapChain const): Deleted.
1472         * Modules/webgpu/WebGPUDevice.h:
1473         (WebCore::WebGPUDevice::device):
1474         * Modules/webgpu/WebGPUDevice.idl:
1475         * Modules/webgpu/WebGPUSwapChainDescriptor.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUSwapChainDescriptor.h.
1476         (WebCore::WebGPUSwapChainDescriptor::asGPUSwapChainDescriptor const):
1477         * Modules/webgpu/WebGPUSwapChainDescriptor.h:
1478         * Sources.txt:
1479         * WebCore.xcodeproj/project.pbxproj:
1480         * platform/graphics/gpu/GPUDevice.cpp:
1481         (WebCore::GPUDevice::setSwapChain):
1482         (WebCore::GPUDevice::tryCreateSwapChain const): Deleted.
1483         * platform/graphics/gpu/GPUDevice.h:
1484         * platform/graphics/gpu/GPUSwapChain.h:
1485         * platform/graphics/gpu/GPUSwapChainDescriptor.h:
1486         (WebCore::GPUSwapChainDescriptor::GPUSwapChainDescriptor):
1487         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
1488         (WebCore::GPUSwapChain::tryCreate):
1489
1490 2019-04-22  Said Abou-Hallawa  <said@apple.com>
1491
1492         Mark SVGStringList properties '[SameObject]' in the IDL files
1493         Followup to https://bugs.webkit.org/show_bug.cgi?id=197137
1494
1495         Reviewed by Darin Adler.
1496
1497         The SVG elements do not create tear-off wrappers for SVGStrigList DOM
1498         objects anymore. Instead they return Ref pointers to the same RefCounted
1499         objects. So they should be marked '[SameObject]' in their IDL files.
1500
1501         * svg/SVGTests.idl:
1502         * svg/SVGViewElement.idl:
1503
1504 2019-04-22  Commit Queue  <commit-queue@webkit.org>
1505
1506         Unreviewed, rolling out r244495.
1507         https://bugs.webkit.org/show_bug.cgi?id=197159
1508
1509         Causing build failures on OpenSource and Internal bots
1510         (Requested by ShawnRoberts on #webkit).
1511
1512         Reverted changeset:
1513
1514         "WHLSLPrepare.cpp always recompiles, even if nothing was
1515         changed"
1516         https://bugs.webkit.org/show_bug.cgi?id=197151
1517         https://trac.webkit.org/changeset/244495
1518
1519 2019-04-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1520
1521         REGRESSION(r241289): [GTK] accessibility/removed-continuation-element-causes-crash.html and accessibility/removed-anonymous-block-child-causes-crash.html crashes
1522         https://bugs.webkit.org/show_bug.cgi?id=194630
1523
1524         Reviewed by Michael Catanzaro.
1525
1526         Do not assume core object always has a wrapper in webkitAccessibleRefChild().
1527
1528         Fixes: accessibility/removed-continuation-element-causes-crash.html
1529                accessibility/removed-anonymous-block-child-causes-crash.html
1530
1531         * accessibility/atk/WebKitAccessible.cpp:
1532         (webkitAccessibleRefChild): Return early if wrapper is nullptr.
1533
1534 2019-04-21  Darin Adler  <darin@apple.com>
1535
1536         WHLSLPrepare.cpp always recompiles, even if nothing was changed
1537         https://bugs.webkit.org/show_bug.cgi?id=197151
1538
1539         Reviewed by Dan Bernstein.
1540
1541         * DerivedSources-input.xcfilelist: Script updated this automatically after
1542         DerivedSources.make was corrected.
1543         * DerivedSources-output.xcfilelist: Ditto, although I had to manually remove
1544         one bogus leftover reference to WHLSLStandardLibrary.cpp.
1545
1546         * DerivedSources.make: Updated the rule that builds WHSLStandardLibrary.h to
1547         no longer refer to nonexistent WHLSLStandardLibrary.cpp. Because the dependency
1548         was on a file that was never created, the rule to regenerate WHSLStandardLibrary.h
1549         was running on every build, instead of only when one of the dependencies changed.
1550
1551 2019-04-20  Said Abou-Hallawa  <said@apple.com>
1552
1553         REGRESSION (r243137): SVGViewElement.viewTarget should not return a new object
1554         https://bugs.webkit.org/show_bug.cgi?id=197137
1555
1556         Reviewed by Darin Adler.
1557
1558         All the DOM objects accessing the viewTarget of the same SVGViewElement 
1559         should hold a Ref pointer to the same SVGStringList property.
1560
1561         Test: svg/dom/SVGViewElement-viewTarget.html
1562
1563         * svg/SVGViewElement.idl:
1564
1565 2019-04-20  Jer Noble  <jer.noble@apple.com>
1566
1567         REGRESSION(r243958): Unnecessary deactivation of AudioSession (PLT Regression)
1568         https://bugs.webkit.org/show_bug.cgi?id=197123
1569         <rdar://problem/49783264>
1570
1571         Reviewed by Per Arne Vollan.
1572
1573         Only set m_becameActive if we actually activated the AudioSession before starting playback. This
1574         avoids unnecessarily deactivating the AudioSession in processWillSuspend().
1575
1576         * platform/audio/PlatformMediaSessionManager.cpp:
1577         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
1578
1579 2019-04-19  Devin Rousso  <drousso@apple.com>
1580
1581         Web Inspector: Timelines: CPU: ensure that tracking stops when disconnecting Web Inspector
1582         https://bugs.webkit.org/show_bug.cgi?id=197115
1583         <rdar://problem/49877875>
1584
1585         Reviewed by Joseph Pecoraro.
1586
1587         * inspector/agents/InspectorCPUProfilerAgent.cpp:
1588         (WebCore::InspectorCPUProfilerAgent::willDestroyFrontendAndBackend):
1589
1590 2019-04-19  Devin Rousso  <drousso@apple.com>
1591
1592         Web Inspector: REGRESSION: Elements: "Inspect Element" context menu often doesn't select that element
1593         https://bugs.webkit.org/show_bug.cgi?id=197091
1594         <rdar://problem/49953728>
1595
1596         Reviewed by Joseph Pecoraro.
1597
1598         Delay the `inspect` event fron firing with the focued node until the frontend has had a
1599         chance to request the document. Otherwise, requesting the document clears the mapping of
1600         node-to-id, so the focused node's id would no longer be valid.
1601
1602         * inspector/agents/InspectorDOMAgent.cpp:
1603         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
1604         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
1605         (WebCore::InspectorDOMAgent::getDocument):
1606         (WebCore::InspectorDOMAgent::focusNode):
1607         (WebCore::InspectorDOMAgent::didCommitLoad):
1608
1609 2019-04-19  John Wilander  <wilander@apple.com>
1610
1611         Disable Ad Click Attribution in ephemeral sessions and make sure conversion requests use an ephemeral, stateless session
1612         https://bugs.webkit.org/show_bug.cgi?id=197108
1613         <rdar://problem/49918702>
1614
1615         Reviewed by Alex Christensen.
1616
1617         Tests: http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html
1618                http/tests/adClickAttribution/store-disabled-in-ephemeral-session.html
1619
1620         * html/HTMLAnchorElement.cpp:
1621         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
1622             Early return for ephemeral sessions.
1623         * loader/ResourceLoader.cpp:
1624         (WebCore::ResourceLoader::shouldUseCredentialStorage):
1625             Now returns false for StoredCredentialsPolicy:EphemeralStatelessCookieless.
1626         * platform/network/StoredCredentialsPolicy.h:
1627             Added enum value EphemeralStatelessCookieless.
1628
1629 2019-04-19  Timothy Hatcher  <timothy@apple.com>
1630
1631         Standardize the <meta name="color-scheme"> separator.
1632         https://bugs.webkit.org/show_bug.cgi?id=193931
1633         rdar://problem/49995929
1634
1635         Reviewed by Darin Adler.
1636
1637         Tests: css-dark-mode/color-scheme-meta.html
1638
1639         * dom/Document.cpp:
1640         (WebCore::processColorSchemeString): Use isHTMLSpace insead of isColorSchemeSeparator and isASCIISpace.
1641         (WebCore::isColorSchemeSeparator): Deleted.
1642
1643 2019-04-19  Wenson Hsieh  <wenson_hsieh@apple.com>
1644
1645         [iOS] Add quirks to disable autocorrection and autocapitalization in hidden editable areas on some websites
1646         https://bugs.webkit.org/show_bug.cgi?id=197102
1647         <rdar://problem/49864669>
1648
1649         Reviewed by Ryosuke Niwa.
1650
1651         Add a quirk to disable autocorrection and autocapitalization in hidden editable areas.
1652
1653         * page/Quirks.cpp:
1654         (WebCore::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreasForHost):
1655         (WebCore::Quirks::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas const):
1656         * page/Quirks.h:
1657
1658 2019-04-18  Fujii Hironori  <Hironori.Fujii@sony.com>
1659
1660         Implement KeyedDecoderGeneric and KeyedEncoderGeneric
1661         https://bugs.webkit.org/show_bug.cgi?id=186410
1662
1663         Reviewed by Don Olmstead.
1664
1665         Implemented KeyedDecoderGeneric and KeyedEncoderGeneric by using
1666         WTF::Persistence::Decoder and WTF::Persistence::Encoder.
1667
1668         No new tests. Covered by existing tests.
1669
1670         * PlatformWin.cmake: Added KeyedDecoderGeneric.cpp and
1671         KeyedEncoderGeneric.cpp, and removed KeyedDecoderCF.cpp and
1672         KeyedEncoderCF.cpp for WinCairo port.
1673         * platform/generic/KeyedDecoderGeneric.cpp:
1674         * platform/generic/KeyedDecoderGeneric.h:
1675         * platform/generic/KeyedEncoderGeneric.cpp:
1676         * platform/generic/KeyedEncoderGeneric.h:
1677
1678 2019-04-18  Ross Kirsling  <ross.kirsling@sony.com>
1679
1680         [WinCairo] Non-unified build fails to link Tools
1681         https://bugs.webkit.org/show_bug.cgi?id=196866
1682
1683         Reviewed by Fujii Hironori.
1684
1685         * CMakeLists.txt:
1686         Drive-by fix -- don't disable string pooling when building WebCoreTestSupport.
1687         (This should have been part of r235203.)
1688
1689 2019-04-18  Commit Queue  <commit-queue@webkit.org>
1690
1691         Unreviewed, rolling out r244434.
1692         https://bugs.webkit.org/show_bug.cgi?id=197089
1693
1694         caused 1 API test failure (Requested by zalan on #webkit).
1695
1696         Reverted changeset:
1697
1698         "Regression (r244291): Broken API Test
1699         AutoLayoutRenderingProgressRelativeOrdering"
1700         https://bugs.webkit.org/show_bug.cgi?id=196948
1701         https://trac.webkit.org/changeset/244434
1702
1703 2019-04-18  Don Olmstead  <don.olmstead@sony.com>
1704
1705         [CMake] Make WebCore headers copies
1706         https://bugs.webkit.org/show_bug.cgi?id=182512
1707         <rdar://problem/37510435>
1708
1709         Unreviewed build fix.
1710
1711         Add new header from r244440.
1712
1713         * Headers.cmake:
1714
1715 2019-04-18  Don Olmstead  <don.olmstead@sony.com>
1716
1717         [CMake] Make WebCore headers copies
1718         https://bugs.webkit.org/show_bug.cgi?id=182512
1719         <rdar://problem/37510435>
1720
1721         Reviewed by Alex Christensen.
1722
1723         The header copying is moved to a target WebCorePrivateFrameworkHeaders. This target was
1724         originally Windows only but now this is enabled for all CMake based ports.
1725
1726         Enumerated all headers within WebCore that are used for WebKit(Legacy), tools and
1727         tests. Shared headers are within Headers.cmake while port and platform specific headers
1728         are in their respective CMake files. Listing out all headers is preferred because globbing
1729         will break the build whenever a file is added.
1730
1731         All include directories within the WebCore source tree are now PRIVATE. They were
1732         modified to use WebCore_PRIVATE_INCLUDE_DIRECTORIES. They will not propagate to other targets
1733         which will prevent erroneous includes in targets dependent on WebCore.
1734
1735         * CMakeLists.txt:
1736         * Headers.cmake: Added.
1737         * PlatformAppleWin.cmake:
1738         * PlatformGTK.cmake:
1739         * PlatformMac.cmake:
1740         * PlatformPlayStation.cmake:
1741         * PlatformWPE.cmake:
1742         * PlatformWin.cmake:
1743         * PlatformWinCairo.cmake:
1744         * platform/Cairo.cmake:
1745         * platform/Curl.cmake:
1746         * platform/FreeType.cmake:
1747         * platform/GStreamer.cmake:
1748         * platform/HolePunch.cmake:
1749         * platform/ImageDecoders.cmake:
1750         * platform/Soup.cmake: Added.
1751         * platform/TextureMapper.cmake:
1752
1753 2019-04-18  Justin Fan  <justin_fan@apple.com>
1754
1755         [Web GPU] Implement API default values
1756         https://bugs.webkit.org/show_bug.cgi?id=197032
1757
1758         Reviewed by Myles C. Maxfield.
1759
1760         Add default values and 'required' qualifiers recently merged to the WebGPU API.
1761
1762         WebGPU tests specifying these default values have been updated to rely on them for functionality.
1763
1764         * Modules/webgpu/GPUBindGroupLayoutBinding.idl:
1765         * Modules/webgpu/GPUBindGroupLayoutDescriptor.idl:
1766         * Modules/webgpu/GPUBlendDescriptor.idl:
1767         * Modules/webgpu/GPUBufferDescriptor.idl:
1768         * Modules/webgpu/GPUColor.idl:
1769         * Modules/webgpu/GPUColorStateDescriptor.idl:
1770         * Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
1771         * Modules/webgpu/GPUExtent3D.idl:
1772         * Modules/webgpu/GPUInputStateDescriptor.idl:
1773         * Modules/webgpu/GPUOrigin3D.h:
1774         * Modules/webgpu/GPUOrigin3D.idl:
1775         * Modules/webgpu/GPURequestAdapterOptions.idl:
1776         * Modules/webgpu/GPUTextureDescriptor.idl:
1777         * Modules/webgpu/GPUVertexAttributeDescriptor.idl:
1778         * Modules/webgpu/GPUVertexInputDescriptor.idl:
1779         * Modules/webgpu/WebGPUBindGroupBinding.idl:
1780         * Modules/webgpu/WebGPUBindGroupDescriptor.idl:
1781         * Modules/webgpu/WebGPUBufferBinding.h:
1782         * Modules/webgpu/WebGPUBufferBinding.idl:
1783         * Modules/webgpu/WebGPUCommandEncoder.idl:
1784         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
1785         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl:
1786         * Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
1787         * Modules/webgpu/WebGPURenderPassDescriptor.idl:
1788         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
1789         (WebCore::WebGPURenderPipelineDescriptor::tryCreateGPURenderPipelineDescriptor const):
1790         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
1791         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
1792         * Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
1793         * platform/graphics/gpu/GPUBlendDescriptor.h:
1794         * platform/graphics/gpu/GPUColorStateDescriptor.h:
1795         * platform/graphics/gpu/GPUCommandBuffer.h:
1796         * platform/graphics/gpu/GPUDepthStencilStateDescriptor.h:
1797         * platform/graphics/gpu/GPURenderPassDescriptor.h:
1798         * platform/graphics/gpu/GPURenderPipelineDescriptor.h:
1799         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
1800         * platform/graphics/gpu/GPURequestAdapterOptions.h:
1801         * platform/graphics/gpu/GPUTextureDescriptor.h:
1802         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
1803         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
1804         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1805         (WebCore::convertRenderPipelineDescriptor):
1806         (WebCore::trySetFunctionsForPipelineDescriptor):
1807
1808 2019-04-18  Jer Noble  <jer.noble@apple.com>
1809
1810         Refactoring: Pull all fullscreen code out of Document and into its own helper class
1811         https://bugs.webkit.org/show_bug.cgi?id=197017
1812
1813         Reviewed by Eric Carlson.
1814
1815         * CMakeLists.txt:
1816         * DerivedSources-input.xcfilelist:
1817         * DerivedSources-output.xcfilelist:
1818         * DerivedSources.make:
1819         * Sources.txt:
1820         * WebCore.xcodeproj/project.pbxproj:
1821         * css/CSSDefaultStyleSheets.cpp:
1822         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
1823         * css/SelectorCheckerTestFunctions.h:
1824         (WebCore::matchesFullScreenPseudoClass):
1825         (WebCore::matchesFullScreenAnimatingFullScreenTransitionPseudoClass):
1826         (WebCore::matchesFullScreenDocumentPseudoClass):
1827         (WebCore::matchesFullScreenControlsHiddenPseudoClass):
1828         * dom/Document.cpp:
1829         (WebCore::Document::removedLastRef):
1830         (WebCore::Document::prepareForDestruction):
1831         (WebCore::Document::nodeChildrenWillBeRemoved):
1832         (WebCore::Document::nodeWillBeRemoved):
1833         (WebCore::isAttributeOnAllOwners): Deleted.
1834         (WebCore::Document::fullScreenIsAllowedForElement const): Deleted.
1835         (WebCore::Document::requestFullScreenForElement): Deleted.
1836         (WebCore::Document::webkitCancelFullScreen): Deleted.
1837         (WebCore::Document::webkitExitFullscreen): Deleted.
1838         (WebCore::Document::webkitFullscreenEnabled const): Deleted.
1839         (WebCore::unwrapFullScreenRenderer): Deleted.
1840         (WebCore::Document::webkitWillEnterFullScreen): Deleted.
1841         (WebCore::Document::webkitDidEnterFullScreen): Deleted.
1842         (WebCore::Document::webkitWillExitFullScreen): Deleted.
1843         (WebCore::Document::webkitDidExitFullScreen): Deleted.
1844         (WebCore::Document::setFullScreenRenderer): Deleted.
1845         (WebCore::Document::dispatchFullScreenChangeEvents): Deleted.
1846         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent): Deleted.
1847         (WebCore::Document::fullScreenElementRemoved): Deleted.
1848         (WebCore::Document::adjustFullScreenElementOnNodeRemoval): Deleted.
1849         (WebCore::Document::isAnimatingFullScreen const): Deleted.
1850         (WebCore::Document::setAnimatingFullScreen): Deleted.
1851         (WebCore::Document::areFullscreenControlsHidden const): Deleted.
1852         (WebCore::Document::setFullscreenControlsHidden): Deleted.
1853         (WebCore::Document::clearFullscreenElementStack): Deleted.
1854         (WebCore::Document::popFullscreenElementStack): Deleted.
1855         (WebCore::Document::pushFullscreenElementStack): Deleted.
1856         (WebCore::Document::addDocumentToFullScreenChangeEventQueue): Deleted.
1857         * dom/Document.h:
1858         (WebCore::Document::fullscreenManager):
1859         (WebCore::Document::webkitIsFullScreen const): Deleted.
1860         (WebCore::Document::webkitFullScreenKeyboardInputAllowed const): Deleted.
1861         (WebCore::Document::webkitCurrentFullScreenElement const): Deleted.
1862         (WebCore::Document::webkitCurrentFullScreenElementForBindings const): Deleted.
1863         (WebCore::Document::fullScreenRenderer const): Deleted.
1864         (WebCore::Document::webkitFullscreenElement const): Deleted.
1865         (WebCore::Document::webkitFullscreenElementForBindings const): Deleted.
1866         * dom/Document.idl:
1867         * dom/DocumentFullscreen.h:
1868         (WebCore::DocumentFullscreen::webkitFullscreenEnabled):
1869         (WebCore::DocumentFullscreen::webkitFullscreenElement):
1870         (WebCore::DocumentFullscreen::webkitExitFullscreen):
1871         (WebCore::DocumentFullscreen::webkitIsFullScreen):
1872         (WebCore::DocumentFullscreen::webkitFullScreenKeyboardInputAllowed):
1873         (WebCore::DocumentFullscreen::webkitCurrentFullScreenElement):
1874         (WebCore::DocumentFullscreen::webkitCancelFullScreen):
1875         * dom/DocumentFullscreen.idl:
1876         * dom/Element.cpp:
1877         (WebCore::Element::webkitRequestFullscreen):
1878         * dom/EventPath.cpp:
1879         (WebCore::shouldEventCrossShadowBoundary):
1880         * dom/FullscreenManager.cpp: Added.
1881         (WebCore::isAttributeOnAllOwners):
1882         (WebCore::FullscreenManager::FullscreenManager):
1883         (WebCore::FullscreenManager::fullscreenIsAllowedForElement const):
1884         (WebCore::FullscreenManager::requestFullscreenForElement):
1885         (WebCore::FullscreenManager::cancelFullscreen):
1886         (WebCore::FullscreenManager::requestExitFullscreen):
1887         (WebCore::FullscreenManager::exitFullscreen):
1888         (WebCore::FullscreenManager::isFullscreenEnabled const):
1889         (WebCore::unwrapFullscreenRenderer):
1890         (WebCore::FullscreenManager::willEnterFullscreen):
1891         (WebCore::FullscreenManager::didEnterFullscreen):
1892         (WebCore::FullscreenManager::willExitFullscreen):
1893         (WebCore::FullscreenManager::didExitFullscreen):
1894         (WebCore::FullscreenManager::setFullscreenRenderer):
1895         (WebCore::FullscreenManager::dispatchFullscreenChangeEvents):
1896         (WebCore::FullscreenManager::dispatchFullscreenChangeOrErrorEvent):
1897         (WebCore::FullscreenManager::fullscreenElementRemoved):
1898         (WebCore::FullscreenManager::adjustFullscreenElementOnNodeRemoval):
1899         (WebCore::FullscreenManager::isAnimatingFullscreen const):
1900         (WebCore::FullscreenManager::setAnimatingFullscreen):
1901         (WebCore::FullscreenManager::areFullscreenControlsHidden const):
1902         (WebCore::FullscreenManager::setFullscreenControlsHidden):
1903         (WebCore::FullscreenManager::clear):
1904         (WebCore::FullscreenManager::emptyEventQueue):
1905         (WebCore::FullscreenManager::clearFullscreenElementStack):
1906         (WebCore::FullscreenManager::popFullscreenElementStack):
1907         (WebCore::FullscreenManager::pushFullscreenElementStack):
1908         (WebCore::FullscreenManager::addDocumentToFullscreenChangeEventQueue):
1909         * dom/FullscreenManager.h: Added.
1910         (WebCore::FullscreenManager::document):
1911         (WebCore::FullscreenManager::document const):
1912         (WebCore::FullscreenManager::topDocument const):
1913         (WebCore::FullscreenManager::page const):
1914         (WebCore::FullscreenManager::frame const):
1915         (WebCore::FullscreenManager::documentElement const):
1916         (WebCore::FullscreenManager::hasLivingRenderTree const):
1917         (WebCore::FullscreenManager::pageCacheState const):
1918         (WebCore::FullscreenManager::scheduleFullStyleRebuild):
1919         (WebCore::FullscreenManager::fullscreenElement const):
1920         (WebCore::FullscreenManager::isFullscreen const):
1921         (WebCore::FullscreenManager::isFullscreenKeyboardInputAllowed const):
1922         (WebCore::FullscreenManager::currentFullscreenElement const):
1923         (WebCore::FullscreenManager::fullscreenRenderer const):
1924         * html/HTMLMediaElement.cpp:
1925         (WebCore::HTMLMediaElement::isFullscreen const):
1926         (WebCore::HTMLMediaElement::isStandardFullscreen const):
1927         (WebCore::HTMLMediaElement::enterFullscreen):
1928         (WebCore::HTMLMediaElement::exitFullscreen):
1929         * html/MediaElementSession.cpp:
1930         (WebCore::MediaElementSession::canShowControlsManager const):
1931         * html/shadow/MediaControlElements.cpp:
1932         (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
1933         * inspector/agents/InspectorDOMAgent.cpp:
1934         * page/EventHandler.cpp:
1935         (WebCore::EventHandler::isKeyEventAllowedInFullScreen const):
1936         (WebCore::EventHandler::internalKeyEvent):
1937         * page/Page.cpp:
1938         (WebCore::Page::setFullscreenControlsHidden):
1939         * rendering/RenderFullScreen.cpp:
1940         (WebCore::RenderFullScreen::wrapNewRenderer):
1941         (WebCore::RenderFullScreen::wrapExistingRenderer):
1942         * rendering/RenderLayerCompositor.cpp:
1943         (WebCore::isDescendantOfFullScreenLayer):
1944         * rendering/updating/RenderTreeBuilder.h:
1945         * rendering/updating/RenderTreeBuilderInline.cpp:
1946         (WebCore::RenderTreeBuilder::Inline::splitInlines):
1947         * rendering/updating/RenderTreeUpdater.cpp:
1948         (WebCore::RenderTreeUpdater::createRenderer):
1949         * style/StyleSharingResolver.cpp:
1950         (WebCore::Style::SharingResolver::canShareStyleWithElement const):
1951         * testing/Internals.cpp:
1952         (WebCore::Internals::webkitWillEnterFullScreenForElement):
1953         (WebCore::Internals::webkitDidEnterFullScreenForElement):
1954         (WebCore::Internals::webkitWillExitFullScreenForElement):
1955         (WebCore::Internals::webkitDidExitFullScreenForElement):
1956         (WebCore::Internals::isAnimatingFullScreen const):
1957
1958 2019-04-18  Jer Noble  <jer.noble@apple.com>
1959
1960         Add support for parsing FairPlayStreaming PSSH boxes.
1961         https://bugs.webkit.org/show_bug.cgi?id=197064
1962
1963         Reviewed by Eric Carlson.
1964
1965         API Tests: ISO.ISOFairPlayStreamingPsshBox
1966
1967         Add a new set of ISOBox classes for parsing the contents of a FairPlayStreaming PSSH box,
1968         and add support for this new box to CDMFairPlayStreaming.
1969
1970         Drive-by fix: add an explicit include for MainThread.h to LibWebRTCProviderCocoa.cpp.
1971
1972         * SourcesCocoa.txt:
1973         * WebCore.xcodeproj/project.pbxproj:
1974         * platform/graphics/FourCC.h:
1975         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
1976         (WebCore::CDMPrivateFairPlayStreaming::cencName):
1977         (WebCore::fairPlaySystemID):
1978         (WebCore::extractSchemeAndKeyIdFromCenc):
1979         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsCenc):
1980         (WebCore::CDMPrivateFairPlayStreaming::sanitizeCenc):
1981         (WebCore::validInitDataTypes):
1982         (WebCore::CDMFactory::platformRegisterFactories):
1983         * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
1984         * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.cpp: Added.
1985         (WebCore::ISOFairPlayStreamingPsshBox::fairPlaySystemID):
1986         (WebCore::ISOFairPlayStreamingInfoBox::parse):
1987         (WebCore::ISOFairPlayStreamingKeyRequestInfoBox::parse):
1988         (WebCore::ISOFairPlayStreamingKeyAssetIdBox::parse):
1989         (WebCore::ISOFairPlayStreamingKeyContextBox::parse):
1990         (WebCore::ISOFairPlayStreamingKeyVersionListBox::parse):
1991         (WebCore::ISOFairPlayStreamingKeyRequestBox::parse):
1992         (WebCore::ISOFairPlayStreamingInitDataBox::parse):
1993         (WebCore::ISOFairPlayStreamingPsshBox::parse):
1994         * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h: Added.
1995         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
1996
1997 2019-04-18  Sihui Liu  <sihui_liu@apple.com>
1998
1999         Blob type cannot be stored correctly in IDB when IDBObjectStore has autoIncrement and keyPath options
2000         https://bugs.webkit.org/show_bug.cgi?id=196128
2001         <rdar://problem/49562115>
2002
2003         Reviewed by Geoffrey Garen.
2004
2005         If a key is auto-generated, it should become a property of the value object. Network process would perform the 
2006         key injection by deserializing IDBValue into script value, setting the property, serializing the result and 
2007         storing it in a database record. But network process does not have a JSDOMGlobalObject, so it would fail to 
2008         deserialize types including Blob and File.
2009
2010         To solve this issue, we move the key injection to web process and let network process store the original value 
2011         it gets. In this case, when web process asks for some value, network process should return key, value and key 
2012         path so that web process can decide whether it should perform a key injection before returning the result. Note
2013         that the auto-generated key would always be stored as the key in a ObjectStore record.
2014
2015         Test: storage/indexeddb/modern/objectstore-autoincrement-types.html
2016
2017         * Modules/indexeddb/IDBCursor.cpp:
2018         (WebCore::IDBCursor::setGetResult):
2019         * Modules/indexeddb/IDBCursor.h:
2020         (WebCore::IDBCursor::primaryKeyPath):
2021         * Modules/indexeddb/IDBGetAllResult.cpp:
2022         (WebCore::IDBGetAllResult::isolatedCopy):
2023         (WebCore::IDBGetAllResult::addKey):
2024         (WebCore::IDBGetAllResult::addValue):
2025         (WebCore::IDBGetAllResult::keys const):
2026         (WebCore::IDBGetAllResult::values const):
2027         (WebCore::IDBGetAllResult::allBlobFilePaths const):
2028         (WebCore::isolatedCopyOfVariant): Deleted.
2029
2030         * Modules/indexeddb/IDBGetAllResult.h: Introduce an IDBKeyPath parameter. Also replace Variant with two Vectors,
2031         because we only needed to store either key or value before, and now the stored value could be incomplete.
2032         (WebCore::IDBGetAllResult::IDBGetAllResult):
2033         (WebCore::IDBGetAllResult::keyPath const):
2034         (WebCore::IDBGetAllResult::encode const):
2035         (WebCore::IDBGetAllResult::decode):
2036
2037         * Modules/indexeddb/IDBGetResult.cpp:
2038         (WebCore::IDBGetResult::setValue):
2039         * Modules/indexeddb/IDBGetResult.h:
2040         (WebCore::IDBGetResult::IDBGetResult):
2041         (WebCore::IDBGetResult::keyPath const):
2042         * Modules/indexeddb/IDBRequest.cpp:
2043         (WebCore::IDBRequest::setResult):
2044         (WebCore::IDBRequest::setResultToStructuredClone):
2045         * Modules/indexeddb/IDBRequest.h:
2046         * Modules/indexeddb/IDBTransaction.cpp:
2047         (WebCore::IDBTransaction::didGetAllRecordsOnServer):
2048         (WebCore::IDBTransaction::didGetRecordOnServer):
2049         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2050         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
2051         * Modules/indexeddb/server/MemoryIndex.cpp:
2052         (WebCore::IDBServer::MemoryIndex::getResultForKeyRange const):
2053         (WebCore::IDBServer::MemoryIndex::getAllRecords const):
2054         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
2055         (WebCore::IDBServer::MemoryIndexCursor::currentData):
2056         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2057         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
2058         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
2059         (WebCore::IDBServer::MemoryObjectStore::getAllRecords const):
2060         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
2061         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
2062         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2063         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
2064         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
2065         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
2066         (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
2067         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
2068         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
2069         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
2070         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
2071         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
2072         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
2073         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
2074         (WebCore::IDBServer::SQLiteIDBCursor::currentData):
2075         * Modules/indexeddb/server/SQLiteIDBCursor.h:
2076         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2077
2078         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Remove the key injection from network process. 
2079         UniqueIDBDatabase stores any value it gets from IDBClient.
2080
2081         * Modules/indexeddb/shared/IDBResultData.cpp:
2082         (WebCore::IDBResultData::getResultRef):
2083         * Modules/indexeddb/shared/IDBResultData.h:
2084
2085         * bindings/js/IDBBindingUtilities.cpp:
2086         (WebCore::injectIDBKeyIntoScriptValue): If property is read-only, set would fail and injectKeyIntoResult would
2087         return null, but we expect it to return result as long as the property value is the same as target. Therefore, 
2088         we can add an early return here.
2089
2090         (WebCore::createKeyPathArray):
2091         (WebCore::generateIndexKeyForValue): We used to generate IndexKey from value stored in database but now the
2092         value gets stored does not include auto-generated key, as we remove the key injection from network process. In 
2093         this case if the IDBIndex has the same key path as the auto-generated key, IndexKey would be failed to create
2094         for it cannot extract auto-generated key from value. Since the auto-generated key would always be the key in 
2095         database record, we could use value of that key when we find a match in key path.
2096
2097         (WebCore::deserializeIDBValueWithKeyInjection): If the key path in the result is single entry, the key is 
2098         probably auto-generated, so we could inject the result key into the result value unconditionally.
2099
2100         * bindings/js/IDBBindingUtilities.h:
2101         * bindings/js/JSIDBCursorWithValueCustom.cpp:
2102         (WebCore::JSIDBCursorWithValue::value const):
2103         * bindings/js/JSIDBRequestCustom.cpp:
2104         (WebCore::JSIDBRequest::result const):
2105
2106 2019-04-18  Zalan Bujtas  <zalan@apple.com>
2107
2108         Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
2109         https://bugs.webkit.org/show_bug.cgi?id=196948
2110         <rdar://problem/49927131>
2111
2112         Reviewed by Tim Horton.
2113
2114         * page/FrameView.cpp:
2115         (WebCore::FrameView::setContentsSize):
2116         (WebCore::FrameView::autoSizeIfEnabled):
2117         * page/FrameView.h:
2118
2119 2019-04-18  Shawn Roberts  <sroberts@apple.com>
2120
2121         Unreviewed manual rollout of r244248 and r244409
2122         Causing assertion failures on Mac WK2 Debug builds
2123         https://bugs.webkit.org/show_bug.cgi?id=195623
2124
2125         * loader/LinkLoader.cpp:
2126         (WebCore::LinkLoader::prefetchIfNeeded):
2127         * loader/ResourceLoadInfo.cpp:
2128         (WebCore::toResourceType):
2129         * loader/ResourceLoadInfo.h:
2130         * loader/ResourceLoader.cpp:
2131         (WebCore::ResourceLoader::willSendRequestInternal):
2132         * loader/cache/CachedResourceLoader.cpp:
2133         (WebCore::CachedResourceLoader::requestResource):
2134
2135 2019-04-18  Antti Koivisto  <antti@apple.com>
2136
2137         Tile update problems in iframe after scrolling page too soon after load
2138         https://bugs.webkit.org/show_bug.cgi?id=197057
2139         <rdar://problem/49913663>
2140
2141         Reviewed by Simon Fraser.
2142
2143         We end up destroying FrameHosting scrolling node when we shouldn't.
2144
2145         No test, despite attempts I couldn't get this state to stick. The problem is that in
2146         most cases the destroying scrolling node gets immediately recreated and connected again.
2147         Getting into testably buggy state requires some very specific layer tree configuration update.
2148
2149         * rendering/RenderLayerBacking.cpp:
2150         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
2151
2152         Test the right thing.
2153
2154 2019-04-18  Antoine Quint  <graouts@apple.com>
2155
2156         [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html
2157         https://bugs.webkit.org/show_bug.cgi?id=197004
2158
2159         Reviewed by Antti Koivisto.
2160
2161         We need to release pointer capture when an element that has pointer capture is disconnected from the DOM.
2162
2163         * dom/Element.cpp:
2164         (WebCore::Element::removedFromAncestor): Notify the PointerCaptureController that an element was disconnected.
2165         * dom/PointerEvent.cpp:
2166         (WebCore::PointerEvent::create): Broaden createPointerCancelEvent() to take in an event type so that we may use it to create a
2167         lostpointercapture event as well.
2168         (WebCore::PointerEvent::createPointerCancelEvent): Deleted.
2169         * dom/PointerEvent.h:
2170         * page/PointerCaptureController.cpp:
2171         (WebCore::PointerCaptureController::elementWasRemoved): Check whether the provided element matches one of the target overrides recorded
2172         in the map of captured pointer IDs.
2173         (WebCore::PointerCaptureController::pointerEventWasDispatched): This block of code was actually useless in this location, the new code
2174         added in elementWasRemoved() performs the actions that the spec text mandates.
2175         (WebCore::PointerCaptureController::cancelPointer): Replace the call to createPointerCancelEvent() with one to create().
2176         * page/PointerCaptureController.h:
2177
2178 2019-04-17  Antoine Quint  <graouts@apple.com>
2179
2180         [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html
2181         https://bugs.webkit.org/show_bug.cgi?id=197006
2182
2183         Reviewed by Antti Koivisto.
2184
2185         Add support for on* HTML attributes and JS properties for pointer events.
2186
2187         * dom/GlobalEventHandlers.idl:
2188         * html/HTMLAttributeNames.in:
2189         * html/HTMLElement.cpp:
2190         (WebCore::HTMLElement::createEventHandlerNameMap):
2191
2192 2019-04-17  Timothy Hatcher  <timothy@apple.com>
2193
2194         Standardize the `<meta name="color-scheme">` separator.
2195         https://bugs.webkit.org/show_bug.cgi?id=193931
2196
2197         Reviewed by Simon Fraser.
2198
2199         Drop support for comma as a valid seperator in <meta name="color-scheme"> to
2200         match the proposal being tracked by: https://github.com/whatwg/html/issues/4504
2201
2202         Tests: css-dark-mode/color-scheme-meta.html
2203                css-dark-mode/older-syntax/supported-color-schemes-meta.html
2204
2205         * dom/Document.cpp:
2206         (WebCore::isColorSchemeSeparator): Drop support for comma.
2207
2208 2019-04-17  Timothy Hatcher  <timothy@apple.com>
2209
2210         Rename `supported-color-schemes` to `color-scheme`.
2211         https://bugs.webkit.org/show_bug.cgi?id=197016
2212         rdar://problem/49980259
2213
2214         Reviewed by Simon Fraser.
2215
2216         Changed `supported-color-schemes` to `color-scheme` to follow the spec changes
2217         being tracked by: https://github.com/w3c/csswg-drafts/issues/3807
2218
2219         The old `supported-color-schemes` is now an alias of `color-scheme` for compatibility.
2220
2221         Tests: css-dark-mode/color-scheme-css-parse.html
2222                css-dark-mode/color-scheme-css.html
2223                css-dark-mode/color-scheme-meta.html
2224                css-dark-mode/color-scheme-priority.html
2225                css-dark-mode/color-scheme-scrollbar.html
2226                css-dark-mode/older-syntax/supported-color-schemes-css.html
2227                css-dark-mode/older-syntax/supported-color-schemes-meta.html
2228                css-dark-mode/older-systems/color-scheme-css.html
2229                css-dark-mode/older-systems/color-scheme-meta.html
2230
2231         * WebCore.xcodeproj/project.pbxproj:
2232         * css/CSSComputedStyleDeclaration.cpp:
2233         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2234         * css/CSSProperties.json:
2235         * css/CSSValueKeywords.in:
2236         * css/StyleBuilderConverter.h:
2237         (WebCore::StyleBuilderConverter::updateColorScheme):
2238         (WebCore::StyleBuilderConverter::convertColorScheme):
2239         (WebCore::StyleBuilderConverter::updateSupportedColorSchemes): Deleted.
2240         (WebCore::StyleBuilderConverter::convertSupportedColorSchemes): Deleted.
2241         * css/StyleBuilderCustom.h:
2242         (WebCore::StyleBuilderCustom::applyValueColorScheme):
2243         (WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes): Deleted.
2244         * css/StyleResolver.cpp:
2245         (WebCore::StyleResolver::applyMatchedProperties):
2246         * css/parser/CSSPropertyParser.cpp:
2247         (WebCore::consumeColorScheme):
2248         (WebCore::CSSPropertyParser::parseSingleValue):
2249         (WebCore::consumeSupportedColorSchemes): Deleted.
2250         * dom/Document.cpp:
2251         (WebCore::processColorSchemeString):
2252         (WebCore::Document::processColorScheme):
2253         (WebCore::Document::useDarkAppearance const):
2254         (WebCore::processColorSchemes): Deleted.
2255         (WebCore::Document::processSupportedColorSchemes): Deleted.
2256         * dom/Document.h:
2257         * html/HTMLMetaElement.cpp:
2258         (WebCore::HTMLMetaElement::process):
2259         * page/FrameView.cpp:
2260         (WebCore::FrameView::rendererForColorScheme const):
2261         (WebCore::FrameView::useDarkAppearance const):
2262         (WebCore::FrameView::styleColorOptions const):
2263         (WebCore::FrameView::rendererForSupportedColorSchemes const): Deleted.
2264         * page/FrameView.h:
2265         * rendering/style/RenderStyle.cpp:
2266         (WebCore::rareInheritedDataChangeRequiresRepaint):
2267         * rendering/style/RenderStyle.h:
2268         (WebCore::RenderStyle::colorScheme const):
2269         (WebCore::RenderStyle::setHasExplicitlySetColorScheme):
2270         (WebCore::RenderStyle::hasExplicitlySetColorScheme const):
2271         (WebCore::RenderStyle::setColorScheme):
2272         (WebCore::RenderStyle::initialColorScheme):
2273         (WebCore::RenderStyle::NonInheritedFlags::operator== const):
2274         (WebCore::RenderStyle::supportedColorSchemes const): Deleted.
2275         (WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Deleted.
2276         (WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Deleted.
2277         (WebCore::RenderStyle::setSupportedColorSchemes): Deleted.
2278         (WebCore::RenderStyle::initialSupportedColorSchemes): Deleted.
2279         * rendering/style/RenderStyleConstants.h:
2280         * rendering/style/StyleColorScheme.h: Renamed from Source/WebCore/rendering/style/StyleSupportedColorSchemes.h.
2281         (WebCore::StyleColorScheme::StyleColorScheme):
2282         (WebCore::StyleColorScheme::operator== const):
2283         (WebCore::StyleColorScheme::operator!= const):
2284         (WebCore::StyleColorScheme::isAuto const):
2285         (WebCore::StyleColorScheme::isOnly const):
2286         (WebCore::StyleColorScheme::colorScheme const):
2287         (WebCore::StyleColorScheme::add):
2288         (WebCore::StyleColorScheme::contains const):
2289         (WebCore::StyleColorScheme::setAllowsTransformations):
2290         (WebCore::StyleColorScheme::allowsTransformations const):
2291         * rendering/style/StyleRareInheritedData.cpp:
2292         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2293         (WebCore::StyleRareInheritedData::operator== const):
2294         * rendering/style/StyleRareInheritedData.h:
2295
2296 2019-04-17  Justin Fan  <justin_fan@apple.com>
2297
2298         [Web GPU] GPUComputePassEncoder::dispatch number of thread groups, not grid size
2299         https://bugs.webkit.org/show_bug.cgi?id=196984
2300
2301         Reviewed by Myles C. Maxfield.
2302
2303         Test: Updated compute-squares.html.
2304
2305         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm:
2306         (WebCore::GPUComputePassEncoder::dispatch):
2307
2308 2019-04-17  Andy Estes  <aestes@apple.com>
2309
2310         [iOS] Support multiple file selection in UIDocumentPickerViewController
2311         https://bugs.webkit.org/show_bug.cgi?id=197014
2312         <rdar://problem/49963514>
2313
2314         Reviewed by Tim Horton.
2315
2316         * platform/LocalizedStrings.h:
2317         Exported multipleFileUploadText().
2318
2319 2019-04-17  John Wilander  <wilander@apple.com>
2320
2321         Add prioritization of ad click conversions and cleaning of sent ad click conversions
2322         https://bugs.webkit.org/show_bug.cgi?id=196934
2323         <rdar://problem/49917773>
2324
2325         Reviewed by Chris Dumez.
2326
2327         Tests: http/tests/adClickAttribution/second-attribution-converted-with-higher-priority.html
2328                http/tests/adClickAttribution/second-attribution-converted-with-lower-priority.html
2329                http/tests/adClickAttribution/second-conversion-with-higher-priority.html
2330                http/tests/adClickAttribution/second-conversion-with-lower-priority.html
2331
2332         * loader/AdClickAttribution.cpp:
2333         (WebCore::AdClickAttribution::hasHigherPriorityThan const):
2334             Added to facilitate priority comparison between two attributions.
2335         * loader/AdClickAttribution.h:
2336         (WebCore::AdClickAttribution::Destination::Destination):
2337             Added a WTF::HashTableDeletedValueType constructor and changed the copy constructor to
2338             a move constructor.
2339         (WebCore::AdClickAttribution::isEmpty const):
2340
2341 2019-04-17  Devin Rousso  <drousso@apple.com>
2342
2343         AX: AccessibilityObject::parentObject() doesn't need to be pure virtual
2344         https://bugs.webkit.org/show_bug.cgi?id=197026
2345         <rdar://problem/49448209>
2346
2347         Reviewed by Timothy Hatcher.
2348
2349         * accessibility/AccessibilityObject.h:
2350         (WebCore::AccessibilityObject::parentObject const):
2351
2352 2019-04-17  Zalan Bujtas  <zalan@apple.com>
2353
2354         [ContentChangeObserver] Use aria role as a hint whether a tap should result in a synthetic click
2355         https://bugs.webkit.org/show_bug.cgi?id=196988
2356         <rdar://problem/49955328>
2357
2358         Reviewed by Simon Fraser.
2359
2360         Test: fast/events/touch/ios/content-observation/tap-on-input-looking-div-with-role.html
2361
2362         * accessibility/AccessibilityObject.h:
2363
2364 2019-04-17  Alex Christensen  <achristensen@webkit.org>
2365
2366         WebSocketHandshake should not know about a Document
2367         https://bugs.webkit.org/show_bug.cgi?id=196468
2368
2369         Reviewed by Tim Horton.
2370
2371         I'll need to move WebSocketHandshake to the NetworkProcess for rdar://problem/46287028
2372         It currently uses the Document pointer for 3 things:
2373         1. To get the user agent, which we can pass in as a creation parameter.
2374         2. To get the origin, which we can also pass in as a creation parameter.
2375         3. To get cookies for the web inspector.  We can pass in a functor instead and have the inspector provide cookies itself.
2376
2377         * Modules/websockets/WebSocketChannel.cpp:
2378         (WebCore::WebSocketChannel::connect):
2379         (WebCore::WebSocketChannel::disconnect):
2380         (WebCore::WebSocketChannel::didOpenSocketStream):
2381         (WebCore::WebSocketChannel::clientHandshakeRequest):
2382         * Modules/websockets/WebSocketChannel.h:
2383         (WebCore::WebSocketChannel::document):
2384         * Modules/websockets/WebSocketHandshake.cpp:
2385         (WebCore::WebSocketHandshake::WebSocketHandshake):
2386         (WebCore::WebSocketHandshake::clientHandshakeMessage const):
2387         (WebCore::WebSocketHandshake::clientHandshakeRequest const):
2388         (WebCore::WebSocketHandshake::clientOrigin const): Deleted.
2389         (WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const): Deleted.
2390         (WebCore::WebSocketHandshake::clearDocument): Deleted.
2391         * Modules/websockets/WebSocketHandshake.h:
2392         * inspector/agents/InspectorNetworkAgent.cpp:
2393         (WebCore::InspectorNetworkAgent::enable):
2394
2395 2019-04-17  Timothy Hatcher  <timothy@apple.com>
2396
2397         Unreviewed build fix for iOSMac after r244223.
2398
2399         * platform/audio/ios/AudioSessionIOS.mm:
2400         (WebCore::AudioSession::routeSharingPolicy const): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END
2401         around AVAudioSessionRouteSharingPolicyLongForm use.
2402
2403 2019-04-17  Chris Dumez  <cdumez@apple.com>
2404
2405         Remember device orientation permission for the duration of the browsing session
2406         https://bugs.webkit.org/show_bug.cgi?id=196992
2407         <rdar://problem/49946067>
2408
2409         Reviewed by Alex Christensen.
2410
2411         Use DeviceOrientationOrMotionPermissionState type more consistently in the code base
2412         instead of bool or Optional<bool>. Added "Prompt" value to this enumeration which is the
2413         default state and which indicates we should ask the client.
2414
2415         * WebCore.xcodeproj/project.pbxproj:
2416         * dom/DeviceOrientationAndMotionAccessController.cpp:
2417         (WebCore::DeviceOrientationAndMotionAccessController::DeviceOrientationAndMotionAccessController):
2418         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
2419         * dom/DeviceOrientationAndMotionAccessController.h:
2420         (WebCore::DeviceOrientationAndMotionAccessController::accessState const):
2421         * dom/DeviceOrientationOrMotionEvent.cpp:
2422         (WebCore::DeviceOrientationOrMotionEvent::requestPermission):
2423         * dom/DeviceOrientationOrMotionPermissionState.h:
2424         * loader/DocumentLoader.h:
2425         (WebCore::DocumentLoader::deviceOrientationAndMotionAccessState const):
2426         (WebCore::DocumentLoader::setDeviceOrientationAndMotionAccessState):
2427         * page/ChromeClient.h:
2428         * page/DOMWindow.cpp:
2429         (WebCore::DOMWindow::isAllowedToAddDeviceMotionOrientationListener const):
2430
2431 2019-04-17  Rob Buis  <rbuis@igalia.com>
2432
2433         XMLHttpRequest has the wrong fallback encoding
2434         https://bugs.webkit.org/show_bug.cgi?id=191741
2435
2436         Reviewed by Alex Christensen.
2437
2438         Allow overriding the response charset as specified here:
2439         https://xhr.spec.whatwg.org/#final-charset
2440
2441         Behavior matches Firefox and Chrome.
2442
2443         Tests: imported/w3c/web-platform-tests/encoding/replacement-encodings.any.html
2444                imported/w3c/web-platform-tests/encoding/replacement-encodings.any.worker.html
2445                imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.html
2446                imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.worker.html
2447
2448         * xml/XMLHttpRequest.cpp:
2449         (WebCore::XMLHttpRequest::finalResponseCharset const):
2450         (WebCore::XMLHttpRequest::createDecoder const):
2451         * xml/XMLHttpRequest.h:
2452
2453 2019-04-16  Antoine Quint  <graouts@apple.com>
2454
2455         Opt Google Maps into simulated mouse events dispatch quirk
2456         https://bugs.webkit.org/show_bug.cgi?id=196965
2457         <rdar://problem/49934766>
2458
2459         Reviewed by Dean Jackson.
2460
2461         Use the correct Google Maps path.
2462
2463         * page/Quirks.cpp:
2464         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2465
2466 2019-04-16  Antoine Quint  <graouts@apple.com>
2467
2468         Opt flipkart.com into simulated mouse events dispatch quirk
2469         https://bugs.webkit.org/show_bug.cgi?id=196961
2470         <rdar://problem/49648520>
2471
2472         Reviewed by Dean Jackson.
2473
2474         * page/Quirks.cpp:
2475         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2476
2477 2019-04-16  Antoine Quint  <graouts@apple.com>
2478
2479         Opt MSN.com into simulated mouse events dispatch quirk
2480         https://bugs.webkit.org/show_bug.cgi?id=196960
2481         <rdar://problem/49403260>
2482
2483         Reviewed by Dean Jackson.
2484
2485         * page/Quirks.cpp:
2486         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2487
2488 2019-04-16  Zan Dobersek  <zdobersek@igalia.com>
2489
2490         ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
2491         https://bugs.webkit.org/show_bug.cgi?id=191354
2492         <rdar://problem/46123406>
2493
2494         Reviewed by Michael Catanzaro.
2495
2496         ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
2497         index validity and, if the index is valid, check for completeness of the
2498         corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
2499         also only retrieve duration for already-complete frames, or expand the
2500         default 0-second value according to the flashing-protection rule when
2501         the target frame is not yet complete.
2502
2503         Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
2504         as that method goes on and decodes image data to determine specific
2505         information. The ImageSource class that's querying this information
2506         doesn't anticipate this, and doesn't handle the increased memory
2507         consumption of the decoded data, leaving MemoryCache in the blind about
2508         the image resource's actual amount of consumed memory. ImageSource can
2509         instead gracefully handle any incomplete frame by marking the decoding
2510         status for this frame as only partial.
2511
2512         * platform/image-decoders/ScalableImageDecoder.cpp:
2513         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
2514         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
2515         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
2516
2517 2019-04-16  Ross Kirsling  <ross.kirsling@sony.com>
2518
2519         Unreviewed non-unified build fix after r244307.
2520
2521         * page/DiagnosticLoggingClient.h:
2522
2523 2019-04-16  Chris Dumez  <cdumez@apple.com>
2524
2525         URL set by document.open() is not communicated to the UIProcess
2526         https://bugs.webkit.org/show_bug.cgi?id=196941
2527         <rdar://problem/49237544>
2528
2529         Reviewed by Geoff Garen.
2530
2531         Notify the FrameLoaderClient whenever an explicit open was done and provide it with
2532         the latest document URL.
2533
2534         * loader/FrameLoader.cpp:
2535         (WebCore::FrameLoader::didExplicitOpen):
2536         * loader/FrameLoaderClient.h:
2537
2538 2019-04-16  Timothy Hatcher  <timothy@apple.com>
2539
2540         FrameView base background color always starts white.
2541         https://bugs.webkit.org/show_bug.cgi?id=196976
2542
2543         Reviewed by Beth Dakin.
2544
2545         * page/FrameView.cpp:
2546         (WebCore::FrameView::setBaseBackgroundColor): Bail early if the base background
2547         color did not change.
2548
2549 2019-04-16  Devin Rousso  <drousso@apple.com>
2550
2551         Unprefix -webkit-sticky
2552         https://bugs.webkit.org/show_bug.cgi?id=196962
2553         <rdar://problem/40903458>
2554
2555         Reviewed by Simon Fraser.
2556
2557         Updated existing tests.
2558
2559         This change doesn't modify functionality, only exposing a new unprefixed CSS value.
2560
2561         * css/CSSProperties.json:
2562         * css/CSSValueKeywords.in:
2563
2564         * css/CSSPrimitiveValueMappings.h:
2565         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2566         (WebCore::CSSPrimitiveValue::operator PositionType const):
2567
2568         * css/parser/CSSParserFastPaths.cpp:
2569         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2570
2571         * editing/EditingStyle.cpp:
2572         (WebCore::EditingStyle::convertPositionStyle):
2573
2574 2019-04-16  Commit Queue  <commit-queue@webkit.org>
2575
2576         Unreviewed, rolling out r244321.
2577         https://bugs.webkit.org/show_bug.cgi?id=196968
2578
2579         Causing all WK2 Debug builds to exit early after Assertion
2580         failures. (Requested by ShawnRoberts on #webkit).
2581
2582         Reverted changeset:
2583
2584         "URL set by document.open() is not communicated to the
2585         UIProcess"
2586         https://bugs.webkit.org/show_bug.cgi?id=196941
2587         https://trac.webkit.org/changeset/244321
2588
2589 2019-04-16  Caitlin Potter  <caitp@igalia.com>
2590
2591         [JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
2592         https://bugs.webkit.org/show_bug.cgi?id=176810
2593
2594         Reviewed by Saam Barati.
2595
2596         Previously, there was a comment here indicating uncertainty of whether it
2597         was necessary to filter DontEnum properties explicitly or not. It turns
2598         out that it was necessary in the case of JSC ProxyObjects.
2599
2600         This patch adds DontEnum filtering for ProxyObjects, however we continue
2601         to explicitly filter them in JSDOMConvertRecord, which needs to use the
2602         property descriptor after filtering. This change prevents observably
2603         fetching the property descriptor twice per property.
2604
2605         * bindings/js/JSDOMConvertRecord.h:
2606
2607 2019-04-15  Antoine Quint  <graouts@apple.com>
2608
2609         [iOS] Redundant pointer events causes material design buttons to flush twice
2610         https://bugs.webkit.org/show_bug.cgi?id=196914
2611         <rdar://problem/49571860>
2612
2613         Reviewed by Dean Jackson.
2614
2615         Test: pointerevents/ios/pointer-event-order.html
2616
2617         Do not dispatch pointer events for mouse events on iOS since we're already dispatching them when processing touch events.
2618
2619         * dom/Element.cpp:
2620         (WebCore::Element::dispatchMouseEvent):
2621
2622 2019-04-15  John Wilander  <wilander@apple.com>
2623
2624         Add a query string nonce to LayoutTests/http/tests/adClickAttribution/send-attribution-conversion-request.html to address flakiness
2625         https://bugs.webkit.org/show_bug.cgi?id=196955
2626
2627         Unreviewed test gardening. The WebCore change is only in a dedicated
2628         test function.
2629
2630         No new tests. Existing test updated.
2631
2632         * loader/AdClickAttribution.cpp:
2633         (WebCore::AdClickAttribution::urlForTesting const):
2634             Now preserves the query string in the test URL.
2635
2636 2019-04-15  Chris Dumez  <cdumez@apple.com>
2637
2638         URL set by document.open() is not communicated to the UIProcess
2639         https://bugs.webkit.org/show_bug.cgi?id=196941
2640         <rdar://problem/49237544>
2641
2642         Reviewed by Geoffrey Garen.
2643
2644         Notify the FrameLoaderClient whenever an explicit open was done and provide it with
2645         the latest document URL.
2646
2647         * loader/FrameLoader.cpp:
2648         (WebCore::FrameLoader::didExplicitOpen):
2649         * loader/FrameLoaderClient.h:
2650
2651 2019-04-15  Eike Rathke  <erack@redhat.com>
2652
2653         Fix logic flow for error log
2654         https://bugs.webkit.org/show_bug.cgi?id=196933
2655
2656         Reviewed by Alexey Proskuryakov.
2657
2658         Missing block braces logged an error always, not just
2659         if (actionIfInvalid == Complain).
2660
2661         * html/HTMLMediaElement.cpp:
2662         (WebCore::HTMLMediaElement::isSafeToLoadURL):
2663
2664 2019-04-15  Myles C. Maxfield  <mmaxfield@apple.com>
2665
2666         [Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
2667         https://bugs.webkit.org/show_bug.cgi?id=196846
2668         <rdar://problem/49499971>
2669
2670         Reviewed by Simon Fraser and Darin Adler.
2671
2672         When adding the special codepath for system-ui to behave as an entire list of fonts rather than a single item,
2673         I never added a cache for the FontPlatformData objects that codepath creates. The non-system-ui codepath already
2674         has a cache in fontPlatformDataCache() in FontCache.cpp.
2675
2676         This patch causes a 16.8x performance improvement on the attached benchmark.
2677
2678         Test: PerformanceTests/Layout/system-ui-rebuild-emoji.html
2679
2680         * page/cocoa/MemoryReleaseCocoa.mm:
2681         (WebCore::platformReleaseMemory):
2682         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2683         (WebCore::invalidateFontCache):
2684         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
2685         (WebCore::FontFamilySpecificationKey::FontFamilySpecificationKey):
2686         (WebCore::FontFamilySpecificationKey::operator== const):
2687         (WebCore::FontFamilySpecificationKey::operator!= const):
2688         (WebCore::FontFamilySpecificationKey::isHashTableDeletedValue const):
2689         (WebCore::FontFamilySpecificationKey::computeHash const):
2690         (WebCore::FontFamilySpecificationKeyHash::hash):
2691         (WebCore::FontFamilySpecificationKeyHash::equal):
2692         (WebCore::fontMap):
2693         (WebCore::clearFontFamilySpecificationCoreTextCache):
2694         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
2695         * platform/graphics/cocoa/FontFamilySpecificationCoreText.h:
2696         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2697         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2698         (WebCore::safeCFEqual): Deleted.
2699
2700 2019-04-15  Devin Rousso  <drousso@apple.com>
2701
2702         Web Inspector: fake value descriptors for promises add a catch handler, preventing "rejectionhandled" events from being fired
2703         https://bugs.webkit.org/show_bug.cgi?id=196484
2704         <rdar://problem/49114725>
2705
2706         Reviewed by Joseph Pecoraro.
2707
2708         Test: inspector/runtime/promise-native-getter.html
2709
2710         Mark errors created from getters as being `isNativeGetterTypeError`.
2711
2712         * bindings/js/JSDOMExceptionHandling.cpp:
2713         (WebCore::throwGetterTypeError):
2714         (WebCore::rejectPromiseWithGetterTypeError):
2715         (WebCore::rejectPromiseWithThisTypeError):
2716
2717         * bindings/js/JSDOMGlobalObject.cpp:
2718         (WebCore::makeGetterTypeErrorForBuiltins):
2719
2720         * bindings/js/JSDOMPromiseDeferred.h:
2721         * bindings/js/JSDOMPromiseDeferred.cpp:
2722         (WebCore::createRejectedPromiseWithTypeError):
2723
2724         * Modules/streams/WritableStream.js:
2725         (getter.closed):
2726         (getter.ready):
2727
2728 2019-04-15  Jer Noble  <jer.noble@apple.com>
2729
2730         Add a DiagnosticLogging method taking an arbitrary dictionary of values.
2731         https://bugs.webkit.org/show_bug.cgi?id=196773
2732
2733         Reviewed by Alex Christensen.
2734
2735         * page/DiagnosticLoggingClient.h:
2736
2737 2019-04-15  Justin Fan  <justin_fan@apple.com>
2738
2739         Let WTF::convertSafely deduce types from arguments.
2740
2741         Reviewer's (Darin Adler) follow-up to https://bugs.webkit.org/show_bug.cgi?id=196793.
2742
2743         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2744         (WebCore::GPUBuffer::tryCreate):
2745         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
2746         (WebCore::GPUCommandBuffer::copyBufferToTexture):
2747         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
2748         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2749         (WebCore::trySetInputStateForPipelineDescriptor):
2750
2751 2019-04-12  Ryosuke Niwa  <rniwa@webkit.org>
2752
2753         Throw TypeError when custom element constructor returns a wrong element or tries to create itself
2754         https://bugs.webkit.org/show_bug.cgi?id=196892
2755
2756         Reviewed by Dean Jackson.
2757
2758         Throw TypeError instead of InvalidStateError for consistency. This updates WebKit's custom elements
2759         implementation for https://github.com/whatwg/html/pull/4525.
2760
2761         Tests: imported/w3c/web-platform-tests/custom-elements/upgrading/Node-cloneNode.html
2762                imported/w3c/web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element.html
2763
2764         * bindings/js/JSCustomElementInterface.cpp:
2765         (WebCore::JSCustomElementInterface::upgradeElement):
2766         * bindings/js/JSHTMLElementCustom.cpp:
2767         (WebCore::constructJSHTMLElement):
2768
2769 2019-04-15  Don Olmstead  <don.olmstead@sony.com>
2770
2771         [CMake] WebCore derived sources should only be referenced inside WebCore
2772         https://bugs.webkit.org/show_bug.cgi?id=196904
2773
2774         Reviewed by Konstantin Tokarev.
2775
2776         Use WebCore_DERIVED_SOURCES_DIR instead of DERIVED_SOURCES_WEBCORE_DIR.
2777
2778         * CMakeLists.txt:
2779         * PlatformGTK.cmake:
2780         * PlatformWin.cmake:
2781         * WebCoreMacros.cmake:
2782
2783 2019-04-15  John Wilander  <wilander@apple.com>
2784
2785         Send delayed Ad Click Attribution conversion requests to the click source
2786         https://bugs.webkit.org/show_bug.cgi?id=196838
2787         <rdar://problem/47650157>
2788
2789         Reviewed by Chris Dumez and Youenn Fablet.
2790
2791         WebCore::AdClickAttribution now:
2792         - Sets m_earliestTimeToSend correctly based on WallTime::now().
2793         - Allows for a test override of the base URL for conversions.
2794         - Holds state for whether or not a conversion request has been sent.
2795         - Outputs m_earliestTimeToSend and m_conversion->hasBeenSent in toString().
2796         - Returns m_earliestTimeToSend as a result of a call to
2797         convertAndGetEarliestTimeToSend() which used to be called setConversion().
2798
2799         Test: http/tests/adClickAttribution/send-attribution-conversion-request.html
2800
2801         * loader/AdClickAttribution.cpp:
2802         (WebCore::AdClickAttribution::convertAndGetEarliestTimeToSend):
2803         (WebCore::AdClickAttribution::url const):
2804         (WebCore::AdClickAttribution::urlForTesting const):
2805         (WebCore::AdClickAttribution::markConversionAsSent):
2806         (WebCore::AdClickAttribution::wasConversionSent const):
2807         (WebCore::AdClickAttribution::toString const):
2808         (WebCore::AdClickAttribution::setConversion): Deleted.
2809             Renamed convertAndGetEarliestTimeToSend().
2810         * loader/AdClickAttribution.h:
2811         (WebCore::AdClickAttribution::Conversion::Conversion):
2812         (WebCore::AdClickAttribution::Conversion::encode const):
2813         (WebCore::AdClickAttribution::Conversion::decode):
2814         * platform/Timer.h:
2815             Now exports nextFireInterval.
2816
2817 2019-04-15  Chris Dumez  <cdumez@apple.com>
2818
2819         Regression(r237903) Speedometer 2 is 1-2% regressed on iOS
2820         https://bugs.webkit.org/show_bug.cgi?id=196841
2821         <rdar://problem/45957016>
2822
2823         Reviewed by Myles C. Maxfield.
2824
2825         Speedometer 2 content does not use the text-underline-offset and text-decoration-thickness
2826         features that were added in r237903 so I looked for behavior changes in the context of
2827         Speedometer from r237903. I found that RenderStyle::changeAffectsVisualOverflow() started
2828         returning true a lot more often after r237903. The reason is that r237903 dropped the
2829         visualOverflowForDecorations() checks in this method and started returning true a lot
2830         more as a result.
2831
2832         To restore previous behavior, this patch adds back the visualOverflowForDecorations() checks
2833         that were dropped in r237903. I have verified that with this patch,
2834         RenderStyle::changeAffectsVisualOverflow() returns true as many times as it used to before
2835         r237903.
2836
2837         * rendering/style/RenderStyle.cpp:
2838         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
2839
2840 2019-04-15  Said Abou-Hallawa  <said@apple.com>
2841
2842         ASSERT fires when removing a disallowed clone from the shadow tree without reseting its corresponding element
2843         https://bugs.webkit.org/show_bug.cgi?id=196895
2844
2845         Reviewed by Darin Adler.
2846
2847         When cloning elements to the shadow tree of an SVGUseElement, the
2848         corresponding element links are set from the clones to the originals.
2849         Later some of the elements may be disallowed to exist in the shadow tree.
2850         For example the SVGPatternElement is disallowed and has to be removed 
2851         even after cloning. The problem is the corresponding elements are not
2852         reset to null. Usually this is not a problem because the removed elements
2853         will be deleted and the destructor of SVGElement will reset the corresponding
2854         element links. However in some cases, the cloned element is referenced
2855         from another SVGElement, for example the target of a SVGTRefElement. In
2856         this case the clone won't be deleted but it will be linked to the original
2857         and the event listeners won't be copied from the original. When the
2858         original is deleted, its event listeners have to be removed. The event
2859         listeners of the clones also ave to be removed. But because the event
2860         listeners of the original were not copied when cloning, the assertion in
2861         SVGElement::removeEventListener() fires.
2862
2863         Test: svg/custom/use-disallowed-element-clear-corresponding-element.html
2864
2865         * svg/SVGUseElement.cpp:
2866         (WebCore::disassociateAndRemoveClones):
2867
2868 2019-04-15  Devin Rousso  <drousso@apple.com>
2869
2870         Web Inspector: DOMDebugger: "Attribute Modified" breakpoints pause after the modification occurs for the style attribute
2871         https://bugs.webkit.org/show_bug.cgi?id=196556
2872         <rdar://problem/49570681>
2873
2874         Reviewed by Timothy Hatcher.
2875
2876         Test: inspector/dom-debugger/attribute-modified-style.html
2877
2878         * css/PropertySetCSSStyleDeclaration.h:
2879         * css/PropertySetCSSStyleDeclaration.cpp:
2880         (WebCore::StyleAttributeMutationScope::~StyleAttributeMutationScope):
2881         (WebCore::InlineCSSStyleDeclaration::willMutate): Added.
2882
2883         * dom/StyledElement.cpp:
2884         (WebCore::StyledElement::styleAttributeChanged):
2885         (WebCore::StyledElement::inlineStyleChanged):
2886
2887         * inspector/InspectorInstrumentation.h:
2888         (WebCore::InspectorInstrumentation::willInvalidateStyleAttr): Added.
2889         (WebCore::InspectorInstrumentation::didInvalidateStyleAttr):
2890         * inspector/InspectorInstrumentation.cpp:
2891         (WebCore::InspectorInstrumentation::willInvalidateStyleAttrImpl): Added.
2892         (WebCore::InspectorInstrumentation::didInvalidateStyleAttrImpl):
2893
2894         * inspector/agents/InspectorDOMAgent.h:
2895         * inspector/agents/InspectorDOMAgent.cpp:
2896         (WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
2897
2898         * inspector/agents/InspectorDOMDebuggerAgent.h:
2899         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
2900         (WebCore::InspectorDOMDebuggerAgent::willInvalidateStyleAttr): Added.
2901         (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr): Deleted.
2902
2903 2019-04-15  Devin Rousso  <drousso@apple.com>
2904
2905         Web Inspector: Elements: event listener change events should only be fired for the selected node and it's ancestors
2906         https://bugs.webkit.org/show_bug.cgi?id=196887
2907         <rdar://problem/49870627>
2908
2909         Reviewed by Timothy Hatcher.
2910
2911         Test: inspector/dom/event-listener-add-remove.html
2912               inspector/dom/event-listener-inspected-node.html
2913
2914         * inspector/agents/InspectorDOMAgent.h:
2915         * inspector/agents/InspectorDOMAgent.cpp:
2916         (WebCore::InspectorDOMAgent::getEventListenersForNode):
2917         (WebCore::InspectorDOMAgent::setInspectedNode):
2918         (WebCore::InspectorDOMAgent::didAddEventListener):
2919         (WebCore::InspectorDOMAgent::willRemoveEventListener):
2920
2921 2019-04-15  Antoine Quint  <graouts@apple.com>
2922
2923         Ensure iOS layout traits are used for media controls in modern compatibility mode
2924         https://bugs.webkit.org/show_bug.cgi?id=196812
2925         <rdar://problem/47460637>
2926
2927         Unreviewed. Speculative fix for test regressions on open-source bots.
2928
2929         * Modules/modern-media-controls/media/media-controller.js:
2930         (MediaController.prototype.get layoutTraits):
2931
2932 2019-04-11  Antoine Quint  <graouts@apple.com>
2933
2934         Ensure iOS layout traits are used for media controls in modern compatibility mode
2935         https://bugs.webkit.org/show_bug.cgi?id=196812
2936         <rdar://problem/47460637>
2937
2938         Reviewed by Dean Jackson.
2939
2940         Test: media/modern-media-controls/media-controller/ios/media-controller-ios-layout-traits-modern-compatibility-mode.html
2941
2942         Instead of looking at the UA string, check whether we support touches which is the correct indicator of whether we should
2943         be using the iOS layout traits for media controls.
2944
2945         * Modules/modern-media-controls/media/media-controller.js:
2946         (MediaController.prototype.get layoutTraits):
2947
2948 2019-04-14  Rob Buis  <rbuis@igalia.com>
2949
2950         Link prefetch not useful for top-level navigation
2951         https://bugs.webkit.org/show_bug.cgi?id=195623
2952
2953         Reviewed by Youenn Fablet.
2954
2955         Cache cross-domain top-level prefetches in a dedicated cache and not in the
2956         memory cache. Ignore prefetches for content extension checks.
2957
2958         Tests: http/tests/cache/link-prefetch-main-resource-iframe.html
2959                http/tests/cache/link-prefetch-main-resource.html
2960
2961         * loader/LinkLoader.cpp:
2962         (WebCore::LinkLoader::prefetchIfNeeded):
2963         * loader/ResourceLoadInfo.cpp:
2964         (WebCore::toResourceType):
2965         * loader/ResourceLoadInfo.h:
2966         * loader/ResourceLoader.cpp:
2967         (WebCore::ResourceLoader::willSendRequestInternal):
2968         * loader/cache/CachedResourceLoader.cpp:
2969         (WebCore::CachedResourceLoader::requestResource):
2970
2971 2019-04-14  Dean Jackson  <dino@apple.com>
2972
2973         Extract UTI mapping and allow for additions
2974         https://bugs.webkit.org/show_bug.cgi?id=196822
2975         <rdar://problem/49822339>
2976
2977         Reviewed by Darin Adler
2978
2979         Post landing feedback on minimizing String constructors.
2980
2981         * platform/network/mac/UTIUtilities.mm:
2982         (WebCore::MIMETypeFromUTITree):
2983         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
2984
2985 2019-04-14  Don Olmstead  <don.olmstead@sony.com>
2986
2987         [CMake] JavaScriptCore derived sources should only be referenced inside JavaScriptCore
2988         https://bugs.webkit.org/show_bug.cgi?id=196742
2989
2990         Reviewed by Konstantin Tokarev.
2991
2992         Don't set JavaScriptCore_SCRIPTS_DIR now that it is set within WebKitFS.
2993
2994         * CMakeLists.txt:
2995
2996 2019-04-12  Antoine Quint  <graouts@apple.com>
2997
2998         Provide a quirk to disable Pointer Events
2999         https://bugs.webkit.org/show_bug.cgi?id=196877
3000         <rdar://problem/49863470>
3001
3002         Reviewed by Dean Jackson.
3003
3004         Add a quirk to disable Pointer Events. We also opt a website that has compatibility issues with Pointer Events into this new quirk.
3005
3006         * dom/PointerEvent.idl:
3007         * page/Quirks.cpp:
3008         (WebCore::Quirks::shouldDisablePointerEventsQuirk const):
3009         * page/Quirks.h:
3010         * page/scrolling/ScrollingCoordinator.cpp:
3011         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
3012         * style/StyleTreeResolver.cpp:
3013         (WebCore::Style::TreeResolver::resolveElement):
3014
3015 2019-04-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3016
3017         Enable modern compatibility mode by default in WKWebView on some devices
3018         https://bugs.webkit.org/show_bug.cgi?id=196883
3019         <rdar://problem/49864527>
3020
3021         Reviewed by Tim Horton.
3022
3023         Add a new helper function to determine whether an app is pre-installed on iOS, for the purposes of ensuring
3024         compatibility with existing Apple apps that are not affected by linked-on-or-after. This involves all apps with
3025         a bundle ID that begins with "com.apple.".
3026
3027         * platform/RuntimeApplicationChecks.h:
3028         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
3029         (WebCore::setApplicationBundleIdentifier):
3030         (WebCore::applicationBundleStartsWith):
3031         (WebCore::IOSApplication::isAppleApplication):
3032
3033 2019-04-12  Justin Fan  <justin_fan@apple.com>
3034
3035         [Web GPU] Prevent narrowing conversions during Metal function calls on 32-bit platforms
3036         https://bugs.webkit.org/show_bug.cgi?id=196793
3037
3038         Reviewed by Darin Adler.
3039
3040         On 32-bit platforms, NSUInteger is 32-bit, which limits certain Web GPU parameters. 
3041         Ensure that valid parameters are properly converted to NSUInteger for Metal calls, regardless of platform.
3042
3043         * platform/graphics/gpu/GPUBuffer.h:
3044         (WebCore::GPUBuffer::byteLength const):
3045         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
3046         (WebCore::tryGetResourceAsBufferBinding):
3047         (WebCore::setBufferOnEncoder):
3048         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
3049         (WebCore::GPUBuffer::validateBufferUsage):
3050         (WebCore::GPUBuffer::tryCreate):
3051         (WebCore::GPUBuffer::GPUBuffer):
3052         (WebCore::GPUBuffer::setSubData):
3053         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
3054         (WebCore::GPUCommandBuffer::copyBufferToBuffer):
3055         (WebCore::GPUCommandBuffer::copyBufferToTexture):
3056         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
3057         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3058         (WebCore::GPURenderPassEncoder::drawIndexed):
3059         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3060         (WebCore::trySetInputStateForPipelineDescriptor):
3061
3062 2019-04-12  Ross Kirsling  <ross.kirsling@sony.com>
3063
3064         Unreviewed fix for non-unified build.
3065
3066         * dom/ScriptedAnimationController.h:
3067         Add missing include from r244182.
3068
3069 2019-04-11  Ryosuke Niwa  <rniwa@webkit.org>
3070
3071         WebThread should run at a higher priority than user initiated
3072         https://bugs.webkit.org/show_bug.cgi?id=196849
3073         <rdar://problem/46851062>
3074
3075         Reviewed by Geoffrey Garen.
3076
3077         Use QOS_CLASS_USER_INTERACTIVE on WebThread with -10 relative priority so that WebThread
3078         won't wait for other threads with priority 30-37 but does not content with the main thread.
3079
3080         Also removed the call to pthread_attr_setschedparam which disables QoS.
3081
3082         This improves the blocked time in StartWebThread from 2~3ms to 250μs while cold launching
3083         iBooks to an opened book.
3084
3085         * platform/ios/wak/WebCoreThread.mm:
3086         (StartWebThread): Replaced 200 * 4096 by 800 * KB for a better readability.
3087
3088 2019-04-12  Ryosuke Niwa  <rniwa@webkit.org>
3089
3090         Add CSS Shadow Parts as a feature under consideration
3091         https://bugs.webkit.org/show_bug.cgi?id=196835
3092
3093         Reviewed by Antti Koivisto.
3094
3095         This feature is under consideration.
3096
3097         * features.json:
3098
3099 2019-04-12  Ross Kirsling  <ross.kirsling@sony.com>
3100
3101         WebKit should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
3102         https://bugs.webkit.org/show_bug.cgi?id=196845
3103
3104         Reviewed by Ryosuke Niwa.
3105
3106         * html/canvas/CanvasRenderingContext2DBase.cpp:
3107         (WebCore::CanvasRenderingContext2DBase::FontProxy::initialize):
3108         (WebCore::CanvasRenderingContext2DBase::FontProxy::fontMetrics const):
3109         (WebCore::CanvasRenderingContext2DBase::FontProxy::fontDescription const):
3110         (WebCore::CanvasRenderingContext2DBase::FontProxy::width const):
3111         (WebCore::CanvasRenderingContext2DBase::FontProxy::drawBidiText const):
3112         (WebCore::CanvasRenderingContext2DBase::beginCompositeLayer):
3113         (WebCore::CanvasRenderingContext2DBase::endCompositeLayer):
3114         Remove inline specifier to address linking errors (regardless of CMake platform).
3115         Doing this in a .cpp file interferes with symbol creation.
3116
3117         * Modules/mediastream/MediaStreamTrack.cpp:
3118         * Modules/webvr/VREyeParameters.cpp:
3119         * Modules/webvr/VRFrameData.cpp:
3120         * Modules/webvr/VRPose.cpp:
3121         * accessibility/AccessibilityList.cpp:
3122         * accessibility/isolatedtree/AXIsolatedTree.cpp:
3123         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
3124         * bindings/js/JSDOMConvertWebGL.cpp:
3125         * bindings/js/JSHistoryCustom.cpp:
3126         * bindings/js/JSIDBCursorWithValueCustom.cpp:
3127         * bindings/js/JSPerformanceObserverCustom.cpp:
3128         * bindings/js/WindowProxy.cpp:
3129         * platform/ColorData.gperf:
3130         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
3131         * platform/network/DNSResolveQueue.cpp:
3132         * workers/service/ServiceWorkerClientQueryOptions.h:
3133         * workers/service/ServiceWorkerContainer.cpp:
3134         Add missing includes to address compiler errors on GTK.
3135
3136 2019-04-12  Zalan Bujtas  <zalan@apple.com>
3137
3138         REGRESSION (r244098): [ Mac WK1 ] Layout Test fast/dynamic/paused-event-dispatch.html is Timing out
3139         https://bugs.webkit.org/show_bug.cgi?id=196789
3140         <rdar://problem/49855255>
3141
3142         Reviewed by Tim Horton.
3143
3144         Disable auto-sizing mode at the start of each test.
3145
3146         * testing/Internals.cpp:
3147         (WebCore::Internals::resetToConsistentState):
3148
3149 2019-04-12  Eric Carlson  <eric.carlson@apple.com>
3150
3151         Update AudioSession route sharing policy
3152         https://bugs.webkit.org/show_bug.cgi?id=196776
3153         <rdar://problem/46501611>
3154
3155         Reviewed by Jer Noble.
3156
3157         No new tests, updated an API test.
3158
3159         * platform/audio/AudioSession.cpp:
3160         (WebCore::convertEnumerationToString):
3161         * platform/audio/AudioSession.h:
3162         (WTF::LogArgument<WebCore::RouteSharingPolicy>::toString):
3163         (WTF::LogArgument<WebCore::AudioSession::CategoryType>::toString):
3164         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
3165         (MediaSessionManagerCocoa::updateSessionState):
3166         * platform/audio/ios/AudioSessionIOS.mm:
3167         (WebCore::AudioSession::setCategory):
3168         (WebCore::AudioSession::routeSharingPolicy const):
3169         * platform/audio/mac/AudioSessionMac.cpp:
3170         (WebCore::AudioSession::setCategory):
3171
3172 2019-04-12  Antoine Quint  <graouts@apple.com>
3173
3174         Opt some websites into the simulated mouse events dispatch quirk when in modern compatibility mode
3175         https://bugs.webkit.org/show_bug.cgi?id=196830
3176         <rdar://problem/49124313>
3177
3178         Reviewed by Wenson Hsieh.
3179
3180         We add a new policy to determine whether simulated mouse events dispatch are allowed and use it to determine whether the
3181         simulated mouse events dispatch quirk can be used for a given website. We then check the domain name for the current page's
3182         document to see if it matches some known websites that require this quirk.
3183
3184         We needed to add some calls into Quirks::shouldDispatchSimulateMouseEvents() where we used to only consult the RuntimeEnabledFeature
3185         flag to ensure we correctly created touch regions for simulated mouse events.
3186
3187         * dom/EventNames.h:
3188         (WebCore::EventNames::isTouchRelatedEventType const):
3189         * dom/Node.cpp:
3190         (WebCore::Node::moveNodeToNewDocument):
3191         (WebCore::tryAddEventListener):
3192         (WebCore::tryRemoveEventListener):
3193         (WebCore::Node::defaultEventHandler):
3194         * loader/DocumentLoader.h:
3195         (WebCore::DocumentLoader::simulatedMouseEventsDispatchPolicy const):
3196         (WebCore::DocumentLoader::setSimulatedMouseEventsDispatchPolicy):
3197         * page/DOMWindow.cpp:
3198         (WebCore::DOMWindow::addEventListener):
3199         (WebCore::DOMWindow::removeEventListener):
3200         * page/Quirks.cpp:
3201         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
3202         (WebCore::Quirks::shouldDispatchSimulateMouseEvents const): Deleted.
3203         * page/Quirks.h:
3204
3205 2019-04-11  Simon Fraser  <simon.fraser@apple.com>
3206
3207         [iOS WK2] Wrong scrolling behavior for nested absolute position elements inside overflow scroll
3208         https://bugs.webkit.org/show_bug.cgi?id=196146
3209
3210         Reviewed by Antti Koivisto.
3211         
3212         computeCoordinatedPositioningForLayer() failed to handle nested positions elements
3213         inside overflow scroll, because it only walked up to the first containing block of
3214         a nested position:absolute. We need to walk all the way up the ancestor layer chain,
3215         looking at containing block, scroller and composited ancestor relationships.
3216
3217         Make this code easier to understand by writing it in terms of "is foo scrolled by bar", rather than
3218         trying to collapse all the logic into a single ancestor walk, which was really hard. This is a few
3219         more ancestor traversals, but we now only run this code if there's composited scrolling
3220         in the ancestor chain.
3221
3222         Tests: scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html
3223                scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow.html
3224                scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html
3225                scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html
3226
3227         * rendering/RenderLayerCompositor.cpp:
3228         (WebCore::enclosingCompositedScrollingLayer):
3229         (WebCore::isScrolledByOverflowScrollLayer):
3230         (WebCore::isNonScrolledLayerInsideScrolledCompositedAncestor):
3231         (WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
3232         (WebCore::collectStationaryLayerRelatedOverflowNodes):
3233         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
3234         (WebCore::collectRelatedCoordinatedScrollingNodes):
3235         (WebCore::layerParentedAcrossCoordinatedScrollingBoundary): Deleted.
3236
3237 2019-04-12  Manuel Rego Casasnovas  <rego@igalia.com>
3238
3239         [css-flex][css-grid] Fix synthesized baseline
3240         https://bugs.webkit.org/show_bug.cgi?id=196312
3241
3242         Reviewed by Javier Fernandez.
3243
3244         When a flex or grid container has no baseline,
3245         its baseline should be synthesized from the border edges.
3246         The same happens for flex and grid items.
3247         
3248         Right now we were using the content box in some cases
3249         and even using the margin box in a particular scenario.
3250         The patch fixes this.
3251         
3252         At the same time this is also fixing the baseline for
3253         inline flex/grid containers to make it interoperable with Firefox.
3254         Inline blocks have a special behavior per legacy reasons,
3255         which applies to inline flex/grid containers when they have no items;
3256         otherwise the items should be used to compute its baseline.
3257         See more at: https://github.com/w3c/csswg-drafts/issues/3416
3258
3259         Note that we need to keep current behavior for buttons,
3260         as the flexbox spec doesn't apply to them.
3261
3262         Tests: css3/flexbox/flexbox-baseline-margins.html
3263                fast/css-grid-layout/grid-baseline-margins-1.html
3264                fast/css-grid-layout/grid-baseline-margins-2.html
3265                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-flexbox-001.html
3266                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-grid-001.html
3267                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-inline-block-001.html
3268
3269         * rendering/RenderButton.cpp:
3270         (WebCore::synthesizedBaselineFromContentBox):
3271         (WebCore::RenderButton::baselinePosition const):
3272         * rendering/RenderButton.h:
3273         * rendering/RenderFlexibleBox.cpp:
3274         (WebCore::synthesizedBaselineFromBorderBox):
3275         (WebCore::RenderFlexibleBox::baselinePosition const):
3276         (WebCore::RenderFlexibleBox::firstLineBaseline const):
3277         (WebCore::RenderFlexibleBox::inlineBlockBaseline const):
3278         * rendering/RenderGrid.cpp:
3279         (WebCore::RenderGrid::baselinePosition const):
3280         (WebCore::RenderGrid::inlineBlockBaseline const):
3281
3282 2019-04-11  Simon Fraser  <simon.fraser@apple.com>
3283
3284         Avoid doing positioned scrolling tree node work for layers not inside overflow:scroll
3285         https://bugs.webkit.org/show_bug.cgi?id=196848
3286
3287         Reviewed by Zalan Bujtas.
3288
3289         Maintain a bit on RenderLayer which says if a layer has a composited scrolling ancestor
3290         in the layer tree. We only need to do work related to making positioned scrolling tree nodes
3291         for layers which are layer tree descendants of overflow:scroll.
3292
3293         * rendering/RenderLayer.cpp:
3294         (WebCore::RenderLayer::RenderLayer):
3295         (WebCore::RenderLayer::updateLayerPositions):
3296         (WebCore::outputPaintOrderTreeLegend):
3297         (WebCore::outputPaintOrderTreeRecursive):
3298         * rendering/RenderLayer.h:
3299         * rendering/RenderLayerCompositor.cpp:
3300         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
3301         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
3302         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
3303         (WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
3304         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
3305
3306 2019-04-11  Zalan Bujtas  <zalan@apple.com>
3307
3308         Try to fix Windows build.
3309
3310         * page/PrintContext.cpp:
3311         (WebCore::PrintContext::computedPageMargin):
3312
3313 2019-04-11  Megan Gardner  <megan_gardner@apple.com>
3314
3315         Update 'Save Image' to more clear instructions
3316         https://bugs.webkit.org/show_bug.cgi?id=196833
3317         <rdar://problem/47446845>
3318
3319         Reviewed by Wenson Hsieh.
3320
3321         Not testable, UI change only.
3322
3323         * en.lproj/Localizable.strings:
3324
3325 2019-04-11  Zalan Bujtas  <zalan@apple.com>
3326
3327         Add @page margin support
3328         https://bugs.webkit.org/show_bug.cgi?id=196680
3329         <rdar://problem/45217707>
3330
3331         Reviewed by Tim Horton.
3332
3333         This patch adds support for @page margin. This feature is currently behind a runtime flag and is off by default.
3334         We resolve the @page margin values in the WebProcess (currently no pseudo class is supported) and transfer them to the UIProcess through computedPagesCallback.
3335         UIProcess is responsible for applying these new values on the printer. We also re-compute the available width/height for the current printing context
3336         in the WebProcess if needed (see PrintInfo for current printer margins).
3337
3338         Tests: printing/page-with-10mm-left-margin.html
3339                printing/page-with-zero-margin.html
3340
3341         * page/PrintContext.cpp:
3342         (WebCore::PrintContext::computedPageMargin):
3343         (WebCore::PrintContext::computedPageSize):
3344         * page/PrintContext.h:
3345         * page/RuntimeEnabledFeatures.h:
3346         (WebCore::RuntimeEnabledFeatures::pageAtRuleSupportEnabled const):
3347         (WebCore::RuntimeEnabledFeatures::setPageAtRuleSupportEnabled):
3348
3349 2019-04-11  Dean Jackson  <dino@apple.com>
3350
3351         Extract UTI mapping and allow for additions
3352         https://bugs.webkit.org/show_bug.cgi?id=196822
3353         <rdar://problem/49822339>
3354
3355         Reviewed by Tim Horton.
3356
3357         Add an ADDITIONAL_SYSTEM_PREVIEW_TYPES macro to the list
3358         of accepted MIME types. And add a new helper to map
3359         MIME types to UTI types when the system was unable to
3360         find an existing type.
3361
3362         * platform/MIMETypeRegistry.cpp:
3363         (WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
3364         * platform/network/mac/UTIUtilities.mm:
3365         (WebCore::UTIFromUnknownMIMEType):
3366         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
3367
3368 2019-04-09  Ryosuke Niwa  <rniwa@webkit.org>
3369
3370         [iOS] Moving backwards by word granularity does not work if the previous line was inside another block element
3371         https://bugs.webkit.org/show_bug.cgi?id=196670
3372
3373         Reviewed by Wenson Hsieh.
3374
3375         The bug was ultimately caused by two reasons:
3376          1. On iOS, previousWordPositionBoundary would identify a blank line as a word boundary.
3377          2. SimplifiedBackwardsTextIterator generates a new line character (\n) between two block elements.
3378
3379         When moving backwards by word granularity, therefore, previousBoundary would encounter a new line created by (2)
3380         and then previousWordPositionBoundary would identify it as a word boundary.
3381
3382         Fixed the bug (2) by adding the same check as TextIterator::exitNode has to avoid generating an extra new line
3383         character following an exiting new line character. Also added internals.rangeAsTextUsingBackwardsTextIterator
3384         to make SimplifiedBackwardsTextIterator directly testable in layout tests.
3385
3386         This fix unveiled an unrelated bug when moving backwards with sentence granularity at the beginning of a line.
3387         In this case, WebKit was previously feeding ICU with the previous line's content followed by two new lines,
3388         which constituted a new sentence. However after the fix, ICU no longer detects a new sentence after the end
3389         of the prevous line. This patch, therefore, introduces a new optional argument to previousBoundary which forces
3390         the succeeding paragraph's content (i.e. the content of the line from which we're moving backwards with sentence
3391         granularity) to be fed to ICU. This fixes the bug that we were previously not being able to move backwards
3392         with sentence granularity at the beginning of a line as indicated by the new tests.
3393
3394         Tests: editing/selection/extend-selection-backward-at-beginning-of-line-by-sentence-granularity.html
3395                editing/selection/extend-selection-backward-at-beginning-of-line-by-word-granularity.html
3396                editing/selection/move-selection-backward-at-beginning-of-line-by-sentence-granularity.html
3397                editing/selection/move-selection-backward-at-beginning-of-line-by-word-granularity.html
3398                editing/text-iterator/backwards-text-iterator-basic.html
3399
3400         * accessibility/AXObjectCache.cpp:
3401         (WebCore::AXObjectCache::previousBoundary): Fixed the bug that moving backwards with sentence granularity at
3402         the beginning of a line does not work like we did in VisibleUnits. See the description below. It's tested by
3403         an existing layout test accessibility/mac/text-marker-sentence-nav.html, which would fail without this fix.
3404         (WebCore::AXObjectCache::startCharacterOffsetOfSentence):
3405         * accessibility/AXObjectCache.h:
3406         (WebCore::CharacterOffset::isEqual const):
3407         * editing/TextIterator.cpp:
3408         (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode): Fixed the bug that we were generating two line
3409         lines between block elements. This fixes the bug that moving backwards with word granularity at the beginning
3410         of a line fails on iOS.
3411         (WebCore::plainTextUsingBackwardsTextIteratorForTesting): Added.
3412         * editing/TextIterator.h:
3413         * editing/VisibleUnits.cpp:
3414         (WebCore::previousBoundary): Added the code to extract the succeeding paragraph's content as context for ICU.
3415         This fixes the bug that moving backwards with sentence granularity at the beginning of a line fails.
3416         Limit the length of backwards iteration at the current position to avoid traversing backwards beyond
3417         the current position, and fixed a bug that an early return for the text node was not taking the suffix length
3418         into account when deciding whether next position resides in the starting container node or not.
3419         (WebCore::startSentenceBoundary):
3420         (WebCore::startOfSentence):
3421         * testing/Internals.cpp: