49a758bf29287bd61ff6d01f8406b0e7abbe2058
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-03-11  Antoine Quint  <graouts@webkit.org>
2
3         [Mac wk2 Release] imported/w3c/web-platform-tests/web-animations/timing-model/animations/updating-the-finished-state.html flaky fail
4         https://bugs.webkit.org/show_bug.cgi?id=206746
5         <rdar://problem/58867580>
6
7         Reviewed by Dean Jackson.
8
9         Because we could end up in situation where localTime was very marginally smaller than endTime inside of WebAnimation::play(), we would end up
10         with an unresolved hold time and we would return before calling WebAnimation::timingDidChange() and thus scheduling an animation update from
11         the timeline because we'd assume it was paused. As a result, the animation would never end and the test would wait for a "finish" event which
12         would never come.
13
14         We now account for an epsilon value when comparing times to account for such situations.
15
16         * animation/WebAnimation.cpp:
17         (WebCore::WebAnimation::play):
18
19 2020-03-11  Chris Dumez  <cdumez@apple.com>
20
21         Defer async scripts until DOMContentLoaded or first paint, whichever comes first
22         https://bugs.webkit.org/show_bug.cgi?id=208896
23
24         Reviewed by Darin Adler.
25
26         Defer async scripts until DOMContentLoaded or first paint, whichever comes first. In
27         Bug 207698, we deferred them until DOMContentLoaded, as a first-paint optimization.
28         However, this seems overly aggressive on pages like wikipedia and it is sufficient
29         to defer those scripts until first-paint to get the performance win.
30
31         * dom/Document.cpp:
32         (WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const):
33         * page/Settings.yaml:
34
35 2020-03-11  Jack Lee  <shihchieh_lee@apple.com>
36
37         Consolidate detachment of document timeline into Document::commonTeardown.
38         https://bugs.webkit.org/show_bug.cgi?id=208786
39         <rdar://problem/59936716>
40
41         Reviewed by Ryosuke Niwa.
42
43         Move detachment of DocumentTimeline to Document::commonTeardown(). 
44
45         No new tests. Covered by existing document tests.
46
47         * dom/Document.cpp:
48         (WebCore::Document::removedLastRef):
49         (WebCore::Document::commonTeardown):
50         (WebCore::Document::prepareForDestruction):
51
52 2020-03-11  Commit Queue  <commit-queue@webkit.org>
53
54         Unreviewed, reverting r258263.
55         https://bugs.webkit.org/show_bug.cgi?id=208922
56
57         it is breaking internal builds (Requested by youenn on
58         #webkit).
59
60         Reverted changeset:
61
62         "Move AudioSession interruption listener code to AudioSession"
63         https://bugs.webkit.org/show_bug.cgi?id=208714
64         https://trac.webkit.org/changeset/258263
65
66 2020-03-11  youenn fablet  <youenn@apple.com>
67
68         Move AudioSession interruption listener code to AudioSession
69         https://bugs.webkit.org/show_bug.cgi?id=208714
70
71         Reviewed by Jer Noble.
72
73         Move AudioSession interruption detection code from MediaSessionManagerIOS helper to AudioSessionIOS.
74         Add interruption observer capabilities to AudioSession and make MediaSessionManagerIOS an observer of it.
75         Manually tested.
76
77         * platform/audio/AudioSession.cpp:
78         (WebCore::AudioSession::addInterruptionObserver):
79         (WebCore::AudioSession::removeInterruptionObserver):
80         (WebCore::AudioSession::beginInterruption):
81         (WebCore::AudioSession::endInterruption):
82         * platform/audio/AudioSession.h:
83         * platform/audio/ios/AudioSessionIOS.mm:
84         (-[WebInterruptionObserverHelper initWithCallback:]):
85         (-[WebInterruptionObserverHelper dealloc]):
86         (-[WebInterruptionObserverHelper clearCallback]):
87         (-[WebInterruptionObserverHelper interruption:]):
88         (WebCore::AudioSessionPrivate::AudioSessionPrivate):
89         (WebCore::AudioSessionPrivate::~AudioSessionPrivate):
90         (WebCore::AudioSession::addInterruptionObserver):
91         (WebCore::AudioSession::removeInterruptionObserver):
92         (WebCore::AudioSession::beginInterruption):
93         (WebCore::AudioSession::endInterruption):
94         * platform/audio/ios/MediaSessionHelperIOS.h:
95         * platform/audio/ios/MediaSessionHelperIOS.mm:
96         (-[WebMediaSessionHelper initWithCallback:]):
97         * platform/audio/ios/MediaSessionManagerIOS.h:
98         * platform/audio/ios/MediaSessionManagerIOS.mm:
99         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
100         (WebCore::MediaSessionManageriOS::~MediaSessionManageriOS):
101         (WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary):
102
103 2020-03-11  Jack Lee  <shihchieh_lee@apple.com>
104
105         Crash in KeyframeEffect::getAnimatedStyle
106         https://bugs.webkit.org/show_bug.cgi?id=208318
107         <rdar://problem/59848234>
108
109         Reviewed by Antoine Quint.
110
111         Quit getAnimatedStyle if element is rendererless.
112
113         Test: fast/animation/keyframe-rendererless-element-crash.html
114
115         * animation/KeyframeEffect.cpp:
116         (WebCore::KeyframeEffect::getAnimatedStyle):
117
118 2020-03-11  Youenn Fablet  <youenn@apple.com>
119
120         [iOS] Unskip fast/mediastream tests
121         https://bugs.webkit.org/show_bug.cgi?id=208636
122
123         Reviewed by Eric Carlson.
124
125         Add label to the settings so that we correctly send this information back to WebProcess.
126         Covered by existing tests.
127
128         * platform/mediastream/mac/AVVideoCaptureSource.mm:
129         (WebCore::AVVideoCaptureSource::settings):
130         * platform/mock/MockRealtimeAudioSource.cpp:
131         (WebCore::MockRealtimeAudioSource::settings):
132         * platform/mock/MockRealtimeVideoSource.cpp:
133         (WebCore::MockRealtimeVideoSource::settings):
134
135 2020-03-10  Tomoki Imai  <Tomoki.Imai@sony.com>
136
137         [OpenSSL] Implement WebCrypto APIs for AES-CTR and AES-KW
138         https://bugs.webkit.org/show_bug.cgi?id=208186
139
140         Reviewed by Fujii Hironori.
141
142         Added WebCrypto implementations for the following algorithms with OpenSSL.
143         - AES-CTR
144         - AES-KW
145
146         Enabled WebCrypto LayoutTests for AES-CTR and AES-KW.
147
148         * crypto/openssl/CryptoAlgorithmAES_CTROpenSSL.cpp:
149         (WebCore::aesAlgorithm): Added. Helper function to select which AES-CTR algorithm to be used by checking key size.
150         (WebCore::crypt): Added. Helper function shared by platformEncrypt/platformDecrypt.
151         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt): Implemented.
152         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt): Implemented.
153         * crypto/openssl/CryptoAlgorithmAES_KWOpenSSL.cpp:
154         (WebCore::aesAlgorithm): Added. Helper function to select which AES-KW algorithm to be used by checking key size.
155         (WebCore::cryptWrapKey):  Added. Helper function for platformWrapKey.
156         (WebCore::cryptUnwrapKey): Added. Helper function for platformUnwrapKey.
157         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey): Implemented.
158         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey): Implemented.
159         * crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp:
160         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Registered CryptoAlgorithmAES_CTR and CryptoAlgorithmAES_KW.
161
162 2020-03-10  Don Olmstead  <don.olmstead@sony.com>
163
164         [GPU Process] Work towards compiling out on non-Cocoa ports
165         https://bugs.webkit.org/show_bug.cgi?id=208899
166
167         Reviewed by Darin Adler.
168
169         Add in additional headers required for GPU Process build.
170
171         * Headers.cmake:
172
173 2020-03-08  Darin Adler  <darin@apple.com>
174
175         Make TextIterator::range return a SimpleRange
176         https://bugs.webkit.org/show_bug.cgi?id=208797
177
178         Reviewed by Don Olmstead.
179
180         * accessibility/AXObjectCache.cpp:
181         (WebCore::AXObjectCache::traverseToOffsetInRange): Updated since
182         TextIterator::range returns a SimpleRange. Also use TextIterator::node where
183         appropriate instead of repeating the code for it here.
184         (WebCore::AXObjectCache::lengthForRange): Use TextIterator::node.
185
186         * accessibility/AccessibilityObject.cpp:
187         (WebCore::AccessibilityObject::stringForRange const): Use TextIterator::node.
188         (WebCore::AccessibilityObject::stringForVisiblePositionRange): Ditto.
189         (WebCore::AccessibilityObject::lengthForVisiblePositionRange const): Ditto.
190
191         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
192         (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
193         Use TextIterator::node and createLiveRange.
194
195         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Added include
196         of SimpleRange and removed "using namespace HTMLNames".
197         (AXAttributeStringSetStyle): Use HTMLNames namespace explicitly.
198         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
199         Use TextIterator::node.
200         (-[WebAccessibilityObjectWrapper subrole]): Use HTMLNames namespace explicitly.
201
202         * dom/DocumentMarkerController.cpp:
203         (WebCore::DocumentMarkerController::collectTextRanges): Use createLiveRange
204         here since we don't want to convert move the class to SimpleRange at this time.
205
206         * dom/Position.cpp: Added include of Range.h.
207
208         * dom/RangeBoundaryPoint.h: Removed a bogus "const" on the return value of
209         RangeBoundaryPoint::toPosition.
210
211         * editing/TextIterator.cpp:
212         (WebCore::BitStack::BitStack): Deleted.
213         (WebCore::BitStack::size const): Deleted.
214         (WebCore::TextIterator::range const): Return a SimpleRange.
215         (WebCore::TextIterator::node const): Updated for the above.
216         (WebCore::CharacterIterator::range const): Use SimpleRange right up until the
217         return statement, where we do createLiveRange. Will come back and remove that soon.
218         (WebCore::TextIterator::rangeFromLocationAndLength): Use createLiveRange in
219         one place, SimpleRange in another.
220
221         * editing/TextIterator.h: Removed include of "Range.h" since we can just use
222         a forward declaration instead. Removed unneeded forward declarations. Simplified
223         the BitStack and TextIteratorCopyableText classes by initializing data members
224         and removing explicit definitions of the constructors and destructors. Took out
225         a stray "explicit" that wasn't needed. Changed the return value of
226         TextIterator::range to SimpleRange.
227
228         * editing/TextManipulationController.cpp:
229         (WebCore::ParagraphContentIterator::ParagraphContentIterator): Call
230         createLiveRange.
231         (WebCore::ParagraphContentIterator::advance): Ditto.
232         (WebCore::ParagraphContentIterator::startPosition): Ditto.
233         (WebCore::ParagraphContentIterator::endPosition): Ditto.
234
235         * editing/cocoa/DataDetection.mm:
236         (WebCore::DataDetection::detectContentInRange): Use createLiveRange.
237
238         * editing/cocoa/HTMLConverter.mm:
239         (WebCore::editingAttributedStringFromRange): Use SimpleRange instead
240         of a live range.
241
242 2020-03-10  Simon Fraser  <simon.fraser@apple.com>
243
244         Track "scrolling scope" on RenderLayers
245         https://bugs.webkit.org/show_bug.cgi?id=208620
246
247         Reviewed by Zalan Bujtas.
248         
249         The scrolling scope code added in r257920 failed to recompute m_contentsScrollingScope
250         when hasCompositedScrollableOverflow() changed, causing bugs on gmail.
251
252         Recompute the m_contentsScrollingScope to match or not match the m_boxScrollingScope
253         based on whether the layer is composited-scrollable.
254
255         Test: fast/scrolling/mac/absolute-in-overflow-scroll-dynamic.html
256
257         * rendering/RenderLayer.cpp:
258         (WebCore::RenderLayer::updateLayerPosition):
259         * rendering/RenderLayerCompositor.cpp:
260         (WebCore::isScrolledByOverflowScrollLayer):
261
262 2020-03-10  Don Olmstead  <don.olmstead@sony.com>
263
264         Non-unified build fixes early March 2020 edition
265         https://bugs.webkit.org/show_bug.cgi?id=208897
266
267         Unreviewed build fix.
268
269         * Modules/mediacontrols/MediaControlsHost.h:
270         * dom/BoundaryPoint.h:
271         * dom/StaticRange.cpp:
272         * editing/FrameSelection.cpp:
273         * loader/cache/CachedResourceRequest.cpp:
274         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
275
276 2020-03-10  Jack Lee  <shihchieh_lee@apple.com>
277
278         Nullptr crash in CompositeEditCommand::moveParagraphWithClones when indenting non-enclosed elements.
279         https://bugs.webkit.org/show_bug.cgi?id=208628
280         <rdar://problem/52011509>
281
282         Reviewed by Ryosuke Niwa.
283
284         When indenting a non-enclosed paragraph, quit if start of contents is not a descendant or sibling of outer block.
285
286         Test: fast/editing/indent-non-enclosed-element-crash.html
287
288         * editing/IndentOutdentCommand.cpp:
289         (WebCore::IndentOutdentCommand::indentIntoBlockquote):
290
291 2020-03-10  Stephan Szabo  <stephan.szabo@sony.com>
292
293         [PlayStation] incomplete type 'WebCore::ScrollingStateFrameScrollingNode' named in nested name specifier
294         https://bugs.webkit.org/show_bug.cgi?id=208882
295
296         Reviewed by Simon Fraser.
297
298         No new tests, build fix.
299
300         * page/scrolling/ScrollingTreeScrollingNode.cpp:
301           Add include of ScrollingStateFrameScrollingNode
302           when ENABLE(SCROLLING_THREAD) is true.
303
304 2020-03-10  Alex Christensen  <achristensen@webkit.org>
305
306         Build fix.
307
308         * platform/audio/ios/MediaSessionHelperIOS.mm:
309         (MediaSessionHelperiOS::providePresentingApplicationPID):
310         Fix an unused parameter warning.
311
312 2020-03-10  Simon Fraser  <simon.fraser@apple.com>
313
314         REGRESSION (r257920): inbox flickers and disappears when scrolling gmail
315         https://bugs.webkit.org/show_bug.cgi?id=208883
316         rdar://problem/60287447
317
318         Partially revert r257920 since it caused gmail scrolling flickers.
319
320         * rendering/RenderLayerCompositor.cpp:
321         (WebCore::isScrolledByOverflowScrollLayer):
322
323 2020-03-10  Dean Jackson  <dino@apple.com>
324
325         Set important EGL context attributes
326         https://bugs.webkit.org/show_bug.cgi?id=208724
327         <rdar://problem/60168306>
328
329         Temporarily revert r258025 while investigating a crash.
330
331         * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
332         (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
333
334 2020-03-10  youenn fablet  <youenn@apple.com>
335
336         Make sure that ServiceWorkerFrameLoaderClient lifetime exceeds its frame lifetime
337         https://bugs.webkit.org/show_bug.cgi?id=208855
338         <rdar://problem/60187332>
339
340         Reviewed by Geoffrey Garen.
341
342         Add lifetime management of the loader client to SWContextManager instead of its connection, which has a shorter lifetime.
343         No JS observable change of behavior.
344
345         * workers/service/context/SWContextManager.cpp:
346         (WebCore::SWContextManager::addServiceWorkerFrameLoaderClient):
347         (WebCore::SWContextManager::removeServiceWorkerFrameLoaderClient):
348         * workers/service/context/SWContextManager.h:
349
350 2020-03-10  Jer Noble  <jer.noble@apple.com>
351
352         Add logging for Modern EME methods.
353         https://bugs.webkit.org/show_bug.cgi?id=205519
354
355         Reviewed by Eric Carlson.
356
357         * Modules/encryptedmedia/MediaKeySession.cpp:
358         (WebCore::MediaKeySession::create):
359         (WebCore::MediaKeySession::MediaKeySession):
360         (WebCore::MediaKeySession::generateRequest):
361         (WebCore::MediaKeySession::load):
362         (WebCore::MediaKeySession::update):
363         (WebCore::MediaKeySession::close):
364         (WebCore::MediaKeySession::remove):
365         (WebCore::MediaKeySession::sessionClosed):
366         (WebCore::MediaKeySession::logChannel const):
367         * Modules/encryptedmedia/MediaKeySession.h:
368         * Modules/encryptedmedia/MediaKeys.cpp:
369         (WebCore::MediaKeys::createSession):
370         (WebCore::MediaKeys::setServerCertificate):
371         * Modules/encryptedmedia/MediaKeys.h:
372         * Modules/encryptedmedia/MediaKeys.idl:
373         * Modules/encryptedmedia/NavigatorEME.cpp:
374         (WTF::LogArgument<Vector<T>>::toString):
375         (WTF::LogArgument<Optional<T>>::toString):
376         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
377         (WebCore::tryNextSupportedConfiguration):
378         * Sources.txt:
379         * WebCore.xcodeproj/project.pbxproj:
380         * platform/encryptedmedia/CDMLogging.cpp: Added.
381         (WebCore::toJSONObject):
382         (WebCore::toJSONString):
383         (WTF::LogArgument<WebCore::CDMKeySystemConfiguration>::toString):
384         (WTF::LogArgument<WebCore::CDMMediaCapability>::toString):
385         (WTF::LogArgument<WebCore::CDMRestrictions>::toString):
386         (WTF::LogArgument<WebCore::CDMEncryptionScheme>::toString):
387         (WTF::LogArgument<WebCore::CDMKeyStatus>::toString):
388         (WTF::LogArgument<WebCore::CDMMessageType>::toString):
389         (WTF::LogArgument<WebCore::CDMRequirement>::toString):
390         (WTF::LogArgument<WebCore::CDMSessionType>::toString):
391         * platform/encryptedmedia/CDMLogging.h: Added.
392         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
393
394 2020-03-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
395
396         Remove the special DisplayList handling in CanvasRenderingContext2DBase
397         https://bugs.webkit.org/show_bug.cgi?id=208828
398
399         Reviewed by Myles C. Maxfield.
400
401         Remove DisplayListDrawingContext and use DisplayList::DrawingContext
402         instead. Remove 'tracksDisplayListReplay' since it is always 'false'.
403         Remove contextDisplayListMap() since items are added to it only if
404         'tracksDisplayListReplay' is true which never happens.
405
406         * html/CustomPaintCanvas.cpp:
407         (WebCore::CustomPaintCanvas::getContext):
408         * html/canvas/CanvasRenderingContext2DBase.cpp:
409         (WebCore::CanvasRenderingContext2DBase::~CanvasRenderingContext2DBase):
410         (WebCore::CanvasRenderingContext2DBase::paintRenderingResultsToCanvas):
411         (WebCore::CanvasRenderingContext2DBase::drawingContext const):
412         (WebCore::DisplayListDrawingContext::DisplayListDrawingContext): Deleted.
413         (WebCore::contextDisplayListMap): Deleted.
414         (WebCore::CanvasRenderingContext2DBase::setTracksDisplayListReplay): Deleted.
415         (WebCore::CanvasRenderingContext2DBase::displayListAsText const): Deleted.
416         (WebCore::CanvasRenderingContext2DBase::replayDisplayListAsText const): Deleted.
417         * html/canvas/CanvasRenderingContext2DBase.h:
418         (WebCore::CanvasRenderingContext2DBase::tracksDisplayListReplay const): Deleted.
419         * platform/graphics/displaylists/DisplayListDrawingContext.h:
420
421 2020-03-10  Jer Noble  <jer.noble@apple.com>
422
423         [MSE] Use CMSampleBufferGetOutputPresentationTimeStamp / CMSampleBufferGetOutputDuration for all presentation times and durations
424         https://bugs.webkit.org/show_bug.cgi?id=208827
425
426         Reviewed by Eric Carlson.
427
428         CMSampleBufferGetOutputPresentationTimeStamp takes into account pre-roll trim durations and
429         movie edit lists, and as such, should be used as the "correct" value for "presentation
430         time".
431
432         outputPresentationTime() is inconsistently used, so rather than replacing all references of
433         outputPresentationTime() with presentationTime(), simply redefine presetationTime() in terms
434         of CMSampleBufferGetPresentationTimeStamp() and remove outputPresentationTime() entirely.
435
436         * Modules/mediasource/SourceBuffer.cpp:
437         (WebCore::SourceBuffer::updateMinimumUpcomingPresentationTime):
438         * platform/MediaSample.h:
439         (WebCore::MediaSample::outputPresentationTime const): Deleted.
440         (WebCore::MediaSample::outputDuration const): Deleted.
441         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
442         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::calculateTimelineOffset):
443         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
444         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
445         (WebCore::MediaSampleAVFObjC::presentationTime const):
446         (WebCore::MediaSampleAVFObjC::duration const):
447         (WebCore::MediaSampleAVFObjC::outputDuration const):
448         (WebCore::MediaSampleAVFObjC::dump const):
449         (WebCore::MediaSampleAVFObjC::toJSONString const):
450         (WebCore::MediaSampleAVFObjC::outputPresentationTime const): Deleted.
451         * platform/mediastream/RealtimeVideoCaptureSource.cpp:
452         (WebCore::RealtimeVideoCaptureSource::adaptVideoSample):
453
454 2020-03-10  Chris Dumez  <cdumez@apple.com>
455
456         Add release logging for when a navigation by a third-party (or untrusted) iframe is blocked
457         https://bugs.webkit.org/show_bug.cgi?id=208863
458
459         Reviewed by Youenn Fablet.
460
461         Add release logging for when a navigation by a third-party (or untrusted) iframe is blocked, to
462         help identify potential regressions in behavior.
463
464         * dom/Document.cpp:
465         (WebCore::Document::canNavigate):
466         (WebCore::Document::frameID const):
467         (WebCore::Document::isAlwaysOnLoggingAllowed const):
468         * dom/Document.h:
469
470 2020-03-10  youenn fablet  <youenn@apple.com>
471
472         Remove SampleBufferDisplayLayer sync IPC
473         https://bugs.webkit.org/show_bug.cgi?id=208804
474
475         Reviewed by Eric Carlson.
476
477         Add an initialize method to initialize the sample buffer display layer.
478         It takes a completion handler so that the initialization can be asynchronous.
479         Update the player to, on initialization callback, create the necessary observers and hook the fullscreen manager.
480
481         Update MediaPlayerPrivateMediaStreamAVFObjC to no longer expose rootLayer and rootLayerBoundsDidChange.
482         This was used by the root layer observer.
483         Instead, pass the root layer to the observer when starting the observer and pass a callback to the observer.
484         Covered by existing tests.
485
486         * platform/graphics/avfoundation/SampleBufferDisplayLayer.cpp:
487         (WebCore::SampleBufferDisplayLayer::create):
488         * platform/graphics/avfoundation/SampleBufferDisplayLayer.h:
489         * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h:
490         * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
491         (WebCore::LocalSampleBufferDisplayLayer::create):
492         (WebCore::LocalSampleBufferDisplayLayer::LocalSampleBufferDisplayLayer):
493         (WebCore::LocalSampleBufferDisplayLayer::initialize):
494         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
495         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
496         (-[WebRootSampleBufferBoundsChangeListener initWithCallback:]):
497         (-[WebRootSampleBufferBoundsChangeListener invalidate]):
498         (-[WebRootSampleBufferBoundsChangeListener begin:]):
499         (-[WebRootSampleBufferBoundsChangeListener stop]):
500         (-[WebRootSampleBufferBoundsChangeListener observeValueForKeyPath:ofObject:change:context:]):
501         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
502         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
503         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer):
504         (-[WebRootSampleBufferBoundsChangeListener initWithParent:]): Deleted.
505         (-[WebRootSampleBufferBoundsChangeListener begin]): Deleted.
506         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::rootLayer const): Deleted.
507
508 2020-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>
509
510         [Cairo] Use std::unique_ptr for cairo_path_t
511         https://bugs.webkit.org/show_bug.cgi?id=208808
512
513         Reviewed by Sergio Villar Senin.
514
515         * platform/graphics/cairo/CairoOperations.cpp:
516         (WebCore::Cairo::clipForPatternFilling):
517         (WebCore::Cairo::drawPathShadow):
518         * platform/graphics/cairo/CairoUniquePtr.h:
519         (WebCore::CairoPtrDeleter<cairo_path_t>::operator() const):
520         * platform/graphics/cairo/CairoUtilities.cpp:
521         (WebCore::appendPathToCairoContext):
522         * platform/graphics/cairo/PathCairo.cpp:
523         (WebCore::Path::Path):
524         (WebCore::Path::operator=):
525         (WebCore::Path::addPath):
526         (WebCore::Path::applySlowCase const):
527
528 2020-03-10  Carlos Garcia Campos  <cgarcia@igalia.com>
529
530         [Cairo] Remove PlatformPathCairo
531         https://bugs.webkit.org/show_bug.cgi?id=208807
532
533         Reviewed by Darin Adler.
534
535         We have a class CairoPath defined in PlatformPathCairo.h that simply wraps a cairo_t. We can use the cairo_t
536         directly as PlatformPath and simplify the cairo path implementation.
537
538         * platform/SourcesCairo.txt:
539         * platform/graphics/Path.h:
540         (WebCore::Path::platformPath const):
541         * platform/graphics/cairo/CairoOperations.cpp:
542         (WebCore::Cairo::fillRectWithRoundedHole):
543         (WebCore::Cairo::fillPath):
544         (WebCore::Cairo::strokePath):
545         (WebCore::Cairo::clipPath):
546         * platform/graphics/cairo/CairoUtilities.cpp:
547         (WebCore::appendWebCorePathToCairoContext):
548         * platform/graphics/cairo/FontCairo.cpp:
549         (WebCore::Font::platformPathForGlyph const):
550         * platform/graphics/cairo/PathCairo.cpp:
551         (WebCore::Path::Path):
552         (WebCore::Path::ensurePlatformPath):
553         (WebCore::Path::operator=):
554         (WebCore::Path::clear):
555         (WebCore::Path::isEmptySlowCase const):
556         (WebCore::Path::currentPointSlowCase const):
557         (WebCore::Path::translate):
558         (WebCore::Path::moveToSlowCase):
559         (WebCore::Path::addLineToSlowCase):
560         (WebCore::Path::addRect):
561         (WebCore::Path::addQuadCurveTo):
562         (WebCore::Path::addBezierCurveTo):
563         (WebCore::Path::addArcSlowCase):
564         (WebCore::Path::addArcTo):
565         (WebCore::Path::addEllipse):
566         (WebCore::Path::addPath):
567         (WebCore::Path::closeSubpath):
568         (WebCore::Path::boundingRectSlowCase const):
569         (WebCore::Path::strokeBoundingRect const):
570         (WebCore::Path::contains const):
571         (WebCore::Path::strokeContains const):
572         (WebCore::Path::applySlowCase const):
573         (WebCore::Path::transform):
574         * platform/graphics/cairo/PlatformPathCairo.cpp: Removed.
575         * platform/graphics/cairo/PlatformPathCairo.h: Removed.
576
577 2020-03-10  youenn fablet  <youenn@apple.com>
578
579         [iOS] Make sure a MediStreamTrack clone does not interrupt the being cloned track
580         https://bugs.webkit.org/show_bug.cgi?id=208634
581
582         Reviewed by Eric Carlson.
583
584         Covered by reenabled tests.
585
586         * platform/mediastream/RealtimeMediaSourceFactory.h:
587         (WebCore::SingleSourceFactory::activeSource): .
588
589 2020-03-10  youenn fablet  <youenn@apple.com>
590
591         Remove sync IPC when creating a remote capture source
592         https://bugs.webkit.org/show_bug.cgi?id=208816
593
594         Reviewed by Eric Carlson.
595
596         Add a whenInitialized method to allow for async creation of realtime media source.
597         Use this method when creating a MediaStream for getUserMedia/getDisplayMedia.
598         Covered by existing tests.
599
600         * platform/mediastream/MediaStreamPrivate.cpp:
601         (WebCore::MediaStreamPrivate::create):
602         * platform/mediastream/MediaStreamPrivate.h:
603         * platform/mediastream/RealtimeMediaSource.h:
604         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
605         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
606
607 2020-03-10  Philippe Normand  <pnormand@igalia.com>
608
609         Unreviewed, !USE(GSTREAMER_GL) build fix after r258197.
610         
611         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
612         (WebCore::GstVideoFrameHolder::platformLayerBuffer):
613
614 2020-03-10  Philippe Normand  <philn@igalia.com>
615
616         [GStreamer][GL] External OES textures rendering support
617         https://bugs.webkit.org/show_bug.cgi?id=208572
618
619         Reviewed by Žan Doberšek.
620
621         For hardware that contains native YUV samplers, some drivers may
622         only support external-oes import of YUV textures, so by supporting
623         this texture target in the MediaPlayer we can avoid some costly
624         operations in the pipeline.
625
626         * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
627         (webKitGLVideoSinkSetMediaPlayerPrivate):
628         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
629         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
630         (WebCore::GstVideoFrameHolder::platformLayerBuffer):
631         (WebCore::MediaPlayerPrivateGStreamer::paint):
632         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
633         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
634         * platform/graphics/texmap/TextureMapperGL.cpp:
635         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
636         (WebCore::TextureMapperGL::drawTextureExternalOES):
637         * platform/graphics/texmap/TextureMapperGL.h:
638         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
639         (WebCore::TextureMapperPlatformLayerBuffer::clone):
640         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
641         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
642         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
643         (WebCore::TextureMapperShaderProgram::create):
644         * platform/graphics/texmap/TextureMapperShaderProgram.h:
645
646 2020-03-10  Rob Buis  <rbuis@igalia.com>
647
648         Align with Origin header changes
649         https://bugs.webkit.org/show_bug.cgi?id=199261
650
651         Reviewed by Darin Adler.
652
653         Call generateOriginHeader in more places so that we comply
654         more with "append a request `Origin` header" algorithm [1].
655
656         Test: imported/w3c/web-platform-tests/fetch/origin/assorted.window.html
657
658         [1] https://fetch.spec.whatwg.org/#append-a-request-origin-header
659
660         * loader/FrameLoader.cpp:
661         (WebCore::FrameLoader::submitForm):
662         * loader/cache/CachedResourceRequest.cpp:
663         (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
664
665 2020-03-09  Yusuke Suzuki  <ysuzuki@apple.com>
666
667         REGRESSION: (r257905) [ Mac wk2 Debug ] ASSERTION FAILED: !m_isolatedWorld->isNormal() || m_wrapper || !m_jsFunction
668         https://bugs.webkit.org/show_bug.cgi?id=208642
669
670         Reviewed by Darin Adler.
671
672         This patch fixes stale assertions and comments in JSEventListener.h, which has various problems.
673
674         1. This assertion is saying, "If m_wrapper is dead, m_jsFunction must be dead". This is wrong. Given that we have conservative
675            GC, JSC never guarantees such a condition. Even if m_wrapper is dead, m_jsFunction can be alive by various reasons: conservative
676            GC finds it, user code stores this function somewhere reachable from the root, etc.
677            The reason why this wrong assertion exists here is because the JSEventListener code and assertion assume that m_jsFunction is nullptr
678            when it is not initialized, and once it is initialized, it should be non nullptr. This is wrong because Weak<> can collect it if it
679            is not retained. This `!m_jsFunction` check mixes "it is not initialized" and "it is already initialized but collected".
680            The correct assertion should be checking `m_wrapper` and `m_jsFunction` are alive (not checking deadness, which is not guaranteed) if
681            the event-listener is once initialized. This patch adds m_isInitialized member to track this status separately from `m_wrapper` and
682            `m_jsFunction`.
683         2. JSEventListener::jsFunction has `if (!m_jsFunction)` condition. But this is not correct. This can revive JSFunction if it is collected
684            because m_wrapper is gone or some way, but this is not expected behavior. The correct way is checking `m_isInitialized`. Once the event-listener
685            is initialized, keeping m_wrapper and m_jsFunction alive is the responsibility of JSEventListener's owner.
686         3. The comments about "zombie m_jsFunctions" is wrong. We are using JSC::Weak<>. So if the object gets collected, it returns
687            nullptr, not getting a zombie pointer.
688         4. We are emitting write-barrier in a wrong order. In the heavily stressed scenario, it is possible that concurrent marking
689            scans JSEventListener just after we emit the write-barrier, and this marking misses the assigned value. We must emit
690            a write-barrier after the assignment. If the write-barrier code is written after the assignment, it correctly offers memory
691            fence to ensure this ordering.
692         5. We also remove "world is not normal, anything is allowed" assertion. The assertion is allowing non-normal world to get dead m_wrapper.
693            But skipping event handlers only in non-normal world does not make sense. And it is originally added as a hack to avoid assertions
694            caused by non-normal world.
695
696         While we are not sure which test is causing, it seems that we found a real bug by fixing this assertion[1].
697
698         [1]: https://bugs.webkit.org/show_bug.cgi?id=208798
699
700         * bindings/js/JSEventListener.cpp:
701         (WebCore::JSEventListener::JSEventListener):
702         (WebCore::JSEventListener::visitJSFunction):
703         * bindings/js/JSEventListener.h:
704         (WebCore::JSEventListener::wrapper const):
705         (WebCore::JSEventListener::setWrapperWhenInitializingJSFunction const):
706         (WebCore::JSEventListener::jsFunction const):
707         (WebCore::JSEventListener::setWrapper const): Deleted.
708         * bindings/js/JSLazyEventListener.cpp:
709         (WebCore::JSLazyEventListener::initializeJSFunction const):
710
711 2020-03-09  Zalan Bujtas  <zalan@apple.com>
712
713         [LayoutTests] Do not expose didAddHorizontal/VerticalScrollbar and willRemoveHorizontal/VerticalScrollbar
714         https://bugs.webkit.org/show_bug.cgi?id=208833
715         <rdar://problem/60244801>
716
717         Reviewed by Simon Fraser.
718
719         didAdd* and willRemove* functions are triggered by layout. Optimal layouts can happen at any point of time.
720         Tests should not rely on the number/order of layouts unless they are specifically designed
721         to test e.g. lack of layouts (see internals.layoutCount).
722         It's sufficient to dump the mouse entered/moved/etc actions only.
723
724         * platform/mock/ScrollAnimatorMock.cpp:
725         (WebCore::ScrollAnimatorMock::didAddVerticalScrollbar):
726         (WebCore::ScrollAnimatorMock::didAddHorizontalScrollbar):
727         (WebCore::ScrollAnimatorMock::willRemoveVerticalScrollbar):
728         (WebCore::ScrollAnimatorMock::willRemoveHorizontalScrollbar):
729
730 2020-03-09  Simon Fraser  <simon.fraser@apple.com>
731
732         ASSERT(!m_textCheckingRequest) on editing/spelling/spellcheck-async-remove-frame.html
733         https://bugs.webkit.org/show_bug.cgi?id=126606
734
735         Reviewed by Wenson Hsieh.
736
737         SpellChecker's sequence numbers need to be unique between frames, because they are sent out
738         to EditorClient which may be one per web view, move from a per-SpellChecker int to
739         TextCheckingRequestIdentifier.
740
741         Change terminology from "sequence" to "identifier" and use Optional in
742         TextCheckingRequestData to represent the unset state.
743
744         Tested by existing tests.
745
746         * editing/SpellChecker.cpp:
747         (WebCore::SpellCheckRequest::SpellCheckRequest):
748         (WebCore::SpellCheckRequest::didSucceed):
749         (WebCore::SpellCheckRequest::didCancel):
750         (WebCore::SpellCheckRequest::setCheckerAndIdentifier):
751         (WebCore::SpellChecker::SpellChecker):
752         (WebCore::SpellChecker::requestCheckingFor):
753         (WebCore::SpellChecker::didCheck):
754         (WebCore::SpellChecker::didCheckSucceed):
755         (WebCore::SpellChecker::didCheckCancel):
756         (WebCore::SpellCheckRequest::setCheckerAndSequence): Deleted.
757         * editing/SpellChecker.h:
758         (WebCore::SpellChecker::lastRequestIdentifier const):
759         (WebCore::SpellChecker::lastProcessedIdentifier const):
760         (WebCore::SpellChecker::lastRequestSequence const): Deleted.
761         (WebCore::SpellChecker::lastProcessedSequence const): Deleted.
762         * platform/text/TextChecking.h:
763         (WebCore::TextCheckingRequestData::TextCheckingRequestData):
764         (WebCore::TextCheckingRequestData::identifier const):
765         (WebCore::TextCheckingRequestData::sequence const): Deleted.
766         * testing/Internals.cpp:
767         (WebCore::Internals::lastSpellCheckRequestSequence):
768         (WebCore::Internals::lastSpellCheckProcessedSequence):
769         * testing/Internals.h:
770         * testing/Internals.idl:
771
772 2020-03-09  Don Olmstead  <don.olmstead@sony.com>
773
774         Remove obsolete feature flags
775         https://bugs.webkit.org/show_bug.cgi?id=208830
776
777         Reviewed by Alex Christensen.
778
779         Remove ENABLE_CUSTOM_SCHEME_HANDLER and ENABLE_MAC_VIDEO_TOOLBOX since they
780         are no longer used.
781
782         * Configurations/FeatureDefines.xcconfig:
783         * editing/cocoa/AlternativeTextUIController.h: USE(DICTION_ALTERNATIVES) -> USE(DICTION_ALTERNATIVES)
784         * html/TextFieldInputType.cpp: ENABLE(DATALIST) -> ENABLE(DATALIST_ELEMENT)
785         (WebCore::TextFieldInputType::destroyShadowSubtree):
786         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: ENABLE(WEBBPU) typo
787
788 2020-03-09  Zalan Bujtas  <zalan@apple.com>
789
790         REGRESSION (257846) Crash on maps.google.com under Element::isVisibleWithoutResolvingFullStyle
791         https://bugs.webkit.org/show_bug.cgi?id=208841
792         <rdar://problem/60238539>
793
794         Reviewed by Simon Fraser.
795
796         Resolve the computed style for the composed ancestors when not available.
797
798         * dom/Element.cpp:
799         (WebCore::Element::isVisibleWithoutResolvingFullStyle const):
800
801 2020-03-09  Andres Gonzalez  <andresg_22@apple.com>
802
803         Remove required setting for libAccessibility.
804         https://bugs.webkit.org/show_bug.cgi?id=208836
805         <rdar://problem/60227703>
806
807         Reviewed by Chris Fleizach.
808
809         Made libAccessibility an optional library for Webcore since
810         accessibility is soft linking it.
811
812         * WebCore.xcodeproj/project.pbxproj:
813
814 2020-03-09  Chris Dumez  <cdumez@apple.com>
815
816         Unreviewed, drop forward declaration that is no longer needed after r258159.
817
818         * xml/XMLHttpRequestProgressEventThrottle.h:
819
820 2020-03-09  Chris Dumez  <cdumez@apple.com>
821
822         Align garbage collection for XMLHttpRequest objects with the specification
823         https://bugs.webkit.org/show_bug.cgi?id=208481
824
825         Reviewed by Ryosuke Niwa.
826
827         Align garbage collection for XMLHttpRequest objects with the specification:
828         - https://xhr.spec.whatwg.org/#garbage-collection
829
830         We now override ActiveDOMObject::hasPendingActivity() to match exactly the text
831         in the specification:
832         """
833         An XMLHttpRequest object must not be garbage collected if its state is either
834         opened with the send() flag set, headers received, or loading, and it has one or
835         more event listeners registered whose type is one of readystatechange, progress,
836         abort, error, load, timeout, and loadend.
837         """
838
839         Previously, we were trying to implement this behavior with ActiveDOMObject's
840         setPendingActivity() / unsetPendingActivity() but this was error and leak prone.
841         It was also keeping the JS wrapper alive too long in the cases where the JS
842         does not have any event listeners. If the JS has not event listeners, then we
843         can collect the JS wrapper, we just need to keep the implementation
844         XMLHttpRequest object for the duration of the load.
845
846         No new tests, covered by existing test such as:
847         fast/xmlhttprequest/xmlhttprequest-gc.html
848
849         * dom/EventTarget.cpp:
850         (WebCore::EventTarget::addEventListener):
851         (WebCore::EventTarget::removeEventListener):
852         (WebCore::EventTarget::removeAllEventListeners):
853         * dom/EventTarget.h:
854         (WebCore::EventTarget::eventListenersDidChange):
855         * xml/XMLHttpRequest.cpp:
856         (WebCore::XMLHttpRequest::XMLHttpRequest):
857         (WebCore::XMLHttpRequest::changeState):
858         (WebCore::XMLHttpRequest::open):
859         (WebCore::XMLHttpRequest::prepareToSend):
860         (WebCore::XMLHttpRequest::createRequest):
861         (WebCore::XMLHttpRequest::abort):
862         (WebCore::XMLHttpRequest::internalAbort):
863         (WebCore::XMLHttpRequest::networkError):
864         (WebCore::XMLHttpRequest::didFail):
865         (WebCore::XMLHttpRequest::didFinishLoading):
866         (WebCore::XMLHttpRequest::didReachTimeout):
867         (WebCore::XMLHttpRequest::contextDestroyed):
868         (WebCore::XMLHttpRequest::eventListenersDidChange):
869         (WebCore::XMLHttpRequest::hasPendingActivity const):
870         * xml/XMLHttpRequest.h:
871         * xml/XMLHttpRequestProgressEventThrottle.cpp:
872         (WebCore::XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle):
873         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchEventWhenPossible):
874         (WebCore::XMLHttpRequestProgressEventThrottle::suspend):
875         (WebCore::XMLHttpRequestProgressEventThrottle::resume):
876         * xml/XMLHttpRequestProgressEventThrottle.h:
877
878 2020-03-09  Wenson Hsieh  <wenson_hsieh@apple.com>
879
880         Creating paths that are single-segment bezier or quad curves should not require a CGPath allocation
881         https://bugs.webkit.org/show_bug.cgi?id=208812
882
883         Reviewed by Tim Horton.
884
885         Extend the inline path data mechanism introduced in r258118 to encompass two more cases of simple path objects:
886         single-segment quad and bezier curves. In these scenarios, we can simply store the start point, end point, and
887         one or two control points (respectively). See below for more details; there should be no change in behavior.
888
889         * platform/graphics/InlinePathData.h:
890
891         Add the new inline path data types to the variant. Note that does not increase the size of the InlinePathData
892         variant, nor does it increase the size of Path, since the variant is already 32 bytes large due to ArcData.
893
894         (WebCore::QuadCurveData::encode const):
895         (WebCore::QuadCurveData::decode):
896         (WebCore::BezierCurveData::encode const):
897         (WebCore::BezierCurveData::decode):
898
899         Add encoders and decoders for QuadCurveData and BezierCurveData.
900
901         * platform/graphics/Path.cpp:
902         (WebCore::Path::apply const):
903
904         In the cases where we have quad and bezier curves, we can apply the path without having to fall back to
905         allocating a platform path object.
906
907         (WebCore::Path::currentPoint const):
908
909         Return endPoint in both of the new inline curve cases.
910
911         (WebCore::Path::elementCount const):
912
913         Return 2 in both of the new cases.
914
915         (WebCore::Path::addQuadCurveTo):
916         (WebCore::Path::addBezierCurveTo):
917
918         If the path is null (we haven't modified anything yet) or the path was only moved to some location, stuff
919         information about the quad or bezier curve into inline data on Path and avoid creating a CGPath on CoreGraphics
920         platforms (and other types of platform paths elsewhere).
921
922         * platform/graphics/Path.h:
923         * platform/graphics/cairo/PathCairo.cpp:
924         (WebCore::Path::addQuadCurveToSlowCase):
925         (WebCore::Path::addBezierCurveToSlowCase):
926         (WebCore::Path::addQuadCurveTo): Deleted.
927         (WebCore::Path::addBezierCurveTo): Deleted.
928         * platform/graphics/cg/PathCG.cpp:
929         (WebCore::Path::createCGPath const):
930         (WebCore::Path::addQuadCurveToSlowCase):
931         (WebCore::Path::addBezierCurveToSlowCase):
932
933         Add -SlowCase suffixes to these methods, and move the main implementation of addQuadCurve and addBezierCurve
934         into platform-agnostic code in Path.cpp where we update the inline path data and bail early if appropriate, and
935         otherwise fall back to addQuadCurveToSlowCase or addBezierCurveToSlowCase.
936
937         (WebCore::Path::addQuadCurveTo): Deleted.
938         (WebCore::Path::addBezierCurveTo): Deleted.
939         * platform/graphics/win/PathDirect2D.cpp:
940         (WebCore::Path::addQuadCurveToSlowCase):
941         (WebCore::Path::addBezierCurveToSlowCase):
942         (WebCore::Path::addQuadCurveTo): Deleted.
943         (WebCore::Path::addBezierCurveTo): Deleted.
944
945 2020-03-09  Antoine Quint  <graouts@apple.com>
946
947         Remove the compile-time flag for Pointer Events
948         https://bugs.webkit.org/show_bug.cgi?id=208821
949         <rdar://problem/60223471>
950
951         Reviewed by Dean Jackson.
952
953         * Configurations/FeatureDefines.xcconfig:
954         * css/CSSComputedStyleDeclaration.cpp:
955         (WebCore::touchActionFlagsToCSSValue):
956         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
957         * css/CSSPrimitiveValueMappings.h:
958         (WebCore::CSSPrimitiveValue::operator OptionSet<TouchAction> const):
959         * css/CSSProperties.json:
960         * css/CSSValueKeywords.in:
961         * css/parser/CSSPropertyParser.cpp:
962         (WebCore::consumeTouchAction):
963         (WebCore::CSSPropertyParser::parseSingleValue):
964         * dom/Document.cpp:
965         (WebCore::Document::prepareMouseEvent):
966         (WebCore::Document::invalidateRenderingDependentRegions):
967         * dom/Document.h:
968         * dom/Element.cpp:
969         (WebCore::dispatchPointerEventIfNeeded):
970         (WebCore::Element::allowsDoubleTapGesture const):
971         (WebCore::Element::removedFromAncestor):
972         * dom/Element.h:
973         * dom/Element.idl:
974         * dom/EventNames.in:
975         * dom/NavigatorMaxTouchPoints.idl:
976         * dom/PointerEvent.cpp:
977         * dom/PointerEvent.h:
978         * dom/PointerEvent.idl:
979         * dom/ios/PointerEventIOS.cpp:
980         * page/EventHandler.cpp:
981         (WebCore::EventHandler::pointerCaptureElementDidChange):
982         (WebCore::EventHandler::prepareMouseEvent):
983         * page/EventHandler.h:
984         * page/Navigator.h:
985         * page/Page.cpp:
986         (WebCore::Page::Page):
987         (WebCore::Page::didChangeMainDocument):
988         * page/Page.h:
989         (WebCore::Page::inspectorController const):
990         (WebCore::Page::pointerCaptureController const):
991         * page/PointerCaptureController.cpp:
992         * page/PointerCaptureController.h:
993         * page/PointerLockController.cpp:
994         (WebCore::PointerLockController::requestPointerLock):
995         * platform/TouchAction.h:
996         * rendering/EventRegion.cpp:
997         (WebCore::EventRegion::operator== const):
998         (WebCore::EventRegion::unite):
999         (WebCore::EventRegion::translate):
1000         (WebCore::operator<<):
1001         * rendering/EventRegion.h:
1002         (WebCore::EventRegion::encode const):
1003         (WebCore::EventRegion::decode):
1004         * rendering/RenderBlock.cpp:
1005         (WebCore::RenderBlock::paintObject):
1006         * rendering/RenderElement.cpp:
1007         (WebCore::RenderElement::styleWillChange):
1008         * rendering/RenderLayer.cpp:
1009         (WebCore::RenderLayer::calculateClipRects const):
1010         * rendering/RenderLayerBacking.cpp:
1011         (WebCore::RenderLayerBacking::updateEventRegion):
1012         (WebCore::patternForTouchAction):
1013         (WebCore::RenderLayerBacking::paintDebugOverlays):
1014         * rendering/style/RenderStyle.h:
1015         (WebCore::RenderStyle::effectiveTouchActions const):
1016         (WebCore::RenderStyle::setEffectiveTouchActions):
1017         (WebCore::RenderStyle::initialTouchActions):
1018         * rendering/style/StyleRareInheritedData.cpp:
1019         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1020         (WebCore::StyleRareInheritedData::operator== const):
1021         * rendering/style/StyleRareInheritedData.h:
1022         * rendering/style/StyleRareNonInheritedData.cpp:
1023         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1024         (WebCore::StyleRareNonInheritedData::operator== const):
1025         * rendering/style/StyleRareNonInheritedData.h:
1026         * style/StyleAdjuster.cpp:
1027         (WebCore::Style::isScrollableOverflow):
1028         (WebCore::Style::computeEffectiveTouchActions):
1029         (WebCore::Style::Adjuster::adjust const):
1030         * style/StyleBuilderConverter.h:
1031         (WebCore::Style::BuilderConverter::convertTouchAction):
1032         * style/StyleTreeResolver.cpp:
1033         (WebCore::Style::TreeResolver::resolveElement):
1034
1035 2020-03-09  Rob Buis  <rbuis@igalia.com>
1036
1037         Rename urlSelected to changeLocation
1038         https://bugs.webkit.org/show_bug.cgi?id=208529
1039
1040         Reviewed by Darin Adler.
1041
1042         Rename urlSelected to changeLocation and remove the existing
1043         changeLocation. The name changeLocation is more intuitive
1044         than urlSelected.
1045
1046         No new tests -- no new or changed functionality.
1047
1048         * html/HTMLAnchorElement.cpp:
1049         (WebCore::HTMLAnchorElement::handleClick):
1050         * html/HTMLLinkElement.cpp:
1051         (WebCore::HTMLLinkElement::handleClick):
1052         * loader/FrameLoader.cpp:
1053         (WebCore::FrameLoader::changeLocation):
1054         (WebCore::FrameLoader::urlSelected): Deleted.
1055         * loader/FrameLoader.h:
1056         * loader/NavigationScheduler.cpp:
1057         * mathml/MathMLElement.cpp:
1058         (WebCore::MathMLElement::defaultEventHandler):
1059         * svg/SVGAElement.cpp:
1060         (WebCore::SVGAElement::defaultEventHandler):
1061
1062 2020-03-09  youenn fablet  <youenn@apple.com>
1063
1064         Log error in clearNowPlayingInfo/setNowPlayingInfo
1065         https://bugs.webkit.org/show_bug.cgi?id=208805
1066
1067         Reviewed by Eric Carlson.
1068
1069         No change of behavior.
1070
1071         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1072         (MediaSessionManagerCocoa::clearNowPlayingInfo):
1073         (MediaSessionManagerCocoa::setNowPlayingInfo):
1074
1075 2020-03-09  Zalan Bujtas  <zalan@apple.com>
1076
1077         [LFC][IFC] Do not floor the computed intrinsic width values
1078         https://bugs.webkit.org/show_bug.cgi?id=208796
1079         <rdar://problem/60209522>
1080
1081         Reviewed by Antti Koivisto.
1082
1083         Floored intrinsic values could lead to unexpected line breaks.
1084         (This happens because IFC uses float currently, while other layout systems use LayoutUnit.)
1085
1086         Test: fast/layoutformattingcontext/absolute-positioned-simple-table3.html
1087
1088         * layout/LayoutUnits.h:
1089         (WebCore::Layout::ceiledLayoutUnit):
1090         * layout/inlineformatting/InlineFormattingContext.cpp:
1091         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
1092         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
1093         * layout/inlineformatting/InlineFormattingContext.h:
1094
1095 2020-03-09  Zalan Bujtas  <zalan@apple.com>
1096
1097         [LFC][TFC] Do no try to distribute extra space in case of shrink to fit (max preferred width).
1098         https://bugs.webkit.org/show_bug.cgi?id=208795
1099         <rdar://problem/60208329>
1100
1101         Reviewed by Antti Koivisto.
1102
1103         When we shrink-to-fit the table and it isn't constrained by the containing block's width, we
1104         should use the maximum width instead of trying to distribute the space.
1105
1106         * layout/tableformatting/TableFormattingContext.cpp:
1107         (WebCore::Layout::TableFormattingContext::layoutInFlowContent):
1108         (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
1109         (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
1110         * layout/tableformatting/TableFormattingContext.h:
1111
1112 2020-03-07  Darin Adler  <darin@apple.com>
1113
1114         Begin moving off of live ranges for WebKit internals
1115         https://bugs.webkit.org/show_bug.cgi?id=208432
1116
1117         Reviewed by Daniel Bates.
1118
1119         The DOM Range class is a live range. The live updating feature of these ranges mean
1120         they are expensive to create and destroy and also make all DOM mutation more expensive
1121         while they are alive. We will be able to speed up, likely measurable on Speedometer,
1122         if we can cut down uses of live ranges.
1123
1124         - Refactored the StaticRange class to create two new structs.
1125         - The BoundaryPoint struct implements what the DOM standard calls a boundary point:
1126           a node and offset. Similar to the RangeBoundaryPoint class, which supports
1127           being the boundary point of a live range, but simpler and not live.
1128         - The SimpleRange struct implements what the DOM standard calls a range (not a live
1129           range). Like StaticRange but without reference counting and DOM binding.
1130         - Since StaticRange is derived publicly from SimpleRange you can pass either to any
1131           function that takes a SimpleRange. And since there is a constructor to create a
1132           SimpleRange from a Range you can pass a Range to those functions too.
1133         - Renamed StaticRange::createFromRange to StaticRange::create.
1134
1135         * Headers.cmake: Added BoundaryPoint.h, SimpleRange.h, and StaticRange.h.
1136         * Sources.txt: Added BoundaryPoint.cpp and SimpleRange.cpp.
1137         * WebCore.xcodeproj/project.pbxproj: Added BoundaryPoint.cpp/h and SimpleRange.cpp/h.
1138
1139         * dom/BoundaryPoint.cpp: Added.
1140         * dom/BoundaryPoint.h: Added.
1141         * dom/SimpleRange.cpp: Added.
1142         * dom/SimpleRange.h: Added.
1143
1144         * dom/StaticRange.cpp:
1145         (WebCore::StaticRange::StaticRange): Take an rvalue reference to a SimpleRange.
1146         (WebCore::StaticRange::create): Ditto. Changed the other overloads to create
1147         a SimpleRange first then call through to the main one.
1148         (WebCore::isDocumentTypeOrAttr): Wrote a much more efficient version of this.
1149         The old version called the virtual function nodeType twice. This calls it at
1150         most once, and mostly doesn't call it at all.
1151         * dom/StaticRange.h: Simplified this class, putting most of the actual range
1152         logic into the base class. Note that this change eliminated the peculiar code
1153         that in the == operator that compared nodes using isEqualNode instead of using
1154         node identity. There was no one who needed that other behavior. Also fixed
1155         mistaken use of unsigned long in StaticRange::Init. It's unsigned long in
1156         the IDL file, but confusingly that's just unsigned in .cpp files.
1157
1158         * dom/StaticRange.idl: Tweaked formatting.
1159
1160         * editing/CompositeEditCommand.cpp:
1161         (WebCore::CompositeEditCommand::targetRanges const): Updated for rename
1162         of StaticRange::create.
1163         * editing/ReplaceRangeWithTextCommand.cpp:
1164         (WebCore::ReplaceRangeWithTextCommand::doApply): Updated since VisibleSelection
1165         takes SimpleRange now.
1166         (WebCore::ReplaceRangeWithTextCommand::targetRanges const): Updated for
1167         rename of StaticRange::create.
1168         * editing/SpellingCorrectionCommand.cpp:
1169         (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand): Updated
1170         since a selection now takes a SimpleRange&, not a StaticRange.
1171         (WebCore::SpellingCorrectionCommand::targetRanges const): Updated for
1172         rename of StaticRange::create.
1173         * editing/TypingCommand.cpp:
1174         (WebCore::TypingCommand::willAddTypingToOpenCommand): Ditto.
1175
1176         * editing/VisibleSelection.cpp:
1177         (WebCore::VisibleSelection::VisibleSelection): Use SimpleRange
1178         instead of StaticRange and Range.
1179         * editing/VisibleSelection.h: Updated for the above.
1180
1181         * editing/mac/EditorMac.mm: Added include.
1182         * page/DragController.cpp: Ditto.
1183         * page/TextIndicator.cpp: Ditto.
1184         (WebCore::TextIndicator::createWithRange): Updated since VisibleSelection
1185         takes SimpleRange now.
1186
1187         * page/mac/EventHandlerMac.mm:
1188         (WebCore::InlineTextBox::collectMarkedTextsForHighlights): Tweaked coding
1189         style a bit.
1190
1191 2020-03-08  Per Arne Vollan  <pvollan@apple.com>
1192
1193         Unreviewed, speculative link fix.
1194
1195         * platform/cocoa/UTTypeRecordSwizzler.mm:
1196
1197 2020-03-08  Per Arne Vollan  <pvollan@apple.com>
1198
1199         Unreviewed, speculative link fix.
1200
1201         * platform/cocoa/UTTypeRecordSwizzler.mm:
1202
1203 2020-03-08  Konstantin Tokarev  <annulen@yandex.ru>
1204
1205         [CMake] Unreviewed build fix for Mac port
1206
1207         * PlatformMac.cmake:
1208
1209 2020-03-08  Per Arne Vollan  <pvollan@apple.com>
1210
1211         [iOS] Mapping to UTI from tag and tag class should be performed in the UI process
1212         https://bugs.webkit.org/show_bug.cgi?id=208783
1213
1214         Reviewed by Brent Fulgham.
1215
1216         This mapping should be done in the UI process, since it is using a system service that will no longer be available
1217         in the WebContent process. To achieve this, the method +[UTTypeRecord typeRecordWithTagOverride] is swizzled in
1218         the WebContent process, and is using the cached mapping sent from the UI process.
1219
1220         API test: WebKit.UTIFromTag
1221
1222         * WebCore.xcodeproj/project.pbxproj:
1223         * platform/cocoa/UTTypeRecordSwizzler.h: Added.
1224         (WebCore::UTTypeItem::encode const):
1225         (WebCore::UTTypeItem::decode):
1226         * platform/cocoa/UTTypeRecordSwizzler.mm: Added.
1227         (-[WebUTTypeRecord setIdentifier:]):
1228         (WebCore::vectorOfUTTypeRecords):
1229         (WebCore::typeRecordWithTagOverride):
1230         (WebCore::createVectorOfUTTypeItem):
1231         (WebCore::setVectorOfUTTypeItem):
1232         (WebCore::swizzleUTTypeRecord):
1233         * platform/network/mac/UTIUtilities.h:
1234         * platform/network/mac/UTIUtilities.mm:
1235         (WebCore::UTIFromTag):
1236         * testing/Internals.cpp:
1237         (WebCore::Internals::getUTIFromTag):
1238         * testing/Internals.h:
1239         * testing/Internals.idl:
1240         * testing/Internals.mm:
1241         (WebCore::Internals::getUTIFromTag):
1242
1243 2020-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1244
1245         Lazily generate CGPaths for some simple types of paths, such as arcs and lines
1246         https://bugs.webkit.org/show_bug.cgi?id=208464
1247         <rdar://problem/59963226>
1248
1249         Reviewed by Daniel Bates, Darin Adler and Tim Horton.
1250
1251         When the GPU process is enabled and used to render the canvas element, some canvas-related subtests in
1252         MotionMark see significant performance regressions. One of the reasons for this is that in the process of
1253         decoding display list items that contain `WebCore::Path`s in the GPU process, we end up allocating a new CGPath
1254         for each WebCore::Path. This dramatically increases page demand and memory usage in the GPU process in contrast
1255         to shipping WebKit, due to the fact that all of these CGPaths allocated up-front, and must all exist somewhere
1256         in the heap upon decoding the display list.
1257
1258         In contrast, in shipping WebKit, each call to stroke the current canvas path (i.e. invoking
1259         GraphicsContext::strokePath) is succeeded by clearing the path, which deallocates the CGPath backing the WebCore
1260         Path. The next time a CGPath needs to be created, CoreGraphics is free to then allocate the new CGPath at the
1261         address of the previous CGPath which was just destroyed, which prevents us from dirtying more pages than
1262         necessary. This phenomenon affects most of the canvas-related MotionMark subtests to some degree, though the
1263         impact is most noticeable with Canvas Lines.
1264
1265         On top of all this, a significant portion of time is also spent calling CGPathApply and converting the resulting
1266         CGPathElements into serializable data when encoding each WebCore Path.
1267
1268         To mitigate these two issues and restore the wins we get from memory locality when drawing paths in large
1269         quantities, we can:
1270
1271         1.  In the case of simple paths, stuff some information about how each path was created as inline data on
1272             WebCore::Path itself, as a new data member. For now, this only encompasses lines, arcs, and moves (Paths
1273             where only `Path::moveTo` was invoked), but may be expanded in the future to include ellipses and rects.
1274             This allows us to achieve two things: (a) make encoding cheaper by not requiring a walk through all of
1275             CGPath's elements, and (b) make decoding cheaper by just initializing the Path using inline data, rather
1276             than having to create a new CGPath.
1277
1278         2.  When painting the StrokePath display list item, just discard `m_path` after we're done painting with it.
1279             This, in conjunction with (1), means that the CGPath backing the WebCore::Path in the GPU process is only
1280             created when we're just about to paint (i.e. when calling into strokePath()), and destroyed right after
1281             we're done painting with it.
1282
1283         See below for details. There should be no change in behavior.
1284
1285         * Headers.cmake:
1286         * WebCore.xcodeproj/project.pbxproj:
1287         * platform/graphics/InlinePathData.h: Added.
1288         (WebCore::MoveData::encode const):
1289         (WebCore::MoveData::decode):
1290         (WebCore::LineData::encode const):
1291         (WebCore::LineData::decode):
1292         (WebCore::ArcData::encode const):
1293         (WebCore::ArcData::decode):
1294
1295         Introduce InlinePathData, a Variant of several different inline data types, each of which represents one simple
1296         path type that is stored using only inline data. This includes line segments (a start point and an end point),
1297         as well as arcs (which, in addition to a center and start and end angles) also includes an optional offset,
1298         which represents the current position of the path at the time "addArc" was called.
1299
1300         For instance, in the following scenario, the path would have an arc that is offset by (100, 0); if filled, it
1301         would result in a composite shape resembling a semicircle on top of a triangle:
1302
1303         path.moveTo(100, 0);
1304         path.addArc(100, 100, 50, 0, PI, false);
1305         context.fill(path);
1306
1307         When a Path is initialized (or after it is cleared), it starts off with neither a CGPath nor inline data. Moving
1308         the path causes it to store inline MoveData; calling calling `addLineTo` or `addArc` then replaces the inline
1309         data with either LineData or ArcData.
1310
1311         If, at any point, the path changes in a different way (i.e. neither line, arc, nor move), we clear out the
1312         inline data and fall back to just representing the path data using the CGPath (m_path).
1313
1314         * platform/graphics/Path.cpp:
1315
1316         Refactor the following 10 methods: moveTo, addLineTo, addArc, isEmpty, currentPoint, apply, elementCount,
1317         hasCurrentPoint, fastBoundingRect, and boundingRect such that their implementations are now in platform-agnostic
1318         code in Path.cpp. Logic in this platform-agnostic code will generally attempt to use inline path data to compute
1319         an answer (or apply the requested mutations) without having to initialize the platform path representation.
1320         Failing this, we fall back to calling -SlowCase versions of these methods, which will exercise the appropriate
1321         APIs on each platform.
1322
1323         (WebCore::Path::elementCountSlowCase const):
1324         (WebCore::Path::apply const):
1325         (WebCore::Path::isEmpty const):
1326         (WebCore::Path::hasCurrentPoint const):
1327         (WebCore::Path::currentPoint const):
1328         (WebCore::Path::elementCount const):
1329         (WebCore::Path::addArc):
1330         (WebCore::Path::addLineTo):
1331         (WebCore::Path::moveTo):
1332
1333         In the case of these three methods for mutating a path, if we've either only moved the path or haven't touched
1334         it at all, we can get away with only updating our inline path data, and avoid creating a CGPath.
1335
1336         (WebCore::Path::boundingRect const):
1337         (WebCore::Path::fastBoundingRect const):
1338         (WebCore::Path::boundingRectFromInlineData const):
1339         (WebCore::Path::polygonPathFromPoints):
1340         * platform/graphics/Path.h:
1341         (WebCore::Path::encode const):
1342         (WebCore::Path::decode):
1343
1344         Teach Path::encode and Path::decode to respectively serialize and deserialize WebCore::Path by consulting only
1345         the inline data, if it is present. For simple types of paths, this decreases the cost of both IPC encoding and
1346         decoding, but adds a negligible amount of overhead in the case where the path is non-inline.
1347
1348         (WebCore::Path::hasInlineData const):
1349         (WebCore::Path::hasAnyInlineData const):
1350         (WebCore::Path::isNull const): Deleted.
1351         * platform/graphics/cairo/PathCairo.cpp:
1352         (WebCore::Path::isEmptySlowCase const):
1353         (WebCore::Path::currentPointSlowCase const):
1354         (WebCore::Path::moveToSlowCase):
1355         (WebCore::Path::addLineToSlowCase):
1356         (WebCore::Path::addArcSlowCase):
1357         (WebCore::Path::boundingRectSlowCase const):
1358         (WebCore::Path::applySlowCase const):
1359         (WebCore::Path::fastBoundingRectSlowCase const):
1360         (WebCore::Path::isNull const):
1361         (WebCore::Path::isEmpty const): Deleted.
1362         (WebCore::Path::hasCurrentPoint const): Deleted.
1363         (WebCore::Path::currentPoint const): Deleted.
1364         (WebCore::Path::moveTo): Deleted.
1365         (WebCore::Path::addLineTo): Deleted.
1366         (WebCore::Path::addArc): Deleted.
1367         (WebCore::Path::boundingRect const): Deleted.
1368         (WebCore::Path::apply const): Deleted.
1369         * platform/graphics/cg/PathCG.cpp:
1370         (WebCore::Path::createCGPath const):
1371
1372         Add a helper method that is invoked when the Path is asked for a CGPath. In this case, if there is inline data,
1373         we need to lazily create the path and apply any inline path data we've accumulated. Once we're done applying the
1374         inline data, set a flag (m_needsToApplyInlineData) to false to avoid re-applying inline data to the path.
1375
1376         (WebCore::Path::platformPath const):
1377         (WebCore::Path::ensurePlatformPath):
1378
1379         When ensurePlatformPath is invoked, we are about to mutate our CGPath in such a way that it can't be expressed
1380         in terms of inline data (at least, not with the changes in this patch). Clear out the inline path data in this
1381         case, and apply the CGPath mutations that were previously stashed away in inline path data.
1382
1383         (WebCore::Path::isNull const):
1384
1385         A path is now considered null if it is not only missing a CGPath, but also does not have any inline path data.
1386         This maintains the invariant that `isNull()` is true iff the `platformPath()` returns 0x0.
1387
1388         (WebCore::Path::Path):
1389         (WebCore::Path::swap):
1390
1391         Update the constructors and `swap` helper method (used by assignment operators) to account for the new members.
1392
1393         (WebCore::Path::contains const):
1394         (WebCore::Path::transform):
1395         (WebCore::zeroRectIfNull):
1396         (WebCore::Path::boundingRectSlowCase const):
1397         (WebCore::Path::fastBoundingRectSlowCase const):
1398         (WebCore::Path::moveToSlowCase):
1399         (WebCore::Path::addLineToSlowCase):
1400         (WebCore::Path::addArcSlowCase):
1401         (WebCore::Path::clear):
1402
1403         When clearing Path, instead of setting `m_path` to a newly allocated CGPath, simply reset it to null. This
1404         ensures that if we then apply some changes that can be expressed using only inline path data, we avoid having to
1405         update the CGPath, and instead just update the inline path data.
1406
1407         (WebCore::Path::isEmptySlowCase const):
1408         (WebCore::Path::currentPointSlowCase const):
1409         (WebCore::Path::applySlowCase const):
1410         (WebCore::Path::elementCountSlowCase const):
1411         (WebCore::Path::boundingRect const): Deleted.
1412         (WebCore::Path::fastBoundingRect const): Deleted.
1413         (WebCore::Path::moveTo): Deleted.
1414         (WebCore::Path::addLineTo): Deleted.
1415         (WebCore::Path::addArc): Deleted.
1416         (WebCore::Path::isEmpty const): Deleted.
1417         (WebCore::Path::hasCurrentPoint const): Deleted.
1418         (WebCore::Path::currentPoint const): Deleted.
1419         (WebCore::Path::apply const): Deleted.
1420         (WebCore::Path::elementCount const): Deleted.
1421         * platform/graphics/displaylists/DisplayListItems.cpp:
1422         (WebCore::DisplayList::StrokePath::apply const):
1423
1424         Throw out the current WebCore::Path after we're done painting with it (see (2) in the above ChangeLog entry).
1425
1426         * platform/graphics/displaylists/DisplayListItems.h:
1427         * platform/graphics/win/PathDirect2D.cpp:
1428         (WebCore::Path::boundingRectSlowCase const):
1429         (WebCore::Path::fastBoundingRectSlowCase const):
1430         (WebCore::Path::moveToSlowCase):
1431         (WebCore::Path::addLineToSlowCase):
1432         (WebCore::Path::addArcSlowCase):
1433         (WebCore::Path::isEmptySlowCase const):
1434         (WebCore::Path::currentPointSlowCase const):
1435         (WebCore::Path::applySlowCase const):
1436         (WebCore::Path::isNull const):
1437         (WebCore::Path::boundingRect const): Deleted.
1438         (WebCore::Path::fastBoundingRect const): Deleted.
1439         (WebCore::Path::moveTo): Deleted.
1440         (WebCore::Path::addLineTo): Deleted.
1441         (WebCore::Path::addArc): Deleted.
1442         (WebCore::Path::isEmpty const): Deleted.
1443         (WebCore::Path::hasCurrentPoint const): Deleted.
1444         (WebCore::Path::currentPoint const): Deleted.
1445         (WebCore::Path::apply const): Deleted.
1446
1447 2020-03-08  Konstantin Tokarev  <annulen@yandex.ru>
1448
1449         [CMake] Some fixes for building Mac port
1450         https://bugs.webkit.org/show_bug.cgi?id=208770
1451
1452         Reviewed by Don Olmstead.
1453
1454         * PlatformMac.cmake:
1455
1456 2020-03-08  Andres Gonzalez  <andresg_22@apple.com>
1457
1458         Implementation of AccessibilitySupport AXSIsolatedTreeMode.
1459         https://bugs.webkit.org/show_bug.cgi?id=208691
1460         <rdar://problem/60178602>
1461
1462         Reviewed by Chris Fleizach.
1463
1464         Honors the system AccessibilitySupport IsolatedTreeMode setting. The
1465         system has three modes for IsolatedTree functionality: off, on on main
1466         thread, and on on secondary thread.
1467
1468         * WebCore.xcodeproj/project.pbxproj:
1469         * accessibility/AXObjectCache.cpp:
1470         (WebCore::AXObjectCache::isolatedTreeFocusedObject):
1471         (WebCore::AXObjectCache::focusedUIElementForPage):
1472         (WebCore::AXObjectCache::isIsolatedTreeEnabled):
1473         (WebCore::AXObjectCache::isolatedTreeRootObject):
1474         (WebCore::AXObjectCache::canUseSecondaryAXThread):
1475         * accessibility/AXObjectCache.h:
1476         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1477         (-[WebAccessibilityObjectWrapperBase detach]):
1478         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
1479         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1480         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1481
1482 2020-03-08  Jer Noble  <jer.noble@apple.com>
1483
1484         Unreviewed watchOS build fix: add platform guards.
1485
1486         * platform/audio/ios/MediaSessionHelperIOS.mm:
1487         (MediaSessionHelperiOS::startMonitoringWirelessRoutes):
1488         (MediaSessionHelperiOS::stopMonitoringWirelessRoutes):
1489
1490 2020-03-08  Fujii Hironori  <Hironori.Fujii@sony.com>
1491
1492         generate-bindings-all.pl: "my" variable $fh masks earlier declaration in same scope
1493         https://bugs.webkit.org/show_bug.cgi?id=208757
1494
1495         Reviewed by Yusuke Suzuki.
1496
1497         * bindings/scripts/generate-bindings-all.pl: Reuse $fh variable instead of defining new one.
1498
1499 2020-03-06  Jer Noble  <jer.noble@apple.com>
1500
1501         [GPUP] Move AVSystemController code into the GPU process
1502         https://bugs.webkit.org/show_bug.cgi?id=208727
1503
1504         Reviewed by Eric Carlson.
1505
1506         Move AVSystemController code out of MediaSessionManageriOS and into a new
1507         class MediaSessionHelper, which is currently iOS only. The abstract base class
1508         will be overriden by WebKit in the WebContent process.
1509
1510         Drive-by fix: Don't call a virtual method (resetRestrictions()) from the constructor of a
1511         virtual base class; the virtual function table hasn't been created yet, and the subclasses'
1512         overridden methods won't be called. Move the call to post-creation.
1513
1514         * platform/audio/PlatformMediaSessionManager.cpp:
1515         (WebCore::PlatformMediaSessionManager::sharedManager):
1516         (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
1517         * platform/audio/ios/MediaSessionHelperIOS.h: Added.
1518         * platform/audio/ios/MediaSessionHelperIOS.mm: Copied from Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm.
1519         (sharedHelperInstance):
1520         (MediaSessionHelper::sharedHelper):
1521         (MediaSessionHelper::resetSharedHelper):
1522         (MediaSessionHelper::setSharedHelper):
1523         (MediaSessionHelper::addClient):
1524         (MediaSessionHelper::removeClient):
1525         (MediaSessionHelperiOS::MediaSessionHelperiOS):
1526         (MediaSessionHelperiOS::~MediaSessionHelperiOS):
1527         (MediaSessionHelperiOS::providePresentingApplicationPID):
1528         (MediaSessionHelperiOS::startMonitoringWirelessRoutes):
1529         (MediaSessionHelperiOS::stopMonitoringWirelessRoutes):
1530         (MediaSessionHelperiOS::carPlayServerDied):
1531         (MediaSessionHelperiOS::updateCarPlayIsConnected):
1532         (MediaSessionHelperiOS::setIsPlayingToAutomotiveHeadUnit):
1533         (MediaSessionHelperiOS::activeAudioRouteDidChange):
1534         (MediaSessionHelperiOS::activeVideoRouteDidChange):
1535         (MediaSessionHelperiOS::receivedInterruption):
1536         (MediaSessionHelperiOS::applicationDidBecomeActive):
1537         (MediaSessionHelperiOS::applicationDidEnterBackground):
1538         (MediaSessionHelperiOS::applicationWillBecomeInactive):
1539         (MediaSessionHelperiOS::applicationWillEnterForeground):
1540         (MediaSessionHelperiOS::externalOutputDeviceAvailableDidChange):
1541         (-[WebMediaSessionHelper initWithCallback:]):
1542         (-[WebMediaSessionHelper dealloc]):
1543         (-[WebMediaSessionHelper clearCallback]):
1544         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
1545         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
1546         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]):
1547         (-[WebMediaSessionHelper interruption:]):
1548         (-[WebMediaSessionHelper applicationWillEnterForeground:]):
1549         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
1550         (-[WebMediaSessionHelper applicationWillResignActive:]):
1551         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]):
1552         (-[WebMediaSessionHelper applicationDidEnterBackground:]):
1553         (-[WebMediaSessionHelper carPlayServerDied:]):
1554         (-[WebMediaSessionHelper carPlayIsConnectedDidChange:]):
1555         (-[WebMediaSessionHelper activeAudioRouteDidChange:]):
1556         * platform/audio/ios/MediaSessionManagerIOS.h:
1557         * platform/audio/ios/MediaSessionManagerIOS.mm:
1558         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
1559         (WebCore::MediaSessionManageriOS::~MediaSessionManageriOS):
1560         (WebCore::MediaSessionManageriOS::hasWirelessTargetsAvailable):
1561         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
1562         (WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary):
1563         (WebCore::MediaSessionManageriOS::providePresentingApplicationPID):
1564         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
1565         (WebCore::MediaSessionManageriOS::isPlayingToAutomotiveHeadUnitDidChange):
1566         (WebCore::MediaSessionManageriOS::activeAudioRouteDidChange):
1567         (WebCore::MediaSessionManageriOS::activeVideoRouteDidChange):
1568         (WebCore::MediaSessionManageriOS::receivedInterruption):
1569         (WebCore::MediaSessionManageriOS::applicationWillEnterForeground):
1570         (WebCore::MediaSessionManageriOS::applicationDidBecomeActive):
1571         (WebCore::MediaSessionManageriOS::applicationDidEnterBackground):
1572         (WebCore::MediaSessionManageriOS::applicationWillBecomeInactive):
1573         (WebCore::MediaSessionManageriOS::carPlayServerDied): Deleted.
1574         (WebCore::MediaSessionManageriOS::updateCarPlayIsConnected): Deleted.
1575         (-[WebMediaSessionHelper initWithCallback:]): Deleted.
1576         (-[WebMediaSessionHelper dealloc]): Deleted.
1577         (-[WebMediaSessionHelper clearCallback]): Deleted.
1578         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Deleted.
1579         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Deleted.
1580         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Deleted.
1581         (-[WebMediaSessionHelper interruption:]): Deleted.
1582         (-[WebMediaSessionHelper applicationWillEnterForeground:]): Deleted.
1583         (-[WebMediaSessionHelper applicationDidBecomeActive:]): Deleted.
1584         (-[WebMediaSessionHelper applicationWillResignActive:]): Deleted.
1585         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]): Deleted.
1586         (-[WebMediaSessionHelper applicationDidEnterBackground:]): Deleted.
1587         (-[WebMediaSessionHelper carPlayServerDied:]): Deleted.
1588         (-[WebMediaSessionHelper carPlayIsConnectedDidChange:]): Deleted.
1589         (-[WebMediaSessionHelper activeAudioRouteDidChange:]): Deleted.
1590
1591 2020-03-08  Andres Gonzalez  <andresg_22@apple.com>
1592
1593         Fix for LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html in IsolatedTree mode.
1594         https://bugs.webkit.org/show_bug.cgi?id=208462
1595         <rdar://problem/59980673>
1596
1597         Reviewed by Chris Fleizach.
1598
1599         Covered by LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html.
1600
1601         - Updates the IsolatedTree on the TextStateChange notification.
1602         - Renamed isAccessibilityScrollView to isAccessibilityScrollViewInstance
1603         and used isScrollView instead everywhere it's appropriate. This makes
1604         code like AXObjectCache::rootWebArea work for both AXObjects and IsolatedObjects.
1605         - Moved several utility functions from WebAccessibilityObjectWrapperMac.mm
1606         to AXObjectCacheMac.mm where they belong, so that they can be used by
1607         AXObjectCache implementation in addition to by the wrapper.
1608
1609         * accessibility/AXObjectCache.cpp:
1610         (WebCore::AXObjectCache::postTextStateChangeNotification):
1611         (WebCore::AXObjectCache::rootWebArea):
1612         * accessibility/AccessibilityObject.cpp:
1613         (WebCore::AccessibilityObject::isOnScreen const):
1614         (WebCore::AccessibilityObject::scrollToGlobalPoint const):
1615         * accessibility/AccessibilityObject.h:
1616         * accessibility/AccessibilityObjectInterface.h:
1617         * accessibility/AccessibilityRenderObject.cpp:
1618         (WebCore::AccessibilityRenderObject::getScrollableAreaIfScrollable const):
1619         * accessibility/AccessibilityScrollView.h:
1620         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1621         (-[WebAccessibilityObjectWrapper accessibilityContainer]):
1622         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1623         (WebCore::AXIsolatedObject::isAccessibilityScrollViewInstance const):
1624         (WebCore::AXIsolatedObject::isAccessibilityScrollView const): Renamed.
1625         * accessibility/isolatedtree/AXIsolatedObject.h:
1626         * accessibility/mac/AXObjectCacheMac.mm:
1627         (WebCore::AXObjectCache::postTextStateChangePlatformNotification): Uses
1628         TextMarker utilities instead of calling into the wrapper. This fixes
1629         the crash caused by the wrapper updating the backingObject that in turn
1630         may change the wrapper.
1631         (WebCore::AXTextMarkerRange): Moved from WebAccessibilityObjectWrapperMac.mm.
1632         (WebCore::textMarkerRangeFromMarkers): Moved from WebAccessibilityObjectWrapperMac.mm.
1633         (WebCore::textMarkerForVisiblePosition): Moved from WebAccessibilityObjectWrapperMac.mm.
1634         (WebCore::textMarkerRangeFromVisiblePositions): Moved from WebAccessibilityObjectWrapperMac.mm.
1635         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
1636         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1637         (AXTextMarkerRange): Moved.
1638         (textMarkerForVisiblePosition): Moved.
1639         (textMarkerRangeFromMarkers): Moved.
1640         (textMarkerRangeFromVisiblePositions): Moved.
1641
1642 2020-03-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1643
1644         Canvas drawing commands have to be flushed to the GPUProcess in batches
1645         https://bugs.webkit.org/show_bug.cgi?id=208597
1646
1647         Reviewed by Myles C. Maxfield.
1648
1649         Make DisplayList::ImageBuffer an observer of DisplayList::Recorder.
1650         It can track adding an item to the recoded DisplayList.
1651
1652         * platform/graphics/displaylists/DisplayListDrawingContext.cpp:
1653         (WebCore::DisplayList::DrawingContext::DrawingContext):
1654         * platform/graphics/displaylists/DisplayListDrawingContext.h:
1655         * platform/graphics/displaylists/DisplayListImageBuffer.h:
1656         (WebCore::DisplayList::ImageBuffer::ImageBuffer):
1657         * platform/graphics/displaylists/DisplayListRecorder.cpp:
1658         (WebCore::DisplayList::Recorder::Recorder):
1659         (WebCore::DisplayList::Recorder::willAppendItem):
1660         * platform/graphics/displaylists/DisplayListRecorder.h:
1661         (WebCore::DisplayList::Recorder::Observer::~Observer):
1662         (WebCore::DisplayList::Recorder::Observer::willAppendItem):
1663
1664 2020-03-08  Konstantin Tokarev  <annulen@yandex.ru>
1665
1666         [GTK] Fix compilation with disabled OpenGL
1667         https://bugs.webkit.org/show_bug.cgi?id=208773
1668
1669         Reviewed by Yusuke Suzuki.
1670
1671         * html/OffscreenCanvas.h:
1672
1673 2020-03-07  Brent Fulgham  <bfulgham@apple.com>
1674
1675         Create a flag to disable in-app browser quirks
1676         https://bugs.webkit.org/show_bug.cgi?id=208777
1677         <rdar://problem/60062197>
1678
1679         Reviewed by Simon Fraser.
1680
1681         This patch makes the following changes:
1682
1683         1. Adds a new flag 'NeedsInAppBrowserPrivacyQuirks' to allow quirks to be toggled
1684            during testing.
1685         2. Reclassify this new flag, and the existing 'InAppBrowserPrivacyEnabled' flag from 
1686            'settings' to Internal Debug settings
1687
1688         The renamed flags are covered by existing tests.
1689
1690         * page/RuntimeEnabledFeatures.h:
1691         (WebCore::RuntimeEnabledFeatures::setNeedsInAppBrowserPrivacyQuirks):
1692         (WebCore::RuntimeEnabledFeatures::needsInAppBrowserPrivacyQuirks const):
1693         * page/Settings.yaml:
1694
1695 2020-03-07  Jer Noble  <jer.noble@apple.com>
1696
1697         [GPUP] Implement Legacy EME API in the GPU Process
1698         https://bugs.webkit.org/show_bug.cgi?id=208402
1699
1700         Reviewed by Eric Carlson.
1701
1702         Prepare for running the LegacyCDM et. al. in the GPU process.
1703
1704         Slightly modernize LegacyCDM to allow all methods representaing a LegacyCDMFactory to be WTF::Functions.
1705
1706         Allow the list of registered factories to be cleared and reset at runtime.
1707
1708         Modify WebKitMediaKeys to notify the MediaPlayer when the keys object is added to a HTMLMediaElement.
1709
1710         Expose the pointer to the internal CDMPrivateInterface for use in WebKit.
1711
1712         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
1713         (WebCore::LegacyCDM::platformRegisterFactories):
1714         (WebCore::installedCDMFactories):
1715         (WebCore::LegacyCDM::registerCDMFactory):
1716         (WebCore::LegacyCDMFactoryForKeySystem):
1717         (WebCore::LegacyCDM::supportsKeySystem):
1718         (WebCore::LegacyCDM::keySystemSupportsMimeType):
1719         (WebCore::LegacyCDM::LegacyCDM):
1720         (WebCore::LegacyCDM::createSession):
1721         * Modules/encryptedmedia/legacy/LegacyCDM.h:
1722         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
1723         (WebCore::WebKitMediaKeys::setMediaElement):
1724         * WebCore.xcodeproj/project.pbxproj:
1725         * html/HTMLMediaElement.cpp:
1726         (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
1727         * platform/graphics/LegacyCDMSession.h:
1728         * platform/graphics/MediaPlayer.cpp:
1729         (WebCore::MediaPlayer::setCDM):
1730         * platform/graphics/MediaPlayer.h:
1731         * platform/graphics/MediaPlayerPrivate.h:
1732         (WebCore::MediaPlayerPrivateInterface::setCDM):
1733
1734 2020-03-07  Jer Noble  <jer.noble@apple.com>
1735
1736         [GPUP] LayoutTest debug assertion crashes: InitDataRegistry::registerInitDataType() called mulitple times with same type
1737         https://bugs.webkit.org/show_bug.cgi?id=208765
1738
1739         Reviewed by Simon Fraser.
1740
1741         Wrap calls to registerInitDataType() in a std::call_once, to ensure it's not called muliple times when
1742         platformRegisterFactories() is called multiple times.
1743
1744         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
1745         (WebCore::CDMFactory::platformRegisterFactories):
1746
1747 2020-03-07  Simon Fraser  <simon.fraser@apple.com>
1748
1749         Generalize setSynchronousScrollingReasons() to take a ScrollingNodeID
1750         https://bugs.webkit.org/show_bug.cgi?id=208774
1751
1752         Reviewed by Zalan Bujtas.
1753
1754         We'll be calling setSynchronousScrollingReasons() for overflow nodes at some point,
1755         so change the argument from FrameView to ScrollingNodeID.
1756
1757         * page/scrolling/AsyncScrollingCoordinator.cpp:
1758         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
1759         * page/scrolling/AsyncScrollingCoordinator.h:
1760         * page/scrolling/ScrollingCoordinator.cpp:
1761         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
1762         * page/scrolling/ScrollingCoordinator.h:
1763         (WebCore::ScrollingCoordinator::setSynchronousScrollingReasons):
1764
1765 2020-03-07  Andres Gonzalez  <andresg_22@apple.com>
1766
1767         REGRESSION: (r257760?) [ Mac wk2 Debug ] ASSERTION FAILED: child->parentObject() == this in WebCore::AccessibilityObject::insertChild
1768         https://bugs.webkit.org/show_bug.cgi?id=208648
1769
1770         Reviewed by Chris Fleizach.
1771
1772         [WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions] must
1773         not update the backing store but instead just get the backing object.
1774
1775         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1776         (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
1777
1778 2020-03-07  Ryosuke Niwa  <rniwa@webkit.org>
1779
1780         TextManipulationController should work with ARIA labels
1781         https://bugs.webkit.org/show_bug.cgi?id=208759
1782
1783         Reviewed by Wenson Hsieh.
1784
1785         This patch makes TextManipulationController work with a few ARIA content attributes.
1786
1787         It also makes observeParagraphs observe content across the entire document since canonicalizing
1788         the starting position can end up skipping some content with ARIA.
1789
1790         Tests: TextManipulation.StartTextManipulationFindAttributeContent
1791                TextManipulation.CompleteTextManipulationShouldReplaceAttributeContent
1792
1793         * editing/TextManipulationController.cpp:
1794         (WebCore::TextManipulationController::startObservingParagraphs): Now takes two Positions instead
1795         of two VisiblePositions.
1796         (WebCore::isAttributeForTextManipulation): Added.
1797         (WebCore::TextManipulationController::observeParagraphs): Added the code to find elements with
1798         ARIA attributes and a few other elements that don't generate RenderObject's.
1799         (WebCore::TextManipulationController::scheduleObservartionUpdate):
1800         (WebCore::TextManipulationController::addItem): Now takes ManipulationItemData instead of indivisual
1801         fields in it.
1802         (WebCore::TextManipulationController::replace): Added the logic to handle ManipulationItemData
1803         that specify element and attributeName.
1804         * editing/TextManipulationController.h:
1805         (WebCore::TextManipulationController::ManipulationItemData): Added element and attributeName.
1806
1807 2020-03-07  Megan Gardner  <megan_gardner@apple.com>
1808
1809         Adopt UIContextMenu for WKFileUploadPanel
1810         https://bugs.webkit.org/show_bug.cgi?id=208687
1811
1812         Reviewed by Tim Horton.
1813
1814         New string, no tests needed.
1815
1816         * en.lproj/Localizable.strings:
1817
1818 2020-03-07  Daniel Bates  <dabates@apple.com>
1819
1820         [iOS] Implement support for dictation alternatives
1821         https://bugs.webkit.org/show_bug.cgi?id=208720
1822         <rdar://problem/58540114>
1823
1824         Reviewed by Brent Fulgham.
1825
1826         Part 3
1827
1828         Separate code that is actually USE(AUTOCORRECTION_PANEL)-specific from code that can also
1829         be used when building with USE(DICTATION_ALTERNATIVES) enabled.
1830
1831         Note that I haven't enable USE_DICTATION_ALTERNATIVES on iOS. So, this code isn't being
1832         compiled for iOS. I will do that in a subsequent change once after all the code is in place
1833         to do so.
1834
1835         * SourcesCocoa.txt: Mark TextAlternativeWithRange.mm as @no-unify to fix build breakage when
1836         a unified source file includes both TextAlternativeWithRange.mm and a file that ultimately
1837         includes LengthBox.h (e.g. WebArchiveResourceFromNSAttributedString.mm). TextAlternativeWithRange.mm
1838         ultimately includes SFNTLayoutTypes.h, which defines a Fixed type that conflicts with enumerator
1839         Fixed (part of the LengthType enumeration) defined in Length.h. Ideally the LengthType enumeration
1840         would be an enum class or scoped to Length to avoid this ambiguity. This would be a big change to do
1841         and so for now I am fixing the build breakage using @no-unify.
1842         * WebCore.xcodeproj/project.pbxproj: Add TextAlternativeWithRange.mm to the project now that
1843         it is excluded from the unified build.
1844         * editing/AlternativeTextController.cpp:
1845         (WebCore::markerTypesForAppliedDictationAlternative):
1846         (WebCore::AlternativeTextController::alternativeTextClient):
1847         (WebCore::AlternativeTextController::markerDescriptionForAppliedAlternativeText):
1848         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
1849         * editing/AlternativeTextController.h:
1850
1851 2020-03-07  Daniel Bates  <dabates@apple.com>
1852
1853         [iOS] Implement support for dictation alternatives
1854         https://bugs.webkit.org/show_bug.cgi?id=208720
1855         <rdar://problem/58540114>
1856
1857         Reviewed by Wenson Hsieh.
1858
1859         Part 2
1860
1861         Include UIKitSPI.h in TextAlternativeWithRange.mm to get the definition of NSTextAlternatives
1862         when building for iOS. Also while I am here, fix up some code style issues and use uniform
1863         initializer syntax.
1864
1865         Note that I haven't enable USE_DICTATION_ALTERNATIVES on iOS. So, this code isn't being
1866         compiled for iOS. I will do that in a subsequent change once after all the code is in place
1867         to do so.
1868
1869         * editing/mac/TextAlternativeWithRange.mm:
1870         (WebCore::TextAlternativeWithRange::TextAlternativeWithRange):
1871
1872 2020-03-07  Daniel Bates  <dabates@apple.com>
1873
1874         [iOS] Implement support for dictation alternatives
1875         https://bugs.webkit.org/show_bug.cgi?id=208720
1876         <rdar://problem/58540114>
1877
1878         Reviewed by Wenson Hsieh.
1879
1880         Part 1
1881
1882         Rename editing/mac/AlternativeTextUIController.{h, mm} to editing/cocoa/AlternativeTextUIController.{h, mm}
1883         as it can be shared by both Mac and iOS. I also took this opportunity to do some very minor modernization
1884         and cleanup to these files: use =default constructors and put the * on the right side for Objective-C types.
1885
1886         Note that I haven't enable USE_DICTATION_ALTERNATIVES on iOS. So, this code isn't being
1887         compiled for iOS. I will do that in a subsequent change once after all the code is in place
1888         to do so.
1889
1890         * SourcesCocoa.txt:
1891         * WebCore.xcodeproj/project.pbxproj:
1892         * editing/cocoa/AlternativeTextContextController.h:
1893         * editing/cocoa/AlternativeTextContextController.mm: Added.
1894         (WebCore::AlternativeTextContextController::addAlternatives):
1895         (WebCore::AlternativeTextContextController::alternativesForContext):
1896         (WebCore::AlternativeTextContextController::removeAlternativesForContext):
1897         (WebCore::AlternativeTextContextController::clear):
1898         * editing/cocoa/AlternativeTextUIController.h: Renamed from Source/WebCore/editing/mac/AlternativeTextUIController.h.
1899         * editing/cocoa/AlternativeTextUIController.mm: Renamed from Source/WebCore/editing/mac/AlternativeTextUIController.mm.
1900         (WebCore::AlternativeTextUIController::addAlternatives):
1901         (WebCore::AlternativeTextUIController::alternativesForContext):
1902         (WebCore::AlternativeTextUIController::clear):
1903         (WebCore::AlternativeTextUIController::showAlternatives):
1904         (WebCore::AlternativeTextUIController::handleAcceptedAlternative):
1905         (WebCore::AlternativeTextUIController::dismissAlternatives):
1906         (WebCore::AlternativeTextUIController::removeAlternatives):
1907
1908 2020-03-07  Fujii Hironori  <Hironori.Fujii@sony.com>
1909
1910         [CMake][Win] GenerateSettings.rb are invoked twice in WebCoreBindings.vcxproj and WebCoreTestSupportBindings.vcxproj
1911         https://bugs.webkit.org/show_bug.cgi?id=208771
1912
1913         Reviewed by Konstantin Tokarev.
1914
1915         CMake Visual Studio generator put a custom command of
1916         GenerateSettings.rb into both WebCoreBindings.vcxproj and
1917         WebCoreTestSupportBindings.vcxproj because both projects are
1918         using the generated files as source files. This causes
1919         unnecessary recompilation.
1920
1921         The fundamental issue of this bug was fixed in CMake 3.12.
1922         <https://gitlab.kitware.com/cmake/cmake/issues/16767>
1923         All Windows ports are using newer CMake for Visual Studio 2019
1924         support.
1925
1926         However, WebCoreTestSupportBindings needs to have a direct or
1927         indirect dependency to WebCoreBindings for CMake Visual Studio
1928         generator to eliminate duplicated custom commands. Otherwise,
1929         GenerateSettings.rb will be triggered in both projects.
1930
1931         * CMakeLists.txt: Added a explicit dependency to WebCoreBindings
1932         for WebCoreTestSupportBindings.
1933         * WebCoreMacros.cmake: Removed stale comment.
1934
1935 2020-03-07  Eric Carlson  <eric.carlson@apple.com>
1936
1937         Implement setWirelessPlaybackTarget, performTaskAtMediaTime, and wouldTaintOrigin in GPUProcess
1938         https://bugs.webkit.org/show_bug.cgi?id=208651
1939         <rdar://problem/60088298>
1940
1941         Reviewed by Youenn Fablet.
1942
1943         * html/HTMLMediaElement.cpp:
1944         (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Remove unused lambda parameter.
1945
1946         * platform/graphics/MediaPlayer.cpp:
1947         (WebCore::MediaPlayer::performTaskAtMediaTime): Make MediaTime parameter const ref
1948         so it isn't copied.
1949         * platform/graphics/MediaPlayer.h:
1950
1951         * platform/graphics/MediaPlayerPrivate.h:
1952         (WebCore::MediaPlayerPrivateInterface::performTaskAtMediaTime): Ditto.
1953
1954         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1955         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1956         (WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime): Ditto.
1957
1958         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1959         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1960         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime): Ditto.
1961
1962         * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
1963         (WebCore::VideoLayerManagerObjC::setVideoFullscreenLayer): Don't set inline image
1964         contents if image is NULL.
1965
1966 2020-03-07  Brady Eidson  <beidson@apple.com>
1967
1968         Add runtime flag for incremental PDF loading.
1969         https://bugs.webkit.org/show_bug.cgi?id=208763
1970
1971         Reviewed by Tim Horton.
1972
1973         * page/RuntimeEnabledFeatures.h:
1974         (WebCore::RuntimeEnabledFeatures::setIncrementalPDFLoadingEnabled):
1975         (WebCore::RuntimeEnabledFeatures::incrementalPDFLoadingEnabled const):
1976
1977 2020-03-07  Zalan Bujtas  <zalan@apple.com>
1978
1979         [LFC][Verification] Use the table wrapper box's offset when matching out-of-flow tables
1980         https://bugs.webkit.org/show_bug.cgi?id=208769
1981         <rdar://problem/60191322>
1982
1983         Reviewed by Antti Koivisto.
1984
1985         In LFC, an out-of-flow table initiates a wrapper table box (out-of-flow) and a child table box (in-flow).
1986         Apply the wrapper table box's offset, when matching the display and the render tree.
1987
1988         Test: fast/layoutformattingcontext/absolute-positioned-simple-table2.html
1989
1990         * layout/Verification.cpp:
1991         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1992
1993 2020-03-07  Darin Adler  <darin@apple.com>
1994
1995         Make Editor::applyEditingStyleToBodyElement do things in a straightforward manner
1996         https://bugs.webkit.org/show_bug.cgi?id=208177
1997
1998         Reviewed by Wenson Hsieh.
1999
2000         * editing/Editor.cpp:
2001         (WebCore::Editor::applyEditingStyleToBodyElement const): Use Document::body and
2002         StyledElement::setInlineStyleProperty to apply styles to the body. The older code
2003         was looping over all body elements in the document, for no good reason, and using
2004         the CSS object model wrapper object for the styles, also for no good reason.
2005
2006 2020-03-05  Sam Weinig  <weinig@apple.com>
2007
2008         Move JavaScriptCore related feature defines from FeatureDefines.xcconfig to PlatformEnableCocoa.h
2009         https://bugs.webkit.org/show_bug.cgi?id=207436
2010         <rdar://problem/59296762>
2011
2012         Reviewed by Darin Adler.
2013
2014         * Configurations/FeatureDefines.xcconfig:
2015         Remove JSC related defines.
2016
2017 2020-03-07  Chris Fleizach  <cfleizach@apple.com>
2018
2019         AX: Provide a way to run tests in isolated tree mode
2020         https://bugs.webkit.org/show_bug.cgi?id=208629
2021         <rdar://problem/60075583>
2022
2023         Reviewed by Ryosuke Niwa.
2024
2025         Now that we have a way to run this with tests, we don't need to allow usage for an unknown client.
2026
2027         * accessibility/AXObjectCache.cpp:
2028         (WebCore::AXObjectCache::clientSupportsIsolatedTree):
2029
2030 2020-03-07  Zalan Bujtas  <zalan@apple.com>
2031
2032         [LFC][IFC] Use start-aligned horizontal adjustment when justify is not eligible.
2033         https://bugs.webkit.org/show_bug.cgi?id=208762
2034         <rdar://problem/60188433>
2035
2036         Reviewed by Antti Koivisto.
2037
2038         Make sure we apply "text-align: start" when "text-align: justify" is not eligible.
2039         Currently "text-align: start" is a no-op, so no chnange in functionality (this might change in the future).
2040
2041         * layout/inlineformatting/InlineLineBuilder.cpp:
2042         (WebCore::Layout::LineBuilder::alignHorizontally):
2043         (WebCore::Layout::LineBuilder::removeTrailingTrimmableContent):
2044         * layout/inlineformatting/InlineLineBuilder.h:
2045         (WebCore::Layout::LineBuilder::isTextAlignJustify const): Deleted.
2046         (WebCore::Layout::LineBuilder::isTextAlignRight const): Deleted.
2047
2048 2020-03-07  Zalan Bujtas  <zalan@apple.com>
2049
2050         [LFC][IFC] Do not text-align: justify the runs on the current line if they are followed by a forced break
2051         https://bugs.webkit.org/show_bug.cgi?id=208761
2052         <rdar://problem/59825136>
2053
2054         Reviewed by Antti Koivisto.
2055
2056         https://www.w3.org/TR/css-text-3/#text-align-property
2057         "Text is justified according to the method specified by the text-justify property,
2058         in order to exactly fill the line box. Unless otherwise specified by text-align-last,
2059         the last line before a forced break or the end of the block is start-aligned."
2060
2061         Test: fast/text/text-align-justify-and-forced-line-break.html
2062
2063         * layout/inlineformatting/InlineLineBuilder.cpp:
2064         (WebCore::Layout::LineBuilder::alignHorizontally):
2065
2066 2020-03-07  Konstantin Tokarev  <annulen@yandex.ru>
2067
2068         REGRESSION(r257975): [GTK][WPE] Build failure after a clean build
2069         https://bugs.webkit.org/show_bug.cgi?id=208711
2070
2071         Reviewed by Yusuke Suzuki.
2072
2073         Make sure that InternalSettingsGenerated,idl is generated before bindings
2074         generation starts.
2075
2076         Also, make IDL preprocessor die if specified IDL file is missing, instead
2077         of going on silently.
2078
2079         * CMakeLists.txt:
2080         * WebCoreMacros.cmake:
2081         * bindings/scripts/preprocess-idls.pl:
2082         (getFileContents):
2083
2084 2020-03-07  Andres Gonzalez  <andresg_22@apple.com>
2085
2086         AXIsolatedObject support for documentLinks.
2087         https://bugs.webkit.org/show_bug.cgi?id=208734
2088
2089         Reviewed by Chris Fleizach.
2090
2091         - Expose documentLinks through the AXCoreObject interface, so that
2092         wrapper code works for both AXObject and AXIsolatedObjects.
2093         - Struct NodeChange now retains wrapper which was causing crash as the
2094         wrapper was destroyed before it was attached to the IsolatedObject.
2095
2096         * accessibility/AccessibilityObject.h:
2097         * accessibility/AccessibilityObjectInterface.h:
2098         * accessibility/AccessibilityRenderObject.cpp:
2099         (WebCore::AccessibilityRenderObject::documentLinks):
2100         (WebCore::AccessibilityRenderObject::getDocumentLinks): Deleted.
2101         * accessibility/AccessibilityRenderObject.h:
2102         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2103         (WebCore::AXIsolatedObject::initializeAttributeData):
2104         * accessibility/isolatedtree/AXIsolatedObject.h:
2105         * accessibility/isolatedtree/AXIsolatedTree.cpp:
2106         (WebCore::AXIsolatedTree::setFocusedNode):
2107         (WebCore::AXIsolatedTree::applyPendingChanges):
2108         * accessibility/isolatedtree/AXIsolatedTree.h:
2109         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2110         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2111
2112 2020-03-07  chris fleizach  <cfleizach@apple.com>
2113
2114         Unreviewed, rolling out r258047.
2115
2116         Referenced SPI not yet available for Safari builders.
2117
2118         Reverted changeset:
2119
2120         "Implementation of AccessibilitySupport AXSIsolatedTreeMode."
2121         https://bugs.webkit.org/show_bug.cgi?id=208691
2122         https://trac.webkit.org/changeset/258047
2123
2124 2020-03-06  David Kilzer  <ddkilzer@apple.com>
2125
2126         REGRESSION (r258051): WinCairo/WPE/GTK build failures
2127         <https://bugs.webkit.org/show_bug.cgi?id=208621>
2128         <rdar://problem/60068047>
2129
2130         * Headers.cmake:
2131         (WebCore_PRIVATE_FRAMEWORK_HEADERS): Add html/ImageData.h to
2132         attempt a build fix.
2133
2134 2020-03-06  Yusuke Suzuki  <ysuzuki@apple.com>
2135
2136         Put remaining fixed-sized cells into IsoSubspace
2137         https://bugs.webkit.org/show_bug.cgi?id=208754
2138
2139         Reviewed by Keith Miller.
2140
2141         * bindings/js/JSDOMIterator.h:
2142         * bindings/scripts/CodeGeneratorJS.pm:
2143         (GeneratePrototypeDeclaration):
2144         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2145         * bindings/scripts/test/JS/JSMapLike.cpp:
2146         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2147         * bindings/scripts/test/JS/JSReadOnlySetLike.cpp:
2148         * bindings/scripts/test/JS/JSSetLike.cpp:
2149         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2150         (WebCore::JSTestActiveDOMObjectConstructor::prototypeForStructure):
2151         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2152         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2153         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2154         (WebCore::JSTestCallTracerConstructor::prototypeForStructure):
2155         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2156         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2157         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2158         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
2159         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2160         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2161         * bindings/scripts/test/JS/JSTestException.cpp:
2162         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2163         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2164         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2165         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2166         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2167         * bindings/scripts/test/JS/JSTestInterface.cpp:
2168         (WebCore::JSTestInterfaceConstructor::construct):
2169         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2170         * bindings/scripts/test/JS/JSTestIterable.cpp:
2171         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2172         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2173         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2174         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2175         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2176         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2177         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2178         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2179         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2180         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2181         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2182         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2183         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2184         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2185         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2186         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2187         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2188         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2189         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2190         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2191         (WebCore::JSTestNamedSetterWithUnforgablePropertiesConstructor::prototypeForStructure):
2192         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2193         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::prototypeForStructure):
2194         * bindings/scripts/test/JS/JSTestNode.cpp:
2195         * bindings/scripts/test/JS/JSTestObj.cpp:
2196         (WebCore::JSTestObjConstructor::construct):
2197         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2198         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2199         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2200         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2201         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2202         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2203         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2204         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2205         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2206         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2207         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2208         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2209         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2210         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2211         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2212         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2213         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2214         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2215         (WebCore::JSTestTypedefsConstructor::construct):
2216
2217 2020-03-06  Simon Fraser  <simon.fraser@apple.com>
2218
2219         Fix scrolling tree hit-testing on scrolled and zoomed pages
2220         https://bugs.webkit.org/show_bug.cgi?id=208755
2221
2222         Reviewed by Zalan Bujtas.
2223
2224         Map the hit-test point from view to content coordinates before hit-testing the scrolling tree.
2225
2226         Tests: fast/scrolling/mac/overflow-scrolled-document.html
2227                fast/scrolling/mac/overflow-zoomed-document.html
2228
2229         * page/scrolling/ScrollingTree.cpp:
2230         (WebCore::ScrollingTree::handleWheelEvent):
2231
2232 2020-03-06  Alex Christensen  <achristensen@webkit.org>
2233
2234         Add SPI to disable cross origin access control checks
2235         https://bugs.webkit.org/show_bug.cgi?id=208748
2236         <rdar://problem/59861114>
2237
2238         Reviewed by Tim Hatcher.
2239
2240         Because loading is done process-globally in the WebProcess, use a CrossOriginAccessControlCheckDisabler::singleton for those checks.
2241         Pass a parameter to the NetworkResourceLoaders to disable these checks only for loads from a web process without access control checks.
2242         As long as we're changing the signature of passesAccessControlCheck, make it return an Expected instead of a bool with an out parameter.
2243
2244         * loader/CrossOriginAccessControl.cpp:
2245         (WebCore::CrossOriginAccessControlCheckDisabler::singleton):
2246         (WebCore::CrossOriginAccessControlCheckDisabler::setCrossOriginAccessControlCheckEnabled):
2247         (WebCore::CrossOriginAccessControlCheckDisabler::crossOriginAccessControlCheckEnabled const):
2248         (WebCore::passesAccessControlCheck):
2249         (WebCore::validatePreflightResponse):
2250         * loader/CrossOriginAccessControl.h:
2251         * loader/CrossOriginPreflightChecker.cpp:
2252         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
2253         * loader/DocumentThreadableLoader.cpp:
2254         (WebCore::DocumentThreadableLoader::loadRequest):
2255         * loader/SubresourceLoader.cpp:
2256         (WebCore::SubresourceLoader::willSendRequestInternal):
2257         (WebCore::SubresourceLoader::didReceiveResponse):
2258         (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):
2259         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
2260         * loader/SubresourceLoader.h:
2261         * loader/cache/CachedResource.cpp:
2262         (WebCore::CachedResource::loadFrom):
2263
2264 2020-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
2265
2266         [GPU Process] Implement CanvasRenderingContext2D.putImageData()
2267         https://bugs.webkit.org/show_bug.cgi?id=208621
2268         <rdar://problem/60068047>
2269
2270         Reviewed by Simon Fraser.
2271
2272         putImageData() is implemented just as a DisplayListItem. Conceptually, it's the
2273         same as a draw command. Unfortunately, it can't be implemented on top of
2274         GraphicsContext, and instead has to be implemented on top of ImageBuffer, so
2275         this patch also adds a delegate to DisplayList::Replayer which can implement the
2276         commands that require an ImageBuffer. This moves in the direction of making the
2277         display list raw data, and moving the applier functions somewhere else at a
2278         higher level.
2279
2280         Implementing this as a DisplayListItem rather than its own IPC message is superior
2281         because it gives us more control about when to flush the in-flight display list.
2282
2283         There is still a few unnecessary copies - we're copying into / out of a SharedData
2284         during encoding. Being able to either have the ImageBuffer retain the SharedBuffer,
2285         or have putImageData() have an overload which accepts a SharedBuffer, would be a
2286         good opportunity for improvement.
2287
2288         Test: fast/canvas/putImageData-multiple.html
2289
2290         * html/ImageData.cpp:
2291         (WebCore::ImageData::deepClone const):
2292         * html/ImageData.h:
2293         * platform/graphics/AlphaPremultiplication.h:
2294         * platform/graphics/GraphicsContext.h:
2295         (WebCore::GraphicsContext::impl):
2296         * platform/graphics/displaylists/DisplayList.h:
2297         * platform/graphics/displaylists/DisplayListDrawingContext.cpp:
2298         (WebCore::DisplayList::DrawingContext::recorder):
2299         * platform/graphics/displaylists/DisplayListDrawingContext.h:
2300         * platform/graphics/displaylists/DisplayListItems.cpp:
2301         (WebCore::DisplayList::Item::sizeInBytes):
2302         (WebCore::DisplayList::PutImageData::PutImageData):
2303         (WebCore::DisplayList::PutImageData::apply const):
2304         (WebCore::DisplayList::operator<<):
2305         * platform/graphics/displaylists/DisplayListItems.h:
2306         (WebCore::DisplayList::DrawingItem::globalBounds const):
2307         (WebCore::DisplayList::PutImageData::create):
2308         (WebCore::DisplayList::PutImageData::inputFormat const):
2309         (WebCore::DisplayList::PutImageData::imageData const):
2310         (WebCore::DisplayList::PutImageData::srcRect const):
2311         (WebCore::DisplayList::PutImageData::destPoint const):
2312         (WebCore::DisplayList::PutImageData::encode const):
2313         (WebCore::DisplayList::PutImageData::decode):
2314         (WebCore::DisplayList::Item::encode const):
2315         (WebCore::DisplayList::Item::decode):
2316         * platform/graphics/displaylists/DisplayListRecorder.cpp:
2317         (WebCore::DisplayList::Recorder::putImageData):
2318         (WebCore::DisplayList::Recorder::updateItemExtent const):
2319         * platform/graphics/displaylists/DisplayListRecorder.h:
2320         * platform/graphics/displaylists/DisplayListReplayer.cpp:
2321         (WebCore::DisplayList::Replayer::Replayer):
2322         (WebCore::DisplayList::Replayer::replay):
2323         * platform/graphics/displaylists/DisplayListReplayer.h:
2324         (WebCore::DisplayList::Replayer::Delegate::~Delegate):
2325         (WebCore::DisplayList::Replayer::Delegate::apply):
2326
2327 2020-03-06  Daniel Bates  <dabates@apple.com>
2328
2329         Add support for inserting and removing a text placeholder
2330         https://bugs.webkit.org/show_bug.cgi?id=208661
2331         <rdar://problem/59371073>
2332
2333         Reviewed by Simon Fraser and Ryosuke Niwa.
2334
2335         Implements the concept of a text placeholder, which is an element that acts like whitespace:
2336         it takes up space in the page layout, but has no visual appearance.
2337
2338         Tests: editing/text-placeholder/insert-and-remove-into-text-field.html
2339                editing/text-placeholder/insert-into-content-editable.html
2340                editing/text-placeholder/insert-into-empty-text-field.html
2341                editing/text-placeholder/insert-into-text-field-in-iframe.html
2342                editing/text-placeholder/insert-into-text-field.html
2343
2344         * Sources.txt:
2345         * WebCore.xcodeproj/project.pbxproj:
2346         * dom/Element.h:
2347         (WebCore::Element::isTextPlaceholderElement const): Added. Defaults to false. I override this
2348         in TextPlaceholderElement.h.
2349
2350         * editing/Editor.cpp:
2351         (WebCore::Editor::insertTextPlaceholder):
2352         (WebCore::Editor::removeTextPlaceholder):
2353         Insert a new placeholder or remove an existing one.
2354
2355         * editing/Editor.h:
2356         * html/shadow/TextPlaceholderElement.cpp: Added.
2357         (WebCore::TextPlaceholderElement::create):
2358         (WebCore::TextPlaceholderElement::TextPlaceholderElement): Set inline styles to size the placeholder.
2359         (WebCore::TextPlaceholderElement::insertedIntoAncestor): If the placeholder is inserted inside an
2360         HTMLTextFormControlElement (e.g. <input> or <textarea>) then hide the HTML placeholder text.
2361         (WebCore::TextPlaceholderElement::removedFromAncestor): If the placeholder was removed from inside
2362         an HTMLTextFormControlElement then show the HTML placeholder text.
2363         * html/shadow/TextPlaceholderElement.h:
2364         (isType):
2365         * testing/Internals.cpp:
2366         (WebCore::Internals::insertTextPlaceholder): Added.
2367         (WebCore::Internals::removeTextPlaceholder): Added.
2368         * testing/Internals.h:
2369         * testing/Internals.idl:
2370
2371 2020-03-06  Andres Gonzalez  <andresg_22@apple.com>
2372
2373         Implementation of AccessibilitySupport AXSIsolatedTreeMode.
2374         https://bugs.webkit.org/show_bug.cgi?id=208691
2375
2376         Reviewed by Chris Fleizach.
2377
2378         Support for the AccessibilitySupport AXIsolatedTreMode accessibility setting.
2379
2380         * accessibility/AXObjectCache.cpp:
2381         (WebCore::AXObjectCache::isolatedTreeFocusedObject):
2382         (WebCore::AXObjectCache::focusedUIElementForPage):
2383         (WebCore::AXObjectCache::isIsolatedTreeEnabled):
2384         (WebCore::AXObjectCache::rootObject):
2385         (WebCore::AXObjectCache::isolatedTreeRootObject):
2386         (WebCore::AXObjectCache::canUseSecondaryAXThread):
2387         * accessibility/AXObjectCache.h:
2388         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2389         (-[WebAccessibilityObjectWrapperBase detach]):
2390         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
2391         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2392         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
2393
2394 2020-03-06  Simon Fraser  <simon.fraser@apple.com>
2395
2396         Hit-test CALayers on the scrolling thread for async frame/overflow scrolling
2397         https://bugs.webkit.org/show_bug.cgi?id=208740
2398         <rdar://problem/48028836>
2399
2400         Reviewed by Tim Horton.
2401
2402         Implement hit-testing in the scrolling thread so we can determine which overflow/subframe
2403         to scroll without hitting the main thread.
2404
2405         ScrollingTreeMac overrides scrollingNodeForPoint() and hit-tests through CALayers, starting at the
2406         root content layer. Locking ensures that the CALayer tree doesn't change while we're hit-testing it.
2407         We collect layers for the given point in back-to-front order much like the iOS code _web_findDescendantViewAtPoint
2408         (too different to share though), and consult event regions on PlatformCALayerCocoa's to determine if the
2409         point is inside the part of the layer that should receive events.
2410
2411         To handle the complex stacking/containing block cases, isScrolledBy() consults the scrolling tree.
2412
2413         For testing, fix it so that multiple calls to monitorWheelEvents() in a single test each start
2414         with clean state.
2415
2416         Tests: fast/scrolling/mac/absolute-in-overflow-scroll.html
2417                fast/scrolling/mac/async-scroll-overflow.html
2418                fast/scrolling/mac/move-node-in-overflow-scroll.html
2419                fast/scrolling/mac/overlapped-overflow-scroll.html
2420
2421         * page/scrolling/ScrollingTree.cpp:
2422         (WebCore::ScrollingTree::handleWheelEvent):
2423         (WebCore::ScrollingTree::scrollingNodeForPoint):
2424         * page/scrolling/ScrollingTree.h:
2425         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2426         * page/scrolling/mac/ScrollingTreeMac.h:
2427         * page/scrolling/mac/ScrollingTreeMac.mm:
2428         (collectDescendantLayersAtPoint):
2429         (scrollingNodeIDForLayer):
2430         (isScrolledBy):
2431         (ScrollingTreeMac::scrollingNodeForPoint):
2432         * testing/js/WebCoreTestSupport.cpp:
2433         (WebCoreTestSupport::monitorWheelEvents): Make sure that each call to eventSender.monitorWheelEvents() clears previous state.
2434
2435 2020-03-06  Jer Noble  <jer.noble@apple.com>
2436
2437         [GPUP] Convert CDMFactory away from platformStrategies() and use WebProcess settings instead
2438         https://bugs.webkit.org/show_bug.cgi?id=208699
2439
2440         Reviewed by Youenn Fablet.
2441
2442         * platform/MediaStrategy.h:
2443         * platform/encryptedmedia/CDMFactory.cpp:
2444
2445 2020-03-06  Ryosuke Niwa  <rniwa@webkit.org>
2446
2447         TextManipulationController should preserve images
2448         https://bugs.webkit.org/show_bug.cgi?id=208692
2449
2450         Reviewed by Wenson Hsieh.
2451
2452         This patch makes TextManipulationController preserve images (img and SVG) and their ordering,
2453         and lays down the foundation for preserving other non-text content.
2454
2455         To do this, this patch introduces ParagraphContentIterator which wraps TextIterator and introduces
2456         a secondary node iteration which detects all ndoes that have been skipped. Ideally, we would update
2457         TextIterator to do this natively but this is tricky due to the multitude of the node traveral options
2458         supported by TextIterator at the moment. ParagraphContentIterator::advance stops at every node
2459         including ones that do not generate text in TextIterator. This also allows more code sharing between
2460         TextManipulationController's observeParagraphs and replace functions.
2461
2462         For now, we special case nodes with RenderReplaced like img element and the root SVG element.
2463
2464         Tests: TextManipulation.CompleteTextManipulationShouldPreserveImagesAsExcludedTokens
2465                TextManipulation.CompleteTextManipulationShouldPreserveSVGAsExcludedTokens
2466                TextManipulation.CompleteTextManipulationShouldPreserveOrderOfBlockImage
2467
2468         * editing/TextManipulationController.cpp:
2469         (WebCore::ParagraphContentIterator): Added.
2470         (WebCore::ParagraphContentIterator::ParagraphContentIterator): Added.
2471         (WebCore::ParagraphContentIterator::advance): Added.
2472         (WebCore::ParagraphContentIterator::currentContent): Added.
2473         (WebCore::ParagraphContentIterator::startPosition): Added.
2474         (WebCore::ParagraphContentIterator::endPosition): Added.
2475         (WebCore::ParagraphContentIterator::atEnd const): Added.
2476         (WebCore::ParagraphContentIterator::moveCurrentNodeForward): Added.
2477         (WebCore::TextManipulationController::observeParagraphs): Adopted ParagraphContentIterator. For
2478         nodes with RenderReplaced, we generate an excluded token "[]". Removed the dead code which was
2479         creating a subrange from TextIterator, and renamed the previously misleadingly named endOfLastNewLine
2480         to startOfCurrentLine for clarity.
2481         (WebCore::TextManipulationController::replace): Adopted ParagraphContentIterator. Fixed a bug that
2482         excluded content were always assumed to be text, and a bug that the replaced content was inserted
2483         at a wrong location when insertionPoint is a position anchored at a node being removed. Also fixed
2484         an obvious bug that we were inserting root replaced contents at the position before a node which
2485         appears immediately before insertionPoint instead of after; this also resulted in the replaced content
2486         being inserted at a wrong location in some cases.
2487
2488 2020-03-06  Andres Gonzalez  <andresg_22@apple.com>
2489
2490         Crash accessing AXIsolatedObject::m_childrenIDS from removeSubtree on the main thread.
2491         https://bugs.webkit.org/show_bug.cgi?id=208728
2492
2493         Reviewed by Chris Fleizach.
2494
2495         AXIsolatedTree::removeSubtree was accessing AXIsolatedObject::m_childrenIDs
2496         on the main thread to remove all descendants recursively. But the lock
2497         had to be unlocked and locked again on each iteration, creating problems
2498         if the secondary thread modifies the children in between iterations.
2499         The solution in this patch is to eliminate removeSubtree, and make
2500         removeNode and applyPendingChanges to remove all descendants.
2501
2502         * accessibility/AXObjectCache.cpp:
2503         (WebCore::AXObjectCache::updateIsolatedTree):
2504         * accessibility/isolatedtree/AXIsolatedTree.cpp:
2505         (WebCore::AXIsolatedTree::appendNodeChanges): Renamed local vars to make it clearer.
2506         (WebCore::AXIsolatedTree::applyPendingChanges):
2507         (WebCore::AXIsolatedTree::removeSubtree): Deleted.
2508         * accessibility/isolatedtree/AXIsolatedTree.h:
2509
2510 2020-03-06  Yusuke Suzuki  <ysuzuki@apple.com>
2511
2512         JSDOMIterator classes should be in IsoSubspace
2513         https://bugs.webkit.org/show_bug.cgi?id=208705
2514
2515         Reviewed by Sam Weinig.
2516
2517         JSDOMIterator should be allocated in IsoSubspace. So we can put all WebCore related cells into IsoSubspaces.
2518         To collect all iterator subspaces in DOMIsoSubspaces class, we scan `iterable<...>` pattern in preprocess-idls.pl.
2519         Then, we create a class for each DOM iterator instead of using `using XXXIterator = JSDOMIterator<...>` to put
2520         subspaceFor implementation easily. And we rename JSDOMIterator to JSDOMIteratorBase to explicitly state that
2521         this is Base class of actual iterators.
2522
2523         * bindings/js/JSDOMIterator.h:
2524         (WebCore::JSDOMIteratorBase::JSDOMIteratorBase):
2525         (WebCore::IteratorTraits>::asJS):
2526         (WebCore::IteratorTraits>::destroy):
2527         (WebCore::IteratorTraits>::next):
2528         (WebCore::JSDOMIterator::createStructure): Deleted.
2529         (WebCore::JSDOMIterator::create): Deleted.
2530         (WebCore::JSDOMIterator::createPrototype): Deleted.
2531         (WebCore::JSDOMIterator::JSDOMIterator): Deleted.
2532         * bindings/js/JSDOMWrapper.h:
2533         (WebCore::JSDOMObject::subspaceFor):
2534         * bindings/scripts/CodeGeneratorJS.pm:
2535         (GenerateIterableDefinition):
2536         (GeneratePrototypeDeclaration):
2537         * bindings/scripts/preprocess-idls.pl:
2538         (interfaceIsIterable):
2539         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2540         (WebCore::JSInterfaceNamePrototype::create): Deleted.
2541         (WebCore::JSInterfaceNamePrototype::createStructure): Deleted.
2542         (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype): Deleted.
2543         * bindings/scripts/test/JS/JSMapLike.cpp:
2544         (WebCore::JSMapLikePrototype::create): Deleted.
2545         (WebCore::JSMapLikePrototype::createStructure): Deleted.
2546         (WebCore::JSMapLikePrototype::JSMapLikePrototype): Deleted.
2547         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2548         (WebCore::JSReadOnlyMapLikePrototype::create): Deleted.
2549         (WebCore::JSReadOnlyMapLikePrototype::createStructure): Deleted.
2550         (WebCore::JSReadOnlyMapLikePrototype::JSReadOnlyMapLikePrototype): Deleted.
2551         * bindings/scripts/test/JS/JSReadOnlySetLike.cpp:
2552         (WebCore::JSReadOnlySetLikePrototype::create): Deleted.
2553         (WebCore::JSReadOnlySetLikePrototype::createStructure): Deleted.
2554         (WebCore::JSReadOnlySetLikePrototype::JSReadOnlySetLikePrototype): Deleted.
2555         * bindings/scripts/test/JS/JSSetLike.cpp:
2556         (WebCore::JSSetLikePrototype::create): Deleted.
2557         (WebCore::JSSetLikePrototype::createStructure): Deleted.
2558         (WebCore::JSSetLikePrototype::JSSetLikePrototype): Deleted.
2559         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2560         (WebCore::JSTestActiveDOMObjectConstructor::prototypeForStructure):
2561         (WebCore::JSTestActiveDOMObjectPrototype::create): Deleted.
2562         (WebCore::JSTestActiveDOMObjectPrototype::createStructure): Deleted.
2563         (WebCore::JSTestActiveDOMObjectPrototype::JSTestActiveDOMObjectPrototype): Deleted.
2564         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2565         (WebCore::JSTestCEReactionsPrototype::create): Deleted.
2566         (WebCore::JSTestCEReactionsPrototype::createStructure): Deleted.
2567         (WebCore::JSTestCEReactionsPrototype::JSTestCEReactionsPrototype): Deleted.
2568         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2569         (WebCore::JSTestCEReactionsStringifierPrototype::create): Deleted.
2570         (WebCore::JSTestCEReactionsStringifierPrototype::createStructure): Deleted.
2571         (WebCore::JSTestCEReactionsStringifierPrototype::JSTestCEReactionsStringifierPrototype): Deleted.
2572         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2573         (WebCore::JSTestCallTracerConstructor::prototypeForStructure):
2574         (WebCore::JSTestCallTracerPrototype::create): Deleted.
2575         (WebCore::JSTestCallTracerPrototype::createStructure): Deleted.
2576         (WebCore::JSTestCallTracerPrototype::JSTestCallTracerPrototype): Deleted.
2577         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2578         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::create): Deleted.
2579         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::createStructure): Deleted.
2580         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::JSTestClassWithJSBuiltinConstructorPrototype): Deleted.
2581         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2582         (WebCore::JSTestDOMJITPrototype::create): Deleted.
2583         (WebCore::JSTestDOMJITPrototype::createStructure): Deleted.
2584         (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype): Deleted.
2585         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2586         (WebCore::JSTestEnabledBySettingPrototype::create): Deleted.
2587         (WebCore::JSTestEnabledBySettingPrototype::createStructure): Deleted.
2588         (WebCore::JSTestEnabledBySettingPrototype::JSTestEnabledBySettingPrototype): Deleted.
2589         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
2590         (WebCore::JSTestEnabledForContextPrototype::create): Deleted.
2591         (WebCore::JSTestEnabledForContextPrototype::createStructure): Deleted.
2592         (WebCore::JSTestEnabledForContextPrototype::JSTestEnabledForContextPrototype): Deleted.
2593         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2594         (WebCore::JSTestEventConstructorPrototype::create): Deleted.
2595         (WebCore::JSTestEventConstructorPrototype::createStructure): Deleted.
2596         (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype): Deleted.
2597         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2598         (WebCore::JSTestEventTargetPrototype::create): Deleted.
2599         (WebCore::JSTestEventTargetPrototype::createStructure): Deleted.
2600         (WebCore::JSTestEventTargetPrototype::JSTestEventTargetPrototype): Deleted.
2601         * bindings/scripts/test/JS/JSTestException.cpp:
2602         (WebCore::JSTestExceptionPrototype::create): Deleted.
2603         (WebCore::JSTestExceptionPrototype::createStructure): Deleted.
2604         (WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype): Deleted.
2605         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2606         (WebCore::JSTestGenerateIsReachablePrototype::create): Deleted.
2607         (WebCore::JSTestGenerateIsReachablePrototype::createStructure): Deleted.
2608         (WebCore::JSTestGenerateIsReachablePrototype::JSTestGenerateIsReachablePrototype): Deleted.
2609         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2610         (WebCore::JSTestGlobalObjectPrototype::create): Deleted.
2611         (WebCore::JSTestGlobalObjectPrototype::createStructure): Deleted.
2612         (WebCore::JSTestGlobalObjectPrototype::JSTestGlobalObjectPrototype): Deleted.
2613         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2614         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::create): Deleted.
2615         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::createStructure): Deleted.
2616         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::JSTestIndexedSetterNoIdentifierPrototype): Deleted.
2617         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2618         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::create): Deleted.
2619         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::createStructure): Deleted.
2620         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::JSTestIndexedSetterThrowingExceptionPrototype): Deleted.
2621         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2622         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::create): Deleted.
2623         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::createStructure): Deleted.
2624         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::JSTestIndexedSetterWithIdentifierPrototype): Deleted.
2625         * bindings/scripts/test/JS/JSTestInterface.cpp:
2626         (WebCore::JSTestInterfaceConstructor::construct):
2627         (WebCore::jsTestInterfacePrototypeFunctionEntriesCaller):
2628         (WebCore::JSTestInterfacePrototype::create): Deleted.
2629         (WebCore::JSTestInterfacePrototype::createStructure): Deleted.
2630         (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype): Deleted.
2631         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2632         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::create): Deleted.
2633         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::createStructure): Deleted.
2634         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype): Deleted.
2635         * bindings/scripts/test/JS/JSTestIterable.cpp:
2636         (WebCore::jsTestIterablePrototypeFunctionEntriesCaller):
2637         (WebCore::JSTestIterablePrototype::create): Deleted.
2638         (WebCore::JSTestIterablePrototype::createStructure): Deleted.
2639         (WebCore::JSTestIterablePrototype::JSTestIterablePrototype): Deleted.
2640         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2641         (WebCore::JSTestJSBuiltinConstructorPrototype::create): Deleted.
2642         (WebCore::JSTestJSBuiltinConstructorPrototype::createStructure): Deleted.
2643         (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype): Deleted.
2644         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2645         (WebCore::JSTestMediaQueryListListenerPrototype::create): Deleted.
2646         (WebCore::JSTestMediaQueryListListenerPrototype::createStructure): Deleted.
2647         (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype): Deleted.
2648         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2649         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::create): Deleted.
2650         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::createStructure): Deleted.
2651         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::JSTestNamedAndIndexedSetterNoIdentifierPrototype): Deleted.
2652         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2653         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::create): Deleted.
2654         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::createStructure): Deleted.
2655         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::JSTestNamedAndIndexedSetterThrowingExceptionPrototype): Deleted.
2656         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2657         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::create): Deleted.
2658         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::createStructure): Deleted.
2659         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::JSTestNamedAndIndexedSetterWithIdentifierPrototype): Deleted.
2660         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2661         (WebCore::JSTestNamedConstructorPrototype::create): Deleted.
2662         (WebCore::JSTestNamedConstructorPrototype::createStructure): Deleted.
2663         (WebCore::JSTestNamedConstructorPrototype::JSTestNamedConstructorPrototype): Deleted.
2664         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2665         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::create): Deleted.
2666         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::createStructure): Deleted.
2667         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::JSTestNamedDeleterNoIdentifierPrototype): Deleted.
2668         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2669         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::create): Deleted.
2670         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::createStructure): Deleted.
2671         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::JSTestNamedDeleterThrowingExceptionPrototype): Deleted.
2672         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2673         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::create): Deleted.
2674         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::createStructure): Deleted.
2675         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::JSTestNamedDeleterWithIdentifierPrototype): Deleted.
2676         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2677         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::create): Deleted.
2678         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::createStructure): Deleted.
2679         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::JSTestNamedDeleterWithIndexedGetterPrototype): Deleted.
2680         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2681         (WebCore::JSTestNamedGetterCallWithPrototype::create): Deleted.
2682         (WebCore::JSTestNamedGetterCallWithPrototype::createStructure): Deleted.
2683         (WebCore::JSTestNamedGetterCallWithPrototype::JSTestNamedGetterCallWithPrototype): Deleted.
2684         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2685         (WebCore::JSTestNamedGetterNoIdentifierPrototype::create): Deleted.
2686         (WebCore::JSTestNamedGetterNoIdentifierPrototype::createStructure): Deleted.
2687         (WebCore::JSTestNamedGetterNoIdentifierPrototype::JSTestNamedGetterNoIdentifierPrototype): Deleted.
2688         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2689         (WebCore::JSTestNamedGetterWithIdentifierPrototype::create): Deleted.
2690         (WebCore::JSTestNamedGetterWithIdentifierPrototype::createStructure): Deleted.
2691         (WebCore::JSTestNamedGetterWithIdentifierPrototype::JSTestNamedGetterWithIdentifierPrototype): Deleted.
2692         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2693         (WebCore::JSTestNamedSetterNoIdentifierPrototype::create): Deleted.
2694         (WebCore::JSTestNamedSetterNoIdentifierPrototype::createStructure): Deleted.
2695         (WebCore::JSTestNamedSetterNoIdentifierPrototype::JSTestNamedSetterNoIdentifierPrototype): Deleted.
2696         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2697         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::create): Deleted.
2698         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::createStructure): Deleted.
2699         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::JSTestNamedSetterThrowingExceptionPrototype): Deleted.
2700         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2701         (WebCore::JSTestNamedSetterWithIdentifierPrototype::create): Deleted.
2702         (WebCore::JSTestNamedSetterWithIdentifierPrototype::createStructure): Deleted.
2703         (WebCore::JSTestNamedSetterWithIdentifierPrototype::JSTestNamedSetterWithIdentifierPrototype): Deleted.
2704         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2705         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::create): Deleted.
2706         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::createStructure): Deleted.
2707         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::JSTestNamedSetterWithIndexedGetterPrototype): Deleted.
2708         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2709         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::create): Deleted.
2710         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::createStructure): Deleted.
2711         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::JSTestNamedSetterWithIndexedGetterAndSetterPrototype): Deleted.
2712         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2713         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::create): Deleted.
2714         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::createStructure): Deleted.
2715         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::JSTestNamedSetterWithOverrideBuiltinsPrototype): Deleted.
2716         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2717         (WebCore::JSTestNamedSetterWithUnforgablePropertiesConstructor::prototypeForStructure):
2718         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::create): Deleted.
2719         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::createStructure): Deleted.
2720         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::JSTestNamedSetterWithUnforgablePropertiesPrototype): Deleted.
2721         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2722         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::prototypeForStructure):
2723         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::create): Deleted.
2724         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::createStructure): Deleted.
2725         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype): Deleted.
2726         * bindings/scripts/test/JS/JSTestNode.cpp:
2727         (WebCore::jsTestNodePrototypeFunctionEntriesCaller):
2728         (WebCore::JSTestNodePrototype::create): Deleted.
2729         (WebCore::JSTestNodePrototype::createStructure): Deleted.
2730         (WebCore::JSTestNodePrototype::JSTestNodePrototype): Deleted.
2731         * bindings/scripts/test/JS/JSTestObj.cpp:
2732         (WebCore::JSTestObjConstructor::construct):
2733         (WebCore::JSTestObjPrototype::create): Deleted.
2734         (WebCore::JSTestObjPrototype::createStructure): Deleted.
2735         (WebCore::JSTestObjPrototype::JSTestObjPrototype): Deleted.
2736         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2737         (WebCore::JSTestOverloadedConstructorsPrototype::create): Deleted.
2738         (WebCore::JSTestOverloadedConstructorsPrototype::createStructure): Deleted.
2739         (WebCore::JSTestOverloadedConstructorsPrototype::JSTestOverloadedConstructorsPrototype): Deleted.
2740         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2741         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::create): Deleted.
2742         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::createStructure): Deleted.
2743         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::JSTestOverloadedConstructorsWithSequencePrototype): Deleted.
2744         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2745         (WebCore::JSTestOverrideBuiltinsPrototype::create): Deleted.
2746         (WebCore::JSTestOverrideBuiltinsPrototype::createStructure): Deleted.
2747         (WebCore::JSTestOverrideBuiltinsPrototype::JSTestOverrideBuiltinsPrototype): Deleted.
2748         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2749         (WebCore::JSTestPluginInterfacePrototype::create): Deleted.
2750         (WebCore::JSTestPluginInterfacePrototype::createStructure): Deleted.
2751         (WebCore::JSTestPluginInterfacePrototype::JSTestPluginInterfacePrototype): Deleted.
2752         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2753         (WebCore::JSTestPromiseRejectionEventPrototype::create): Deleted.
2754         (WebCore::JSTestPromiseRejectionEventPrototype::createStructure): Deleted.
2755         (WebCore::JSTestPromiseRejectionEventPrototype::JSTestPromiseRejectionEventPrototype): Deleted.
2756         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2757         (WebCore::JSTestSerializationPrototype::create): Deleted.
2758         (WebCore::JSTestSerializationPrototype::createStructure): Deleted.
2759         (WebCore::JSTestSerializationPrototype::JSTestSerializationPrototype): Deleted.
2760         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2761         (WebCore::JSTestSerializationIndirectInheritancePrototype::create): Deleted.
2762         (WebCore::JSTestSerializationIndirectInheritancePrototype::createStructure): Deleted.
2763         (WebCore::JSTestSerializationIndirectInheritancePrototype::JSTestSerializationIndirectInheritancePrototype): Deleted.
2764         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2765         (WebCore::JSTestSerializationInheritPrototype::create): Deleted.
2766         (WebCore::JSTestSerializationInheritPrototype::createStructure): Deleted.
2767         (WebCore::JSTestSerializationInheritPrototype::JSTestSerializationInheritPrototype): Deleted.
2768         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2769         (WebCore::JSTestSerializationInheritFinalPrototype::create): Deleted.
2770         (WebCore::JSTestSerializationInheritFinalPrototype::createStructure): Deleted.
2771         (WebCore::JSTestSerializationInheritFinalPrototype::JSTestSerializationInheritFinalPrototype): Deleted.
2772         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2773         (WebCore::JSTestSerializedScriptValueInterfacePrototype::create): Deleted.
2774         (WebCore::JSTestSerializedScriptValueInterfacePrototype::createStructure): Deleted.
2775         (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype): Deleted.
2776         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2777         (WebCore::JSTestStringifierPrototype::create): Deleted.
2778         (WebCore::JSTestStringifierPrototype::createStructure): Deleted.
2779         (WebCore::JSTestStringifierPrototype::JSTestStringifierPrototype): Deleted.
2780         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2781         (WebCore::JSTestStringifierAnonymousOperationPrototype::create): Deleted.
2782         (WebCore::JSTestStringifierAnonymousOperationPrototype::createStructure): Deleted.
2783         (WebCore::JSTestStringifierAnonymousOperationPrototype::JSTestStringifierAnonymousOperationPrototype): Deleted.
2784         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2785         (WebCore::JSTestStringifierNamedOperationPrototype::create): Deleted.
2786         (WebCore::JSTestStringifierNamedOperationPrototype::createStructure): Deleted.
2787         (WebCore::JSTestStringifierNamedOperationPrototype::JSTestStringifierNamedOperationPrototype): Deleted.
2788         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2789         (WebCore::JSTestStringifierOperationImplementedAsPrototype::create): Deleted.
2790         (WebCore::JSTestStringifierOperationImplementedAsPrototype::createStructure): Deleted.
2791         (WebCore::JSTestStringifierOperationImplementedAsPrototype::JSTestStringifierOperationImplementedAsPrototype): Deleted.
2792         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2793         (WebCore::JSTestStringifierOperationNamedToStringPrototype::create): Deleted.
2794         (WebCore::JSTestStringifierOperationNamedToStringPrototype::createStructure): Deleted.
2795         (WebCore::JSTestStringifierOperationNamedToStringPrototype::JSTestStringifierOperationNamedToStringPrototype): Deleted.
2796         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2797         (WebCore::JSTestStringifierReadOnlyAttributePrototype::create): Deleted.
2798         (WebCore::JSTestStringifierReadOnlyAttributePrototype::createStructure): Deleted.
2799         (WebCore::JSTestStringifierReadOnlyAttributePrototype::JSTestStringifierReadOnlyAttributePrototype): Deleted.
2800         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2801         (WebCore::JSTestStringifierReadWriteAttributePrototype::create): Deleted.
2802         (WebCore::JSTestStringifierReadWriteAttributePrototype::createStructure): Deleted.
2803         (WebCore::JSTestStringifierReadWriteAttributePrototype::JSTestStringifierReadWriteAttributePrototype): Deleted.
2804         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2805         (WebCore::JSTestTypedefsConstructor::construct):
2806         (WebCore::JSTestTypedefsPrototype::create): Deleted.
2807         (WebCore::JSTestTypedefsPrototype::createStructure): Deleted.
2808         (WebCore::JSTestTypedefsPrototype::JSTestTypedefsPrototype): Deleted.
2809
2810 2020-03-06  James Darpinian  <jdarpinian@chromium.org>
2811
2812         Set important EGL context attributes
2813         https://bugs.webkit.org/show_bug.cgi?id=208724
2814
2815         Reviewed by Dean Jackson.
2816
2817         These EGL context attributes are important to make ANGLE's validation correct for
2818         WebGL contexts. ROBUST_RESOURCE_INITIALIZATION is especially important; the lack
2819         of it may be a root cause of some of the test flakiness we have seen. With this
2820         change WebKit's EGL context attributes now match Chromium's for ANGLE/WebGL
2821         contexts.
2822
2823         * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
2824         (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
2825
2826 2020-03-06  Youenn Fablet  <youenn@apple.com>
2827
2828         Use ObjectIdentifier to identify media sessions
2829         https://bugs.webkit.org/show_bug.cgi?id=208710
2830
2831         Reviewed by Eric Carlson.
2832
2833         No change of behavior, except that the identifier is now stable over time and unique per process.
2834
2835         * Headers.cmake:
2836         * WebCore.xcodeproj/project.pbxproj:
2837         * html/HTMLMediaElement.cpp:
2838         (WebCore::HTMLMediaElement::HTMLMediaElement):
2839         (WebCore::HTMLMediaElement::mediaSessionUniqueIdentifier const):
2840         * html/HTMLMediaElement.h:
2841         * platform/audio/NowPlayingInfo.h:
2842         (WebCore::NowPlayingInfo::decode):
2843         * platform/audio/PlatformMediaSessionManager.h:
2844         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const):
2845         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
2846         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
2847         (MediaSessionManagerCocoa::setNowPlayingInfo):
2848         (MediaSessionManagerCocoa::updateNowPlayingInfo):
2849         * testing/Internals.cpp:
2850         (WebCore::Internals::nowPlayingState const):
2851
2852 2020-03-06  Jason Lawrence  <lawrence.j@apple.com>
2853
2854         Unreviewed, rolling out r257760.
2855
2856         This commit caused flaky crashing on Mac wk2.
2857
2858         Reverted changeset:
2859
2860         "Fix for LayoutTests/accessibility/mac/value-change/value-
2861         change-user-info-contenteditable.html in IsolatedTree mode."
2862         https://bugs.webkit.org/show_bug.cgi?id=208462
2863         https://trac.webkit.org/changeset/257760
2864
2865 2020-03-06  David Quesada  <david_quesada@apple.com>
2866
2867         Add _WKResourceLoadInfo.resourceType SPI
2868         https://bugs.webkit.org/show_bug.cgi?id=208723
2869
2870         Reviewed by Alex Christensen.
2871
2872         Covered by API tests.
2873
2874         * Modules/beacon/NavigatorBeacon.cpp:
2875         (WebCore::NavigatorBeacon::sendBeacon):
2876         * loader/PingLoader.cpp:
2877         (WebCore::PingLoader::sendPing):
2878         * platform/network/ResourceRequestBase.h:
2879
2880 2020-03-06  Youenn Fablet  <youenn@apple.com>
2881
2882         Add support for NowPlaying commands in GPUProcess
2883         https://bugs.webkit.org/show_bug.cgi?id=208707
2884
2885         Reviewed by Eric Carlson.
2886
2887         Add a NowPlayingManager that is responsible to clear/set/update NowPlaying information as well as receive commands
2888         and send them to the current NowPlaying client.
2889         Manually tested.
2890
2891         * Headers.cmake:
2892         * Sources.txt:
2893         * WebCore.xcodeproj/project.pbxproj:
2894         * platform/audio/PlatformMediaSessionManager.h:
2895
2896 2020-03-06  Simon Fraser  <simon.fraser@apple.com>
2897
2898         Move synchronousScrollingReasons to ScrollingTreeScrollingNode
2899         https://bugs.webkit.org/show_bug.cgi?id=208721
2900
2901         Reviewed by Antti Koivisto.
2902
2903         synchronousScrollingReasons was on Scrolling*FrameScrollingNode, but with async overflow
2904         scrolling, some overflow scrolls will need to scroll synchronously if they paint any
2905         background-attachment:fixed, so move synchronousScrollingReasons down to Scrolling*ScrollingNode.
2906
2907         Also wrap the scrolling tree parts in #if ENABLE(SCROLLING_THREAD) since synchronous scrolling
2908         is only a thing if you use threaded scrolling. Ideally more of the ScrollingCoordinator code
2909         would also have #if ENABLE(SCROLLING_THREAD) but that can be done later.
2910
2911         * page/scrolling/AsyncScrollingCoordinator.cpp:
2912         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
2913         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2914         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2915         (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
2916         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
2917         (WebCore::ScrollingStateFrameScrollingNode::setSynchronousScrollingReasons): Deleted.
2918         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2919         * page/scrolling/ScrollingStateScrollingNode.cpp:
2920         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
2921         (WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):
2922         (WebCore::ScrollingStateScrollingNode::setSynchronousScrollingReasons):
2923         (WebCore::ScrollingStateScrollingNode::dumpProperties const):
2924         * page/scrolling/ScrollingStateScrollingNode.h:
2925         (WebCore::ScrollingStateScrollingNode::synchronousScrollingReasons const):
2926         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2927         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
2928         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties const):
2929         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2930         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2931         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
2932         (WebCore::ScrollingTreeScrollingNode::dumpProperties const):
2933         * page/scrolling/ScrollingTreeScrollingNode.h:
2934
2935 2020-03-06  Simon Fraser  <simon.fraser@apple.com>
2936
2937         Make it possible to safely access CALayers and PlatformCALayerCocoa objects on the scrolling thread
2938         https://bugs.webkit.org/show_bug.cgi?id=208672
2939
2940         Reviewed by Antti Koivisto.
2941
2942         Async overflow/frame scrolling on macOS is going to hit-test through the CALayer tree on the
2943         scrolling thread, and access PlatformCALayers that hang off CALayers. We therefore have to ensure
2944         that those layers are not getting mutated while hit-testing.
2945
2946         We only touch PlatformCALayers and CALayers through two codepaths: GraphicsLayer::flushCompositingState()
2947         when pushing GraphicsLayer changes to CA, and when destroying GraphicsLayers which tears down their associated
2948         PlatformCALayers (the CALayers remain parented in the tree).
2949
2950         To prevent a PlatformCALayer from being destroyed while being accessed on the scrolling thread, we make
2951         it ThreadSafeRefCounted<>, and lock around fetching thePlatformCALayer from the layerToPlatformLayerMap() which
2952         retains it.
2953
2954         To prevent the CALayer/PlatformCALayer trees being mutated during layer flushing, we lock around 
2955         rootLayer->flushCompositingState() in RenderLayerCompositor::flushPendingLayerChanges().
2956
2957         The lock is owned by ScrollingTreeMac.
2958
2959         * page/scrolling/AsyncScrollingCoordinator.h:
2960         (WebCore::LayerTreeHitTestLocker::LayerTreeHitTestLocker):
2961         (WebCore::LayerTreeHitTestLocker::~LayerTreeHitTestLocker):
2962         * page/scrolling/ScrollingTree.h:
2963         (WebCore::ScrollingTree::lockLayersForHitTesting):
2964         (WebCore::ScrollingTree::unlockLayersForHitTesting):
2965         * page/scrolling/mac/ScrollingTreeMac.h:
2966         * page/scrolling/mac/ScrollingTreeMac.mm:
2967         (ScrollingTreeMac::lockLayersForHitTesting):
2968         (ScrollingTreeMac::unlockLayersForHitTesting):
2969         * platform/graphics/ca/PlatformCALayer.h:
2970         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2971         (WebCore::layerToPlatformLayerMapMutex):
2972         (WebCore::PlatformCALayer::platformCALayerForLayer):
2973         * rendering/RenderLayerCompositor.cpp:
2974         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2975
2976 2020-03-06  Simon Fraser  <simon.fraser@apple.com>
2977
2978         Put an event region on scroll container layers
2979         https://bugs.webkit.org/show_bug.cgi?id=208684
2980
2981         Reviewed by Antti Koivisto.
2982         
2983         Hit-testing through the CALayer tree on macOS, where we don't have scroll views for overflow,
2984         is simpler if scroll container layers have an event region that just represents the bounds of
2985         the layer. These regions are harmless to have on iOS too.
2986
2987         This patch adds them for overflow scroll, and for m_clipLayer which is the scroll container
2988         layer for scrollable subframes.
2989
2990         Tests: fast/scrolling/mac/event-region-scrolled-contents-layer.html
2991                fast/scrolling/mac/event-region-subframe.html
2992
2993         * rendering/RenderLayerBacking.cpp:
2994         (WebCore::RenderLayerBacking::updateEventRegion):
2995         * rendering/RenderLayerCompositor.cpp:
2996         (WebCore::RenderLayerCompositor::updateScrollLayerClipping):
2997
2998 2020-03-06  Antti Koivisto  <antti@apple.com>
2999
3000         Reduce ThreadTimers maxDurationOfFiringTimers to 16ms
3001         https://bugs.webkit.org/show_bug.cgi?id=208717
3002
3003         Reviewed by Simon Fraser.
3004
3005         50ms -> 16ms.
3006
3007         This gives us more chances to do rendering updates. A/B testing says it is neutral for performance.
3008
3009         * platform/ThreadTimers.cpp:
3010
3011 2020-03-06  Kate Cheney  <katherine_cheney@apple.com>
3012
3013         Remove redundant flags in script evaluation checks
3014         https://bugs.webkit.org/show_bug.cgi?id=208609
3015         <rdar://problem/60058656>
3016         
3017         Reviewed by Brent Fulgham.
3018         
3019         hasNavigatedAwayFromAppBoundDomain only gets set in WebPageProxy if
3020         its a main frame navigation and In-App Browser privacy is enabled,
3021         we don't need to check again at the sites.
3022
3023         * bindings/js/ScriptController.cpp:
3024         (WebCore::ScriptController::executeScriptInWorld):
3025         * page/Frame.cpp:
3026         (WebCore::Frame::injectUserScriptImmediately):
3027
3028 2020-03-06  Zalan Bujtas  <zalan@apple.com>
3029
3030         [LFC][TFC] Absolute positioned table should generate a static table box inside the out-of-flow table wrapper box
3031         https://bugs.webkit.org/show_bug.cgi?id=208713
3032         <rdar://problem/60151358>
3033
3034         Reviewed by Antti Koivisto.
3035
3036         Test: fast/layoutformattingcontext/absolute-positioned-simple-table.html
3037
3038         <table style="position: absolute"> should generate
3039         1. absolute positioned table wrapper box
3040         2. static (inflow) positioned table box inside the out-of-flow table wrapper box. 
3041
3042         * layout/layouttree/LayoutTreeBuilder.cpp:
3043         (WebCore::Layout::TreeBuilder::buildTableStructure):
3044
3045 2020-03-05  Darin Adler  <darin@apple.com>
3046
3047         Improve some media code
3048         https://bugs.webkit.org/show_bug.cgi?id=208322
3049
3050         Reviewed by Anders Carlsson.
3051
3052         - TextTrack objects now take Document instead of ScriptExecutionContext.
3053         - Made more TextTrack functions private and protected.
3054         - Made TextTrack parsing functions use return values rather than out arguments.
3055         - Use references rather than pointers and Ref rather than RefPtr for non-null things.
3056         - Made MediaControlsHost use a WeakPtr instead of a raw pointer.
3057
3058         * Modules/mediacontrols/MediaControlsHost.cpp:
3059         (WebCore::alwaysOnKeyword): Made private to this file instead of exposed in header.
3060         (WebCore::manualKeyword): Ditto.
3061         (WebCore::MediaControlsHost::create): Take a reference instead of a pointer to
3062         the media element.
3063         (WebCore::MediaControlsHost::MediaControlsHost): Ditto, and make a weak pointer.
3064         (WebCore::MediaControlsHost::sortedTrackListForMenu): Added null check.
3065         (WebCore::MediaControlsHost::displayNameForTrack): Ditto.
3066         (WebCore::MediaControlsHost::captionMenuOffItem): Ditto.
3067         (WebCore::MediaControlsHost::captionMenuAutomaticItem): Ditto.
3068         (WebCore::MediaControlsHost::captionDisplayMode const): Ditto.
3069         (WebCore::MediaControlsHost::setSelectedTextTrack): Ditto.
3070         (WebCore::MediaControlsHost::textTrackContainer): Ditto.
3071         (WebCore::MediaControlsHost::allowsInlineMediaPlayback const): Ditto.
3072         (WebCore::MediaControlsHost::supportsFullscreen const): Ditto.
3073         (WebCore::MediaControlsHost::isVideoLayerInline const): Ditto.
3074         (WebCore::MediaControlsHost::isInMediaDocument const): Ditto.
3075         (WebCore::MediaControlsHost::setPreparedToReturnVideoLayerToInline): Ditto.
3076         (WebCore::MediaControlsHost::userGestureRequired const): Ditto.
3077         (WebCore::MediaControlsHost::shouldForceControlsDisplay const): Ditto.
3078         (WebCore::MediaControlsHost::externalDeviceDisplayName const): Ditto.
3079         (WebCore::MediaControlsHost::externalDeviceType const): Ditto.
3080         (WebCore::MediaControlsHost::controlsDependOnPageScaleFactor const): Ditto.
3081         (WebCore::MediaControlsHost::setControlsDependOnPageScaleFactor): Ditto.
3082         (WebCore::MediaControlsHost::generateUUID): Made a static member.
3083         (WebCore::MediaControlsHost::shadowRootCSSText): Ditto.
3084         (WebCore::MediaControlsHost::base64StringForIconNameAndType): Ditto.
3085         (WebCore::MediaControlsHost::formattedStringForDuration): Ditto.
3086         (WebCore::MediaControlsHost::compactMode const): Tweaked logic a bit.
3087
3088         * Modules/mediacontrols/MediaControlsHost.h: Made various member functions
3089         into static member functions, used references instead of pointers for
3090         things that are never null, used WeakPtr for m_mediaElement.
3091
3092         * Modules/mediasource/SourceBuffer.cpp:
3093         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
3094         Document instead of ScriptExecutionContext.
3095
3096         * html/HTMLMediaElement.cpp:
3097         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Document instead of
3098         ScriptExecutionContext.
3099         (WebCore::HTMLMediaElement::updateCaptionContainer): Pass reference to
3100         MediaControlsHost::create.
3101         (WebCore::HTMLMediaElement::setSelectedTextTrack): Update since special items
3102         are now references rather than pointers.
3103         (WebCore::HTMLMediaElement::updateTextTrackDisplay): Pass reference.
3104         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): Ditto.
3105
3106         * html/HTMLTrackElement.cpp:
3107         (WebCore::HTMLTrackElement::parseAttribute): Removed setIsDefault function
3108         since the track can simply read the attribute out of the element instead.
3109
3110         * html/shadow/MediaControlElements.cpp:
3111         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
3112         Update since special items are now referencse rather than pointers.
3113
3114         * html/track/DataCue.cpp:
3115         (WebCore::DataCue::DataCue): Document instead of ScriptExecutionContext.
3116         (WebCore::DataCue::create): Moved these functions out of the header.
3117         * html/track/DataCue.h: Updated for the above.
3118         * html/track/DataCue.idl: Ditto.
3119
3120         * html/track/InbandDataTextTrack.cpp:
3121         (WebCore::InbandDataTextTrack::InbandDataTextTrack): Document instead
3122         of ScriptExecutionContext.
3123         (WebCore::InbandDataTextTrack::create): Ditto.
3124         (WebCore::InbandDataTextTrack::addDataCue): Ditto. Also use reference
3125         instead of pointer when calling hasCue.
3126         * html/track/InbandDataTextTrack.h: Updated for the above.
3127
3128         * html/track/InbandGenericTextTrack.cpp:
3129         (WebCore::InbandGenericTextTrack::InbandGenericTextTrack): Document
3130         instead of ScriptExecutionContext.
3131         (WebCore::InbandGenericTextTrack::create): Ditto.
3132         (WebCore::InbandGenericTextTrack::addGenericCue): Ditto. Also use
3133         reference instead of pointer when calling hasCue.
3134         (WebCore::InbandGenericTextTrack::parser): Ditto.
3135         (WebCore::InbandGenericTextTrack::newCuesParsed): Ditto. Also use
3136         return value from takeCues instead of out arguenmt from getNewCues.
3137         Also use reference instead of pointer when calling hasCue.
3138         (WebCore::InbandGenericTextTrack::newRegionsParsed): Ditto.
3139         * html/track/InbandGenericTextTrack.h: Update for above.
3140
3141         * html/track/InbandTextTrack.cpp:
3142         (WebCore::InbandTextTrack::create): Document instead of
3143         ScriptExecutionContext.
3144         (WebCore::InbandTextTrack::InbandTextTrack): Ditto.
3145         * html/track/InbandTextTrack.h: Update for above.
3146
3147         * html/track/InbandWebVTTTextTrack.cpp:
3148         (WebCore::InbandWebVTTTextTrack::InbandWebVTTTextTrack): Document
3149         instead of ScriptExecutionContext.
3150         (WebCore::InbandWebVTTTextTrack::create): Ditto.
3151         (WebCore::InbandWebVTTTextTrack::parser): Ditto.
3152         (WebCore::InbandWebVTTTextTrack::newCuesParsed): Ditto. Also use
3153         return value from takeCues instead of out arguenmt from getNewCues.
3154         Also use reference instead of pointer when calling hasCue.
3155         (WebCore::InbandWebVTTTextTrack::newRegionsParsed): Ditto.
3156         * html/track/InbandWebVTTTextTrack.h: Update for above.
3157
3158         * html/track/LoadableTextTrack.cpp:
3159         (WebCore::LoadableTextTrack::create): Moved here from header.
3160         (WebCore::LoadableTextTrack::loadTimerFired): Document instead of
3161         ScriptExecutionContext.
3162         (WebCore::LoadableTextTrack::newRegionsAvailable): Use return value
3163         from getNewRegions instead of out argument.
3164         (WebCore::LoadableTextTrack::isDefault const): New implementation that
3165         does not rely on a data member; checks attribute on video element.
3166         * html/track/LoadableTextTrack.h: Updated for above changes.
3167
3168         * html/track/TextTrack.cpp:
3169         (WebCore::TextTrack::captionMenuOffItem): Return a reference rather
3170         than a pointer.
3171         (WebCore::TextTrack::captionMenuAutomaticItem): Ditto.
3172         (WebCore::TextTrack::create): Document rather than ScriptExecutionContext.
3173         (WebCore::TextTrack::document const): Added. For use by derived classes.
3174         (WebCore::TextTrack::addRegion): Ref rather than RefPtr.
3175         (WebCore::TextTrack::removeRegion): Reference rather than pointer.
3176         (WebCore::TextTrack::cueWillChange): Ditto.
3177         (WebCore::TextTrack::cueDidChange): Ditto.
3178         (WebCore::TextTrack::hasCue): Ditto.
3179
3180         * html/track/TextTrack.h: Removed declarations of non-existent
3181         disabledKeyword, hiddenKeyword, and showingKeyword functions.
3182         Made setKind, client, and hasCue protected. Made overrides of
3183         eventTargetInterface, scriptExecutionContext, and logClassName
3184         private. Removed setIsDefault. Updated for changes above.
3185
3186         * html/track/TextTrack.idl: Did what FIXME suggested, making the region
3187         parameters non-nullable. Passing null silently did nothing before. There
3188         is some small risk of website incompatibility if someone accidentally
3189         relied on this WebKit-specific behavior.
3190
3191         * html/track/TextTrackCue.cpp:
3192         (WebCore::TextTrackCue::create): Document instead of ScriptExecutionContext.
3193         (WebCore::TextTrackCue::TextTrackCue): Ditto.
3194         (WebCore::TextTrackCue::willChange): Pass reference.
3195         (WebCore::TextTrackCue::didChange): Ditto.
3196         * html/track/TextTrackCue.h: Update for above changes.
3197         * html/track/TextTrackCue.idl: Ditto.
3198
3199         * html/track/TextTrackCueGeneric.cpp:
3200         (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): Update since the base
3201         class now takes an rvalue reference to the string.
3202         (WebCore::TextTrackCueGeneric::isOrderedBefore const): Use auto.
3203         (WebCore::TextTrackCueGeneric::isPositionedAbove const): Ditto.
3204
3205         * html/track/VTTCue.cpp:
3206         (WebCore::VTTCue::create): Document instead of ScriptExecutionContext.
3207         Also take String with an rvalue reference.
3208         (WebCore::VTTCue::VTTCue): Ditto.
3209         * html/track/VTTCue.h: Update for above changes.
3210         * html/track/VTTCue.idl: Ditto.
3211
3212         * html/track/WebVTTParser.cpp:
3213         (WebCore::WebVTTParser::WebVTTParser): Document instead of
3214         ScriptExecutionContext. References instead of pointers. Initialize
3215         m_state in class definition.
3216         (WebCore::WebVTTParser::takeCues): Renamed from getNewCues and changed
3217         to use a return value instead of an out argument.
3218         (WebCore::WebVTTParser::takeRegions): Ditto.
3219         (WebCore::WebVTTParser::takeStyleSheets): Ditto.
3220         (WebCore::WebVTTParser::parseCueData): Remove null check of m_client.
3221         (WebCore::WebVTTParser::parse): Ditto.
3222         (WebCore::WebVTTParser::collectWebVTTBlock): Ditto.
3223         (WebCore::WebVTTParser::checkAndCreateRegion): Pass document.
3224         (WebCore::WebVTTParser::checkAndStoreRegion): Use
3225         Vector::removeFirstMatching instead of Vector::removeFirst.
3226         (WebCore::WebVTTParser::createNewCue): Remove null check of m_client.
3227         * html/track/WebVTTParser.h: Update for above changes.
3228
3229         * loader/TextTrackLoader.cpp:
3230         (WebCore::TextTrackLoader::TextTrackLoader): Document instead of
3231         ScriptExecutionContext. References instead of pointers. Initialize
3232         data members in in class definition.
3233         (WebCore::TextTrackLoader::processNewCueData): Pass references.
3234         (WebCore::TextTrackLoader::corsPolicyPreventedLoad): Use m_document.
3235         (WebCore::TextTrackLoader::load): Ditto.
3236         (WebCore::TextTrackLoader::getNewCues): Use takeCues.
3237         (WebCore::TextTrackLoader::getNewRegions): Changed to return a vector
3238         instead of using an out argument. Use takeRegions.
3239         (WebCore::TextTrackLoader::getNewStyleSheets): Ditto.
3240         * loader/TextTrackLoader.h: Updated for the above.
3241
3242         * page/CaptionUserPreferences.cpp:
3243         (WebCore::trackDisplayName): Updated since these are references.
3244         (WebCore::CaptionUserPreferences::mediaSelectionOptionForTrack const): Ditto.
3245         (WebCore::CaptionUserPreferences::sortedTrackListForMenu): Ditto.
3246         * page/CaptionUserPreferencesMediaAF.cpp:
3247         (WebCore::trackDisplayName): Ditto.
3248         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Ditto.
3249         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
3250         (WebCore::PlaybackSessionModelMediaElement::selectLegibleMediaOption): Ditto.
3251         (WebCore::PlaybackSessionModelMediaElement::legibleMediaSelectedIndex const):
3252         Updated to use references rather than pointers. Refactored the logic to
3253         use Optional and nested if statements to make the algorithm clearer.
3254
3255 2020-03-05  Simon Fraser  <simon.fraser@apple.com>
3256
3257         Use an OptionSet<> for SynchronousScrollingReasons
3258         https://bugs.webkit.org/show_bug.cgi?id=208697
3259
3260         Reviewed by Antti Koivisto.
3261
3262         Convert SynchronousScrollingReasons to an OptionSet<SynchronousScrollingReason>.
3263
3264         * page/PerformanceLoggingClient.cpp:
3265         (WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString):
3266         * page/PerformanceLoggingClient.h:
3267         * page/scrolling/AsyncScrollingCoordinator.cpp:
3268         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
3269         (WebCore::AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged):
3270         * page/scrolling/AsyncScrollingCoordinator.h:
3271         * page/scrolling/ScrollingCoordinator.cpp:
3272         (WebCore::ScrollingCoordinator::synchronousScrollingReasons const):
3273         (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously const):
3274         (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
3275         * page/scrolling/ScrollingCoordinator.h:
3276         (WebCore::ScrollingCoordinator::setSynchronousScrollingReasons):
3277         * page/scrolling/ScrollingCoordinatorTypes.h:
3278         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3279         (WebCore::ScrollingStateFrameScrollingNode::setSynchronousScrollingReasons):
3280         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
3281         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3282         * page/scrolling/ScrollingTree.h:
3283         (WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged):
3284         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3285         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties const):
3286         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3287         * page/scrolling/ThreadedScrollingTree.cpp:
3288         (WebCore::ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged):
3289         * page/scrolling/ThreadedScrollingTree.h:
3290
3291 2020-03-06  Antoine Quint  <graouts@webkit.org>
3292
3293         Remove the experimental flag for Pointer Events
3294         https://bugs.webkit.org/show_bug.cgi?id=208655
3295         <rdar://problem/60090545>
3296
3297         Reviewed by Dean Jackson.
3298
3299         * dom/Element.cpp:
3300         (WebCore::dispatchPointerEventIfNeeded):
3301         (WebCore::Element::removedFromAncestor):
3302         * dom/Element.idl:
3303         * dom/NavigatorMaxTouchPoints.idl:
3304         * dom/PointerEvent.idl:
3305         * page/RuntimeEnabledFeatures.h:
3306         (WebCore::RuntimeEnabledFeatures::setPointerEventsEnabled): Deleted.
3307         (WebCore::RuntimeEnabledFeatures::pointerEventsEnabled const): Deleted.
3308         * style/StyleTreeResolver.cpp:
3309         (WebCore::Style::TreeResolver::resolveElement):
3310
3311 2020-03-06  Enrique Ocaña González  <eocanha@igalia.com>
3312
3313         [GStreamer] Streaming aac/mp3 audio doesn't always work
3314         https://bugs.webkit.org/show_bug.cgi?id=205801
3315
3316         Reviewed by Philippe Normand.
3317
3318         Don't rely on response size to replace Content-Length. This may break streaming videos,
3319         which should always have an Infinite duration.
3320
3321         This patch is based on the fix found by Philippe Normand <pnormand@igalia.com>
3322
3323         Test: http/tests/media/video-no-content-length-stall.html
3324
3325         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3326         (CachedResourceStreamingClient::dataReceived):
3327
3328 2020-03-06  Frederic Wang  <fwang@igalia.com>
3329
3330         [intersection-observer] Accept a Document as an explicit root
3331         https://bugs.webkit.org/show_bug.cgi?id=208047
3332
3333         Reviewed by Simon Fraser.
3334
3335         This patch introduces a recent enhancement to the Intersection Observer specification: the
3336         root initialization parameter can be explicitly be set to a Document. The typical use case
3337         is when document is an iframe. See https://github.com/w3c/IntersectionObserver/issues/372
3338
3339         This patch also updates the way Element's intersection observer data is handled so that it is
3340         more consistent with the explicit Document root case introduced here.
3341
3342         Test: imported/w3c/web-platform-tests/intersection-observer/document-scrolling-element-root.html
3343
3344         * dom/Document.cpp:
3345         (WebCore::Document::~Document): Notify observers about our desctruction.
3346         (WebCore::Document::updateIntersectionObservations): Use new method name. This does not
3347         require null-check because ensureIntersectionObserverData() has been called in
3348         IntersectionObserver::observe().
3349         (WebCore::Document::ensureIntersectionObserverData): Return reference to intersection
3350         observer data for this document, creating one if it does not exist.
3351         * dom/Document.h: Add new intersection observer data, used for documents that are explicit
3352         intersection observer roots.
3353         (WebCore::Document::intersectionObserverDataIfExists): Return pointer to intersection
3354         observer data or null if it does not exist.
3355         * dom/Element.cpp:
3356         (WebCore::Element::didMoveToNewDocument): Use new method name.
3357         (WebCore::Element::disconnectFromIntersectionObservers): Ditto and null-check weak refs.
3358         (WebCore::Element::intersectionObserverDataIfExists): Rename method to match Document's one
3359         and be more explicit that it will be null if it does not exist.
3360         (WebCore::Element::intersectionObserverData): Renamed.
3361         * dom/Element.h: Renamed.
3362         * html/LazyLoadImageObserver.cpp:
3363         (WebCore::LazyLoadImageObserver::intersectionObserver): Initialize with a WTF::Optional
3364         after API change.
3365         * page/IntersectionObserver.cpp:
3366         (WebCore::IntersectionObserver::create): Pass a Node* root, which can be null (implicit
3367         root), Document* or Element* (explicit roots). This is determined from init.root.
3368         (WebCore::IntersectionObserver::IntersectionObserver): Handle the case of explicit Document
3369         root.
3370         (WebCore::IntersectionObserver::~IntersectionObserver): Ditto and update method name for
3371         the explicit Element case. Note that in both explicit root cases the corresponding
3372         ensureIntersectionObserverData() method had been called in the constructor so they can
3373         be safely deferenced.
3374         (WebCore::IntersectionObserver::removeTargetRegistration): Use new method name.
3375         * page/IntersectionObserver.h: Update comment and code now that explicit root is a Node* and
3376         IntersectionObserver::Init::root is either an Element or a Document or null.
3377         (WebCore::IntersectionObserver::root const): Ditto.
3378         (): Deleted.
3379         * page/IntersectionObserver.idl: Update IDL to match the spec IntersectionObserver::root
3380         is a nullable Node and IntersectionObserverInit::root a nullable Element or Document.
3381
3382 2020-03-06  Yusuke Suzuki  <ysuzuki@apple.com>
3383
3384         Put all generated JSCells in WebCore into IsoSubspace
3385         https://bugs.webkit.org/show_bug.cgi?id=205107
3386
3387         Reviewed by Saam Barati.
3388
3389         This patch automatically generates IsoSubspace per WebCore DOM object type.
3390         In preprocess-idls.pl, we collect all the DOM object types and generate DOMIsoSubspaces class,
3391         which contains all the necessary IsoSubspaces. And it is held by WebCoreJSClientData.
3392
3393         CodeGeneratorJS.pm starts putting `subspaceFor` and `subspaceForImpl` for each JS DOM wrapper classes.
3394         And we dynamically create IsoSubspace and set it to WebCoreJSClientData's DOMIsoSubspaces. At the same
3395         time, we register IsoSubspace to m_outputConstraintSpaces if the class has output constraits callback.
3396
3397         From the previous patch, we fixed outputConstraintSpaces bug, which is returning a copy of Vector<>
3398         instead of a reference to the member Vector.
3399
3400         * CMakeLists.txt:
3401         * DerivedSources-output.xcfilelist:
3402         * DerivedSources.make:
3403         * WebCoreMacros.cmake:
3404         * bindings/js/JSDOMWrapper.cpp:
3405         (WebCore::outputConstraintSubspaceFor): Deleted.
3406         * bindings/js/JSDOMWrapper.h:
3407         * bindings/js/WebCoreJSClientData.cpp:
3408         (WebCore::JSVMClientData::JSVMClientData):
3409         * bindings/js/WebCoreJSClientData.h:
3410         (WebCore::JSVMClientData::forEachOutputConstraintSpace):
3411         (WebCore::JSVMClientData::subspaces):
3412         (WebCore::JSVMClientData::outputConstraintSpace): Deleted.
3413         (WebCore::JSVMClientData::subspaceForJSDOMWindow): Deleted.
3414         (WebCore::JSVMClientData::subspaceForJSDedicatedWorkerGlobalScope): Deleted.
3415         (WebCore::JSVMClientData::subspaceForJSRemoteDOMWindow): Deleted.
3416         (WebCore::JSVMClientData::subspaceForJSWorkerGlobalScope): Deleted.
3417         (WebCore::JSVMClientData::subspaceForJSServiceWorkerGlobalScope): Deleted.
3418         (WebCore::JSVMClientData::subspaceForJSPaintWorkletGlobalScope): Deleted.
3419         (WebCore::JSVMClientData::subspaceForJSWorkletGlobalScope): Deleted.
3420         * bindings/scripts/CodeGeneratorJS.pm:
3421         (GenerateHeader):
3422         (GenerateImplementation):
3423         * bindings/scripts/generate-bindings-all.pl:
3424         * bindings/scripts/preprocess-idls.pl:
3425         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3426         (WebCore::JSInterfaceName::subspaceForImpl):
3427         * bindings/scripts/test/JS/JSInterfaceName.h:
3428         (WebCore::JSInterfaceName::subspaceFor):
3429         * bindings/scripts/test/JS/JSMapLike.cpp:
3430         (WebCore::JSMapLike::subspaceForImpl):
3431         * bindings/scripts/test/JS/JSMapLike.h:
3432         (WebCore::JSMapLike::subspaceFor):
3433         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3434         (WebCore::JSReadOnlyMapLike::subspaceForImpl):
3435         * bindings/scripts/test/JS/JSReadOnlyMapLike.h:
3436         (WebCore::JSReadOnlyMapLike::subspaceFor):
3437         * bindings/scripts/test/JS/JSReadOnlySetLike.cpp:
3438         (WebCore::JSReadOnlySetLike::subspaceForImpl):
3439         * bindings/scripts/test/JS/JSReadOnlySetLike.h:
3440         (WebCore::JSReadOnlySetLike::subspaceFor):
3441         * bindings/scripts/test/JS/JSSetLike.cpp:
3442         (WebCore::JSSetLike::subspaceForImpl):
3443         * bindings/scripts/test/JS/JSSetLike.h:
3444         (WebCore::JSSetLike::subspaceFor):
3445         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3446         (WebCore::JSTestActiveDOMObject::subspaceForImpl):
3447         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3448         (WebCore::JSTestActiveDOMObject::subspaceFor):
3449         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3450         (WebCore::JSTestCEReactions::subspaceForImpl):
3451         * bindings/scripts/test/JS/JSTestCEReactions.h:
3452         (WebCore::JSTestCEReactions::subspaceFor):
3453         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3454         (WebCore::JSTestCEReactionsStringifier::subspaceForImpl):
3455         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
3456         (WebCore::JSTestCEReactionsStringifier::subspaceFor):
3457         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3458         (WebCore::JSTestCallTracer::subspaceForImpl):
3459         * bindings/scripts/test/JS/JSTestCallTracer.h:
3460         (WebCore::JSTestCallTracer::subspaceFor):
3461         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3462         (WebCore::JSTestClassWithJSBuiltinConstructor::subspaceForImpl):
3463         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
3464         (WebCore::JSTestClassWithJSBuiltinConstructor::subspaceFor):
3465         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3466         (WebCore::JSTestDOMJIT::subspaceForImpl):
3467         * bindings/scripts/test/JS/JSTestDOMJIT.h:
3468         (WebCore::JSTestDOMJIT::subspaceFor):
3469         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3470         (WebCore::JSTestEnabledBySetting::subspaceForImpl):
3471         * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
3472         (WebCore::JSTestEnabledBySetting::subspaceFor):
3473         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
3474         (WebCore::JSTestEnabledForContext::subspaceForImpl):
3475         * bindings/scripts/test/JS/JSTestEnabledForContext.h:
3476         (WebCore::JSTestEnabledForContext::subspaceFor):
3477         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3478         (WebCore::JSTestEventConstructor::subspaceForImpl):
3479         * bindings/scripts/test/JS/JSTestEventConstructor.h:
3480         (WebCore::JSTestEventConstructor::subspaceFor):
3481         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3482         (WebCore::JSTestEventTarget::subspaceForImpl):
3483         * bindings/scripts/test/JS/JSTestEventTarget.h:
3484         (WebCore::JSTestEventTarget::subspaceFor):
3485         * bindings/scripts/test/JS/JSTestException.cpp:
3486         (WebCore::JSTestException::subspaceForImpl):
3487         * bindings/scripts/test/JS/JSTestException.h:
3488         (WebCore::JSTestException::subspaceFor):
3489         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3490         (WebCore::JSTestGenerateIsReachable::subspaceForImpl):
3491         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
3492         (WebCore::JSTestGenerateIsReachable::subspaceFor):
3493         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3494         (WebCore::JSTestGlobalObject::subspaceForImpl):
3495         * bindings/scripts/test/JS/JSTestGlobalObject.h:
3496         (WebCore::JSTestGlobalObject::subspaceFor):
3497         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3498         (WebCore::JSTestIndexedSetterNoIdentifier::subspaceForImpl):
3499         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
3500         (WebCore::JSTestIndexedSetterNoIdentifier::subspaceFor):
3501         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3502         (WebCore::JSTestIndexedSetterThrowingException::subspaceForImpl):
3503         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
3504         (WebCore::JSTestIndexedSetterThrowingException::subspaceFor):
3505         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3506         (WebCore::JSTestIndexedSetterWithIdentifier::subspaceForImpl):
3507         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
3508         (WebCore::JSTestIndexedSetterWithIdentifier::subspaceFor):
3509         * bindings/scripts/test/JS/JSTestInterface.cpp:
3510         (WebCore::JSTestInterface::subspaceForImpl):
3511         * bindings/scripts/test/JS/JSTestInterface.h:
3512         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3513         (WebCore::JSTestInterfaceLeadingUnderscore::subspaceForImpl):
3514         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
3515         (WebCore::JSTestInterfaceLeadingUnderscore::subspaceFor):
3516         * bindings/scripts/test/JS/JSTestIterable.cpp:
3517         (WebCore::JSTestIterable::subspaceForImpl):
3518         * bindings/scripts/test/JS/JSTestIterable.h:
3519         (WebCore::JSTestIterable::subspaceFor):
3520         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3521         (WebCore::JSTestJSBuiltinConstructor::subspaceForImpl):
3522         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
3523         (WebCore::JSTestJSBuiltinConstructor::subspaceFor):
3524         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3525         (WebCore::JSTestMediaQueryListListener::subspaceForImpl):
3526         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
3527         (WebCore::JSTestMediaQueryListListener::subspaceFor):
3528         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3529         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::subspaceForImpl):
3530         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
3531         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::subspaceFor):
3532         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3533         (WebCore::JSTestNamedAndIndexedSetterThrowingException::subspaceForImpl):
3534         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
3535         (WebCore::JSTestNamedAndIndexedSetterThrowingException::subspaceFor):
3536         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3537         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::subspaceForImpl):
3538         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
3539         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::subspaceFor):
3540         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3541         (WebCore::JSTestNamedConstructor::subspaceForImpl):
3542         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
3543         (WebCore::JSTestNamedConstructor::subspaceFor):
3544         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3545         (WebCore::JSTestNamedDeleterNoIdentifier::subspaceForImpl):
3546         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
3547         (WebCore::JSTestNamedDeleterNoIdentifier::subspaceFor):
3548         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3549         (WebCore::JSTestNamedDeleterThrowingException::subspaceForImpl):
3550         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
3551         (WebCore::JSTestNamedDeleterThrowingException::subspaceFor):
3552         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3553         (WebCore::JSTestNamedDeleterWithIdentifier::subspaceForImpl):
3554         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
3555         (WebCore::JSTestNamedDeleterWithIdentifier::subspaceFor):
3556         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3557         (WebCore::JSTestNamedDeleterWithIndexedGetter::subspaceForImpl):
3558         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
3559         (WebCore::JSTestNamedDeleterWithIndexedGetter::subspaceFor):
3560         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3561         (WebCore::JSTestNamedGetterCallWith::subspaceForImpl):
3562         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
3563         (WebCore::JSTestNamedGetterCallWith::subspaceFor):
3564         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3565         (WebCore::JSTestNamedGetterNoIdentifier::subspaceForImpl):
3566         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
3567         (WebCore::JSTestNamedGetterNoIdentifier::subspaceFor):
3568         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3569         (WebCore::JSTestNamedGetterWithIdentifier::subspaceForImpl):
3570         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
3571         (WebCore::JSTestNamedGetterWithIdentifier::subspaceFor):
3572         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3573         (WebCore::JSTestNamedSetterNoIdentifier::subspaceForImpl):
3574         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
3575         (WebCore::JSTestNamedSetterNoIdentifier::subspaceFor):
3576         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3577         (WebCore::JSTestNamedSetterThrowingException::subspaceForImpl):
3578         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
3579         (WebCore::JSTestNamedSetterThrowingException::subspaceFor):
3580         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3581         (WebCore::JSTestNamedSetterWithIdentifier::subspaceForImpl):
3582         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
3583         (WebCore::JSTestNamedSetterWithIdentifier::subspaceFor):
3584         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3585         (WebCore::JSTestNamedSetterWithIndexedGetter::subspaceForImpl):
3586         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
3587         (WebCore::JSTestNamedSetterWithIndexedGetter::subspaceFor):
3588         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3589         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::subspaceForImpl):
3590         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
3591         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::subspaceFor):
3592         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3593         (WebCore::JSTestNamedSetterWithOverrideBuiltins::subspaceForImpl):
3594         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
3595         (WebCore::JSTestNamedSetterWithOverrideBuiltins::subspaceFor):
3596         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3597         (WebCore::JSTestNamedSetterWithUnforgableProperties::subspaceForImpl):
3598         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
3599         (WebCore::JSTestNamedSetterWithUnforgableProperties::subspaceFor):
3600         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3601         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::subspaceForImpl):
3602         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
3603         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::subspaceFor):
3604         * bindings/scripts/test/JS/JSTestNode.cpp:
3605         (WebCore::JSTestNode::subspaceForImpl):
3606         * bindings/scripts/test/JS/JSTestNode.h:
3607         * bindings/scripts/test/JS/JSTestObj.cpp:
3608         (WebCore::JSTestObj::subspaceForImpl):
3609         * bindings/scripts/test/JS/JSTestObj.h:
3610         (WebCore::JSTestObj::subspaceFor):
3611         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3612         (WebCore::JSTestOverloadedConstructors::subspaceForImpl):
3613         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
3614         (WebCore::JSTestOverloadedConstructors::subspaceFor):
3615         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3616         (WebCore::JSTestOverloadedConstructorsWithSequence::subspaceForImpl):
3617         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
3618         (WebCore::JSTestOverloadedConstructorsWithSequence::subspaceFor):
3619         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3620         (WebCore::JSTestOverrideBuiltins::subspaceForImpl):
3621         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
3622         (WebCore::JSTestOverrideBuiltins::subspaceFor):
3623         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
3624         (WebCore::JSTestPluginInterface::subspaceForImpl):
3625         * bindings/scripts/test/JS/JSTestPluginInterface.h:
3626         (WebCore::JSTestPluginInterface::subspaceFor):
3627         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3628         (WebCore::JSTestPromiseRejectionEvent::subspaceForImpl):
3629         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h:
3630         (WebCore::JSTestPromiseRejectionEvent::subspaceFor):
3631         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3632         (WebCore::JSTestSerialization::subspaceForImpl):
3633         * bindings/scripts/test/JS/JSTestSerialization.h:
3634         (WebCore::JSTestSerialization::subspaceFor):
3635         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
3636         (WebCore::JSTestSerializationIndirectInheritance::subspaceForImpl):
3637         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h:
3638         (WebCore::JSTestSerializationIndirectInheritance::subspaceFor):
3639         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
3640         (WebCore::JSTestSerializationInherit::subspaceForImpl):
3641         * bindings/scripts/test/JS/JSTestSerializationInherit.h:
3642         (WebCore::JSTestSerializationInherit::subspaceFor):
3643         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
3644         (WebCore::JSTestSerializationInheritFinal::subspaceForImpl):
3645         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
3646         (WebCore::JSTestSerializationInheritFinal::subspaceFor):
3647         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3648         (WebCore::JSTestSerializedScriptValueInterface::subspaceForImpl):
3649         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
3650         (WebCore::JSTestSerializedScriptValueInterface::subspaceFor):
3651         * bindings/scripts/test/JS/JSTestStringifier.cpp:
3652         (WebCore::JSTestStringifier::subspaceForImpl):
3653         * bindings/scripts/test/JS/JSTestStringifier.h:
3654         (WebCore::JSTestStringifier::subspaceFor):
3655         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3656         (WebCore::JSTestStringifierAnonymousOperation::subspaceForImpl):
3657         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h:
3658         (WebCore::JSTestStringifierAnonymousOperation::subspaceFor):
3659         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3660         (WebCore::JSTestStringifierNamedOperation::subspaceForImpl):
3661         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h:
3662         (WebCore::JSTestStringifierNamedOperation::subspaceFor):
3663         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3664         (WebCore::JSTestStringifierOperationImplementedAs::subspaceForImpl):
3665         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h:
3666         (WebCore::JSTestStringifierOperationImplementedAs::subspaceFor):
3667         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3668         (WebCore::JSTestStringifierOperationNamedToString::subspaceForImpl):
3669         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h:
3670         (WebCore::JSTestStringifierOperationNamedToString::subspaceFor):
3671         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3672         (WebCore::JSTestStringifierReadOnlyAttribute::subspaceForImpl):
3673         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h:
3674         (WebCore::JSTestStringifierReadOnlyAttribute::subspaceFor):
3675         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3676         (WebCore::JSTestStringifierReadWriteAttribute::subspaceForImpl):
3677         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h:
3678         (WebCore::JSTestStringifierReadWriteAttribute::subspaceFor):
3679         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3680         (WebCore::JSTestTypedefs::subspaceForImpl):
3681         * bindings/scripts/test/JS/JSTestTypedefs.h:
3682         (WebCore::JSTestTypedefs::subspaceFor):
3683
3684 2020-03-06  Commit Queue  <commit-queue@webkit.org>
3685
3686         Unreviewed, rolling out r257950.
3687         https://bugs.webkit.org/show_bug.cgi?id=208704
3688
3689         causing debug failure (Requested by yusukesuzuki on #webkit).
3690
3691         Reverted changeset:
3692
3693         "Put all generated JSCells in WebCore into IsoSubspace"
3694         https://bugs.webkit.org/show_bug.cgi?id=205107
3695         https://trac.webkit.org/changeset/257950
3696
3697 2020-03-06  Michael Catanzaro  <mcatanzaro@gnome.org>
3698
3699         [WPE][GTK] Use Firefox user agent quirk more aggressively on Google Docs
3700         https://bugs.webkit.org/show_bug.cgi?id=208647
3701
3702         Reviewed by Carlos Garcia Campos.
3703
3704         I had previously determined that we need to send a Firefox user agent quirk to
3705         accounts.youtube.com to avoid unsupported browser warnings on Google Docs. Either the user
3706         agent check has since become more aggressive, or it somehow depends on factors I don't
3707         understand, but as of today it's no longer enough. We now need the quirk for docs.google.com
3708         as well.
3709
3710         * platform/UserAgentQuirks.cpp:
3711         (WebCore::urlRequiresFirefoxBrowser):
3712
3713 2020-03-05  Zalan Bujtas  <zalan@apple.com>
3714
3715         [LFC][TFC] An absolute positioned <table> should establish a table formatting context
3716         https://bugs.webkit.org/show_bug.cgi?id=208695
3717         <rdar://problem/60122473>
3718
3719         Reviewed by Antti Koivisto.
3720
3721         Not all type of content gets blockified when out-of-flow positioned or floated.
3722
3723         * layout/layouttree/LayoutBox.cpp:
3724         (WebCore::Layout::Box::establishesBlockFormattingContext const):
3725
3726 2020-02-29  Darin Adler  <darin@apple.com>
3727
3728         Simplify gradient parsing
3729         https://bugs.webkit.org/show_bug.cgi?id=208417
3730
3731         Reviewed by Anders Carlsson.
3732
3733         - Use Optional<> and invalid Color to represent unspecified positions and colors.
3734           This is simpler and easier to get right than separate booleans.
3735         - Simplified sorting of stops in legacy gradients to remove extra CSS value
3736           evaluation and unnecessary "sort in place" technique.
3737         - Rewrote equals functions for CSS gradient value classes. The new pattern is
3738           to compare all the data members that hold parsed CSS data, handling null
3739           correctly, since the parser won't set inappropriate ones. The old code had
3740           complex logic to only compare certain data members, which was unnecessary
3741           and hard to read to tell if it was correct.
3742         - Added some more use of WTFMove to cut down on reference count churn.
3743
3744         * css/CSSGradientValue.cpp:
3745         (WebCore::CSSGradientValue::image): Removed unneeded call to get().
3746         (WebCore::compareStops): Deleted.
3747         (WebCore::CSSGradientValue::sortStopsIfNeeded): Deleted.
3748         (WebCore::resolveStopColors): Take advantage of the fact that we know because
3749         of parsing rules that the only stops without colors are midpoints to drastically
3750         simplify this function to a trivial loop.
3751         (WebCore::CSSGradientValue::hasColorDerivedFromElement const): Added.
3752         Checks to see if any of the stop colors is derived from the element. The old
3753         code confusingly would store the answer to this in the stop, but only in the
3754         first stop with this property. Computing it without modifying the stop, and
3755         memoizing it in the gradient preserves the same performance characteristics
3756         as before without requiring a boolean in each stop in the stops vector.
3757         (WebCore::CSSGradientValue::gradientWithStylesResolved): Call the new
3758         hasColorDerivedFromElement function instead of having the logic here.
3759         (WebCore::LinearGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
3760         Update since GradientStop now has optional offsets. By the time this
3761         function is called they are all guaranteed to be filled in, so we can
3762         just use the * operator.
3763         (WebCore::RadialGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
3764         Ditto.
3765         (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
3766         Ditto.
3767         (WebCore::CSSGradientValue::computeStops): Moved the sorting of stops for
3768         the deprecated gradients here. Also updated since Gradient::ColorStop
3769         no longer uses "m_" prefixes on its public struct data members. Some
3770         simplification because we no longer need to explicitly set "specified"
3771         to true since it's no longer a separate boolean.
3772         (WebCore::positionFromValue): Handle a null pointer for value by returning
3773         0, which is what the caller was doing explicitly before. Use float
3774         instead of int for some internal computations that were mixing the two
3775         for no good reason.
3776         (WebCore::computeEndPoint): Removed null checks now that positionFromValue
3777         does them for us, turning this into a one-liner.
3778         (WebCore::CSSGradientValue::isCacheable const): Use hasColorDerivedFromElement.
3779         (WebCore::CSSGradientValue::knownToBeOpaque const): Removed unnnecessary
3780         checking the color both before and after when a color filter is involved.
3781         (WebCore::CSSGradientValue::equals const): Added. Shared by all the equals
3782         functions for derived classes.
3783         (WebCore::appendGradientStops): Updated for changes to CSSGradientColorStop.
3784         (WebCore::appendSpaceSeparatedOptionalCSSPtrText): Added template helper
3785         for writing two optional CSS values with a space between.
3786         (WebCore::writeColorStop): Ditto. Also converted to non-member function,
3787         removed unneeded isMidpoint check, use appendSpaceSeparatedOptionalCSSPtrText.
3788         (WebCore::CSSLinearGradientValue::customCSSText const): Call function
3789         members so we don't have to expose CSSGradientValue data members as
3790         protected things that can be accessed by derived classes. Some other
3791         small refactoring, such as getting rid of extra boolean wroteFirstStop.
3792         (WebCore::CSSLinearGradientValue::createGradient): Updated to use
3793         function members instead of protected data members.
3794         (WebCore::CSSLinearGradientValue::equals const): Compare all data
3795         members and use CSSGradientValue::equals, makes this a 1-liner.
3796         (WebCore::CSSRadialGradientValue::customCSSText const): Call function
3797         members as described above and use appendSpaceSeparatedOptionalCSSPtrText.
3798         (WebCore::CSSRadialGradientValue::createGradient): Ditto.
3799         (WebCore::CSSRadialGradientValue::equals const): Compare all data
3800         members and use CSSGradientValue::equals.
3801         (WebCore::CSSConicGradientValue::customCSSText const): Call function
3802         members as described above and use appendSpaceSeparatedOptionalCSSPtrText.
3803         (WebCore::CSSConicGradientValue::createGradient): Ditto.
3804         (WebCore::CSSConicGradientValue::equals const): Compare all data
3805         members and use CSSGradientValue::equals, makes this a 1-liner.
3806
3807         * css/CSSGradientValue.h: Removed unneeded includes and forward declarations.
3808         Renamed CSSGradientColorStop data members to not use m_ prefix since this is
3809         a struct with public data members, and WebKit style says not to do that here.
3810         Removed m_colorIsDerivedFromElement and isMidpoint from CSSGradientColorStop,
3811         m_colorIsDerivedFromElement is now stored in the gradient, not the color stop,
3812         and midpoints are any color stop with null color. Replaced the
3813         CSSGradientValue::stopCount function, which mixed size_t and unsigned types,
3814         with a hasTwoStops function, which is all the caller needs. Converted the
3815         isFixedSize, fixedSize, isPending, and loadSubimages into static member
3816         functions: they don't do any work and so don't need an instance. Removed
3817         the unneeded gradient type argument to the cloning constructors. Removed
3818         m_stopsSorted and added m_hasColorDerivedFromElement and
3819         hasColorDerivedFromElement. Added getter functions that are protected so
3820         the data members themselves can be private. Removed sortStopsIfNeeded
3821         and writeColorStop.
3822
3823         * css/parser/CSSPropertyParserHelpers.cpp:
3824         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
3825         Updated for CSSGradientColorStop member renaming.
3826         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient): Use
3827         more WTFMove to save a little bit of reference count churn; in some cases
3828         that means moving the setter calls to the end of the function after all
3829         the error checking.
3830         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops): Ditto.
3831         Removed code to set isMidpoint and the FIXME-NEWPARSER comment that said
3832         it could be removed. Used lambda to cut down on repeated code. Changed
3833         parsing of stops with a second position to repeat the color instead of
3834         relying on later computation to repeat it; this is required so we can
3835         always treat an omitted color as a midpoint.
3836         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient): Ditto.
3837         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient): Ditto.
3838         (WebCore::CSSPropertyParserHelpers::consumeLinearGradient): Ditto.
3839         (WebCore::CSSPropertyParserHelpers::consumeConicGradient): Ditto.
3840
3841         * html/HTMLInputElement.cpp:
3842         (WebCore::autoFillStrongPasswordMaskImage): Updated for the renamed
3843         CSSGradientColorStop members, added a missing call to doneAddingStops,
3844         and use some WTFMove to cut down on reference count churn.
3845
3846 2020-03-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
3847
3848         Remove the optimization for discarding no operation DisplayList items between Save and Restore items
3849         https://bugs.webkit.org/show_bug.cgi?id=208659
3850
3851         Reviewed by Simon Fraser.
3852
3853         This optimization is wrong in the case of drawing a canvas in general.
3854         The original implementation of the DisplayList assumes balanced Save/
3855         Restore GraphicsContext. In canvas a GraphicsConext 'save' can be issued
3856         in a frame and the corresponding restore is issued many frames later.
3857
3858         * platform/graphics/displaylists/DisplayList.cpp:
3859         (WebCore::DisplayList::DisplayList::removeItemsFromIndex): Deleted.
3860         * platform/graphics/displaylists/DisplayList.h:
3861         * platform/graphics/displaylists/DisplayListItems.cpp:
3862         (WebCore::DisplayList::operator<<):
3863         * platform/graphics/displaylists/DisplayListItems.h:
3864         (WebCore::DisplayList::Save::encode const):
3865         (WebCore::DisplayList::Save::decode):
3866         (WebCore::DisplayList::Save::restoreIndex const): Deleted.
3867         (WebCore::DisplayList::Save::setRestoreIndex): Deleted.
3868         * platform/graphics/displaylists/DisplayListRecorder.cpp:
3869         (WebCore::DisplayList::Recorder::save):
3870         (WebCore::DisplayList::Recorder::restore):
3871         * platform/graphics/displaylists/DisplayListRecorder.h:
3872         (WebCore::DisplayList::Recorder::ContextState::cloneForSave const):
3873
3874 2020-03-05  Ben Nham  <nham@apple.com>
3875
3876         Add signposts for top-level execution of script elements
3877         https://bugs.webkit.org/show_bug.cgi?id=208548
3878
3879         Reviewed by Alex Christensen.
3880