Implementation of AccessibilitySupport AXSIsolatedTreeMode.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-03-08  Andres Gonzalez  <andresg_22@apple.com>
2
3         Implementation of AccessibilitySupport AXSIsolatedTreeMode.
4         https://bugs.webkit.org/show_bug.cgi?id=208691
5         <rdar://problem/60178602>
6
7         Reviewed by Chris Fleizach.
8
9         Honors the system AccessibilitySupport IsolatedTreeMode setting. The
10         system has three modes for IsolatedTree functionality: off, on on main
11         thread, and on on secondary thread.
12
13         * WebCore.xcodeproj/project.pbxproj:
14         * accessibility/AXObjectCache.cpp:
15         (WebCore::AXObjectCache::isolatedTreeFocusedObject):
16         (WebCore::AXObjectCache::focusedUIElementForPage):
17         (WebCore::AXObjectCache::isIsolatedTreeEnabled):
18         (WebCore::AXObjectCache::isolatedTreeRootObject):
19         (WebCore::AXObjectCache::canUseSecondaryAXThread):
20         * accessibility/AXObjectCache.h:
21         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
22         (-[WebAccessibilityObjectWrapperBase detach]):
23         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
24         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
25         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
26
27 2020-03-08  Jer Noble  <jer.noble@apple.com>
28
29         Unreviewed watchOS build fix: add platform guards.
30
31         * platform/audio/ios/MediaSessionHelperIOS.mm:
32         (MediaSessionHelperiOS::startMonitoringWirelessRoutes):
33         (MediaSessionHelperiOS::stopMonitoringWirelessRoutes):
34
35 2020-03-08  Fujii Hironori  <Hironori.Fujii@sony.com>
36
37         generate-bindings-all.pl: "my" variable $fh masks earlier declaration in same scope
38         https://bugs.webkit.org/show_bug.cgi?id=208757
39
40         Reviewed by Yusuke Suzuki.
41
42         * bindings/scripts/generate-bindings-all.pl: Reuse $fh variable instead of defining new one.
43
44 2020-03-06  Jer Noble  <jer.noble@apple.com>
45
46         [GPUP] Move AVSystemController code into the GPU process
47         https://bugs.webkit.org/show_bug.cgi?id=208727
48
49         Reviewed by Eric Carlson.
50
51         Move AVSystemController code out of MediaSessionManageriOS and into a new
52         class MediaSessionHelper, which is currently iOS only. The abstract base class
53         will be overriden by WebKit in the WebContent process.
54
55         Drive-by fix: Don't call a virtual method (resetRestrictions()) from the constructor of a
56         virtual base class; the virtual function table hasn't been created yet, and the subclasses'
57         overridden methods won't be called. Move the call to post-creation.
58
59         * platform/audio/PlatformMediaSessionManager.cpp:
60         (WebCore::PlatformMediaSessionManager::sharedManager):
61         (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
62         * platform/audio/ios/MediaSessionHelperIOS.h: Added.
63         * platform/audio/ios/MediaSessionHelperIOS.mm: Copied from Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm.
64         (sharedHelperInstance):
65         (MediaSessionHelper::sharedHelper):
66         (MediaSessionHelper::resetSharedHelper):
67         (MediaSessionHelper::setSharedHelper):
68         (MediaSessionHelper::addClient):
69         (MediaSessionHelper::removeClient):
70         (MediaSessionHelperiOS::MediaSessionHelperiOS):
71         (MediaSessionHelperiOS::~MediaSessionHelperiOS):
72         (MediaSessionHelperiOS::providePresentingApplicationPID):
73         (MediaSessionHelperiOS::startMonitoringWirelessRoutes):
74         (MediaSessionHelperiOS::stopMonitoringWirelessRoutes):
75         (MediaSessionHelperiOS::carPlayServerDied):
76         (MediaSessionHelperiOS::updateCarPlayIsConnected):
77         (MediaSessionHelperiOS::setIsPlayingToAutomotiveHeadUnit):
78         (MediaSessionHelperiOS::activeAudioRouteDidChange):
79         (MediaSessionHelperiOS::activeVideoRouteDidChange):
80         (MediaSessionHelperiOS::receivedInterruption):
81         (MediaSessionHelperiOS::applicationDidBecomeActive):
82         (MediaSessionHelperiOS::applicationDidEnterBackground):
83         (MediaSessionHelperiOS::applicationWillBecomeInactive):
84         (MediaSessionHelperiOS::applicationWillEnterForeground):
85         (MediaSessionHelperiOS::externalOutputDeviceAvailableDidChange):
86         (-[WebMediaSessionHelper initWithCallback:]):
87         (-[WebMediaSessionHelper dealloc]):
88         (-[WebMediaSessionHelper clearCallback]):
89         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
90         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
91         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]):
92         (-[WebMediaSessionHelper interruption:]):
93         (-[WebMediaSessionHelper applicationWillEnterForeground:]):
94         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
95         (-[WebMediaSessionHelper applicationWillResignActive:]):
96         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]):
97         (-[WebMediaSessionHelper applicationDidEnterBackground:]):
98         (-[WebMediaSessionHelper carPlayServerDied:]):
99         (-[WebMediaSessionHelper carPlayIsConnectedDidChange:]):
100         (-[WebMediaSessionHelper activeAudioRouteDidChange:]):
101         * platform/audio/ios/MediaSessionManagerIOS.h:
102         * platform/audio/ios/MediaSessionManagerIOS.mm:
103         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
104         (WebCore::MediaSessionManageriOS::~MediaSessionManageriOS):
105         (WebCore::MediaSessionManageriOS::hasWirelessTargetsAvailable):
106         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
107         (WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary):
108         (WebCore::MediaSessionManageriOS::providePresentingApplicationPID):
109         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
110         (WebCore::MediaSessionManageriOS::isPlayingToAutomotiveHeadUnitDidChange):
111         (WebCore::MediaSessionManageriOS::activeAudioRouteDidChange):
112         (WebCore::MediaSessionManageriOS::activeVideoRouteDidChange):
113         (WebCore::MediaSessionManageriOS::receivedInterruption):
114         (WebCore::MediaSessionManageriOS::applicationWillEnterForeground):
115         (WebCore::MediaSessionManageriOS::applicationDidBecomeActive):
116         (WebCore::MediaSessionManageriOS::applicationDidEnterBackground):
117         (WebCore::MediaSessionManageriOS::applicationWillBecomeInactive):
118         (WebCore::MediaSessionManageriOS::carPlayServerDied): Deleted.
119         (WebCore::MediaSessionManageriOS::updateCarPlayIsConnected): Deleted.
120         (-[WebMediaSessionHelper initWithCallback:]): Deleted.
121         (-[WebMediaSessionHelper dealloc]): Deleted.
122         (-[WebMediaSessionHelper clearCallback]): Deleted.
123         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Deleted.
124         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Deleted.
125         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Deleted.
126         (-[WebMediaSessionHelper interruption:]): Deleted.
127         (-[WebMediaSessionHelper applicationWillEnterForeground:]): Deleted.
128         (-[WebMediaSessionHelper applicationDidBecomeActive:]): Deleted.
129         (-[WebMediaSessionHelper applicationWillResignActive:]): Deleted.
130         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]): Deleted.
131         (-[WebMediaSessionHelper applicationDidEnterBackground:]): Deleted.
132         (-[WebMediaSessionHelper carPlayServerDied:]): Deleted.
133         (-[WebMediaSessionHelper carPlayIsConnectedDidChange:]): Deleted.
134         (-[WebMediaSessionHelper activeAudioRouteDidChange:]): Deleted.
135
136 2020-03-08  Andres Gonzalez  <andresg_22@apple.com>
137
138         Fix for LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html in IsolatedTree mode.
139         https://bugs.webkit.org/show_bug.cgi?id=208462
140         <rdar://problem/59980673>
141
142         Reviewed by Chris Fleizach.
143
144         Covered by LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html.
145
146         - Updates the IsolatedTree on the TextStateChange notification.
147         - Renamed isAccessibilityScrollView to isAccessibilityScrollViewInstance
148         and used isScrollView instead everywhere it's appropriate. This makes
149         code like AXObjectCache::rootWebArea work for both AXObjects and IsolatedObjects.
150         - Moved several utility functions from WebAccessibilityObjectWrapperMac.mm
151         to AXObjectCacheMac.mm where they belong, so that they can be used by
152         AXObjectCache implementation in addition to by the wrapper.
153
154         * accessibility/AXObjectCache.cpp:
155         (WebCore::AXObjectCache::postTextStateChangeNotification):
156         (WebCore::AXObjectCache::rootWebArea):
157         * accessibility/AccessibilityObject.cpp:
158         (WebCore::AccessibilityObject::isOnScreen const):
159         (WebCore::AccessibilityObject::scrollToGlobalPoint const):
160         * accessibility/AccessibilityObject.h:
161         * accessibility/AccessibilityObjectInterface.h:
162         * accessibility/AccessibilityRenderObject.cpp:
163         (WebCore::AccessibilityRenderObject::getScrollableAreaIfScrollable const):
164         * accessibility/AccessibilityScrollView.h:
165         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
166         (-[WebAccessibilityObjectWrapper accessibilityContainer]):
167         * accessibility/isolatedtree/AXIsolatedObject.cpp:
168         (WebCore::AXIsolatedObject::isAccessibilityScrollViewInstance const):
169         (WebCore::AXIsolatedObject::isAccessibilityScrollView const): Renamed.
170         * accessibility/isolatedtree/AXIsolatedObject.h:
171         * accessibility/mac/AXObjectCacheMac.mm:
172         (WebCore::AXObjectCache::postTextStateChangePlatformNotification): Uses
173         TextMarker utilities instead of calling into the wrapper. This fixes
174         the crash caused by the wrapper updating the backingObject that in turn
175         may change the wrapper.
176         (WebCore::AXTextMarkerRange): Moved from WebAccessibilityObjectWrapperMac.mm.
177         (WebCore::textMarkerRangeFromMarkers): Moved from WebAccessibilityObjectWrapperMac.mm.
178         (WebCore::textMarkerForVisiblePosition): Moved from WebAccessibilityObjectWrapperMac.mm.
179         (WebCore::textMarkerRangeFromVisiblePositions): Moved from WebAccessibilityObjectWrapperMac.mm.
180         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
181         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
182         (AXTextMarkerRange): Moved.
183         (textMarkerForVisiblePosition): Moved.
184         (textMarkerRangeFromMarkers): Moved.
185         (textMarkerRangeFromVisiblePositions): Moved.
186
187 2020-03-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
188
189         Canvas drawing commands have to be flushed to the GPUProcess in batches
190         https://bugs.webkit.org/show_bug.cgi?id=208597
191
192         Reviewed by Myles C. Maxfield.
193
194         Make DisplayList::ImageBuffer an observer of DisplayList::Recorder.
195         It can track adding an item to the recoded DisplayList.
196
197         * platform/graphics/displaylists/DisplayListDrawingContext.cpp:
198         (WebCore::DisplayList::DrawingContext::DrawingContext):
199         * platform/graphics/displaylists/DisplayListDrawingContext.h:
200         * platform/graphics/displaylists/DisplayListImageBuffer.h:
201         (WebCore::DisplayList::ImageBuffer::ImageBuffer):
202         * platform/graphics/displaylists/DisplayListRecorder.cpp:
203         (WebCore::DisplayList::Recorder::Recorder):
204         (WebCore::DisplayList::Recorder::willAppendItem):
205         * platform/graphics/displaylists/DisplayListRecorder.h:
206         (WebCore::DisplayList::Recorder::Observer::~Observer):
207         (WebCore::DisplayList::Recorder::Observer::willAppendItem):
208
209 2020-03-08  Konstantin Tokarev  <annulen@yandex.ru>
210
211         [GTK] Fix compilation with disabled OpenGL
212         https://bugs.webkit.org/show_bug.cgi?id=208773
213
214         Reviewed by Yusuke Suzuki.
215
216         * html/OffscreenCanvas.h:
217
218 2020-03-07  Brent Fulgham  <bfulgham@apple.com>
219
220         Create a flag to disable in-app browser quirks
221         https://bugs.webkit.org/show_bug.cgi?id=208777
222         <rdar://problem/60062197>
223
224         Reviewed by Simon Fraser.
225
226         This patch makes the following changes:
227
228         1. Adds a new flag 'NeedsInAppBrowserPrivacyQuirks' to allow quirks to be toggled
229            during testing.
230         2. Reclassify this new flag, and the existing 'InAppBrowserPrivacyEnabled' flag from 
231            'settings' to Internal Debug settings
232
233         The renamed flags are covered by existing tests.
234
235         * page/RuntimeEnabledFeatures.h:
236         (WebCore::RuntimeEnabledFeatures::setNeedsInAppBrowserPrivacyQuirks):
237         (WebCore::RuntimeEnabledFeatures::needsInAppBrowserPrivacyQuirks const):
238         * page/Settings.yaml:
239
240 2020-03-07  Jer Noble  <jer.noble@apple.com>
241
242         [GPUP] Implement Legacy EME API in the GPU Process
243         https://bugs.webkit.org/show_bug.cgi?id=208402
244
245         Reviewed by Eric Carlson.
246
247         Prepare for running the LegacyCDM et. al. in the GPU process.
248
249         Slightly modernize LegacyCDM to allow all methods representaing a LegacyCDMFactory to be WTF::Functions.
250
251         Allow the list of registered factories to be cleared and reset at runtime.
252
253         Modify WebKitMediaKeys to notify the MediaPlayer when the keys object is added to a HTMLMediaElement.
254
255         Expose the pointer to the internal CDMPrivateInterface for use in WebKit.
256
257         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
258         (WebCore::LegacyCDM::platformRegisterFactories):
259         (WebCore::installedCDMFactories):
260         (WebCore::LegacyCDM::registerCDMFactory):
261         (WebCore::LegacyCDMFactoryForKeySystem):
262         (WebCore::LegacyCDM::supportsKeySystem):
263         (WebCore::LegacyCDM::keySystemSupportsMimeType):
264         (WebCore::LegacyCDM::LegacyCDM):
265         (WebCore::LegacyCDM::createSession):
266         * Modules/encryptedmedia/legacy/LegacyCDM.h:
267         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
268         (WebCore::WebKitMediaKeys::setMediaElement):
269         * WebCore.xcodeproj/project.pbxproj:
270         * html/HTMLMediaElement.cpp:
271         (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
272         * platform/graphics/LegacyCDMSession.h:
273         * platform/graphics/MediaPlayer.cpp:
274         (WebCore::MediaPlayer::setCDM):
275         * platform/graphics/MediaPlayer.h:
276         * platform/graphics/MediaPlayerPrivate.h:
277         (WebCore::MediaPlayerPrivateInterface::setCDM):
278
279 2020-03-07  Jer Noble  <jer.noble@apple.com>
280
281         [GPUP] LayoutTest debug assertion crashes: InitDataRegistry::registerInitDataType() called mulitple times with same type
282         https://bugs.webkit.org/show_bug.cgi?id=208765
283
284         Reviewed by Simon Fraser.
285
286         Wrap calls to registerInitDataType() in a std::call_once, to ensure it's not called muliple times when
287         platformRegisterFactories() is called multiple times.
288
289         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
290         (WebCore::CDMFactory::platformRegisterFactories):
291
292 2020-03-07  Simon Fraser  <simon.fraser@apple.com>
293
294         Generalize setSynchronousScrollingReasons() to take a ScrollingNodeID
295         https://bugs.webkit.org/show_bug.cgi?id=208774
296
297         Reviewed by Zalan Bujtas.
298
299         We'll be calling setSynchronousScrollingReasons() for overflow nodes at some point,
300         so change the argument from FrameView to ScrollingNodeID.
301
302         * page/scrolling/AsyncScrollingCoordinator.cpp:
303         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
304         * page/scrolling/AsyncScrollingCoordinator.h:
305         * page/scrolling/ScrollingCoordinator.cpp:
306         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
307         * page/scrolling/ScrollingCoordinator.h:
308         (WebCore::ScrollingCoordinator::setSynchronousScrollingReasons):
309
310 2020-03-07  Andres Gonzalez  <andresg_22@apple.com>
311
312         REGRESSION: (r257760?) [ Mac wk2 Debug ] ASSERTION FAILED: child->parentObject() == this in WebCore::AccessibilityObject::insertChild
313         https://bugs.webkit.org/show_bug.cgi?id=208648
314
315         Reviewed by Chris Fleizach.
316
317         [WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions] must
318         not update the backing store but instead just get the backing object.
319
320         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
321         (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
322
323 2020-03-07  Ryosuke Niwa  <rniwa@webkit.org>
324
325         TextManipulationController should work with ARIA labels
326         https://bugs.webkit.org/show_bug.cgi?id=208759
327
328         Reviewed by Wenson Hsieh.
329
330         This patch makes TextManipulationController work with a few ARIA content attributes.
331
332         It also makes observeParagraphs observe content across the entire document since canonicalizing
333         the starting position can end up skipping some content with ARIA.
334
335         Tests: TextManipulation.StartTextManipulationFindAttributeContent
336                TextManipulation.CompleteTextManipulationShouldReplaceAttributeContent
337
338         * editing/TextManipulationController.cpp:
339         (WebCore::TextManipulationController::startObservingParagraphs): Now takes two Positions instead
340         of two VisiblePositions.
341         (WebCore::isAttributeForTextManipulation): Added.
342         (WebCore::TextManipulationController::observeParagraphs): Added the code to find elements with
343         ARIA attributes and a few other elements that don't generate RenderObject's.
344         (WebCore::TextManipulationController::scheduleObservartionUpdate):
345         (WebCore::TextManipulationController::addItem): Now takes ManipulationItemData instead of indivisual
346         fields in it.
347         (WebCore::TextManipulationController::replace): Added the logic to handle ManipulationItemData
348         that specify element and attributeName.
349         * editing/TextManipulationController.h:
350         (WebCore::TextManipulationController::ManipulationItemData): Added element and attributeName.
351
352 2020-03-07  Megan Gardner  <megan_gardner@apple.com>
353
354         Adopt UIContextMenu for WKFileUploadPanel
355         https://bugs.webkit.org/show_bug.cgi?id=208687
356
357         Reviewed by Tim Horton.
358
359         New string, no tests needed.
360
361         * en.lproj/Localizable.strings:
362
363 2020-03-07  Daniel Bates  <dabates@apple.com>
364
365         [iOS] Implement support for dictation alternatives
366         https://bugs.webkit.org/show_bug.cgi?id=208720
367         <rdar://problem/58540114>
368
369         Reviewed by Brent Fulgham.
370
371         Part 3
372
373         Separate code that is actually USE(AUTOCORRECTION_PANEL)-specific from code that can also
374         be used when building with USE(DICTATION_ALTERNATIVES) enabled.
375
376         Note that I haven't enable USE_DICTATION_ALTERNATIVES on iOS. So, this code isn't being
377         compiled for iOS. I will do that in a subsequent change once after all the code is in place
378         to do so.
379
380         * SourcesCocoa.txt: Mark TextAlternativeWithRange.mm as @no-unify to fix build breakage when
381         a unified source file includes both TextAlternativeWithRange.mm and a file that ultimately
382         includes LengthBox.h (e.g. WebArchiveResourceFromNSAttributedString.mm). TextAlternativeWithRange.mm
383         ultimately includes SFNTLayoutTypes.h, which defines a Fixed type that conflicts with enumerator
384         Fixed (part of the LengthType enumeration) defined in Length.h. Ideally the LengthType enumeration
385         would be an enum class or scoped to Length to avoid this ambiguity. This would be a big change to do
386         and so for now I am fixing the build breakage using @no-unify.
387         * WebCore.xcodeproj/project.pbxproj: Add TextAlternativeWithRange.mm to the project now that
388         it is excluded from the unified build.
389         * editing/AlternativeTextController.cpp:
390         (WebCore::markerTypesForAppliedDictationAlternative):
391         (WebCore::AlternativeTextController::alternativeTextClient):
392         (WebCore::AlternativeTextController::markerDescriptionForAppliedAlternativeText):
393         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
394         * editing/AlternativeTextController.h:
395
396 2020-03-07  Daniel Bates  <dabates@apple.com>
397
398         [iOS] Implement support for dictation alternatives
399         https://bugs.webkit.org/show_bug.cgi?id=208720
400         <rdar://problem/58540114>
401
402         Reviewed by Wenson Hsieh.
403
404         Part 2
405
406         Include UIKitSPI.h in TextAlternativeWithRange.mm to get the definition of NSTextAlternatives
407         when building for iOS. Also while I am here, fix up some code style issues and use uniform
408         initializer syntax.
409
410         Note that I haven't enable USE_DICTATION_ALTERNATIVES on iOS. So, this code isn't being
411         compiled for iOS. I will do that in a subsequent change once after all the code is in place
412         to do so.
413
414         * editing/mac/TextAlternativeWithRange.mm:
415         (WebCore::TextAlternativeWithRange::TextAlternativeWithRange):
416
417 2020-03-07  Daniel Bates  <dabates@apple.com>
418
419         [iOS] Implement support for dictation alternatives
420         https://bugs.webkit.org/show_bug.cgi?id=208720
421         <rdar://problem/58540114>
422
423         Reviewed by Wenson Hsieh.
424
425         Part 1
426
427         Rename editing/mac/AlternativeTextUIController.{h, mm} to editing/cocoa/AlternativeTextUIController.{h, mm}
428         as it can be shared by both Mac and iOS. I also took this opportunity to do some very minor modernization
429         and cleanup to these files: use =default constructors and put the * on the right side for Objective-C types.
430
431         Note that I haven't enable USE_DICTATION_ALTERNATIVES on iOS. So, this code isn't being
432         compiled for iOS. I will do that in a subsequent change once after all the code is in place
433         to do so.
434
435         * SourcesCocoa.txt:
436         * WebCore.xcodeproj/project.pbxproj:
437         * editing/cocoa/AlternativeTextContextController.h:
438         * editing/cocoa/AlternativeTextContextController.mm: Added.
439         (WebCore::AlternativeTextContextController::addAlternatives):
440         (WebCore::AlternativeTextContextController::alternativesForContext):
441         (WebCore::AlternativeTextContextController::removeAlternativesForContext):
442         (WebCore::AlternativeTextContextController::clear):
443         * editing/cocoa/AlternativeTextUIController.h: Renamed from Source/WebCore/editing/mac/AlternativeTextUIController.h.
444         * editing/cocoa/AlternativeTextUIController.mm: Renamed from Source/WebCore/editing/mac/AlternativeTextUIController.mm.
445         (WebCore::AlternativeTextUIController::addAlternatives):
446         (WebCore::AlternativeTextUIController::alternativesForContext):
447         (WebCore::AlternativeTextUIController::clear):
448         (WebCore::AlternativeTextUIController::showAlternatives):
449         (WebCore::AlternativeTextUIController::handleAcceptedAlternative):
450         (WebCore::AlternativeTextUIController::dismissAlternatives):
451         (WebCore::AlternativeTextUIController::removeAlternatives):
452
453 2020-03-07  Fujii Hironori  <Hironori.Fujii@sony.com>
454
455         [CMake][Win] GenerateSettings.rb are invoked twice in WebCoreBindings.vcxproj and WebCoreTestSupportBindings.vcxproj
456         https://bugs.webkit.org/show_bug.cgi?id=208771
457
458         Reviewed by Konstantin Tokarev.
459
460         CMake Visual Studio generator put a custom command of
461         GenerateSettings.rb into both WebCoreBindings.vcxproj and
462         WebCoreTestSupportBindings.vcxproj because both projects are
463         using the generated files as source files. This causes
464         unnecessary recompilation.
465
466         The fundamental issue of this bug was fixed in CMake 3.12.
467         <https://gitlab.kitware.com/cmake/cmake/issues/16767>
468         All Windows ports are using newer CMake for Visual Studio 2019
469         support.
470
471         However, WebCoreTestSupportBindings needs to have a direct or
472         indirect dependency to WebCoreBindings for CMake Visual Studio
473         generator to eliminate duplicated custom commands. Otherwise,
474         GenerateSettings.rb will be triggered in both projects.
475
476         * CMakeLists.txt: Added a explicit dependency to WebCoreBindings
477         for WebCoreTestSupportBindings.
478         * WebCoreMacros.cmake: Removed stale comment.
479
480 2020-03-07  Eric Carlson  <eric.carlson@apple.com>
481
482         Implement setWirelessPlaybackTarget, performTaskAtMediaTime, and wouldTaintOrigin in GPUProcess
483         https://bugs.webkit.org/show_bug.cgi?id=208651
484         <rdar://problem/60088298>
485
486         Reviewed by Youenn Fablet.
487
488         * html/HTMLMediaElement.cpp:
489         (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Remove unused lambda parameter.
490
491         * platform/graphics/MediaPlayer.cpp:
492         (WebCore::MediaPlayer::performTaskAtMediaTime): Make MediaTime parameter const ref
493         so it isn't copied.
494         * platform/graphics/MediaPlayer.h:
495
496         * platform/graphics/MediaPlayerPrivate.h:
497         (WebCore::MediaPlayerPrivateInterface::performTaskAtMediaTime): Ditto.
498
499         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
500         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
501         (WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime): Ditto.
502
503         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
504         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
505         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime): Ditto.
506
507         * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
508         (WebCore::VideoLayerManagerObjC::setVideoFullscreenLayer): Don't set inline image
509         contents if image is NULL.
510
511 2020-03-07  Brady Eidson  <beidson@apple.com>
512
513         Add runtime flag for incremental PDF loading.
514         https://bugs.webkit.org/show_bug.cgi?id=208763
515
516         Reviewed by Tim Horton.
517
518         * page/RuntimeEnabledFeatures.h:
519         (WebCore::RuntimeEnabledFeatures::setIncrementalPDFLoadingEnabled):
520         (WebCore::RuntimeEnabledFeatures::incrementalPDFLoadingEnabled const):
521
522 2020-03-07  Zalan Bujtas  <zalan@apple.com>
523
524         [LFC][Verification] Use the table wrapper box's offset when matching out-of-flow tables
525         https://bugs.webkit.org/show_bug.cgi?id=208769
526         <rdar://problem/60191322>
527
528         Reviewed by Antti Koivisto.
529
530         In LFC, an out-of-flow table initiates a wrapper table box (out-of-flow) and a child table box (in-flow).
531         Apply the wrapper table box's offset, when matching the display and the render tree.
532
533         Test: fast/layoutformattingcontext/absolute-positioned-simple-table2.html
534
535         * layout/Verification.cpp:
536         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
537
538 2020-03-07  Darin Adler  <darin@apple.com>
539
540         Make Editor::applyEditingStyleToBodyElement do things in a straightforward manner
541         https://bugs.webkit.org/show_bug.cgi?id=208177
542
543         Reviewed by Wenson Hsieh.
544
545         * editing/Editor.cpp:
546         (WebCore::Editor::applyEditingStyleToBodyElement const): Use Document::body and
547         StyledElement::setInlineStyleProperty to apply styles to the body. The older code
548         was looping over all body elements in the document, for no good reason, and using
549         the CSS object model wrapper object for the styles, also for no good reason.
550
551 2020-03-05  Sam Weinig  <weinig@apple.com>
552
553         Move JavaScriptCore related feature defines from FeatureDefines.xcconfig to PlatformEnableCocoa.h
554         https://bugs.webkit.org/show_bug.cgi?id=207436
555         <rdar://problem/59296762>
556
557         Reviewed by Darin Adler.
558
559         * Configurations/FeatureDefines.xcconfig:
560         Remove JSC related defines.
561
562 2020-03-07  Chris Fleizach  <cfleizach@apple.com>
563
564         AX: Provide a way to run tests in isolated tree mode
565         https://bugs.webkit.org/show_bug.cgi?id=208629
566         <rdar://problem/60075583>
567
568         Reviewed by Ryosuke Niwa.
569
570         Now that we have a way to run this with tests, we don't need to allow usage for an unknown client.
571
572         * accessibility/AXObjectCache.cpp:
573         (WebCore::AXObjectCache::clientSupportsIsolatedTree):
574
575 2020-03-07  Zalan Bujtas  <zalan@apple.com>
576
577         [LFC][IFC] Use start-aligned horizontal adjustment when justify is not eligible.
578         https://bugs.webkit.org/show_bug.cgi?id=208762
579         <rdar://problem/60188433>
580
581         Reviewed by Antti Koivisto.
582
583         Make sure we apply "text-align: start" when "text-align: justify" is not eligible.
584         Currently "text-align: start" is a no-op, so no chnange in functionality (this might change in the future).
585
586         * layout/inlineformatting/InlineLineBuilder.cpp:
587         (WebCore::Layout::LineBuilder::alignHorizontally):
588         (WebCore::Layout::LineBuilder::removeTrailingTrimmableContent):
589         * layout/inlineformatting/InlineLineBuilder.h:
590         (WebCore::Layout::LineBuilder::isTextAlignJustify const): Deleted.
591         (WebCore::Layout::LineBuilder::isTextAlignRight const): Deleted.
592
593 2020-03-07  Zalan Bujtas  <zalan@apple.com>
594
595         [LFC][IFC] Do not text-align: justify the runs on the current line if they are followed by a forced break
596         https://bugs.webkit.org/show_bug.cgi?id=208761
597         <rdar://problem/59825136>
598
599         Reviewed by Antti Koivisto.
600
601         https://www.w3.org/TR/css-text-3/#text-align-property
602         "Text is justified according to the method specified by the text-justify property,
603         in order to exactly fill the line box. Unless otherwise specified by text-align-last,
604         the last line before a forced break or the end of the block is start-aligned."
605
606         Test: fast/text/text-align-justify-and-forced-line-break.html
607
608         * layout/inlineformatting/InlineLineBuilder.cpp:
609         (WebCore::Layout::LineBuilder::alignHorizontally):
610
611 2020-03-07  Konstantin Tokarev  <annulen@yandex.ru>
612
613         REGRESSION(r257975): [GTK][WPE] Build failure after a clean build
614         https://bugs.webkit.org/show_bug.cgi?id=208711
615
616         Reviewed by Yusuke Suzuki.
617
618         Make sure that InternalSettingsGenerated,idl is generated before bindings
619         generation starts.
620
621         Also, make IDL preprocessor die if specified IDL file is missing, instead
622         of going on silently.
623
624         * CMakeLists.txt:
625         * WebCoreMacros.cmake:
626         * bindings/scripts/preprocess-idls.pl:
627         (getFileContents):
628
629 2020-03-07  Andres Gonzalez  <andresg_22@apple.com>
630
631         AXIsolatedObject support for documentLinks.
632         https://bugs.webkit.org/show_bug.cgi?id=208734
633
634         Reviewed by Chris Fleizach.
635
636         - Expose documentLinks through the AXCoreObject interface, so that
637         wrapper code works for both AXObject and AXIsolatedObjects.
638         - Struct NodeChange now retains wrapper which was causing crash as the
639         wrapper was destroyed before it was attached to the IsolatedObject.
640
641         * accessibility/AccessibilityObject.h:
642         * accessibility/AccessibilityObjectInterface.h:
643         * accessibility/AccessibilityRenderObject.cpp:
644         (WebCore::AccessibilityRenderObject::documentLinks):
645         (WebCore::AccessibilityRenderObject::getDocumentLinks): Deleted.
646         * accessibility/AccessibilityRenderObject.h:
647         * accessibility/isolatedtree/AXIsolatedObject.cpp:
648         (WebCore::AXIsolatedObject::initializeAttributeData):
649         * accessibility/isolatedtree/AXIsolatedObject.h:
650         * accessibility/isolatedtree/AXIsolatedTree.cpp:
651         (WebCore::AXIsolatedTree::setFocusedNode):
652         (WebCore::AXIsolatedTree::applyPendingChanges):
653         * accessibility/isolatedtree/AXIsolatedTree.h:
654         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
655         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
656
657 2020-03-07  chris fleizach  <cfleizach@apple.com>
658
659         Unreviewed, rolling out r258047.
660
661         Referenced SPI not yet available for Safari builders.
662
663         Reverted changeset:
664
665         "Implementation of AccessibilitySupport AXSIsolatedTreeMode."
666         https://bugs.webkit.org/show_bug.cgi?id=208691
667         https://trac.webkit.org/changeset/258047
668
669 2020-03-06  David Kilzer  <ddkilzer@apple.com>
670
671         REGRESSION (r258051): WinCairo/WPE/GTK build failures
672         <https://bugs.webkit.org/show_bug.cgi?id=208621>
673         <rdar://problem/60068047>
674
675         * Headers.cmake:
676         (WebCore_PRIVATE_FRAMEWORK_HEADERS): Add html/ImageData.h to
677         attempt a build fix.
678
679 2020-03-06  Yusuke Suzuki  <ysuzuki@apple.com>
680
681         Put remaining fixed-sized cells into IsoSubspace
682         https://bugs.webkit.org/show_bug.cgi?id=208754
683
684         Reviewed by Keith Miller.
685
686         * bindings/js/JSDOMIterator.h:
687         * bindings/scripts/CodeGeneratorJS.pm:
688         (GeneratePrototypeDeclaration):
689         * bindings/scripts/test/JS/JSInterfaceName.cpp:
690         * bindings/scripts/test/JS/JSMapLike.cpp:
691         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
692         * bindings/scripts/test/JS/JSReadOnlySetLike.cpp:
693         * bindings/scripts/test/JS/JSSetLike.cpp:
694         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
695         (WebCore::JSTestActiveDOMObjectConstructor::prototypeForStructure):
696         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
697         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
698         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
699         (WebCore::JSTestCallTracerConstructor::prototypeForStructure):
700         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
701         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
702         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
703         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
704         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
705         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
706         * bindings/scripts/test/JS/JSTestException.cpp:
707         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
708         * bindings/scripts/test/JS/JSTestGlobalObject.h:
709         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
710         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
711         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
712         * bindings/scripts/test/JS/JSTestInterface.cpp:
713         (WebCore::JSTestInterfaceConstructor::construct):
714         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
715         * bindings/scripts/test/JS/JSTestIterable.cpp:
716         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
717         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
718         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
719         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
720         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
721         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
722         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
723         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
724         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
725         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
726         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
727         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
728         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
729         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
730         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
731         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
732         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
733         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
734         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
735         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
736         (WebCore::JSTestNamedSetterWithUnforgablePropertiesConstructor::prototypeForStructure):
737         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
738         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::prototypeForStructure):
739         * bindings/scripts/test/JS/JSTestNode.cpp:
740         * bindings/scripts/test/JS/JSTestObj.cpp:
741         (WebCore::JSTestObjConstructor::construct):
742         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
743         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
744         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
745         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
746         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
747         * bindings/scripts/test/JS/JSTestSerialization.cpp:
748         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
749         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
750         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
751         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
752         * bindings/scripts/test/JS/JSTestStringifier.cpp:
753         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
754         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
755         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
756         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
757         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
758         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
759         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
760         (WebCore::JSTestTypedefsConstructor::construct):
761
762 2020-03-06  Simon Fraser  <simon.fraser@apple.com>
763
764         Fix scrolling tree hit-testing on scrolled and zoomed pages
765         https://bugs.webkit.org/show_bug.cgi?id=208755
766
767         Reviewed by Zalan Bujtas.
768
769         Map the hit-test point from view to content coordinates before hit-testing the scrolling tree.
770
771         Tests: fast/scrolling/mac/overflow-scrolled-document.html
772                fast/scrolling/mac/overflow-zoomed-document.html
773
774         * page/scrolling/ScrollingTree.cpp:
775         (WebCore::ScrollingTree::handleWheelEvent):
776
777 2020-03-06  Alex Christensen  <achristensen@webkit.org>
778
779         Add SPI to disable cross origin access control checks
780         https://bugs.webkit.org/show_bug.cgi?id=208748
781         <rdar://problem/59861114>
782
783         Reviewed by Tim Hatcher.
784
785         Because loading is done process-globally in the WebProcess, use a CrossOriginAccessControlCheckDisabler::singleton for those checks.
786         Pass a parameter to the NetworkResourceLoaders to disable these checks only for loads from a web process without access control checks.
787         As long as we're changing the signature of passesAccessControlCheck, make it return an Expected instead of a bool with an out parameter.
788
789         * loader/CrossOriginAccessControl.cpp:
790         (WebCore::CrossOriginAccessControlCheckDisabler::singleton):
791         (WebCore::CrossOriginAccessControlCheckDisabler::setCrossOriginAccessControlCheckEnabled):
792         (WebCore::CrossOriginAccessControlCheckDisabler::crossOriginAccessControlCheckEnabled const):
793         (WebCore::passesAccessControlCheck):
794         (WebCore::validatePreflightResponse):
795         * loader/CrossOriginAccessControl.h:
796         * loader/CrossOriginPreflightChecker.cpp:
797         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
798         * loader/DocumentThreadableLoader.cpp:
799         (WebCore::DocumentThreadableLoader::loadRequest):
800         * loader/SubresourceLoader.cpp:
801         (WebCore::SubresourceLoader::willSendRequestInternal):
802         (WebCore::SubresourceLoader::didReceiveResponse):
803         (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):
804         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
805         * loader/SubresourceLoader.h:
806         * loader/cache/CachedResource.cpp:
807         (WebCore::CachedResource::loadFrom):
808
809 2020-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
810
811         [GPU Process] Implement CanvasRenderingContext2D.putImageData()
812         https://bugs.webkit.org/show_bug.cgi?id=208621
813         <rdar://problem/60068047>
814
815         Reviewed by Simon Fraser.
816
817         putImageData() is implemented just as a DisplayListItem. Conceptually, it's the
818         same as a draw command. Unfortunately, it can't be implemented on top of
819         GraphicsContext, and instead has to be implemented on top of ImageBuffer, so
820         this patch also adds a delegate to DisplayList::Replayer which can implement the
821         commands that require an ImageBuffer. This moves in the direction of making the
822         display list raw data, and moving the applier functions somewhere else at a
823         higher level.
824
825         Implementing this as a DisplayListItem rather than its own IPC message is superior
826         because it gives us more control about when to flush the in-flight display list.
827
828         There is still a few unnecessary copies - we're copying into / out of a SharedData
829         during encoding. Being able to either have the ImageBuffer retain the SharedBuffer,
830         or have putImageData() have an overload which accepts a SharedBuffer, would be a
831         good opportunity for improvement.
832
833         Test: fast/canvas/putImageData-multiple.html
834
835         * html/ImageData.cpp:
836         (WebCore::ImageData::deepClone const):
837         * html/ImageData.h:
838         * platform/graphics/AlphaPremultiplication.h:
839         * platform/graphics/GraphicsContext.h:
840         (WebCore::GraphicsContext::impl):
841         * platform/graphics/displaylists/DisplayList.h:
842         * platform/graphics/displaylists/DisplayListDrawingContext.cpp:
843         (WebCore::DisplayList::DrawingContext::recorder):
844         * platform/graphics/displaylists/DisplayListDrawingContext.h:
845         * platform/graphics/displaylists/DisplayListItems.cpp:
846         (WebCore::DisplayList::Item::sizeInBytes):
847         (WebCore::DisplayList::PutImageData::PutImageData):
848         (WebCore::DisplayList::PutImageData::apply const):
849         (WebCore::DisplayList::operator<<):
850         * platform/graphics/displaylists/DisplayListItems.h:
851         (WebCore::DisplayList::DrawingItem::globalBounds const):
852         (WebCore::DisplayList::PutImageData::create):
853         (WebCore::DisplayList::PutImageData::inputFormat const):
854         (WebCore::DisplayList::PutImageData::imageData const):
855         (WebCore::DisplayList::PutImageData::srcRect const):
856         (WebCore::DisplayList::PutImageData::destPoint const):
857         (WebCore::DisplayList::PutImageData::encode const):
858         (WebCore::DisplayList::PutImageData::decode):
859         (WebCore::DisplayList::Item::encode const):
860         (WebCore::DisplayList::Item::decode):
861         * platform/graphics/displaylists/DisplayListRecorder.cpp:
862         (WebCore::DisplayList::Recorder::putImageData):
863         (WebCore::DisplayList::Recorder::updateItemExtent const):
864         * platform/graphics/displaylists/DisplayListRecorder.h:
865         * platform/graphics/displaylists/DisplayListReplayer.cpp:
866         (WebCore::DisplayList::Replayer::Replayer):
867         (WebCore::DisplayList::Replayer::replay):
868         * platform/graphics/displaylists/DisplayListReplayer.h:
869         (WebCore::DisplayList::Replayer::Delegate::~Delegate):
870         (WebCore::DisplayList::Replayer::Delegate::apply):
871
872 2020-03-06  Daniel Bates  <dabates@apple.com>
873
874         Add support for inserting and removing a text placeholder
875         https://bugs.webkit.org/show_bug.cgi?id=208661
876         <rdar://problem/59371073>
877
878         Reviewed by Simon Fraser and Ryosuke Niwa.
879
880         Implements the concept of a text placeholder, which is an element that acts like whitespace:
881         it takes up space in the page layout, but has no visual appearance.
882
883         Tests: editing/text-placeholder/insert-and-remove-into-text-field.html
884                editing/text-placeholder/insert-into-content-editable.html
885                editing/text-placeholder/insert-into-empty-text-field.html
886                editing/text-placeholder/insert-into-text-field-in-iframe.html
887                editing/text-placeholder/insert-into-text-field.html
888
889         * Sources.txt:
890         * WebCore.xcodeproj/project.pbxproj:
891         * dom/Element.h:
892         (WebCore::Element::isTextPlaceholderElement const): Added. Defaults to false. I override this
893         in TextPlaceholderElement.h.
894
895         * editing/Editor.cpp:
896         (WebCore::Editor::insertTextPlaceholder):
897         (WebCore::Editor::removeTextPlaceholder):
898         Insert a new placeholder or remove an existing one.
899
900         * editing/Editor.h:
901         * html/shadow/TextPlaceholderElement.cpp: Added.
902         (WebCore::TextPlaceholderElement::create):
903         (WebCore::TextPlaceholderElement::TextPlaceholderElement): Set inline styles to size the placeholder.
904         (WebCore::TextPlaceholderElement::insertedIntoAncestor): If the placeholder is inserted inside an
905         HTMLTextFormControlElement (e.g. <input> or <textarea>) then hide the HTML placeholder text.
906         (WebCore::TextPlaceholderElement::removedFromAncestor): If the placeholder was removed from inside
907         an HTMLTextFormControlElement then show the HTML placeholder text.
908         * html/shadow/TextPlaceholderElement.h:
909         (isType):
910         * testing/Internals.cpp:
911         (WebCore::Internals::insertTextPlaceholder): Added.
912         (WebCore::Internals::removeTextPlaceholder): Added.
913         * testing/Internals.h:
914         * testing/Internals.idl:
915
916 2020-03-06  Andres Gonzalez  <andresg_22@apple.com>
917
918         Implementation of AccessibilitySupport AXSIsolatedTreeMode.
919         https://bugs.webkit.org/show_bug.cgi?id=208691
920
921         Reviewed by Chris Fleizach.
922
923         Support for the AccessibilitySupport AXIsolatedTreMode accessibility setting.
924
925         * accessibility/AXObjectCache.cpp:
926         (WebCore::AXObjectCache::isolatedTreeFocusedObject):
927         (WebCore::AXObjectCache::focusedUIElementForPage):
928         (WebCore::AXObjectCache::isIsolatedTreeEnabled):
929         (WebCore::AXObjectCache::rootObject):
930         (WebCore::AXObjectCache::isolatedTreeRootObject):
931         (WebCore::AXObjectCache::canUseSecondaryAXThread):
932         * accessibility/AXObjectCache.h:
933         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
934         (-[WebAccessibilityObjectWrapperBase detach]):
935         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
936         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
937         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
938
939 2020-03-06  Simon Fraser  <simon.fraser@apple.com>
940
941         Hit-test CALayers on the scrolling thread for async frame/overflow scrolling
942         https://bugs.webkit.org/show_bug.cgi?id=208740
943         <rdar://problem/48028836>
944
945         Reviewed by Tim Horton.
946
947         Implement hit-testing in the scrolling thread so we can determine which overflow/subframe
948         to scroll without hitting the main thread.
949
950         ScrollingTreeMac overrides scrollingNodeForPoint() and hit-tests through CALayers, starting at the
951         root content layer. Locking ensures that the CALayer tree doesn't change while we're hit-testing it.
952         We collect layers for the given point in back-to-front order much like the iOS code _web_findDescendantViewAtPoint
953         (too different to share though), and consult event regions on PlatformCALayerCocoa's to determine if the
954         point is inside the part of the layer that should receive events.
955
956         To handle the complex stacking/containing block cases, isScrolledBy() consults the scrolling tree.
957
958         For testing, fix it so that multiple calls to monitorWheelEvents() in a single test each start
959         with clean state.
960
961         Tests: fast/scrolling/mac/absolute-in-overflow-scroll.html
962                fast/scrolling/mac/async-scroll-overflow.html
963                fast/scrolling/mac/move-node-in-overflow-scroll.html
964                fast/scrolling/mac/overlapped-overflow-scroll.html
965
966         * page/scrolling/ScrollingTree.cpp:
967         (WebCore::ScrollingTree::handleWheelEvent):
968         (WebCore::ScrollingTree::scrollingNodeForPoint):
969         * page/scrolling/ScrollingTree.h:
970         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
971         * page/scrolling/mac/ScrollingTreeMac.h:
972         * page/scrolling/mac/ScrollingTreeMac.mm:
973         (collectDescendantLayersAtPoint):
974         (scrollingNodeIDForLayer):
975         (isScrolledBy):
976         (ScrollingTreeMac::scrollingNodeForPoint):
977         * testing/js/WebCoreTestSupport.cpp:
978         (WebCoreTestSupport::monitorWheelEvents): Make sure that each call to eventSender.monitorWheelEvents() clears previous state.
979
980 2020-03-06  Jer Noble  <jer.noble@apple.com>
981
982         [GPUP] Convert CDMFactory away from platformStrategies() and use WebProcess settings instead
983         https://bugs.webkit.org/show_bug.cgi?id=208699
984
985         Reviewed by Youenn Fablet.
986
987         * platform/MediaStrategy.h:
988         * platform/encryptedmedia/CDMFactory.cpp:
989
990 2020-03-06  Ryosuke Niwa  <rniwa@webkit.org>
991
992         TextManipulationController should preserve images
993         https://bugs.webkit.org/show_bug.cgi?id=208692
994
995         Reviewed by Wenson Hsieh.
996
997         This patch makes TextManipulationController preserve images (img and SVG) and their ordering,
998         and lays down the foundation for preserving other non-text content.
999
1000         To do this, this patch introduces ParagraphContentIterator which wraps TextIterator and introduces
1001         a secondary node iteration which detects all ndoes that have been skipped. Ideally, we would update
1002         TextIterator to do this natively but this is tricky due to the multitude of the node traveral options
1003         supported by TextIterator at the moment. ParagraphContentIterator::advance stops at every node
1004         including ones that do not generate text in TextIterator. This also allows more code sharing between
1005         TextManipulationController's observeParagraphs and replace functions.
1006
1007         For now, we special case nodes with RenderReplaced like img element and the root SVG element.
1008
1009         Tests: TextManipulation.CompleteTextManipulationShouldPreserveImagesAsExcludedTokens
1010                TextManipulation.CompleteTextManipulationShouldPreserveSVGAsExcludedTokens
1011                TextManipulation.CompleteTextManipulationShouldPreserveOrderOfBlockImage
1012
1013         * editing/TextManipulationController.cpp:
1014         (WebCore::ParagraphContentIterator): Added.
1015         (WebCore::ParagraphContentIterator::ParagraphContentIterator): Added.
1016         (WebCore::ParagraphContentIterator::advance): Added.
1017         (WebCore::ParagraphContentIterator::currentContent): Added.
1018         (WebCore::ParagraphContentIterator::startPosition): Added.
1019         (WebCore::ParagraphContentIterator::endPosition): Added.
1020         (WebCore::ParagraphContentIterator::atEnd const): Added.
1021         (WebCore::ParagraphContentIterator::moveCurrentNodeForward): Added.
1022         (WebCore::TextManipulationController::observeParagraphs): Adopted ParagraphContentIterator. For
1023         nodes with RenderReplaced, we generate an excluded token "[]". Removed the dead code which was
1024         creating a subrange from TextIterator, and renamed the previously misleadingly named endOfLastNewLine
1025         to startOfCurrentLine for clarity.
1026         (WebCore::TextManipulationController::replace): Adopted ParagraphContentIterator. Fixed a bug that
1027         excluded content were always assumed to be text, and a bug that the replaced content was inserted
1028         at a wrong location when insertionPoint is a position anchored at a node being removed. Also fixed
1029         an obvious bug that we were inserting root replaced contents at the position before a node which
1030         appears immediately before insertionPoint instead of after; this also resulted in the replaced content
1031         being inserted at a wrong location in some cases.
1032
1033 2020-03-06  Andres Gonzalez  <andresg_22@apple.com>
1034
1035         Crash accessing AXIsolatedObject::m_childrenIDS from removeSubtree on the main thread.
1036         https://bugs.webkit.org/show_bug.cgi?id=208728
1037
1038         Reviewed by Chris Fleizach.
1039
1040         AXIsolatedTree::removeSubtree was accessing AXIsolatedObject::m_childrenIDs
1041         on the main thread to remove all descendants recursively. But the lock
1042         had to be unlocked and locked again on each iteration, creating problems
1043         if the secondary thread modifies the children in between iterations.
1044         The solution in this patch is to eliminate removeSubtree, and make
1045         removeNode and applyPendingChanges to remove all descendants.
1046
1047         * accessibility/AXObjectCache.cpp:
1048         (WebCore::AXObjectCache::updateIsolatedTree):
1049         * accessibility/isolatedtree/AXIsolatedTree.cpp:
1050         (WebCore::AXIsolatedTree::appendNodeChanges): Renamed local vars to make it clearer.
1051         (WebCore::AXIsolatedTree::applyPendingChanges):
1052         (WebCore::AXIsolatedTree::removeSubtree): Deleted.
1053         * accessibility/isolatedtree/AXIsolatedTree.h:
1054
1055 2020-03-06  Yusuke Suzuki  <ysuzuki@apple.com>
1056
1057         JSDOMIterator classes should be in IsoSubspace
1058         https://bugs.webkit.org/show_bug.cgi?id=208705
1059
1060         Reviewed by Sam Weinig.
1061
1062         JSDOMIterator should be allocated in IsoSubspace. So we can put all WebCore related cells into IsoSubspaces.
1063         To collect all iterator subspaces in DOMIsoSubspaces class, we scan `iterable<...>` pattern in preprocess-idls.pl.
1064         Then, we create a class for each DOM iterator instead of using `using XXXIterator = JSDOMIterator<...>` to put
1065         subspaceFor implementation easily. And we rename JSDOMIterator to JSDOMIteratorBase to explicitly state that
1066         this is Base class of actual iterators.
1067
1068         * bindings/js/JSDOMIterator.h:
1069         (WebCore::JSDOMIteratorBase::JSDOMIteratorBase):
1070         (WebCore::IteratorTraits>::asJS):
1071         (WebCore::IteratorTraits>::destroy):
1072         (WebCore::IteratorTraits>::next):
1073         (WebCore::JSDOMIterator::createStructure): Deleted.
1074         (WebCore::JSDOMIterator::create): Deleted.
1075         (WebCore::JSDOMIterator::createPrototype): Deleted.
1076         (WebCore::JSDOMIterator::JSDOMIterator): Deleted.
1077         * bindings/js/JSDOMWrapper.h:
1078         (WebCore::JSDOMObject::subspaceFor):
1079         * bindings/scripts/CodeGeneratorJS.pm:
1080         (GenerateIterableDefinition):
1081         (GeneratePrototypeDeclaration):
1082         * bindings/scripts/preprocess-idls.pl:
1083         (interfaceIsIterable):
1084         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1085         (WebCore::JSInterfaceNamePrototype::create): Deleted.
1086         (WebCore::JSInterfaceNamePrototype::createStructure): Deleted.
1087         (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype): Deleted.
1088         * bindings/scripts/test/JS/JSMapLike.cpp:
1089         (WebCore::JSMapLikePrototype::create): Deleted.
1090         (WebCore::JSMapLikePrototype::createStructure): Deleted.
1091         (WebCore::JSMapLikePrototype::JSMapLikePrototype): Deleted.
1092         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1093         (WebCore::JSReadOnlyMapLikePrototype::create): Deleted.
1094         (WebCore::JSReadOnlyMapLikePrototype::createStructure): Deleted.
1095         (WebCore::JSReadOnlyMapLikePrototype::JSReadOnlyMapLikePrototype): Deleted.
1096         * bindings/scripts/test/JS/JSReadOnlySetLike.cpp:
1097         (WebCore::JSReadOnlySetLikePrototype::create): Deleted.
1098         (WebCore::JSReadOnlySetLikePrototype::createStructure): Deleted.
1099         (WebCore::JSReadOnlySetLikePrototype::JSReadOnlySetLikePrototype): Deleted.
1100         * bindings/scripts/test/JS/JSSetLike.cpp:
1101         (WebCore::JSSetLikePrototype::create): Deleted.
1102         (WebCore::JSSetLikePrototype::createStructure): Deleted.
1103         (WebCore::JSSetLikePrototype::JSSetLikePrototype): Deleted.
1104         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1105         (WebCore::JSTestActiveDOMObjectConstructor::prototypeForStructure):
1106         (WebCore::JSTestActiveDOMObjectPrototype::create): Deleted.
1107         (WebCore::JSTestActiveDOMObjectPrototype::createStructure): Deleted.
1108         (WebCore::JSTestActiveDOMObjectPrototype::JSTestActiveDOMObjectPrototype): Deleted.
1109         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1110         (WebCore::JSTestCEReactionsPrototype::create): Deleted.
1111         (WebCore::JSTestCEReactionsPrototype::createStructure): Deleted.
1112         (WebCore::JSTestCEReactionsPrototype::JSTestCEReactionsPrototype): Deleted.
1113         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1114         (WebCore::JSTestCEReactionsStringifierPrototype::create): Deleted.
1115         (WebCore::JSTestCEReactionsStringifierPrototype::createStructure): Deleted.
1116         (WebCore::JSTestCEReactionsStringifierPrototype::JSTestCEReactionsStringifierPrototype): Deleted.
1117         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1118         (WebCore::JSTestCallTracerConstructor::prototypeForStructure):
1119         (WebCore::JSTestCallTracerPrototype::create): Deleted.
1120         (WebCore::JSTestCallTracerPrototype::createStructure): Deleted.
1121         (WebCore::JSTestCallTracerPrototype::JSTestCallTracerPrototype): Deleted.
1122         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1123         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::create): Deleted.
1124         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::createStructure): Deleted.
1125         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::JSTestClassWithJSBuiltinConstructorPrototype): Deleted.
1126         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1127         (WebCore::JSTestDOMJITPrototype::create): Deleted.
1128         (WebCore::JSTestDOMJITPrototype::createStructure): Deleted.
1129         (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype): Deleted.
1130         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1131         (WebCore::JSTestEnabledBySettingPrototype::create): Deleted.
1132         (WebCore::JSTestEnabledBySettingPrototype::createStructure): Deleted.
1133         (WebCore::JSTestEnabledBySettingPrototype::JSTestEnabledBySettingPrototype): Deleted.
1134         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
1135         (WebCore::JSTestEnabledForContextPrototype::create): Deleted.
1136         (WebCore::JSTestEnabledForContextPrototype::createStructure): Deleted.
1137         (WebCore::JSTestEnabledForContextPrototype::JSTestEnabledForContextPrototype): Deleted.
1138         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1139         (WebCore::JSTestEventConstructorPrototype::create): Deleted.
1140         (WebCore::JSTestEventConstructorPrototype::createStructure): Deleted.
1141         (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype): Deleted.
1142         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1143         (WebCore::JSTestEventTargetPrototype::create): Deleted.
1144         (WebCore::JSTestEventTargetPrototype::createStructure): Deleted.
1145         (WebCore::JSTestEventTargetPrototype::JSTestEventTargetPrototype): Deleted.
1146         * bindings/scripts/test/JS/JSTestException.cpp:
1147         (WebCore::JSTestExceptionPrototype::create): Deleted.
1148         (WebCore::JSTestExceptionPrototype::createStructure): Deleted.
1149         (WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype): Deleted.
1150         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1151         (WebCore::JSTestGenerateIsReachablePrototype::create): Deleted.
1152         (WebCore::JSTestGenerateIsReachablePrototype::createStructure): Deleted.
1153         (WebCore::JSTestGenerateIsReachablePrototype::JSTestGenerateIsReachablePrototype): Deleted.
1154         * bindings/scripts/test/JS/JSTestGlobalObject.h:
1155         (WebCore::JSTestGlobalObjectPrototype::create): Deleted.
1156         (WebCore::JSTestGlobalObjectPrototype::createStructure): Deleted.
1157         (WebCore::JSTestGlobalObjectPrototype::JSTestGlobalObjectPrototype): Deleted.
1158         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1159         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::create): Deleted.
1160         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::createStructure): Deleted.
1161         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::JSTestIndexedSetterNoIdentifierPrototype): Deleted.
1162         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1163         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::create): Deleted.
1164         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::createStructure): Deleted.
1165         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::JSTestIndexedSetterThrowingExceptionPrototype): Deleted.
1166         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1167         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::create): Deleted.
1168         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::createStructure): Deleted.
1169         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::JSTestIndexedSetterWithIdentifierPrototype): Deleted.
1170         * bindings/scripts/test/JS/JSTestInterface.cpp:
1171         (WebCore::JSTestInterfaceConstructor::construct):
1172         (WebCore::jsTestInterfacePrototypeFunctionEntriesCaller):
1173         (WebCore::JSTestInterfacePrototype::create): Deleted.
1174         (WebCore::JSTestInterfacePrototype::createStructure): Deleted.
1175         (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype): Deleted.
1176         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1177         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::create): Deleted.
1178         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::createStructure): Deleted.
1179         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype): Deleted.
1180         * bindings/scripts/test/JS/JSTestIterable.cpp:
1181         (WebCore::jsTestIterablePrototypeFunctionEntriesCaller):
1182         (WebCore::JSTestIterablePrototype::create): Deleted.
1183         (WebCore::JSTestIterablePrototype::createStructure): Deleted.
1184         (WebCore::JSTestIterablePrototype::JSTestIterablePrototype): Deleted.
1185         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1186         (WebCore::JSTestJSBuiltinConstructorPrototype::create): Deleted.
1187         (WebCore::JSTestJSBuiltinConstructorPrototype::createStructure): Deleted.
1188         (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype): Deleted.
1189         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1190         (WebCore::JSTestMediaQueryListListenerPrototype::create): Deleted.
1191         (WebCore::JSTestMediaQueryListListenerPrototype::createStructure): Deleted.
1192         (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype): Deleted.
1193         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1194         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::create): Deleted.
1195         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::createStructure): Deleted.
1196         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::JSTestNamedAndIndexedSetterNoIdentifierPrototype): Deleted.
1197         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1198         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::create): Deleted.
1199         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::createStructure): Deleted.
1200         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::JSTestNamedAndIndexedSetterThrowingExceptionPrototype): Deleted.
1201         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1202         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::create): Deleted.
1203         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::createStructure): Deleted.
1204         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::JSTestNamedAndIndexedSetterWithIdentifierPrototype): Deleted.
1205         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1206         (WebCore::JSTestNamedConstructorPrototype::create): Deleted.
1207         (WebCore::JSTestNamedConstructorPrototype::createStructure): Deleted.
1208         (WebCore::JSTestNamedConstructorPrototype::JSTestNamedConstructorPrototype): Deleted.
1209         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1210         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::create): Deleted.
1211         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::createStructure): Deleted.
1212         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::JSTestNamedDeleterNoIdentifierPrototype): Deleted.
1213         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1214         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::create): Deleted.
1215         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::createStructure): Deleted.
1216         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::JSTestNamedDeleterThrowingExceptionPrototype): Deleted.
1217         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1218         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::create): Deleted.
1219         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::createStructure): Deleted.
1220         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::JSTestNamedDeleterWithIdentifierPrototype): Deleted.
1221         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1222         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::create): Deleted.
1223         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::createStructure): Deleted.
1224         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::JSTestNamedDeleterWithIndexedGetterPrototype): Deleted.
1225         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1226         (WebCore::JSTestNamedGetterCallWithPrototype::create): Deleted.
1227         (WebCore::JSTestNamedGetterCallWithPrototype::createStructure): Deleted.
1228         (WebCore::JSTestNamedGetterCallWithPrototype::JSTestNamedGetterCallWithPrototype): Deleted.
1229         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1230         (WebCore::JSTestNamedGetterNoIdentifierPrototype::create): Deleted.
1231         (WebCore::JSTestNamedGetterNoIdentifierPrototype::createStructure): Deleted.
1232         (WebCore::JSTestNamedGetterNoIdentifierPrototype::JSTestNamedGetterNoIdentifierPrototype): Deleted.
1233         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1234         (WebCore::JSTestNamedGetterWithIdentifierPrototype::create): Deleted.
1235         (WebCore::JSTestNamedGetterWithIdentifierPrototype::createStructure): Deleted.
1236         (WebCore::JSTestNamedGetterWithIdentifierPrototype::JSTestNamedGetterWithIdentifierPrototype): Deleted.
1237         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1238         (WebCore::JSTestNamedSetterNoIdentifierPrototype::create): Deleted.
1239         (WebCore::JSTestNamedSetterNoIdentifierPrototype::createStructure): Deleted.
1240         (WebCore::JSTestNamedSetterNoIdentifierPrototype::JSTestNamedSetterNoIdentifierPrototype): Deleted.
1241         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1242         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::create): Deleted.
1243         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::createStructure): Deleted.
1244         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::JSTestNamedSetterThrowingExceptionPrototype): Deleted.
1245         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1246         (WebCore::JSTestNamedSetterWithIdentifierPrototype::create): Deleted.
1247         (WebCore::JSTestNamedSetterWithIdentifierPrototype::createStructure): Deleted.
1248         (WebCore::JSTestNamedSetterWithIdentifierPrototype::JSTestNamedSetterWithIdentifierPrototype): Deleted.
1249         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1250         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::create): Deleted.
1251         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::createStructure): Deleted.
1252         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::JSTestNamedSetterWithIndexedGetterPrototype): Deleted.
1253         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1254         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::create): Deleted.
1255         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::createStructure): Deleted.
1256         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::JSTestNamedSetterWithIndexedGetterAndSetterPrototype): Deleted.
1257         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1258         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::create): Deleted.
1259         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::createStructure): Deleted.
1260         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::JSTestNamedSetterWithOverrideBuiltinsPrototype): Deleted.
1261         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1262         (WebCore::JSTestNamedSetterWithUnforgablePropertiesConstructor::prototypeForStructure):
1263         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::create): Deleted.
1264         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::createStructure): Deleted.
1265         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::JSTestNamedSetterWithUnforgablePropertiesPrototype): Deleted.
1266         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1267         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::prototypeForStructure):
1268         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::create): Deleted.
1269         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::createStructure): Deleted.
1270         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype): Deleted.
1271         * bindings/scripts/test/JS/JSTestNode.cpp:
1272         (WebCore::jsTestNodePrototypeFunctionEntriesCaller):
1273         (WebCore::JSTestNodePrototype::create): Deleted.
1274         (WebCore::JSTestNodePrototype::createStructure): Deleted.
1275         (WebCore::JSTestNodePrototype::JSTestNodePrototype): Deleted.
1276         * bindings/scripts/test/JS/JSTestObj.cpp:
1277         (WebCore::JSTestObjConstructor::construct):
1278         (WebCore::JSTestObjPrototype::create): Deleted.
1279         (WebCore::JSTestObjPrototype::createStructure): Deleted.
1280         (WebCore::JSTestObjPrototype::JSTestObjPrototype): Deleted.
1281         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1282         (WebCore::JSTestOverloadedConstructorsPrototype::create): Deleted.
1283         (WebCore::JSTestOverloadedConstructorsPrototype::createStructure): Deleted.
1284         (WebCore::JSTestOverloadedConstructorsPrototype::JSTestOverloadedConstructorsPrototype): Deleted.
1285         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1286         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::create): Deleted.
1287         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::createStructure): Deleted.
1288         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::JSTestOverloadedConstructorsWithSequencePrototype): Deleted.
1289         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1290         (WebCore::JSTestOverrideBuiltinsPrototype::create): Deleted.
1291         (WebCore::JSTestOverrideBuiltinsPrototype::createStructure): Deleted.
1292         (WebCore::JSTestOverrideBuiltinsPrototype::JSTestOverrideBuiltinsPrototype): Deleted.
1293         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1294         (WebCore::JSTestPluginInterfacePrototype::create): Deleted.
1295         (WebCore::JSTestPluginInterfacePrototype::createStructure): Deleted.
1296         (WebCore::JSTestPluginInterfacePrototype::JSTestPluginInterfacePrototype): Deleted.
1297         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1298         (WebCore::JSTestPromiseRejectionEventPrototype::create): Deleted.
1299         (WebCore::JSTestPromiseRejectionEventPrototype::createStructure): Deleted.
1300         (WebCore::JSTestPromiseRejectionEventPrototype::JSTestPromiseRejectionEventPrototype): Deleted.
1301         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1302         (WebCore::JSTestSerializationPrototype::create): Deleted.
1303         (WebCore::JSTestSerializationPrototype::createStructure): Deleted.
1304         (WebCore::JSTestSerializationPrototype::JSTestSerializationPrototype): Deleted.
1305         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
1306         (WebCore::JSTestSerializationIndirectInheritancePrototype::create): Deleted.
1307         (WebCore::JSTestSerializationIndirectInheritancePrototype::createStructure): Deleted.
1308         (WebCore::JSTestSerializationIndirectInheritancePrototype::JSTestSerializationIndirectInheritancePrototype): Deleted.
1309         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1310         (WebCore::JSTestSerializationInheritPrototype::create): Deleted.
1311         (WebCore::JSTestSerializationInheritPrototype::createStructure): Deleted.
1312         (WebCore::JSTestSerializationInheritPrototype::JSTestSerializationInheritPrototype): Deleted.
1313         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1314         (WebCore::JSTestSerializationInheritFinalPrototype::create): Deleted.
1315         (WebCore::JSTestSerializationInheritFinalPrototype::createStructure): Deleted.
1316         (WebCore::JSTestSerializationInheritFinalPrototype::JSTestSerializationInheritFinalPrototype): Deleted.
1317         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1318         (WebCore::JSTestSerializedScriptValueInterfacePrototype::create): Deleted.
1319         (WebCore::JSTestSerializedScriptValueInterfacePrototype::createStructure): Deleted.
1320         (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype): Deleted.
1321         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1322         (WebCore::JSTestStringifierPrototype::create): Deleted.
1323         (WebCore::JSTestStringifierPrototype::createStructure): Deleted.
1324         (WebCore::JSTestStringifierPrototype::JSTestStringifierPrototype): Deleted.
1325         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1326         (WebCore::JSTestStringifierAnonymousOperationPrototype::create): Deleted.
1327         (WebCore::JSTestStringifierAnonymousOperationPrototype::createStructure): Deleted.
1328         (WebCore::JSTestStringifierAnonymousOperationPrototype::JSTestStringifierAnonymousOperationPrototype): Deleted.
1329         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1330         (WebCore::JSTestStringifierNamedOperationPrototype::create): Deleted.
1331         (WebCore::JSTestStringifierNamedOperationPrototype::createStructure): Deleted.
1332         (WebCore::JSTestStringifierNamedOperationPrototype::JSTestStringifierNamedOperationPrototype): Deleted.
1333         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1334         (WebCore::JSTestStringifierOperationImplementedAsPrototype::create): Deleted.
1335         (WebCore::JSTestStringifierOperationImplementedAsPrototype::createStructure): Deleted.
1336         (WebCore::JSTestStringifierOperationImplementedAsPrototype::JSTestStringifierOperationImplementedAsPrototype): Deleted.
1337         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1338         (WebCore::JSTestStringifierOperationNamedToStringPrototype::create): Deleted.
1339         (WebCore::JSTestStringifierOperationNamedToStringPrototype::createStructure): Deleted.
1340         (WebCore::JSTestStringifierOperationNamedToStringPrototype::JSTestStringifierOperationNamedToStringPrototype): Deleted.
1341         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1342         (WebCore::JSTestStringifierReadOnlyAttributePrototype::create): Deleted.
1343         (WebCore::JSTestStringifierReadOnlyAttributePrototype::createStructure): Deleted.
1344         (WebCore::JSTestStringifierReadOnlyAttributePrototype::JSTestStringifierReadOnlyAttributePrototype): Deleted.
1345         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1346         (WebCore::JSTestStringifierReadWriteAttributePrototype::create): Deleted.
1347         (WebCore::JSTestStringifierReadWriteAttributePrototype::createStructure): Deleted.
1348         (WebCore::JSTestStringifierReadWriteAttributePrototype::JSTestStringifierReadWriteAttributePrototype): Deleted.
1349         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1350         (WebCore::JSTestTypedefsConstructor::construct):
1351         (WebCore::JSTestTypedefsPrototype::create): Deleted.
1352         (WebCore::JSTestTypedefsPrototype::createStructure): Deleted.
1353         (WebCore::JSTestTypedefsPrototype::JSTestTypedefsPrototype): Deleted.
1354
1355 2020-03-06  James Darpinian  <jdarpinian@chromium.org>
1356
1357         Set important EGL context attributes
1358         https://bugs.webkit.org/show_bug.cgi?id=208724
1359
1360         Reviewed by Dean Jackson.
1361
1362         These EGL context attributes are important to make ANGLE's validation correct for
1363         WebGL contexts. ROBUST_RESOURCE_INITIALIZATION is especially important; the lack
1364         of it may be a root cause of some of the test flakiness we have seen. With this
1365         change WebKit's EGL context attributes now match Chromium's for ANGLE/WebGL
1366         contexts.
1367
1368         * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
1369         (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
1370
1371 2020-03-06  Youenn Fablet  <youenn@apple.com>
1372
1373         Use ObjectIdentifier to identify media sessions
1374         https://bugs.webkit.org/show_bug.cgi?id=208710
1375
1376         Reviewed by Eric Carlson.
1377
1378         No change of behavior, except that the identifier is now stable over time and unique per process.
1379
1380         * Headers.cmake:
1381         * WebCore.xcodeproj/project.pbxproj:
1382         * html/HTMLMediaElement.cpp:
1383         (WebCore::HTMLMediaElement::HTMLMediaElement):
1384         (WebCore::HTMLMediaElement::mediaSessionUniqueIdentifier const):
1385         * html/HTMLMediaElement.h:
1386         * platform/audio/NowPlayingInfo.h:
1387         (WebCore::NowPlayingInfo::decode):
1388         * platform/audio/PlatformMediaSessionManager.h:
1389         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const):
1390         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
1391         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1392         (MediaSessionManagerCocoa::setNowPlayingInfo):
1393         (MediaSessionManagerCocoa::updateNowPlayingInfo):
1394         * testing/Internals.cpp:
1395         (WebCore::Internals::nowPlayingState const):
1396
1397 2020-03-06  Jason Lawrence  <lawrence.j@apple.com>
1398
1399         Unreviewed, rolling out r257760.
1400
1401         This commit caused flaky crashing on Mac wk2.
1402
1403         Reverted changeset:
1404
1405         "Fix for LayoutTests/accessibility/mac/value-change/value-
1406         change-user-info-contenteditable.html in IsolatedTree mode."
1407         https://bugs.webkit.org/show_bug.cgi?id=208462
1408         https://trac.webkit.org/changeset/257760
1409
1410 2020-03-06  David Quesada  <david_quesada@apple.com>
1411
1412         Add _WKResourceLoadInfo.resourceType SPI
1413         https://bugs.webkit.org/show_bug.cgi?id=208723
1414
1415         Reviewed by Alex Christensen.
1416
1417         Covered by API tests.
1418
1419         * Modules/beacon/NavigatorBeacon.cpp:
1420         (WebCore::NavigatorBeacon::sendBeacon):
1421         * loader/PingLoader.cpp:
1422         (WebCore::PingLoader::sendPing):
1423         * platform/network/ResourceRequestBase.h:
1424
1425 2020-03-06  Youenn Fablet  <youenn@apple.com>
1426
1427         Add support for NowPlaying commands in GPUProcess
1428         https://bugs.webkit.org/show_bug.cgi?id=208707
1429
1430         Reviewed by Eric Carlson.
1431
1432         Add a NowPlayingManager that is responsible to clear/set/update NowPlaying information as well as receive commands
1433         and send them to the current NowPlaying client.
1434         Manually tested.
1435
1436         * Headers.cmake:
1437         * Sources.txt:
1438         * WebCore.xcodeproj/project.pbxproj:
1439         * platform/audio/PlatformMediaSessionManager.h:
1440
1441 2020-03-06  Simon Fraser  <simon.fraser@apple.com>
1442
1443         Move synchronousScrollingReasons to ScrollingTreeScrollingNode
1444         https://bugs.webkit.org/show_bug.cgi?id=208721
1445
1446         Reviewed by Antti Koivisto.
1447
1448         synchronousScrollingReasons was on Scrolling*FrameScrollingNode, but with async overflow
1449         scrolling, some overflow scrolls will need to scroll synchronously if they paint any
1450         background-attachment:fixed, so move synchronousScrollingReasons down to Scrolling*ScrollingNode.
1451
1452         Also wrap the scrolling tree parts in #if ENABLE(SCROLLING_THREAD) since synchronous scrolling
1453         is only a thing if you use threaded scrolling. Ideally more of the ScrollingCoordinator code
1454         would also have #if ENABLE(SCROLLING_THREAD) but that can be done later.
1455
1456         * page/scrolling/AsyncScrollingCoordinator.cpp:
1457         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
1458         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1459         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1460         (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
1461         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
1462         (WebCore::ScrollingStateFrameScrollingNode::setSynchronousScrollingReasons): Deleted.
1463         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1464         * page/scrolling/ScrollingStateScrollingNode.cpp:
1465         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
1466         (WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):
1467         (WebCore::ScrollingStateScrollingNode::setSynchronousScrollingReasons):
1468         (WebCore::ScrollingStateScrollingNode::dumpProperties const):
1469         * page/scrolling/ScrollingStateScrollingNode.h:
1470         (WebCore::ScrollingStateScrollingNode::synchronousScrollingReasons const):
1471         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1472         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
1473         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties const):
1474         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1475         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1476         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
1477         (WebCore::ScrollingTreeScrollingNode::dumpProperties const):
1478         * page/scrolling/ScrollingTreeScrollingNode.h:
1479
1480 2020-03-06  Simon Fraser  <simon.fraser@apple.com>
1481
1482         Make it possible to safely access CALayers and PlatformCALayerCocoa objects on the scrolling thread
1483         https://bugs.webkit.org/show_bug.cgi?id=208672
1484
1485         Reviewed by Antti Koivisto.
1486
1487         Async overflow/frame scrolling on macOS is going to hit-test through the CALayer tree on the
1488         scrolling thread, and access PlatformCALayers that hang off CALayers. We therefore have to ensure
1489         that those layers are not getting mutated while hit-testing.
1490
1491         We only touch PlatformCALayers and CALayers through two codepaths: GraphicsLayer::flushCompositingState()
1492         when pushing GraphicsLayer changes to CA, and when destroying GraphicsLayers which tears down their associated
1493         PlatformCALayers (the CALayers remain parented in the tree).
1494
1495         To prevent a PlatformCALayer from being destroyed while being accessed on the scrolling thread, we make
1496         it ThreadSafeRefCounted<>, and lock around fetching thePlatformCALayer from the layerToPlatformLayerMap() which
1497         retains it.
1498
1499         To prevent the CALayer/PlatformCALayer trees being mutated during layer flushing, we lock around 
1500         rootLayer->flushCompositingState() in RenderLayerCompositor::flushPendingLayerChanges().
1501
1502         The lock is owned by ScrollingTreeMac.
1503
1504         * page/scrolling/AsyncScrollingCoordinator.h:
1505         (WebCore::LayerTreeHitTestLocker::LayerTreeHitTestLocker):
1506         (WebCore::LayerTreeHitTestLocker::~LayerTreeHitTestLocker):
1507         * page/scrolling/ScrollingTree.h:
1508         (WebCore::ScrollingTree::lockLayersForHitTesting):
1509         (WebCore::ScrollingTree::unlockLayersForHitTesting):
1510         * page/scrolling/mac/ScrollingTreeMac.h:
1511         * page/scrolling/mac/ScrollingTreeMac.mm:
1512         (ScrollingTreeMac::lockLayersForHitTesting):
1513         (ScrollingTreeMac::unlockLayersForHitTesting):
1514         * platform/graphics/ca/PlatformCALayer.h:
1515         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1516         (WebCore::layerToPlatformLayerMapMutex):
1517         (WebCore::PlatformCALayer::platformCALayerForLayer):
1518         * rendering/RenderLayerCompositor.cpp:
1519         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1520
1521 2020-03-06  Simon Fraser  <simon.fraser@apple.com>
1522
1523         Put an event region on scroll container layers
1524         https://bugs.webkit.org/show_bug.cgi?id=208684
1525
1526         Reviewed by Antti Koivisto.
1527         
1528         Hit-testing through the CALayer tree on macOS, where we don't have scroll views for overflow,
1529         is simpler if scroll container layers have an event region that just represents the bounds of
1530         the layer. These regions are harmless to have on iOS too.
1531
1532         This patch adds them for overflow scroll, and for m_clipLayer which is the scroll container
1533         layer for scrollable subframes.
1534
1535         Tests: fast/scrolling/mac/event-region-scrolled-contents-layer.html
1536                fast/scrolling/mac/event-region-subframe.html
1537
1538         * rendering/RenderLayerBacking.cpp:
1539         (WebCore::RenderLayerBacking::updateEventRegion):
1540         * rendering/RenderLayerCompositor.cpp:
1541         (WebCore::RenderLayerCompositor::updateScrollLayerClipping):
1542
1543 2020-03-06  Antti Koivisto  <antti@apple.com>
1544
1545         Reduce ThreadTimers maxDurationOfFiringTimers to 16ms
1546         https://bugs.webkit.org/show_bug.cgi?id=208717
1547
1548         Reviewed by Simon Fraser.
1549
1550         50ms -> 16ms.
1551
1552         This gives us more chances to do rendering updates. A/B testing says it is neutral for performance.
1553
1554         * platform/ThreadTimers.cpp:
1555
1556 2020-03-06  Kate Cheney  <katherine_cheney@apple.com>
1557
1558         Remove redundant flags in script evaluation checks
1559         https://bugs.webkit.org/show_bug.cgi?id=208609
1560         <rdar://problem/60058656>
1561         
1562         Reviewed by Brent Fulgham.
1563         
1564         hasNavigatedAwayFromAppBoundDomain only gets set in WebPageProxy if
1565         its a main frame navigation and In-App Browser privacy is enabled,
1566         we don't need to check again at the sites.
1567
1568         * bindings/js/ScriptController.cpp:
1569         (WebCore::ScriptController::executeScriptInWorld):
1570         * page/Frame.cpp:
1571         (WebCore::Frame::injectUserScriptImmediately):
1572
1573 2020-03-06  Zalan Bujtas  <zalan@apple.com>
1574
1575         [LFC][TFC] Absolute positioned table should generate a static table box inside the out-of-flow table wrapper box
1576         https://bugs.webkit.org/show_bug.cgi?id=208713
1577         <rdar://problem/60151358>
1578
1579         Reviewed by Antti Koivisto.
1580
1581         Test: fast/layoutformattingcontext/absolute-positioned-simple-table.html
1582
1583         <table style="position: absolute"> should generate
1584         1. absolute positioned table wrapper box
1585         2. static (inflow) positioned table box inside the out-of-flow table wrapper box. 
1586
1587         * layout/layouttree/LayoutTreeBuilder.cpp:
1588         (WebCore::Layout::TreeBuilder::buildTableStructure):
1589
1590 2020-03-05  Darin Adler  <darin@apple.com>
1591
1592         Improve some media code
1593         https://bugs.webkit.org/show_bug.cgi?id=208322
1594
1595         Reviewed by Anders Carlsson.
1596
1597         - TextTrack objects now take Document instead of ScriptExecutionContext.
1598         - Made more TextTrack functions private and protected.
1599         - Made TextTrack parsing functions use return values rather than out arguments.
1600         - Use references rather than pointers and Ref rather than RefPtr for non-null things.
1601         - Made MediaControlsHost use a WeakPtr instead of a raw pointer.
1602
1603         * Modules/mediacontrols/MediaControlsHost.cpp:
1604         (WebCore::alwaysOnKeyword): Made private to this file instead of exposed in header.
1605         (WebCore::manualKeyword): Ditto.
1606         (WebCore::MediaControlsHost::create): Take a reference instead of a pointer to
1607         the media element.
1608         (WebCore::MediaControlsHost::MediaControlsHost): Ditto, and make a weak pointer.
1609         (WebCore::MediaControlsHost::sortedTrackListForMenu): Added null check.
1610         (WebCore::MediaControlsHost::displayNameForTrack): Ditto.
1611         (WebCore::MediaControlsHost::captionMenuOffItem): Ditto.
1612         (WebCore::MediaControlsHost::captionMenuAutomaticItem): Ditto.
1613         (WebCore::MediaControlsHost::captionDisplayMode const): Ditto.
1614         (WebCore::MediaControlsHost::setSelectedTextTrack): Ditto.
1615         (WebCore::MediaControlsHost::textTrackContainer): Ditto.
1616         (WebCore::MediaControlsHost::allowsInlineMediaPlayback const): Ditto.
1617         (WebCore::MediaControlsHost::supportsFullscreen const): Ditto.
1618         (WebCore::MediaControlsHost::isVideoLayerInline const): Ditto.
1619         (WebCore::MediaControlsHost::isInMediaDocument const): Ditto.
1620         (WebCore::MediaControlsHost::setPreparedToReturnVideoLayerToInline): Ditto.
1621         (WebCore::MediaControlsHost::userGestureRequired const): Ditto.
1622         (WebCore::MediaControlsHost::shouldForceControlsDisplay const): Ditto.
1623         (WebCore::MediaControlsHost::externalDeviceDisplayName const): Ditto.
1624         (WebCore::MediaControlsHost::externalDeviceType const): Ditto.
1625         (WebCore::MediaControlsHost::controlsDependOnPageScaleFactor const): Ditto.
1626         (WebCore::MediaControlsHost::setControlsDependOnPageScaleFactor): Ditto.
1627         (WebCore::MediaControlsHost::generateUUID): Made a static member.
1628         (WebCore::MediaControlsHost::shadowRootCSSText): Ditto.
1629         (WebCore::MediaControlsHost::base64StringForIconNameAndType): Ditto.
1630         (WebCore::MediaControlsHost::formattedStringForDuration): Ditto.
1631         (WebCore::MediaControlsHost::compactMode const): Tweaked logic a bit.
1632
1633         * Modules/mediacontrols/MediaControlsHost.h: Made various member functions
1634         into static member functions, used references instead of pointers for
1635         things that are never null, used WeakPtr for m_mediaElement.
1636
1637         * Modules/mediasource/SourceBuffer.cpp:
1638         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
1639         Document instead of ScriptExecutionContext.
1640
1641         * html/HTMLMediaElement.cpp:
1642         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Document instead of
1643         ScriptExecutionContext.
1644         (WebCore::HTMLMediaElement::updateCaptionContainer): Pass reference to
1645         MediaControlsHost::create.
1646         (WebCore::HTMLMediaElement::setSelectedTextTrack): Update since special items
1647         are now references rather than pointers.
1648         (WebCore::HTMLMediaElement::updateTextTrackDisplay): Pass reference.
1649         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): Ditto.
1650
1651         * html/HTMLTrackElement.cpp:
1652         (WebCore::HTMLTrackElement::parseAttribute): Removed setIsDefault function
1653         since the track can simply read the attribute out of the element instead.
1654
1655         * html/shadow/MediaControlElements.cpp:
1656         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
1657         Update since special items are now referencse rather than pointers.
1658
1659         * html/track/DataCue.cpp:
1660         (WebCore::DataCue::DataCue): Document instead of ScriptExecutionContext.
1661         (WebCore::DataCue::create): Moved these functions out of the header.
1662         * html/track/DataCue.h: Updated for the above.
1663         * html/track/DataCue.idl: Ditto.
1664
1665         * html/track/InbandDataTextTrack.cpp:
1666         (WebCore::InbandDataTextTrack::InbandDataTextTrack): Document instead
1667         of ScriptExecutionContext.
1668         (WebCore::InbandDataTextTrack::create): Ditto.
1669         (WebCore::InbandDataTextTrack::addDataCue): Ditto. Also use reference
1670         instead of pointer when calling hasCue.
1671         * html/track/InbandDataTextTrack.h: Updated for the above.
1672
1673         * html/track/InbandGenericTextTrack.cpp:
1674         (WebCore::InbandGenericTextTrack::InbandGenericTextTrack): Document
1675         instead of ScriptExecutionContext.
1676         (WebCore::InbandGenericTextTrack::create): Ditto.
1677         (WebCore::InbandGenericTextTrack::addGenericCue): Ditto. Also use
1678         reference instead of pointer when calling hasCue.
1679         (WebCore::InbandGenericTextTrack::parser): Ditto.
1680         (WebCore::InbandGenericTextTrack::newCuesParsed): Ditto. Also use
1681         return value from takeCues instead of out arguenmt from getNewCues.
1682         Also use reference instead of pointer when calling hasCue.
1683         (WebCore::InbandGenericTextTrack::newRegionsParsed): Ditto.
1684         * html/track/InbandGenericTextTrack.h: Update for above.
1685
1686         * html/track/InbandTextTrack.cpp:
1687         (WebCore::InbandTextTrack::create): Document instead of
1688         ScriptExecutionContext.
1689         (WebCore::InbandTextTrack::InbandTextTrack): Ditto.
1690         * html/track/InbandTextTrack.h: Update for above.
1691
1692         * html/track/InbandWebVTTTextTrack.cpp:
1693         (WebCore::InbandWebVTTTextTrack::InbandWebVTTTextTrack): Document
1694         instead of ScriptExecutionContext.
1695         (WebCore::InbandWebVTTTextTrack::create): Ditto.
1696         (WebCore::InbandWebVTTTextTrack::parser): Ditto.
1697         (WebCore::InbandWebVTTTextTrack::newCuesParsed): Ditto. Also use
1698         return value from takeCues instead of out arguenmt from getNewCues.
1699         Also use reference instead of pointer when calling hasCue.
1700         (WebCore::InbandWebVTTTextTrack::newRegionsParsed): Ditto.
1701         * html/track/InbandWebVTTTextTrack.h: Update for above.
1702
1703         * html/track/LoadableTextTrack.cpp:
1704         (WebCore::LoadableTextTrack::create): Moved here from header.
1705         (WebCore::LoadableTextTrack::loadTimerFired): Document instead of
1706         ScriptExecutionContext.
1707         (WebCore::LoadableTextTrack::newRegionsAvailable): Use return value
1708         from getNewRegions instead of out argument.
1709         (WebCore::LoadableTextTrack::isDefault const): New implementation that
1710         does not rely on a data member; checks attribute on video element.
1711         * html/track/LoadableTextTrack.h: Updated for above changes.
1712
1713         * html/track/TextTrack.cpp:
1714         (WebCore::TextTrack::captionMenuOffItem): Return a reference rather
1715         than a pointer.
1716         (WebCore::TextTrack::captionMenuAutomaticItem): Ditto.
1717         (WebCore::TextTrack::create): Document rather than ScriptExecutionContext.
1718         (WebCore::TextTrack::document const): Added. For use by derived classes.
1719         (WebCore::TextTrack::addRegion): Ref rather than RefPtr.
1720         (WebCore::TextTrack::removeRegion): Reference rather than pointer.
1721         (WebCore::TextTrack::cueWillChange): Ditto.
1722         (WebCore::TextTrack::cueDidChange): Ditto.
1723         (WebCore::TextTrack::hasCue): Ditto.
1724
1725         * html/track/TextTrack.h: Removed declarations of non-existent
1726         disabledKeyword, hiddenKeyword, and showingKeyword functions.
1727         Made setKind, client, and hasCue protected. Made overrides of
1728         eventTargetInterface, scriptExecutionContext, and logClassName
1729         private. Removed setIsDefault. Updated for changes above.
1730
1731         * html/track/TextTrack.idl: Did what FIXME suggested, making the region
1732         parameters non-nullable. Passing null silently did nothing before. There
1733         is some small risk of website incompatibility if someone accidentally
1734         relied on this WebKit-specific behavior.
1735
1736         * html/track/TextTrackCue.cpp:
1737         (WebCore::TextTrackCue::create): Document instead of ScriptExecutionContext.
1738         (WebCore::TextTrackCue::TextTrackCue): Ditto.
1739         (WebCore::TextTrackCue::willChange): Pass reference.
1740         (WebCore::TextTrackCue::didChange): Ditto.
1741         * html/track/TextTrackCue.h: Update for above changes.
1742         * html/track/TextTrackCue.idl: Ditto.
1743
1744         * html/track/TextTrackCueGeneric.cpp:
1745         (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): Update since the base
1746         class now takes an rvalue reference to the string.
1747         (WebCore::TextTrackCueGeneric::isOrderedBefore const): Use auto.
1748         (WebCore::TextTrackCueGeneric::isPositionedAbove const): Ditto.
1749
1750         * html/track/VTTCue.cpp:
1751         (WebCore::VTTCue::create): Document instead of ScriptExecutionContext.
1752         Also take String with an rvalue reference.
1753         (WebCore::VTTCue::VTTCue): Ditto.
1754         * html/track/VTTCue.h: Update for above changes.
1755         * html/track/VTTCue.idl: Ditto.
1756
1757         * html/track/WebVTTParser.cpp:
1758         (WebCore::WebVTTParser::WebVTTParser): Document instead of
1759         ScriptExecutionContext. References instead of pointers. Initialize
1760         m_state in class definition.
1761         (WebCore::WebVTTParser::takeCues): Renamed from getNewCues and changed
1762         to use a return value instead of an out argument.
1763         (WebCore::WebVTTParser::takeRegions): Ditto.
1764         (WebCore::WebVTTParser::takeStyleSheets): Ditto.
1765         (WebCore::WebVTTParser::parseCueData): Remove null check of m_client.
1766         (WebCore::WebVTTParser::parse): Ditto.
1767         (WebCore::WebVTTParser::collectWebVTTBlock): Ditto.
1768         (WebCore::WebVTTParser::checkAndCreateRegion): Pass document.
1769         (WebCore::WebVTTParser::checkAndStoreRegion): Use
1770         Vector::removeFirstMatching instead of Vector::removeFirst.
1771         (WebCore::WebVTTParser::createNewCue): Remove null check of m_client.
1772         * html/track/WebVTTParser.h: Update for above changes.
1773
1774         * loader/TextTrackLoader.cpp:
1775         (WebCore::TextTrackLoader::TextTrackLoader): Document instead of
1776         ScriptExecutionContext. References instead of pointers. Initialize
1777         data members in in class definition.
1778         (WebCore::TextTrackLoader::processNewCueData): Pass references.
1779         (WebCore::TextTrackLoader::corsPolicyPreventedLoad): Use m_document.
1780         (WebCore::TextTrackLoader::load): Ditto.
1781         (WebCore::TextTrackLoader::getNewCues): Use takeCues.
1782         (WebCore::TextTrackLoader::getNewRegions): Changed to return a vector
1783         instead of using an out argument. Use takeRegions.
1784         (WebCore::TextTrackLoader::getNewStyleSheets): Ditto.
1785         * loader/TextTrackLoader.h: Updated for the above.
1786
1787         * page/CaptionUserPreferences.cpp:
1788         (WebCore::trackDisplayName): Updated since these are references.
1789         (WebCore::CaptionUserPreferences::mediaSelectionOptionForTrack const): Ditto.
1790         (WebCore::CaptionUserPreferences::sortedTrackListForMenu): Ditto.
1791         * page/CaptionUserPreferencesMediaAF.cpp:
1792         (WebCore::trackDisplayName): Ditto.
1793         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Ditto.
1794         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
1795         (WebCore::PlaybackSessionModelMediaElement::selectLegibleMediaOption): Ditto.
1796         (WebCore::PlaybackSessionModelMediaElement::legibleMediaSelectedIndex const):
1797         Updated to use references rather than pointers. Refactored the logic to
1798         use Optional and nested if statements to make the algorithm clearer.
1799
1800 2020-03-05  Simon Fraser  <simon.fraser@apple.com>
1801
1802         Use an OptionSet<> for SynchronousScrollingReasons
1803         https://bugs.webkit.org/show_bug.cgi?id=208697
1804
1805         Reviewed by Antti Koivisto.
1806
1807         Convert SynchronousScrollingReasons to an OptionSet<SynchronousScrollingReason>.
1808
1809         * page/PerformanceLoggingClient.cpp:
1810         (WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString):
1811         * page/PerformanceLoggingClient.h:
1812         * page/scrolling/AsyncScrollingCoordinator.cpp:
1813         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
1814         (WebCore::AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged):
1815         * page/scrolling/AsyncScrollingCoordinator.h:
1816         * page/scrolling/ScrollingCoordinator.cpp:
1817         (WebCore::ScrollingCoordinator::synchronousScrollingReasons const):
1818         (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously const):
1819         (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
1820         * page/scrolling/ScrollingCoordinator.h:
1821         (WebCore::ScrollingCoordinator::setSynchronousScrollingReasons):
1822         * page/scrolling/ScrollingCoordinatorTypes.h:
1823         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1824         (WebCore::ScrollingStateFrameScrollingNode::setSynchronousScrollingReasons):
1825         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
1826         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1827         * page/scrolling/ScrollingTree.h:
1828         (WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged):
1829         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1830         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties const):
1831         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1832         * page/scrolling/ThreadedScrollingTree.cpp:
1833         (WebCore::ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged):
1834         * page/scrolling/ThreadedScrollingTree.h:
1835
1836 2020-03-06  Antoine Quint  <graouts@webkit.org>
1837
1838         Remove the experimental flag for Pointer Events
1839         https://bugs.webkit.org/show_bug.cgi?id=208655
1840         <rdar://problem/60090545>
1841
1842         Reviewed by Dean Jackson.
1843
1844         * dom/Element.cpp:
1845         (WebCore::dispatchPointerEventIfNeeded):
1846         (WebCore::Element::removedFromAncestor):
1847         * dom/Element.idl:
1848         * dom/NavigatorMaxTouchPoints.idl:
1849         * dom/PointerEvent.idl:
1850         * page/RuntimeEnabledFeatures.h:
1851         (WebCore::RuntimeEnabledFeatures::setPointerEventsEnabled): Deleted.
1852         (WebCore::RuntimeEnabledFeatures::pointerEventsEnabled const): Deleted.
1853         * style/StyleTreeResolver.cpp:
1854         (WebCore::Style::TreeResolver::resolveElement):
1855
1856 2020-03-06  Enrique Ocaña González  <eocanha@igalia.com>
1857
1858         [GStreamer] Streaming aac/mp3 audio doesn't always work
1859         https://bugs.webkit.org/show_bug.cgi?id=205801
1860
1861         Reviewed by Philippe Normand.
1862
1863         Don't rely on response size to replace Content-Length. This may break streaming videos,
1864         which should always have an Infinite duration.
1865
1866         This patch is based on the fix found by Philippe Normand <pnormand@igalia.com>
1867
1868         Test: http/tests/media/video-no-content-length-stall.html
1869
1870         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1871         (CachedResourceStreamingClient::dataReceived):
1872
1873 2020-03-06  Frederic Wang  <fwang@igalia.com>
1874
1875         [intersection-observer] Accept a Document as an explicit root
1876         https://bugs.webkit.org/show_bug.cgi?id=208047
1877
1878         Reviewed by Simon Fraser.
1879
1880         This patch introduces a recent enhancement to the Intersection Observer specification: the
1881         root initialization parameter can be explicitly be set to a Document. The typical use case
1882         is when document is an iframe. See https://github.com/w3c/IntersectionObserver/issues/372
1883
1884         This patch also updates the way Element's intersection observer data is handled so that it is
1885         more consistent with the explicit Document root case introduced here.
1886
1887         Test: imported/w3c/web-platform-tests/intersection-observer/document-scrolling-element-root.html
1888
1889         * dom/Document.cpp:
1890         (WebCore::Document::~Document): Notify observers about our desctruction.
1891         (WebCore::Document::updateIntersectionObservations): Use new method name. This does not
1892         require null-check because ensureIntersectionObserverData() has been called in
1893         IntersectionObserver::observe().
1894         (WebCore::Document::ensureIntersectionObserverData): Return reference to intersection
1895         observer data for this document, creating one if it does not exist.
1896         * dom/Document.h: Add new intersection observer data, used for documents that are explicit
1897         intersection observer roots.
1898         (WebCore::Document::intersectionObserverDataIfExists): Return pointer to intersection
1899         observer data or null if it does not exist.
1900         * dom/Element.cpp:
1901         (WebCore::Element::didMoveToNewDocument): Use new method name.
1902         (WebCore::Element::disconnectFromIntersectionObservers): Ditto and null-check weak refs.
1903         (WebCore::Element::intersectionObserverDataIfExists): Rename method to match Document's one
1904         and be more explicit that it will be null if it does not exist.
1905         (WebCore::Element::intersectionObserverData): Renamed.
1906         * dom/Element.h: Renamed.
1907         * html/LazyLoadImageObserver.cpp:
1908         (WebCore::LazyLoadImageObserver::intersectionObserver): Initialize with a WTF::Optional
1909         after API change.
1910         * page/IntersectionObserver.cpp:
1911         (WebCore::IntersectionObserver::create): Pass a Node* root, which can be null (implicit
1912         root), Document* or Element* (explicit roots). This is determined from init.root.
1913         (WebCore::IntersectionObserver::IntersectionObserver): Handle the case of explicit Document
1914         root.
1915         (WebCore::IntersectionObserver::~IntersectionObserver): Ditto and update method name for
1916         the explicit Element case. Note that in both explicit root cases the corresponding
1917         ensureIntersectionObserverData() method had been called in the constructor so they can
1918         be safely deferenced.
1919         (WebCore::IntersectionObserver::removeTargetRegistration): Use new method name.
1920         * page/IntersectionObserver.h: Update comment and code now that explicit root is a Node* and
1921         IntersectionObserver::Init::root is either an Element or a Document or null.
1922         (WebCore::IntersectionObserver::root const): Ditto.
1923         (): Deleted.
1924         * page/IntersectionObserver.idl: Update IDL to match the spec IntersectionObserver::root
1925         is a nullable Node and IntersectionObserverInit::root a nullable Element or Document.
1926
1927 2020-03-06  Yusuke Suzuki  <ysuzuki@apple.com>
1928
1929         Put all generated JSCells in WebCore into IsoSubspace
1930         https://bugs.webkit.org/show_bug.cgi?id=205107
1931
1932         Reviewed by Saam Barati.
1933
1934         This patch automatically generates IsoSubspace per WebCore DOM object type.
1935         In preprocess-idls.pl, we collect all the DOM object types and generate DOMIsoSubspaces class,
1936         which contains all the necessary IsoSubspaces. And it is held by WebCoreJSClientData.
1937
1938         CodeGeneratorJS.pm starts putting `subspaceFor` and `subspaceForImpl` for each JS DOM wrapper classes.
1939         And we dynamically create IsoSubspace and set it to WebCoreJSClientData's DOMIsoSubspaces. At the same
1940         time, we register IsoSubspace to m_outputConstraintSpaces if the class has output constraits callback.
1941
1942         From the previous patch, we fixed outputConstraintSpaces bug, which is returning a copy of Vector<>
1943         instead of a reference to the member Vector.
1944
1945         * CMakeLists.txt:
1946         * DerivedSources-output.xcfilelist:
1947         * DerivedSources.make:
1948         * WebCoreMacros.cmake:
1949         * bindings/js/JSDOMWrapper.cpp:
1950         (WebCore::outputConstraintSubspaceFor): Deleted.
1951         * bindings/js/JSDOMWrapper.h:
1952         * bindings/js/WebCoreJSClientData.cpp:
1953         (WebCore::JSVMClientData::JSVMClientData):
1954         * bindings/js/WebCoreJSClientData.h:
1955         (WebCore::JSVMClientData::forEachOutputConstraintSpace):
1956         (WebCore::JSVMClientData::subspaces):
1957         (WebCore::JSVMClientData::outputConstraintSpace): Deleted.
1958         (WebCore::JSVMClientData::subspaceForJSDOMWindow): Deleted.
1959         (WebCore::JSVMClientData::subspaceForJSDedicatedWorkerGlobalScope): Deleted.
1960         (WebCore::JSVMClientData::subspaceForJSRemoteDOMWindow): Deleted.
1961         (WebCore::JSVMClientData::subspaceForJSWorkerGlobalScope): Deleted.
1962         (WebCore::JSVMClientData::subspaceForJSServiceWorkerGlobalScope): Deleted.
1963         (WebCore::JSVMClientData::subspaceForJSPaintWorkletGlobalScope): Deleted.
1964         (WebCore::JSVMClientData::subspaceForJSWorkletGlobalScope): Deleted.
1965         * bindings/scripts/CodeGeneratorJS.pm:
1966         (GenerateHeader):
1967         (GenerateImplementation):
1968         * bindings/scripts/generate-bindings-all.pl:
1969         * bindings/scripts/preprocess-idls.pl:
1970         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1971         (WebCore::JSInterfaceName::subspaceForImpl):
1972         * bindings/scripts/test/JS/JSInterfaceName.h:
1973         (WebCore::JSInterfaceName::subspaceFor):
1974         * bindings/scripts/test/JS/JSMapLike.cpp:
1975         (WebCore::JSMapLike::subspaceForImpl):
1976         * bindings/scripts/test/JS/JSMapLike.h:
1977         (WebCore::JSMapLike::subspaceFor):
1978         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1979         (WebCore::JSReadOnlyMapLike::subspaceForImpl):
1980         * bindings/scripts/test/JS/JSReadOnlyMapLike.h:
1981         (WebCore::JSReadOnlyMapLike::subspaceFor):
1982         * bindings/scripts/test/JS/JSReadOnlySetLike.cpp:
1983         (WebCore::JSReadOnlySetLike::subspaceForImpl):
1984         * bindings/scripts/test/JS/JSReadOnlySetLike.h:
1985         (WebCore::JSReadOnlySetLike::subspaceFor):
1986         * bindings/scripts/test/JS/JSSetLike.cpp:
1987         (WebCore::JSSetLike::subspaceForImpl):
1988         * bindings/scripts/test/JS/JSSetLike.h:
1989         (WebCore::JSSetLike::subspaceFor):
1990         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1991         (WebCore::JSTestActiveDOMObject::subspaceForImpl):
1992         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1993         (WebCore::JSTestActiveDOMObject::subspaceFor):
1994         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1995         (WebCore::JSTestCEReactions::subspaceForImpl):
1996         * bindings/scripts/test/JS/JSTestCEReactions.h:
1997         (WebCore::JSTestCEReactions::subspaceFor):
1998         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1999         (WebCore::JSTestCEReactionsStringifier::subspaceForImpl):
2000         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
2001         (WebCore::JSTestCEReactionsStringifier::subspaceFor):
2002         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2003         (WebCore::JSTestCallTracer::subspaceForImpl):
2004         * bindings/scripts/test/JS/JSTestCallTracer.h:
2005         (WebCore::JSTestCallTracer::subspaceFor):
2006         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2007         (WebCore::JSTestClassWithJSBuiltinConstructor::subspaceForImpl):
2008         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
2009         (WebCore::JSTestClassWithJSBuiltinConstructor::subspaceFor):
2010         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2011         (WebCore::JSTestDOMJIT::subspaceForImpl):
2012         * bindings/scripts/test/JS/JSTestDOMJIT.h:
2013         (WebCore::JSTestDOMJIT::subspaceFor):
2014         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2015         (WebCore::JSTestEnabledBySetting::subspaceForImpl):
2016         * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
2017         (WebCore::JSTestEnabledBySetting::subspaceFor):
2018         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
2019         (WebCore::JSTestEnabledForContext::subspaceForImpl):
2020         * bindings/scripts/test/JS/JSTestEnabledForContext.h:
2021         (WebCore::JSTestEnabledForContext::subspaceFor):
2022         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2023         (WebCore::JSTestEventConstructor::subspaceForImpl):
2024         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2025         (WebCore::JSTestEventConstructor::subspaceFor):
2026         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2027         (WebCore::JSTestEventTarget::subspaceForImpl):
2028         * bindings/scripts/test/JS/JSTestEventTarget.h:
2029         (WebCore::JSTestEventTarget::subspaceFor):
2030         * bindings/scripts/test/JS/JSTestException.cpp:
2031         (WebCore::JSTestException::subspaceForImpl):
2032         * bindings/scripts/test/JS/JSTestException.h:
2033         (WebCore::JSTestException::subspaceFor):
2034         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2035         (WebCore::JSTestGenerateIsReachable::subspaceForImpl):
2036         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2037         (WebCore::JSTestGenerateIsReachable::subspaceFor):
2038         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2039         (WebCore::JSTestGlobalObject::subspaceForImpl):
2040         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2041         (WebCore::JSTestGlobalObject::subspaceFor):
2042         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2043         (WebCore::JSTestIndexedSetterNoIdentifier::subspaceForImpl):
2044         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
2045         (WebCore::JSTestIndexedSetterNoIdentifier::subspaceFor):
2046         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2047         (WebCore::JSTestIndexedSetterThrowingException::subspaceForImpl):
2048         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
2049         (WebCore::JSTestIndexedSetterThrowingException::subspaceFor):
2050         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2051         (WebCore::JSTestIndexedSetterWithIdentifier::subspaceForImpl):
2052         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
2053         (WebCore::JSTestIndexedSetterWithIdentifier::subspaceFor):
2054         * bindings/scripts/test/JS/JSTestInterface.cpp:
2055         (WebCore::JSTestInterface::subspaceForImpl):
2056         * bindings/scripts/test/JS/JSTestInterface.h:
2057         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2058         (WebCore::JSTestInterfaceLeadingUnderscore::subspaceForImpl):
2059         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
2060         (WebCore::JSTestInterfaceLeadingUnderscore::subspaceFor):
2061         * bindings/scripts/test/JS/JSTestIterable.cpp:
2062         (WebCore::JSTestIterable::subspaceForImpl):
2063         * bindings/scripts/test/JS/JSTestIterable.h:
2064         (WebCore::JSTestIterable::subspaceFor):
2065         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2066         (WebCore::JSTestJSBuiltinConstructor::subspaceForImpl):
2067         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
2068         (WebCore::JSTestJSBuiltinConstructor::subspaceFor):
2069         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2070         (WebCore::JSTestMediaQueryListListener::subspaceForImpl):
2071         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2072         (WebCore::JSTestMediaQueryListListener::subspaceFor):
2073         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2074         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::subspaceForImpl):
2075         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
2076         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::subspaceFor):
2077         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2078         (WebCore::JSTestNamedAndIndexedSetterThrowingException::subspaceForImpl):
2079         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
2080         (WebCore::JSTestNamedAndIndexedSetterThrowingException::subspaceFor):
2081         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2082         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::subspaceForImpl):
2083         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
2084         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::subspaceFor):
2085         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2086         (WebCore::JSTestNamedConstructor::subspaceForImpl):
2087         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2088         (WebCore::JSTestNamedConstructor::subspaceFor):
2089         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2090         (WebCore::JSTestNamedDeleterNoIdentifier::subspaceForImpl):
2091         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
2092         (WebCore::JSTestNamedDeleterNoIdentifier::subspaceFor):
2093         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2094         (WebCore::JSTestNamedDeleterThrowingException::subspaceForImpl):
2095         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
2096         (WebCore::JSTestNamedDeleterThrowingException::subspaceFor):
2097         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2098         (WebCore::JSTestNamedDeleterWithIdentifier::subspaceForImpl):
2099         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
2100         (WebCore::JSTestNamedDeleterWithIdentifier::subspaceFor):
2101         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2102         (WebCore::JSTestNamedDeleterWithIndexedGetter::subspaceForImpl):
2103         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
2104         (WebCore::JSTestNamedDeleterWithIndexedGetter::subspaceFor):
2105         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2106         (WebCore::JSTestNamedGetterCallWith::subspaceForImpl):
2107         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
2108         (WebCore::JSTestNamedGetterCallWith::subspaceFor):
2109         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2110         (WebCore::JSTestNamedGetterNoIdentifier::subspaceForImpl):
2111         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
2112         (WebCore::JSTestNamedGetterNoIdentifier::subspaceFor):
2113         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2114         (WebCore::JSTestNamedGetterWithIdentifier::subspaceForImpl):
2115         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
2116         (WebCore::JSTestNamedGetterWithIdentifier::subspaceFor):
2117         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2118         (WebCore::JSTestNamedSetterNoIdentifier::subspaceForImpl):
2119         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
2120         (WebCore::JSTestNamedSetterNoIdentifier::subspaceFor):
2121         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2122         (WebCore::JSTestNamedSetterThrowingException::subspaceForImpl):
2123         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
2124         (WebCore::JSTestNamedSetterThrowingException::subspaceFor):
2125         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2126         (WebCore::JSTestNamedSetterWithIdentifier::subspaceForImpl):
2127         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
2128         (WebCore::JSTestNamedSetterWithIdentifier::subspaceFor):
2129         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2130         (WebCore::JSTestNamedSetterWithIndexedGetter::subspaceForImpl):
2131         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
2132         (WebCore::JSTestNamedSetterWithIndexedGetter::subspaceFor):
2133         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2134         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::subspaceForImpl):
2135         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
2136         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::subspaceFor):
2137         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2138         (WebCore::JSTestNamedSetterWithOverrideBuiltins::subspaceForImpl):
2139         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
2140         (WebCore::JSTestNamedSetterWithOverrideBuiltins::subspaceFor):
2141         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2142         (WebCore::JSTestNamedSetterWithUnforgableProperties::subspaceForImpl):
2143         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
2144         (WebCore::JSTestNamedSetterWithUnforgableProperties::subspaceFor):
2145         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2146         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::subspaceForImpl):
2147         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
2148         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::subspaceFor):
2149         * bindings/scripts/test/JS/JSTestNode.cpp:
2150         (WebCore::JSTestNode::subspaceForImpl):
2151         * bindings/scripts/test/JS/JSTestNode.h:
2152         * bindings/scripts/test/JS/JSTestObj.cpp:
2153         (WebCore::JSTestObj::subspaceForImpl):
2154         * bindings/scripts/test/JS/JSTestObj.h:
2155         (WebCore::JSTestObj::subspaceFor):
2156         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2157         (WebCore::JSTestOverloadedConstructors::subspaceForImpl):
2158         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2159         (WebCore::JSTestOverloadedConstructors::subspaceFor):
2160         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2161         (WebCore::JSTestOverloadedConstructorsWithSequence::subspaceForImpl):
2162         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
2163         (WebCore::JSTestOverloadedConstructorsWithSequence::subspaceFor):
2164         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2165         (WebCore::JSTestOverrideBuiltins::subspaceForImpl):
2166         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2167         (WebCore::JSTestOverrideBuiltins::subspaceFor):
2168         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2169         (WebCore::JSTestPluginInterface::subspaceForImpl):
2170         * bindings/scripts/test/JS/JSTestPluginInterface.h:
2171         (WebCore::JSTestPluginInterface::subspaceFor):
2172         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2173         (WebCore::JSTestPromiseRejectionEvent::subspaceForImpl):
2174         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h:
2175         (WebCore::JSTestPromiseRejectionEvent::subspaceFor):
2176         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2177         (WebCore::JSTestSerialization::subspaceForImpl):
2178         * bindings/scripts/test/JS/JSTestSerialization.h:
2179         (WebCore::JSTestSerialization::subspaceFor):
2180         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2181         (WebCore::JSTestSerializationIndirectInheritance::subspaceForImpl):
2182         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h:
2183         (WebCore::JSTestSerializationIndirectInheritance::subspaceFor):
2184         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2185         (WebCore::JSTestSerializationInherit::subspaceForImpl):
2186         * bindings/scripts/test/JS/JSTestSerializationInherit.h:
2187         (WebCore::JSTestSerializationInherit::subspaceFor):
2188         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2189         (WebCore::JSTestSerializationInheritFinal::subspaceForImpl):
2190         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
2191         (WebCore::JSTestSerializationInheritFinal::subspaceFor):
2192         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2193         (WebCore::JSTestSerializedScriptValueInterface::subspaceForImpl):
2194         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2195         (WebCore::JSTestSerializedScriptValueInterface::subspaceFor):
2196         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2197         (WebCore::JSTestStringifier::subspaceForImpl):
2198         * bindings/scripts/test/JS/JSTestStringifier.h:
2199         (WebCore::JSTestStringifier::subspaceFor):
2200         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2201         (WebCore::JSTestStringifierAnonymousOperation::subspaceForImpl):
2202         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h:
2203         (WebCore::JSTestStringifierAnonymousOperation::subspaceFor):
2204         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2205         (WebCore::JSTestStringifierNamedOperation::subspaceForImpl):
2206         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h:
2207         (WebCore::JSTestStringifierNamedOperation::subspaceFor):
2208         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2209         (WebCore::JSTestStringifierOperationImplementedAs::subspaceForImpl):
2210         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h:
2211         (WebCore::JSTestStringifierOperationImplementedAs::subspaceFor):
2212         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2213         (WebCore::JSTestStringifierOperationNamedToString::subspaceForImpl):
2214         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h:
2215         (WebCore::JSTestStringifierOperationNamedToString::subspaceFor):
2216         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2217         (WebCore::JSTestStringifierReadOnlyAttribute::subspaceForImpl):
2218         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h:
2219         (WebCore::JSTestStringifierReadOnlyAttribute::subspaceFor):
2220         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2221         (WebCore::JSTestStringifierReadWriteAttribute::subspaceForImpl):
2222         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h:
2223         (WebCore::JSTestStringifierReadWriteAttribute::subspaceFor):
2224         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2225         (WebCore::JSTestTypedefs::subspaceForImpl):
2226         * bindings/scripts/test/JS/JSTestTypedefs.h:
2227         (WebCore::JSTestTypedefs::subspaceFor):
2228
2229 2020-03-06  Commit Queue  <commit-queue@webkit.org>
2230
2231         Unreviewed, rolling out r257950.
2232         https://bugs.webkit.org/show_bug.cgi?id=208704
2233
2234         causing debug failure (Requested by yusukesuzuki on #webkit).
2235
2236         Reverted changeset:
2237
2238         "Put all generated JSCells in WebCore into IsoSubspace"
2239         https://bugs.webkit.org/show_bug.cgi?id=205107
2240         https://trac.webkit.org/changeset/257950
2241
2242 2020-03-06  Michael Catanzaro  <mcatanzaro@gnome.org>
2243
2244         [WPE][GTK] Use Firefox user agent quirk more aggressively on Google Docs
2245         https://bugs.webkit.org/show_bug.cgi?id=208647
2246
2247         Reviewed by Carlos Garcia Campos.
2248
2249         I had previously determined that we need to send a Firefox user agent quirk to
2250         accounts.youtube.com to avoid unsupported browser warnings on Google Docs. Either the user
2251         agent check has since become more aggressive, or it somehow depends on factors I don't
2252         understand, but as of today it's no longer enough. We now need the quirk for docs.google.com
2253         as well.
2254
2255         * platform/UserAgentQuirks.cpp:
2256         (WebCore::urlRequiresFirefoxBrowser):
2257
2258 2020-03-05  Zalan Bujtas  <zalan@apple.com>
2259
2260         [LFC][TFC] An absolute positioned <table> should establish a table formatting context
2261         https://bugs.webkit.org/show_bug.cgi?id=208695
2262         <rdar://problem/60122473>
2263
2264         Reviewed by Antti Koivisto.
2265
2266         Not all type of content gets blockified when out-of-flow positioned or floated.
2267
2268         * layout/layouttree/LayoutBox.cpp:
2269         (WebCore::Layout::Box::establishesBlockFormattingContext const):
2270
2271 2020-02-29  Darin Adler  <darin@apple.com>
2272
2273         Simplify gradient parsing
2274         https://bugs.webkit.org/show_bug.cgi?id=208417
2275
2276         Reviewed by Anders Carlsson.
2277
2278         - Use Optional<> and invalid Color to represent unspecified positions and colors.
2279           This is simpler and easier to get right than separate booleans.
2280         - Simplified sorting of stops in legacy gradients to remove extra CSS value
2281           evaluation and unnecessary "sort in place" technique.
2282         - Rewrote equals functions for CSS gradient value classes. The new pattern is
2283           to compare all the data members that hold parsed CSS data, handling null
2284           correctly, since the parser won't set inappropriate ones. The old code had
2285           complex logic to only compare certain data members, which was unnecessary
2286           and hard to read to tell if it was correct.
2287         - Added some more use of WTFMove to cut down on reference count churn.
2288
2289         * css/CSSGradientValue.cpp:
2290         (WebCore::CSSGradientValue::image): Removed unneeded call to get().
2291         (WebCore::compareStops): Deleted.
2292         (WebCore::CSSGradientValue::sortStopsIfNeeded): Deleted.
2293         (WebCore::resolveStopColors): Take advantage of the fact that we know because
2294         of parsing rules that the only stops without colors are midpoints to drastically
2295         simplify this function to a trivial loop.
2296         (WebCore::CSSGradientValue::hasColorDerivedFromElement const): Added.
2297         Checks to see if any of the stop colors is derived from the element. The old
2298         code confusingly would store the answer to this in the stop, but only in the
2299         first stop with this property. Computing it without modifying the stop, and
2300         memoizing it in the gradient preserves the same performance characteristics
2301         as before without requiring a boolean in each stop in the stops vector.
2302         (WebCore::CSSGradientValue::gradientWithStylesResolved): Call the new
2303         hasColorDerivedFromElement function instead of having the logic here.
2304         (WebCore::LinearGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
2305         Update since GradientStop now has optional offsets. By the time this
2306         function is called they are all guaranteed to be filled in, so we can
2307         just use the * operator.
2308         (WebCore::RadialGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
2309         Ditto.
2310         (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
2311         Ditto.
2312         (WebCore::CSSGradientValue::computeStops): Moved the sorting of stops for
2313         the deprecated gradients here. Also updated since Gradient::ColorStop
2314         no longer uses "m_" prefixes on its public struct data members. Some
2315         simplification because we no longer need to explicitly set "specified"
2316         to true since it's no longer a separate boolean.
2317         (WebCore::positionFromValue): Handle a null pointer for value by returning
2318         0, which is what the caller was doing explicitly before. Use float
2319         instead of int for some internal computations that were mixing the two
2320         for no good reason.
2321         (WebCore::computeEndPoint): Removed null checks now that positionFromValue
2322         does them for us, turning this into a one-liner.
2323         (WebCore::CSSGradientValue::isCacheable const): Use hasColorDerivedFromElement.
2324         (WebCore::CSSGradientValue::knownToBeOpaque const): Removed unnnecessary
2325         checking the color both before and after when a color filter is involved.
2326         (WebCore::CSSGradientValue::equals const): Added. Shared by all the equals
2327         functions for derived classes.
2328         (WebCore::appendGradientStops): Updated for changes to CSSGradientColorStop.
2329         (WebCore::appendSpaceSeparatedOptionalCSSPtrText): Added template helper
2330         for writing two optional CSS values with a space between.
2331         (WebCore::writeColorStop): Ditto. Also converted to non-member function,
2332         removed unneeded isMidpoint check, use appendSpaceSeparatedOptionalCSSPtrText.
2333         (WebCore::CSSLinearGradientValue::customCSSText const): Call function
2334         members so we don't have to expose CSSGradientValue data members as
2335         protected things that can be accessed by derived classes. Some other
2336         small refactoring, such as getting rid of extra boolean wroteFirstStop.
2337         (WebCore::CSSLinearGradientValue::createGradient): Updated to use
2338         function members instead of protected data members.
2339         (WebCore::CSSLinearGradientValue::equals const): Compare all data
2340         members and use CSSGradientValue::equals, makes this a 1-liner.
2341         (WebCore::CSSRadialGradientValue::customCSSText const): Call function
2342         members as described above and use appendSpaceSeparatedOptionalCSSPtrText.
2343         (WebCore::CSSRadialGradientValue::createGradient): Ditto.
2344         (WebCore::CSSRadialGradientValue::equals const): Compare all data
2345         members and use CSSGradientValue::equals.
2346         (WebCore::CSSConicGradientValue::customCSSText const): Call function
2347         members as described above and use appendSpaceSeparatedOptionalCSSPtrText.
2348         (WebCore::CSSConicGradientValue::createGradient): Ditto.
2349         (WebCore::CSSConicGradientValue::equals const): Compare all data
2350         members and use CSSGradientValue::equals, makes this a 1-liner.
2351
2352         * css/CSSGradientValue.h: Removed unneeded includes and forward declarations.
2353         Renamed CSSGradientColorStop data members to not use m_ prefix since this is
2354         a struct with public data members, and WebKit style says not to do that here.
2355         Removed m_colorIsDerivedFromElement and isMidpoint from CSSGradientColorStop,
2356         m_colorIsDerivedFromElement is now stored in the gradient, not the color stop,
2357         and midpoints are any color stop with null color. Replaced the
2358         CSSGradientValue::stopCount function, which mixed size_t and unsigned types,
2359         with a hasTwoStops function, which is all the caller needs. Converted the
2360         isFixedSize, fixedSize, isPending, and loadSubimages into static member
2361         functions: they don't do any work and so don't need an instance. Removed
2362         the unneeded gradient type argument to the cloning constructors. Removed
2363         m_stopsSorted and added m_hasColorDerivedFromElement and
2364         hasColorDerivedFromElement. Added getter functions that are protected so
2365         the data members themselves can be private. Removed sortStopsIfNeeded
2366         and writeColorStop.
2367
2368         * css/parser/CSSPropertyParserHelpers.cpp:
2369         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
2370         Updated for CSSGradientColorStop member renaming.
2371         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient): Use
2372         more WTFMove to save a little bit of reference count churn; in some cases
2373         that means moving the setter calls to the end of the function after all
2374         the error checking.
2375         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops): Ditto.
2376         Removed code to set isMidpoint and the FIXME-NEWPARSER comment that said
2377         it could be removed. Used lambda to cut down on repeated code. Changed
2378         parsing of stops with a second position to repeat the color instead of
2379         relying on later computation to repeat it; this is required so we can
2380         always treat an omitted color as a midpoint.
2381         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient): Ditto.
2382         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient): Ditto.
2383         (WebCore::CSSPropertyParserHelpers::consumeLinearGradient): Ditto.
2384         (WebCore::CSSPropertyParserHelpers::consumeConicGradient): Ditto.
2385
2386         * html/HTMLInputElement.cpp:
2387         (WebCore::autoFillStrongPasswordMaskImage): Updated for the renamed
2388         CSSGradientColorStop members, added a missing call to doneAddingStops,
2389         and use some WTFMove to cut down on reference count churn.
2390
2391 2020-03-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
2392
2393         Remove the optimization for discarding no operation DisplayList items between Save and Restore items
2394         https://bugs.webkit.org/show_bug.cgi?id=208659
2395
2396         Reviewed by Simon Fraser.
2397
2398         This optimization is wrong in the case of drawing a canvas in general.
2399         The original implementation of the DisplayList assumes balanced Save/
2400         Restore GraphicsContext. In canvas a GraphicsConext 'save' can be issued
2401         in a frame and the corresponding restore is issued many frames later.
2402
2403         * platform/graphics/displaylists/DisplayList.cpp:
2404         (WebCore::DisplayList::DisplayList::removeItemsFromIndex): Deleted.
2405         * platform/graphics/displaylists/DisplayList.h:
2406         * platform/graphics/displaylists/DisplayListItems.cpp:
2407         (WebCore::DisplayList::operator<<):
2408         * platform/graphics/displaylists/DisplayListItems.h:
2409         (WebCore::DisplayList::Save::encode const):
2410         (WebCore::DisplayList::Save::decode):
2411         (WebCore::DisplayList::Save::restoreIndex const): Deleted.
2412         (WebCore::DisplayList::Save::setRestoreIndex): Deleted.
2413         * platform/graphics/displaylists/DisplayListRecorder.cpp:
2414         (WebCore::DisplayList::Recorder::save):
2415         (WebCore::DisplayList::Recorder::restore):
2416         * platform/graphics/displaylists/DisplayListRecorder.h:
2417         (WebCore::DisplayList::Recorder::ContextState::cloneForSave const):
2418
2419 2020-03-05  Ben Nham  <nham@apple.com>
2420
2421         Add signposts for top-level execution of script elements
2422         https://bugs.webkit.org/show_bug.cgi?id=208548
2423
2424         Reviewed by Alex Christensen.
2425
2426         This adds signposts for initial global scope code evaluation of script elements. This makes
2427         it easier to understand what code is executing and blocking initial HTML parsing from
2428         completing.
2429
2430         In the long run, it would be nice to extend this to all top-level entry points back into JS
2431         (e.g. we should emit an interval if we re-enter a script via setTimeout). However, such
2432         probes have been removed in the past for being too noisy or slow (like in
2433         https://bugs.webkit.org/show_bug.cgi?id=187196), so let's just start with this for now.
2434
2435         Note that we do emit the script URL in the signpost, but the signpost is gated behind both
2436         an environment variable and an Apple-internal check to prevent accidentally leaking
2437         sensitive info.
2438
2439         * dom/ScriptElement.cpp:
2440         (WebCore::ScriptElement::executeClassicScript):
2441         (WebCore::ScriptElement::executeModuleScript):
2442
2443 2020-03-05  Zalan Bujtas  <zalan@apple.com>
2444
2445         [First paint] Fixed sized SVG content should taken into account when computing VNE status
2446         https://bugs.webkit.org/show_bug.cgi?id=208663
2447         <rdar://problem/60096896>
2448
2449         Reviewed by Simon Fraser.
2450
2451         Let's add fixed sized SVG to the list of content we track as VNE pixel count.
2452         It helps to reach VNE status sooner on youtube.com.
2453
2454         * rendering/updating/RenderTreeBuilder.cpp:
2455         (WebCore::RenderTreeBuilder::reportVisuallyNonEmptyContent):
2456
2457 2020-03-05  Yusuke Suzuki  <ysuzuki@apple.com>
2458
2459         Put all generated JSCells in WebCore into IsoSubspace
2460         https://bugs.webkit.org/show_bug.cgi?id=205107
2461
2462         Reviewed by Saam Barati.
2463
2464         This patch automatically generates IsoSubspace per WebCore DOM object type.
2465         In preprocess-idls.pl, we collect all the DOM object types and generate DOMIsoSubspaces class,
2466         which contains all the necessary IsoSubspaces. And it is held by WebCoreJSClientData.
2467
2468         CodeGeneratorJS.pm starts putting `subspaceFor` and `subspaceForImpl` for each JS DOM wrapper classes.
2469         And we dynamically create IsoSubspace and set it to WebCoreJSClientData's DOMIsoSubspaces. At the same
2470         time, we register IsoSubspace to m_outputConstraintSpaces if the class has output constraits callback.
2471
2472         We also remove stale assertion in JSEventListener. It is saying the following.
2473
2474             1. If the world is normal.
2475             2. If m_wrapper is gone.
2476             3. If m_jsFunction is not gone.
2477
2478         Then, the assertion hits. But this is wrong. We have no guarantee that m_jsFunction is gone when m_wrapper is gone.
2479         We have conservative GC. We have generational GC. Someone can hold m_jsFunction's instance. Everything makes it possible
2480         that m_jsFunction is live while m_wrapper is gone. This patch removes this assertion.
2481
2482         * CMakeLists.txt:
2483         * DerivedSources-output.xcfilelist:
2484         * DerivedSources.make:
2485         * WebCoreMacros.cmake:
2486         * bindings/js/JSDOMWrapper.cpp:
2487         (WebCore::outputConstraintSubspaceFor): Deleted.
2488         * bindings/js/JSDOMWrapper.h:
2489         * bindings/js/JSEventListener.h:
2490         (WebCore::JSEventListener::jsFunction const):
2491         * bindings/js/WebCoreJSClientData.cpp:
2492         (WebCore::JSVMClientData::JSVMClientData):
2493         * bindings/js/WebCoreJSClientData.h:
2494         (WebCore::JSVMClientData::forEachOutputConstraintSpace):
2495         (WebCore::JSVMClientData::subspaces):
2496         (WebCore::JSVMClientData::outputConstraintSpace): Deleted.
2497         (WebCore::JSVMClientData::subspaceForJSDOMWindow): Deleted.
2498         (WebCore::JSVMClientData::subspaceForJSDedicatedWorkerGlobalScope): Deleted.
2499         (WebCore::JSVMClientData::subspaceForJSRemoteDOMWindow): Deleted.
2500         (WebCore::JSVMClientData::subspaceForJSWorkerGlobalScope): Deleted.
2501         (WebCore::JSVMClientData::subspaceForJSServiceWorkerGlobalScope): Deleted.
2502         (WebCore::JSVMClientData::subspaceForJSPaintWorkletGlobalScope): Deleted.
2503         (WebCore::JSVMClientData::subspaceForJSWorkletGlobalScope): Deleted.
2504         * bindings/scripts/CodeGeneratorJS.pm:
2505         (GenerateHeader):
2506         (GenerateImplementation):
2507         * bindings/scripts/generate-bindings-all.pl:
2508         * bindings/scripts/preprocess-idls.pl:
2509         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2510         (WebCore::JSInterfaceName::subspaceForImpl):
2511         * bindings/scripts/test/JS/JSInterfaceName.h:
2512         (WebCore::JSInterfaceName::subspaceFor):
2513         * bindings/scripts/test/JS/JSMapLike.cpp:
2514         (WebCore::JSMapLike::subspaceForImpl):
2515         * bindings/scripts/test/JS/JSMapLike.h:
2516         (WebCore::JSMapLike::subspaceFor):
2517         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2518         (WebCore::JSReadOnlyMapLike::subspaceForImpl):
2519         * bindings/scripts/test/JS/JSReadOnlyMapLike.h:
2520         (WebCore::JSReadOnlyMapLike::subspaceFor):
2521         * bindings/scripts/test/JS/JSReadOnlySetLike.cpp:
2522         (WebCore::JSReadOnlySetLike::subspaceForImpl):
2523         * bindings/scripts/test/JS/JSReadOnlySetLike.h:
2524         (WebCore::JSReadOnlySetLike::subspaceFor):
2525         * bindings/scripts/test/JS/JSSetLike.cpp:
2526         (WebCore::JSSetLike::subspaceForImpl):
2527         * bindings/scripts/test/JS/JSSetLike.h:
2528         (WebCore::JSSetLike::subspaceFor):
2529         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2530         (WebCore::JSTestActiveDOMObject::subspaceForImpl):
2531         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2532         (WebCore::JSTestActiveDOMObject::subspaceFor):
2533         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2534         (WebCore::JSTestCEReactions::subspaceForImpl):
2535         * bindings/scripts/test/JS/JSTestCEReactions.h:
2536         (WebCore::JSTestCEReactions::subspaceFor):
2537         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2538         (WebCore::JSTestCEReactionsStringifier::subspaceForImpl):
2539         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
2540         (WebCore::JSTestCEReactionsStringifier::subspaceFor):
2541         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2542         (WebCore::JSTestCallTracer::subspaceForImpl):
2543         * bindings/scripts/test/JS/JSTestCallTracer.h:
2544         (WebCore::JSTestCallTracer::subspaceFor):
2545         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2546         (WebCore::JSTestClassWithJSBuiltinConstructor::subspaceForImpl):
2547         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
2548         (WebCore::JSTestClassWithJSBuiltinConstructor::subspaceFor):
2549         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2550         (WebCore::JSTestDOMJIT::subspaceForImpl):
2551         * bindings/scripts/test/JS/JSTestDOMJIT.h:
2552         (WebCore::JSTestDOMJIT::subspaceFor):
2553         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2554         (WebCore::JSTestEnabledBySetting::subspaceForImpl):
2555         * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
2556         (WebCore::JSTestEnabledBySetting::subspaceFor):
2557         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
2558         (WebCore::JSTestEnabledForContext::subspaceForImpl):
2559         * bindings/scripts/test/JS/JSTestEnabledForContext.h:
2560         (WebCore::JSTestEnabledForContext::subspaceFor):
2561         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2562         (WebCore::JSTestEventConstructor::subspaceForImpl):
2563         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2564         (WebCore::JSTestEventConstructor::subspaceFor):
2565         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2566         (WebCore::JSTestEventTarget::subspaceForImpl):
2567         * bindings/scripts/test/JS/JSTestEventTarget.h:
2568         (WebCore::JSTestEventTarget::subspaceFor):
2569         * bindings/scripts/test/JS/JSTestException.cpp:
2570         (WebCore::JSTestException::subspaceForImpl):
2571         * bindings/scripts/test/JS/JSTestException.h:
2572         (WebCore::JSTestException::subspaceFor):
2573         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2574         (WebCore::JSTestGenerateIsReachable::subspaceForImpl):
2575         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2576         (WebCore::JSTestGenerateIsReachable::subspaceFor):
2577         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2578         (WebCore::JSTestGlobalObject::subspaceForImpl):
2579         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2580         (WebCore::JSTestGlobalObject::subspaceFor):
2581         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2582         (WebCore::JSTestIndexedSetterNoIdentifier::subspaceForImpl):
2583         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
2584         (WebCore::JSTestIndexedSetterNoIdentifier::subspaceFor):
2585         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2586         (WebCore::JSTestIndexedSetterThrowingException::subspaceForImpl):
2587         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
2588         (WebCore::JSTestIndexedSetterThrowingException::subspaceFor):
2589         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2590         (WebCore::JSTestIndexedSetterWithIdentifier::subspaceForImpl):
2591         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
2592         (WebCore::JSTestIndexedSetterWithIdentifier::subspaceFor):
2593         * bindings/scripts/test/JS/JSTestInterface.cpp:
2594         (WebCore::JSTestInterface::subspaceForImpl):
2595         * bindings/scripts/test/JS/JSTestInterface.h:
2596         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2597         (WebCore::JSTestInterfaceLeadingUnderscore::subspaceForImpl):
2598         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
2599         (WebCore::JSTestInterfaceLeadingUnderscore::subspaceFor):
2600         * bindings/scripts/test/JS/JSTestIterable.cpp:
2601         (WebCore::JSTestIterable::subspaceForImpl):
2602         * bindings/scripts/test/JS/JSTestIterable.h:
2603         (WebCore::JSTestIterable::subspaceFor):
2604         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2605         (WebCore::JSTestJSBuiltinConstructor::subspaceForImpl):
2606         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
2607         (WebCore::JSTestJSBuiltinConstructor::subspaceFor):
2608         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2609         (WebCore::JSTestMediaQueryListListener::subspaceForImpl):
2610         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2611         (WebCore::JSTestMediaQueryListListener::subspaceFor):
2612         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2613         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::subspaceForImpl):
2614         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
2615         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::subspaceFor):
2616         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2617         (WebCore::JSTestNamedAndIndexedSetterThrowingException::subspaceForImpl):
2618         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
2619         (WebCore::JSTestNamedAndIndexedSetterThrowingException::subspaceFor):
2620         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2621         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::subspaceForImpl):
2622         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
2623         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::subspaceFor):
2624         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2625         (WebCore::JSTestNamedConstructor::subspaceForImpl):
2626         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2627         (WebCore::JSTestNamedConstructor::subspaceFor):
2628         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2629         (WebCore::JSTestNamedDeleterNoIdentifier::subspaceForImpl):
2630         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
2631         (WebCore::JSTestNamedDeleterNoIdentifier::subspaceFor):
2632         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2633         (WebCore::JSTestNamedDeleterThrowingException::subspaceForImpl):
2634         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
2635         (WebCore::JSTestNamedDeleterThrowingException::subspaceFor):
2636         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2637         (WebCore::JSTestNamedDeleterWithIdentifier::subspaceForImpl):
2638         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
2639         (WebCore::JSTestNamedDeleterWithIdentifier::subspaceFor):
2640         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2641         (WebCore::JSTestNamedDeleterWithIndexedGetter::subspaceForImpl):
2642         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
2643         (WebCore::JSTestNamedDeleterWithIndexedGetter::subspaceFor):
2644         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2645         (WebCore::JSTestNamedGetterCallWith::subspaceForImpl):
2646         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
2647         (WebCore::JSTestNamedGetterCallWith::subspaceFor):
2648         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2649         (WebCore::JSTestNamedGetterNoIdentifier::subspaceForImpl):
2650         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
2651         (WebCore::JSTestNamedGetterNoIdentifier::subspaceFor):
2652         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2653         (WebCore::JSTestNamedGetterWithIdentifier::subspaceForImpl):
2654         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
2655         (WebCore::JSTestNamedGetterWithIdentifier::subspaceFor):
2656         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2657         (WebCore::JSTestNamedSetterNoIdentifier::subspaceForImpl):
2658         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
2659         (WebCore::JSTestNamedSetterNoIdentifier::subspaceFor):
2660         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2661         (WebCore::JSTestNamedSetterThrowingException::subspaceForImpl):
2662         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
2663         (WebCore::JSTestNamedSetterThrowingException::subspaceFor):
2664         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2665         (WebCore::JSTestNamedSetterWithIdentifier::subspaceForImpl):
2666         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
2667         (WebCore::JSTestNamedSetterWithIdentifier::subspaceFor):
2668         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2669         (WebCore::JSTestNamedSetterWithIndexedGetter::subspaceForImpl):
2670         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
2671         (WebCore::JSTestNamedSetterWithIndexedGetter::subspaceFor):
2672         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2673         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::subspaceForImpl):
2674         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
2675         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::subspaceFor):
2676         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2677         (WebCore::JSTestNamedSetterWithOverrideBuiltins::subspaceForImpl):
2678         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
2679         (WebCore::JSTestNamedSetterWithOverrideBuiltins::subspaceFor):
2680         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2681         (WebCore::JSTestNamedSetterWithUnforgableProperties::subspaceForImpl):
2682         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
2683         (WebCore::JSTestNamedSetterWithUnforgableProperties::subspaceFor):
2684         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2685         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::subspaceForImpl):
2686         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
2687         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::subspaceFor):
2688         * bindings/scripts/test/JS/JSTestNode.cpp:
2689         (WebCore::JSTestNode::subspaceForImpl):
2690         * bindings/scripts/test/JS/JSTestNode.h:
2691         * bindings/scripts/test/JS/JSTestObj.cpp:
2692         (WebCore::JSTestObj::subspaceForImpl):
2693         * bindings/scripts/test/JS/JSTestObj.h:
2694         (WebCore::JSTestObj::subspaceFor):
2695         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2696         (WebCore::JSTestOverloadedConstructors::subspaceForImpl):
2697         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2698         (WebCore::JSTestOverloadedConstructors::subspaceFor):
2699         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2700         (WebCore::JSTestOverloadedConstructorsWithSequence::subspaceForImpl):
2701         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
2702         (WebCore::JSTestOverloadedConstructorsWithSequence::subspaceFor):
2703         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2704         (WebCore::JSTestOverrideBuiltins::subspaceForImpl):
2705         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2706         (WebCore::JSTestOverrideBuiltins::subspaceFor):
2707         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2708         (WebCore::JSTestPluginInterface::subspaceForImpl):
2709         * bindings/scripts/test/JS/JSTestPluginInterface.h:
2710         (WebCore::JSTestPluginInterface::subspaceFor):
2711         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2712         (WebCore::JSTestPromiseRejectionEvent::subspaceForImpl):
2713         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h:
2714         (WebCore::JSTestPromiseRejectionEvent::subspaceFor):
2715         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2716         (WebCore::JSTestSerialization::subspaceForImpl):
2717         * bindings/scripts/test/JS/JSTestSerialization.h:
2718         (WebCore::JSTestSerialization::subspaceFor):
2719         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2720         (WebCore::JSTestSerializationIndirectInheritance::subspaceForImpl):
2721         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h:
2722         (WebCore::JSTestSerializationIndirectInheritance::subspaceFor):
2723         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2724         (WebCore::JSTestSerializationInherit::subspaceForImpl):
2725         * bindings/scripts/test/JS/JSTestSerializationInherit.h:
2726         (WebCore::JSTestSerializationInherit::subspaceFor):
2727         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2728         (WebCore::JSTestSerializationInheritFinal::subspaceForImpl):
2729         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
2730         (WebCore::JSTestSerializationInheritFinal::subspaceFor):
2731         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2732         (WebCore::JSTestSerializedScriptValueInterface::subspaceForImpl):
2733         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2734         (WebCore::JSTestSerializedScriptValueInterface::subspaceFor):
2735         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2736         (WebCore::JSTestStringifier::subspaceForImpl):
2737         * bindings/scripts/test/JS/JSTestStringifier.h:
2738         (WebCore::JSTestStringifier::subspaceFor):
2739         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2740         (WebCore::JSTestStringifierAnonymousOperation::subspaceForImpl):
2741         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h:
2742         (WebCore::JSTestStringifierAnonymousOperation::subspaceFor):
2743         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2744         (WebCore::JSTestStringifierNamedOperation::subspaceForImpl):
2745         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h:
2746         (WebCore::JSTestStringifierNamedOperation::subspaceFor):
2747         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2748         (WebCore::JSTestStringifierOperationImplementedAs::subspaceForImpl):
2749         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h:
2750         (WebCore::JSTestStringifierOperationImplementedAs::subspaceFor):
2751         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2752         (WebCore::JSTestStringifierOperationNamedToString::subspaceForImpl):
2753         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h:
2754         (WebCore::JSTestStringifierOperationNamedToString::subspaceFor):
2755         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2756         (WebCore::JSTestStringifierReadOnlyAttribute::subspaceForImpl):
2757         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h:
2758         (WebCore::JSTestStringifierReadOnlyAttribute::subspaceFor):
2759         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2760         (WebCore::JSTestStringifierReadWriteAttribute::subspaceForImpl):
2761         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h:
2762         (WebCore::JSTestStringifierReadWriteAttribute::subspaceFor):
2763         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2764         (WebCore::JSTestTypedefs::subspaceForImpl):
2765         * bindings/scripts/test/JS/JSTestTypedefs.h:
2766         (WebCore::JSTestTypedefs::subspaceFor):
2767
2768 2020-03-05  Andres Gonzalez  <andresg_22@apple.com>
2769
2770         Fix for several failures of LayoutTests in isolated tree mode.
2771         https://bugs.webkit.org/show_bug.cgi?id=208658
2772
2773         Reviewed by Chris Fleizach.
2774
2775         - Exposes the scrollView method through the AXCoreObject interface so
2776         that wrapper code can use it for both AXObjects and IsolatedObjects.
2777         - Fix for a crash/assert where InvalidAXID cannot be passed as key to
2778         the HashMap methods.
2779
2780         * accessibility/AccessibilityObject.h:
2781         * accessibility/AccessibilityObjectInterface.h:
2782         * accessibility/AccessibilityScrollView.h:
2783         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2784         (WebCore::AXIsolatedObject::scrollView const):
2785         * accessibility/isolatedtree/AXIsolatedObject.h:
2786         * accessibility/isolatedtree/AXIsolatedTree.cpp:
2787         (WebCore::AXIsolatedTree::applyPendingChanges):
2788         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2789         (-[WebAccessibilityObjectWrapper scrollViewParent]):
2790         (-[WebAccessibilityObjectWrapper _accessibilityShowContextMenu]):
2791
2792 2020-03-05  Jacob Uphoff  <jacob_uphoff@apple.com>
2793
2794         Unreviewed, rolling out r257945.
2795
2796         This causes tests to fail
2797
2798         Reverted changeset:
2799
2800         "Remove the optimization for discarding no operation
2801         DisplayList items between Save and Restore items"
2802         https://bugs.webkit.org/show_bug.cgi?id=208659
2803         https://trac.webkit.org/changeset/257945
2804
2805 2020-03-05  Simon Fraser  <simon.fraser@apple.com>
2806
2807         When using the scrolling thread, push ScrollingNodeIDs onto PlatformCALayers
2808         https://bugs.webkit.org/show_bug.cgi?id=208654
2809
2810         Reviewed by Antti Koivisto.
2811
2812         The scrolling thread on macOS will need to be able to associate layers with scrolling nodes,
2813         so push a ScrollingNodeID down through GraphicsLayer to PlatformCALayerCocoa.
2814         
2815         We only need one ScrollingNodeID per platform layer, since a given platform layer only
2816         ever has one scrolling role.
2817
2818         * page/scrolling/ScrollingTree.cpp:
2819         (WebCore::ScrollingTree::scrollingTreeAsText):
2820         * platform/graphics/GraphicsLayer.cpp:
2821         (WebCore::GraphicsLayer::dumpProperties const):
2822         * platform/graphics/GraphicsLayer.h:
2823         (WebCore::GraphicsLayer::scrollingNodeID const):
2824         (WebCore::GraphicsLayer::setScrollingNodeID):
2825         * platform/graphics/ca/GraphicsLayerCA.cpp:
2826         (WebCore::GraphicsLayerCA::setScrollingNodeID):
2827         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2828         (WebCore::GraphicsLayerCA::updateScrollingNode):
2829         * platform/graphics/ca/GraphicsLayerCA.h:
2830         * platform/graphics/ca/PlatformCALayer.h: setEventRegion() doesn't need to be pure virtual.
2831         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2832         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2833         (WebCore::PlatformCALayerCocoa::setEventRegion):
2834         (WebCore::PlatformCALayerCocoa::eventRegionContainsPoint const):
2835         * platform/graphics/ca/win/PlatformCALayerWin.h:
2836         * rendering/RenderLayerBacking.cpp:
2837         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
2838         (WebCore::RenderLayerBacking::setScrollingNodeIDForRole):
2839         * rendering/RenderLayerBacking.h:
2840         * rendering/RenderLayerCompositor.cpp:
2841         (WebCore::RenderLayerCompositor::ensureRootLayer):
2842         (WebCore::RenderLayerCompositor::attachScrollingNode): For subframe scrolling, the clipLayer
2843         is the layer that gets associated with a scrolling node.
2844         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingProxyRole):
2845
2846 2020-03-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
2847
2848         Remove the optimization for discarding no operation DisplayList items between Save and Restore items
2849         https://bugs.webkit.org/show_bug.cgi?id=208659
2850
2851         Reviewed by Simon Fraser.
2852
2853         This optimization is wrong in the case of drawing a canvas in general.
2854         The original implementation of the DisplayList assumes balanced Save/
2855         Restore GraphicsContext. In canvas a GraphicsConext 'save' can be issued
2856         in a frame and the corresponding restore is issued many frames later.
2857
2858         * platform/graphics/displaylists/DisplayList.cpp:
2859         (WebCore::DisplayList::DisplayList::removeItemsFromIndex): Deleted.
2860         * platform/graphics/displaylists/DisplayList.h:
2861         * platform/graphics/displaylists/DisplayListItems.cpp:
2862         * platform/graphics/displaylists/DisplayListItems.h:
2863         (WebCore::DisplayList::Save::encode const):
2864         (WebCore::DisplayList::Save::decode):
2865         (WebCore::DisplayList::Save::restoreIndex const): Deleted.
2866         (WebCore::DisplayList::Save::setRestoreIndex): Deleted.
2867         * platform/graphics/displaylists/DisplayListRecorder.cpp:
2868         (WebCore::DisplayList::Recorder::save):
2869         (WebCore::DisplayList::Recorder::restore):
2870         * platform/graphics/displaylists/DisplayListRecorder.h:
2871         (WebCore::DisplayList::Recorder::ContextState::cloneForSave const):
2872
2873 2020-03-05  Simon Fraser  <simon.fraser@apple.com>
2874
2875         Windows build fix after r257938.
2876         
2877         Surround the event region painting code with #if ENABLE(ASYNC_SCROLLING); Windows
2878         doesn't need to build this code.
2879
2880         * rendering/RenderLayerBacking.cpp:
2881         * rendering/RenderLayerBacking.h:
2882         * rendering/RenderLayerCompositor.cpp:
2883         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2884
2885 2020-03-05  Antoine Quint  <graouts@apple.com>
2886
2887         Page-specific UserStyleSheets should wait until the initial empty document has been removed to be injected
2888         https://bugs.webkit.org/show_bug.cgi?id=208644
2889         <rdar://problem/60042429>
2890
2891         Reviewed by Brady Eidson.
2892
2893         When a WKWebView is created and asked to load a URL, it will first load an empty initial document (about:blank) prior
2894         to creating a Document for the requested URL. We need to ensure that page-specific UserStyleSheets are only injected
2895         once the Document for the requested URL starts loading.
2896
2897         When Page::injectUserStyleSheet() is called, if we determine that the empty initial document is visible, we enqueue
2898         the provided UserStyleSheet and wait until the new mainFrameDidChangeToNonInitialEmptyDocument() method is called
2899         to empty that queue and inject the UserStyleSheets then.
2900
2901         This new method is called from Frame::setDocument() for a main frame once we've determined the frame's document has
2902         changed to a non-null value and that the frame loader's state machine indicates that we're no longer displaying the
2903         initial empty document.
2904
2905         * dom/ExtensionStyleSheets.h:
2906         * page/Frame.cpp:
2907         (WebCore::Frame::setDocument):
2908         * page/Page.cpp:
2909         (WebCore::Page::injectUserStyleSheet):
2910         (WebCore::Page::removeInjectedUserStyleSheet):
2911         (WebCore::Page::mainFrameDidChangeToNonInitialEmptyDocument):
2912         * page/Page.h:
2913
2914 2020-03-05  Simon Fraser  <simon.fraser@apple.com>
2915
2916         Generate layer event regions for async overflow scrolling on macOS
2917         https://bugs.webkit.org/show_bug.cgi?id=208649
2918
2919         Reviewed by Antti Koivisto.
2920
2921         Turn on the existing code for event region generation on macOS, and generate event
2922         regions when async overflow scroll is enabled.
2923         
2924         Tweak the region debug color to be more visible.
2925
2926         Tests: fast/scrolling/mac/border-radius-event-region.html
2927                fast/scrolling/mac/event-region-visibility-hidden.html
2928
2929         * rendering/RenderLayerBacking.cpp:
2930         (WebCore::RenderLayerBacking::updateEventRegion):
2931         (WebCore::RenderLayerBacking::paintDebugOverlays):
2932
2933 2020-03-05  Jer Noble  <jer.noble@apple.com>
2934
2935         [GPUP] Implement RemoteAudioSession
2936         https://bugs.webkit.org/show_bug.cgi?id=208583
2937
2938         Reviewed by Alex Christensen.
2939
2940         Add EnumTraits for all the enumerations inside AudioSession.
2941
2942         Make many AudioSession methods virtual, so they can be overridden in the case where the
2943         GPU process is enabled.
2944
2945         * Sources.txt:
2946         * WebCore.xcodeproj/project.pbxproj:
2947         * platform/audio/AudioSession.cpp:
2948         (WebCore::AudioSession::create):
2949         (WebCore::AudioSession::sharedSession):
2950         * platform/audio/AudioSession.h:
2951
2952 2020-03-05  Simon Fraser  <simon.fraser@apple.com>
2953
2954         Make m_viewportConstrainedObjects into a WeakHashSet
2955         https://bugs.webkit.org/show_bug.cgi?id=208625
2956
2957         Reviewed by Ryosuke Niwa.
2958
2959         Use WeakHashSet<> for m_viewportConstrainedObjects.
2960
2961         * page/FrameView.cpp:
2962         (WebCore::FrameView::didDestroyRenderTree):
2963         (WebCore::FrameView::addViewportConstrainedObject):
2964         (WebCore::FrameView::removeViewportConstrainedObject):
2965         (WebCore::FrameView::scrollContentsFastPath):
2966         (WebCore::FrameView::setViewportConstrainedObjectsNeedLayout):
2967         * page/FrameView.h:
2968         * page/scrolling/ScrollingCoordinator.cpp:
2969         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects const):
2970         * rendering/RenderLayerCompositor.cpp:
2971         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2972         * rendering/RenderLayerModelObject.cpp:
2973         (WebCore::RenderLayerModelObject::willBeDestroyed):
2974         (WebCore::RenderLayerModelObject::styleDidChange):
2975
2976 2020-03-05  Kenneth Russell  <kbr@chromium.org>
2977
2978         REGRESSION: [ Mac ] fast/canvas/webgl/texImage2D-video-flipY-false.html is Timing out
2979         https://bugs.webkit.org/show_bug.cgi?id=205734
2980
2981         Fix two bugs in MediaPlayerPrivateAVFoundationObjC causing the
2982         preferred AVPlayerItemVideoOutput code path to not be taken, in
2983         the situation where GPU-to-GPU copies are not possible because the
2984         video's format doesn't allow them.
2985
2986         Implement currentTime, fixing longstanding bug in the
2987         AVAssetImageGenerator fallback where only the first frame of the
2988         video would be displayed.
2989
2990         Covered by existing layout test.
2991
2992         Reviewed by Dean Jackson.
2993
2994         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2995         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2996         (WebCore::MediaPlayerPrivateAVFoundationObjC::currentTime const):
2997         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
2998         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
2999
3000 2020-03-05  youenn fablet  <youenn@apple.com>
3001
3002         In case an activating service worker is terminated, it should go to activated state
3003         https://bugs.webkit.org/show_bug.cgi?id=208440
3004         <rdar://problem/59742332>
3005
3006         Reviewed by Chris Dumez.
3007
3008         Covered by updated test.
3009
3010         * workers/service/server/SWServerWorker.cpp:
3011         (WebCore::SWServerWorker::setState):
3012         As per spec, if an activated service worker is terminated or its activate event is timing out,
3013         we should move it to activate state.
3014
3015 2020-03-05  Zalan Bujtas  <zalan@apple.com>
3016
3017         [LFC][Integration] Reset position style on line breaks.
3018         https://bugs.webkit.org/show_bug.cgi?id=208646
3019         <rdar://problem/60086589>
3020
3021         Reviewed by Antti Koivisto.
3022
3023         Test: fast/inline/out-of-flow-positioned-line-break.html
3024
3025         We need to treat line breaks as statically positioned inline content.
3026         In the long run we should do something along these lines:
3027         https://github.com/w3c/csswg-drafts/issues/610
3028
3029         * layout/integration/LayoutIntegrationBoxTree.cpp:
3030         (WebCore::LayoutIntegration::BoxTree::buildTree):
3031
3032 2020-03-05  Eric Carlson  <eric.carlson@apple.com>
3033
3034         Some media tests crash when run in the GPU process
3035         https://bugs.webkit.org/show_bug.cgi?id=208611
3036         <rdar://problem/60060320>
3037
3038         Reviewed by Jer Noble.
3039
3040         The AVPlayerItemOutputPullDelegate is not called on the main queue, so it can't
3041         use a WeakPtr that is created on the main queue. Rather than having the ObjC 
3042         delegate object call back to MediaPlayerPrivateAVFoundationObjC to signal a
3043         semaphore it owns, have the delegate object own the semaphore and expose it
3044         so MediaPlayerPrivateAVFoundationObjC can use it, removing the need for the
3045         WeakPtr completely.
3046
3047         No new tests, this fixes a crash in existing tests.
3048
3049         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3050         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3051         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
3052         Don't allocate m_videoOutputDelegate, it isn't needed immediately.
3053         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer): Drive-by
3054         optimization: don't update the current image when the fullscreen layer is set to NULL.
3055         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Allocate m_videoOutputDelegate.
3056         (WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
3057         Wait on the deletage's semphore.
3058         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
3059         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange): Deleted.
3060         (-[WebCoreAVFPullDelegate initWithPlayer:]): Deleted.
3061
3062 2020-03-05  Simon Fraser  <simon.fraser@apple.com>
3063
3064         Change ScrollingTreeMac.cpp to a .mm file
3065         https://bugs.webkit.org/show_bug.cgi?id=208652
3066
3067         Reviewed by Antti Koivisto.
3068
3069         Simple file rename.
3070
3071         * SourcesCocoa.txt:
3072         * WebCore.xcodeproj/project.pbxproj:
3073         * page/scrolling/mac/ScrollingTreeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeMac.cpp.
3074
3075 2020-03-05  Jason Lawrence  <lawrence.j@apple.com>
3076
3077         Unreviewed, rolling out r257905.
3078
3079         This commit caused crashes on Mac wk2 Debug.
3080
3081         Reverted changeset:
3082
3083         "Put all generated JSCells in WebCore into IsoSubspace"
3084         https://bugs.webkit.org/show_bug.cgi?id=205107
3085         https://trac.webkit.org/changeset/257905
3086
3087 2020-03-05  Simon Fraser  <simon.fraser@apple.com>
3088
3089         Track "scrolling scope" on RenderLayers
3090         https://bugs.webkit.org/show_bug.cgi?id=208620
3091
3092         Reviewed by Zalan Bujtas.
3093
3094         Keep track of a "scrolling scope" on RenderLayers. Layers that share a scrolling scope
3095         get scrolled by some common async-scrollable containing-block ancestor. The scope is just
3096         a unique identifier.
3097         
3098         Each layer has two scopes; a "box" scope that applies to the background/borders, and
3099         a "content" scope that applies to (potentially) scrollable content. For most layers,
3100         these will be the same, and shared with the layer's containing block ancestor layer.
3101
3102         For async-scrollable overflow, "box" scope is shared with the cb ancestor, but "content" scope
3103         will have a new value that applies to all the layers moved by that scroller.
3104
3105         Having this value makes it easy to ask the question "is this layer scrolled by some ancestor",
3106         which is a tricky computation for things like a position:absolute layer inside a non-containing block
3107         stacking context overflow:scroll. Also, position:fixed whose containing block is the root will share
3108         the scrolling scope of the root.
3109
3110         No behavior change.
3111
3112         * rendering/RenderLayer.cpp:
3113         (WebCore::nextScrollingScope):
3114         (WebCore::RenderLayer::RenderLayer):
3115         (WebCore::RenderLayer::updateLayerPositions):
3116         (WebCore::RenderLayer::updateLayerPosition):
3117         (WebCore::outputPaintOrderTreeLegend):
3118         (WebCore::outputPaintOrderTreeRecursive):
3119         * rendering/RenderLayer.h:
3120         * rendering/RenderLayerCompositor.cpp:
3121         (WebCore::isScrolledByOverflowScrollLayer):
3122
3123 2020-03-05  youenn fablet  <youenn@apple.com>
3124
3125         Add logging support for capture sources in GPUProcess
3126         https://bugs.webkit.org/show_bug.cgi?id=208637
3127
3128         Reviewed by Eric Carlson.
3129
3130         Make sure RealtimeVideoSource propagates its logger to its underlying source and to its clones.
3131         No change of behavior.
3132
3133         * platform/mediastream/RealtimeMediaSource.h:
3134         * platform/mediastream/RealtimeVideoSource.cpp:
3135         (WebCore::RealtimeVideoSource::clone):
3136         (WebCore::RealtimeVideoSource::setLogger):
3137         * platform/mediastream/RealtimeVideoSource.h:
3138
3139 2020-03-05  Wenson Hsieh  <wenson_hsieh@apple.com>
3140
3141         Optimize Path::encode on platforms that support CGPathGetNumberOfElements
3142         https://bugs.webkit.org/show_bug.cgi?id=208266
3143
3144         Reviewed by Darin Adler and Simon Fraser.
3145
3146         When encoding Path objects, we currently first encode the number of elements in the path by iterating over each
3147         path element and incrementing a counter; then, we iterate over each element again, and encode information
3148         (points, angles, etc.) for each path element.
3149
3150         However, on platforms that have the fix for <rdar://problem/59828724>, the first call to CGPathApply can be
3151         skipped, since CoreGraphics can (in constant time, for the most part) simply tell us how many elements are in
3152         the CGPath. See comments below for more details.
3153
3154         There should be no change in behavior.
3155
3156         * platform/graphics/Path.cpp:
3157         * platform/graphics/Path.h:
3158
3159         Add an `elementCount` method on Path, which returns the count of elements in the path. On platforms where
3160         CGPathGetNumberOfElements exists (and the fix for <rdar://problem/59828724> is also present), we return the
3161         result of calling this SPI. Otherwise, fall back to mapping over each path element and incrementing a count.
3162
3163         (WebCore::Path::encode const):
3164
3165         Use the new `elementCount` method when encoding a WebCore::Path.
3166
3167         * platform/graphics/cg/PathCG.cpp:
3168         (WebCore::Path::elementCount const):
3169
3170 2020-03-05  Zalan Bujtas  <zalan@apple.com>
3171
3172         [LFC][Invalidation] Incoming image data should invalidate layout tree content
3173         https://bugs.webkit.org/show_bug.cgi?id=208640
3174         <rdar://problem/60083229>
3175
3176         Reviewed by Antti Koivisto.
3177
3178         This is a forced invalidation (in the least intrusive way) to make sure LFC has up-to-date replaced information.
3179
3180         * rendering/RenderImage.cpp:
3181         (WebCore::RenderImage::imageChanged):
3182
3183 2020-03-05  Youenn Fablet  <youenn@apple.com>
3184
3185         Remove CoreAudioCaptureSourceFactory::setCoreAudioActiveSource/unsetCoreAudioActiveSource
3186         https://bugs.webkit.org/show_bug.cgi?id=208632
3187
3188         Reviewed by Eric Carlson.
3189
3190         We can remove this code since suspend/resume is now directly handled
3191         by the AudioSharedUnit singleton instead of going through the source.
3192         No change of behavior.
3193
3194         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3195         (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
3196         (WebCore::CoreAudioCaptureSource::startProducingData):
3197         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3198
3199 2020-03-05  Youenn Fablet  <youenn@apple.com>
3200
3201         Export NowPlaying commands to GPUProcess when media playing in GPUProcess is enabled
3202         https://bugs.webkit.org/show_bug.cgi?id=208568
3203
3204         Reviewed by Eric Carlson.
3205
3206         Removed PlatformMediaSessionClient NowPlaying getters since only HTMLMediaElement is eligible.
3207         Let MediaElementSession generates its own NowPlayingInfo when requested by the session manager.
3208         Use platform strategies to abstract out how to execute NowPlaying orders.
3209
3210         Manually tested for NowPlaying functionality.
3211         Also covered by existing tests for the refactoring bits.
3212
3213         * Headers.cmake:
3214         * Modules/webaudio/AudioContext.cpp:
3215         (WebCore::AudioContext::sourceApplicationIdentifier const): Deleted.
3216         * Modules/webaudio/AudioContext.h:
3217         * WebCore.xcodeproj/project.pbxproj:
3218         * html/HTMLMediaElement.h:
3219         * html/MediaElementSession.cpp:
3220         (WebCore::MediaElementSession::allowsPlaybackControlsForAutoplayingAudio const):
3221         (WebCore::MediaElementSession::nowPlayingInfo const):
3222         (WebCore::MediaElementSession::allowsNowPlayingControlsVisibility const): Deleted.
3223         * html/MediaElementSession.h:
3224         * platform/MediaStrategy.h:
3225         * platform/audio/AudioSession.h:
3226         * platform/audio/NowPlayingInfo.h: Added.
3227         (WebCore::NowPlayingInfo::encode const):
3228         (WebCore::NowPlayingInfo::decode):
3229         * platform/audio/PlatformMediaSession.cpp:
3230         (WebCore::PlatformMediaSession::nowPlayingInfo const):
3231         (WebCore::PlatformMediaSession::uniqueIdentifier const): Deleted.
3232         (WebCore::PlatformMediaSession::title const): Deleted.
3233         (WebCore::PlatformMediaSession::duration const): Deleted.
3234         (WebCore::PlatformMediaSession::currentTime const): Deleted.
3235         (WebCore::PlatformMediaSession::sourceApplicationIdentifier const): Deleted.
3236         (WebCore::PlatformMediaSessionClient::mediaSessionUniqueIdentifier const): Deleted.
3237         (WebCore::PlatformMediaSessionClient::mediaSessionTitle const): Deleted.
3238         (WebCore::PlatformMediaSessionClient::mediaSessionDuration const): Deleted.
3239         (WebCore::PlatformMediaSessionClient::mediaSessionCurrentTime const): Deleted.
3240         * platform/audio/PlatformMediaSession.h:
3241         (WebCore::PlatformMediaSession::allowsNowPlayingControlsVisibility const): Deleted.
3242         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
3243         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
3244         (MediaSessionManagerCocoa::clearNowPlayingInfo):
3245         (MediaSessionManagerCocoa::setNowPlayingInfo):
3246         (MediaSessionManagerCocoa::nowPlayingEligibleSession):
3247         (MediaSessionManagerCocoa::updateNowPlayingInfo):
3248         * platform/audio/ios/MediaSessionManagerIOS.h:
3249         * platform/audio/ios/MediaSessionManagerIOS.mm:
3250         (WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary):
3251         (WebCore::MediaSessionManageriOS::providePresentingApplicationPID):
3252
3253 2020-03-04  Yusuke Suzuki  <ysuzuki@apple.com>
3254
3255         Put all generated JSCells in WebCore into IsoSubspace
3256         https://bugs.webkit.org/show_bug.cgi?id=205107
3257
3258         Reviewed by Saam Barati.
3259
3260         This patch automatically generates IsoSubspace per WebCore DOM object type.
3261         In preprocess-idls.pl, we collect all the DOM object types and generate DOMIsoSubspaces class,
3262         which contains all the necessary IsoSubspaces. And it is held by WebCoreJSClientData.
3263
3264         CodeGeneratorJS.pm starts putting `subspaceFor` and `subspaceForImpl` for each JS DOM wrapper classes.
3265         And we dynamically create IsoSubspace and set it to WebCoreJSClientData's DOMIsoSubspaces. At the same
3266         time, we register IsoSubspace to m_outputConstraintSpaces if the class has output constraits callback.
3267
3268         * CMakeLists.txt:
3269         * DerivedSources-output.xcfilelist:
3270         * DerivedSources.make:
3271         * WebCoreMacros.cmake:
3272         * bindings/js/JSDOMWrapper.cpp:
3273         (WebCore::outputConstraintSubspaceFor): Deleted.
3274         * bindings/js/JSDOMWrapper.h:
3275         * bindings/js/WebCoreJSClientData.cpp:
3276         (WebCore::JSVMClientData::JSVMClientData):
3277         * bindings/js/WebCoreJSClientData.h:
3278         (WebCore::JSVMClientData::forEachOutputConstraintSpace):
3279         (WebCore::JSVMClientData::subspaces):
3280         (WebCore::JSVMClientData::outputConstraintSpace): Deleted.
3281         (WebCore::JSVMClientData::subspaceForJSDOMWindow): Deleted.
3282         (WebCore::JSVMClientData::subspaceForJSDedicatedWorkerGlobalScope): Deleted.
3283         (WebCore::JSVMClientData::subspaceForJSRemoteDOMWindow): Deleted.
3284         (WebCore::JSVMClientData::subspaceForJSWorkerGlobalScope): Deleted.
3285         (WebCore::JSVMClientData::subspaceForJSServiceWorkerGlobalScope): Deleted.
3286         (WebCore::JSVMClientData::subspaceForJSPaintWorkletGlobalScope): Deleted.
3287         (WebCore::JSVMClientData::subspaceForJSWorkletGlobalScope): Deleted.
3288         * bindings/scripts/CodeGeneratorJS.pm:
3289         (GenerateHeader):
3290         (GenerateImplementation):
3291         * bindings/scripts/generate-bindings-all.pl:
3292         * bindings/scripts/preprocess-idls.pl:
3293         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3294         (WebCore::JSInterfaceName::subspaceForImpl):
3295         * bindings/scripts/test/JS/JSInterfaceName.h:
3296         (WebCore::JSInterfaceName::subspaceFor):
3297         * bindings/scripts/test/JS/JSMapLike.cpp:
3298         (WebCore::JSMapLike::subspaceForImpl):
3299         * bindings/scripts/test/JS/JSMapLike.h:
3300         (WebCore::JSMapLike::subspaceFor):
3301         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3302         (WebCore::JSReadOnlyMapLike::subspaceForImpl):
3303         * bindings/scripts/test/JS/JSReadOnlyMapLike.h:
3304         (WebCore::JSReadOnlyMapLike::subspaceFor):
3305         * bindings/scripts/test/JS/JSReadOnlySetLike.cpp:
3306         (WebCore::JSReadOnlySetLike::subspaceForImpl):
3307         * bindings/scripts/test/JS/JSReadOnlySetLike.h:
3308         (WebCore::JSReadOnlySetLike::subspaceFor):
3309         * bindings/scripts/test/JS/JSSetLike.cpp:
3310         (WebCore::JSSetLike::subspaceForImpl):
3311         * bindings/scripts/test/JS/JSSetLike.h: