- Revision
- 253689
- Author
- [email protected]
- Date
- 2019-12-18 09:01:24 -0800 (Wed, 18 Dec 2019)
Log Message
Move m_exposedContentRect into the DelegatedScrollingGeometry optional
https://bugs.webkit.org/show_bug.cgi?id=205377
Reviewed by Tim Horton.
Source/WebCore:
ScrollView's m_exposedContentRect is only set for delegated scrolling, so move it into
DelegatedScrollingGeometry and remove the iOS #ifdefs around it. Move the WAK/NSView-related
code into platformExposedContentRect() for iOS WK1. Stub out exposedContentRect() functions
on TiledCoreAnimationDrawingArea.
* platform/ScrollView.cpp:
(WebCore::ScrollView::exposedContentRect const):
(WebCore::ScrollView::setExposedContentRect):
(WebCore::ScrollView::platformExposedContentRect const):
* platform/ScrollView.h:
* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::platformExposedContentRect const):
(WebCore::ScrollView::exposedContentRect const): Deleted.
(WebCore::ScrollView::setExposedContentRect): Deleted.
Source/WebKit:
ScrollView's m_exposedContentRect is only set for delegated scrolling, so move it into
DelegatedScrollingGeometry and remove the iOS #ifdefs around it. Move the WAK/NSView-related
code into platformExposedContentRect() for iOS WK1. Stub out exposedContentRect() functions
on TiledCoreAnimationDrawingArea.
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
(WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):
(WebKit::TiledCoreAnimationDrawingArea::exposedContentRect const):
(WebKit::TiledCoreAnimationDrawingArea::setExposedContentRect):
(WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (253688 => 253689)
--- trunk/Source/WebCore/ChangeLog 2019-12-18 16:46:15 UTC (rev 253688)
+++ trunk/Source/WebCore/ChangeLog 2019-12-18 17:01:24 UTC (rev 253689)
@@ -1,3 +1,25 @@
+2019-12-18 Simon Fraser <[email protected]>
+
+ Move m_exposedContentRect into the DelegatedScrollingGeometry optional
+ https://bugs.webkit.org/show_bug.cgi?id=205377
+
+ Reviewed by Tim Horton.
+
+ ScrollView's m_exposedContentRect is only set for delegated scrolling, so move it into
+ DelegatedScrollingGeometry and remove the iOS #ifdefs around it. Move the WAK/NSView-related
+ code into platformExposedContentRect() for iOS WK1. Stub out exposedContentRect() functions
+ on TiledCoreAnimationDrawingArea.
+
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::exposedContentRect const):
+ (WebCore::ScrollView::setExposedContentRect):
+ (WebCore::ScrollView::platformExposedContentRect const):
+ * platform/ScrollView.h:
+ * platform/ios/ScrollViewIOS.mm:
+ (WebCore::ScrollView::platformExposedContentRect const):
+ (WebCore::ScrollView::exposedContentRect const): Deleted.
+ (WebCore::ScrollView::setExposedContentRect): Deleted.
+
2019-12-18 Chris Dumez <[email protected]>
REGRESSION: 32 Tests Crashing on Mac Debug wk2 with ASSERTION FAILED: m_pendingActivityForEventDispatch
Modified: trunk/Source/WebCore/platform/ScrollView.cpp (253688 => 253689)
--- trunk/Source/WebCore/platform/ScrollView.cpp 2019-12-18 16:46:15 UTC (rev 253688)
+++ trunk/Source/WebCore/platform/ScrollView.cpp 2019-12-18 17:01:24 UTC (rev 253689)
@@ -220,6 +220,33 @@
setScrollPosition(position);
}
+FloatRect ScrollView::exposedContentRect() const
+{
+#if PLATFORM(IOS_FAMILY)
+ if (platformWidget())
+ return platformExposedContentRect();
+#endif
+
+ const ScrollView* parent = this->parent();
+ if (!parent)
+ return m_delegatedScrollingGeometry ? m_delegatedScrollingGeometry->exposedContentRect : FloatRect();
+
+ IntRect parentViewExtentContentRect = enclosingIntRect(parent->exposedContentRect());
+ IntRect selfExtentContentRect = rootViewToContents(parentViewExtentContentRect);
+ selfExtentContentRect.intersect(boundsRect());
+ return selfExtentContentRect;
+}
+
+void ScrollView::setExposedContentRect(const FloatRect& rect)
+{
+ ASSERT(!platformWidget());
+
+ if (!m_delegatedScrollingGeometry)
+ m_delegatedScrollingGeometry = DelegatedScrollingGeometry();
+
+ m_delegatedScrollingGeometry->exposedContentRect = rect;
+}
+
FloatSize ScrollView::unobscuredContentSize() const
{
ASSERT(m_delegatedScrollingGeometry);
@@ -1590,6 +1617,11 @@
return { };
}
+FloatRect ScrollView::platformExposedContentRect() const
+{
+ return { };
+}
+
void ScrollView::platformSetContentsSize()
{
}
Modified: trunk/Source/WebCore/platform/ScrollView.h (253688 => 253689)
--- trunk/Source/WebCore/platform/ScrollView.h 2019-12-18 16:46:15 UTC (rev 253688)
+++ trunk/Source/WebCore/platform/ScrollView.h 2019-12-18 17:01:24 UTC (rev 253689)
@@ -475,6 +475,7 @@
IntSize platformVisibleContentSizeIncludingObscuredArea(bool includeScrollbars) const;
IntRect platformUnobscuredContentRect(VisibleContentRectIncludesScrollbars) const;
+ FloatRect platformExposedContentRect() const;
void platformSetContentsSize();
@@ -499,11 +500,11 @@
ScrollbarMode m_horizontalScrollbarMode { ScrollbarAuto };
ScrollbarMode m_verticalScrollbarMode { ScrollbarAuto };
- FloatRect m_exposedContentRect;
// FIXME: More things will move into here.
struct DelegatedScrollingGeometry {
FloatSize unobscuredContentSize;
+ FloatRect exposedContentRect;
};
Optional<DelegatedScrollingGeometry> m_delegatedScrollingGeometry;
Modified: trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm (253688 => 253689)
--- trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm 2019-12-18 16:46:15 UTC (rev 253688)
+++ trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm 2019-12-18 17:01:24 UTC (rev 253689)
@@ -113,38 +113,23 @@
return enclosingIntRect(r);
}
-FloatRect ScrollView::exposedContentRect() const
+FloatRect ScrollView::platformExposedContentRect() const
{
- if (NSScrollView *view = static_cast<NSScrollView *>(platformWidget())) {
- CGRect r = CGRectZero;
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- if ([view isKindOfClass:[NSScrollView class]])
- r = [view exposedContentRect];
- else {
- r.origin = [view visibleRect].origin;
- r.size = [view bounds].size;
- }
-
- END_BLOCK_OBJC_EXCEPTIONS;
- return r;
+ ASSERT(platformWidget());
+ NSScrollView *view = static_cast<NSScrollView *>(platformWidget());
+ CGRect r = CGRectZero;
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ if ([view isKindOfClass:[NSScrollView class]])
+ r = [view exposedContentRect];
+ else {
+ r.origin = [view visibleRect].origin;
+ r.size = [view bounds].size;
}
- const ScrollView* parent = this->parent();
- if (!parent)
- return m_exposedContentRect;
-
- IntRect parentViewExtentContentRect = enclosingIntRect(parent->exposedContentRect());
- IntRect selfExtentContentRect = rootViewToContents(parentViewExtentContentRect);
- selfExtentContentRect.intersect(boundsRect());
- return selfExtentContentRect;
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return r;
}
-void ScrollView::setExposedContentRect(const FloatRect& rect)
-{
- ASSERT(!platformWidget());
- m_exposedContentRect = rect;
-}
-
void ScrollView::setActualScrollPosition(const IntPoint& position)
{
NSScrollView *view = static_cast<NSScrollView *>(platformWidget());
Modified: trunk/Source/WebKit/ChangeLog (253688 => 253689)
--- trunk/Source/WebKit/ChangeLog 2019-12-18 16:46:15 UTC (rev 253688)
+++ trunk/Source/WebKit/ChangeLog 2019-12-18 17:01:24 UTC (rev 253689)
@@ -1,3 +1,28 @@
+2019-12-18 Simon Fraser <[email protected]>
+
+ Move m_exposedContentRect into the DelegatedScrollingGeometry optional
+ https://bugs.webkit.org/show_bug.cgi?id=205377
+
+ Reviewed by Tim Horton.
+
+ ScrollView's m_exposedContentRect is only set for delegated scrolling, so move it into
+ DelegatedScrollingGeometry and remove the iOS #ifdefs around it. Move the WAK/NSView-related
+ code into platformExposedContentRect() for iOS WK1. Stub out exposedContentRect() functions
+ on TiledCoreAnimationDrawingArea.
+
+ * WebProcess/WebPage/DrawingArea.h:
+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
+ (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect):
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
+ (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
+ (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):
+ (WebKit::TiledCoreAnimationDrawingArea::exposedContentRect const):
+ (WebKit::TiledCoreAnimationDrawingArea::setExposedContentRect):
+ (WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling):
+
2019-12-18 Wenson Hsieh <[email protected]>
Enable the async clipboard API by default on macOS and iOS
Modified: trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h (253688 => 253689)
--- trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h 2019-12-18 16:46:15 UTC (rev 253688)
+++ trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h 2019-12-18 17:01:24 UTC (rev 253689)
@@ -98,11 +98,11 @@
virtual void acceleratedAnimationDidStart(uint64_t /*layerID*/, const String& /*key*/, MonotonicTime /*startTime*/) { }
virtual void acceleratedAnimationDidEnd(uint64_t /*layerID*/, const String& /*key*/) { }
virtual void addFence(const WTF::MachSendRight&) { }
-#endif
-#if PLATFORM(IOS_FAMILY)
+
virtual WebCore::FloatRect exposedContentRect() const = 0;
virtual void setExposedContentRect(const WebCore::FloatRect&) = 0;
#endif
+
virtual void mainFrameScrollabilityChanged(bool) { }
virtual bool supportsAsyncScrolling() const { return false; }
Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h (253688 => 253689)
--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h 2019-12-18 16:46:15 UTC (rev 253688)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h 2019-12-18 17:01:24 UTC (rev 253689)
@@ -95,10 +95,8 @@
void acceleratedAnimationDidStart(uint64_t layerID, const String& key, MonotonicTime startTime) override;
void acceleratedAnimationDidEnd(uint64_t layerID, const String& key) override;
-#if PLATFORM(IOS_FAMILY)
WebCore::FloatRect exposedContentRect() const override;
void setExposedContentRect(const WebCore::FloatRect&) override;
-#endif
void didUpdate() override;
Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm (253688 => 253689)
--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm 2019-12-18 16:46:15 UTC (rev 253688)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm 2019-12-18 17:01:24 UTC (rev 253689)
@@ -228,7 +228,6 @@
updateScrolledExposedRect();
}
-#if PLATFORM(IOS_FAMILY)
WebCore::FloatRect RemoteLayerTreeDrawingArea::exposedContentRect() const
{
FrameView* frameView = m_webPage.mainFrameView();
@@ -249,7 +248,6 @@
frameView->setExposedContentRect(exposedContentRect);
scheduleCompositingLayerFlush();
}
-#endif
void RemoteLayerTreeDrawingArea::updateScrolledExposedRect()
{
Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (253688 => 253689)
--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2019-12-18 16:46:15 UTC (rev 253688)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2019-12-18 17:01:24 UTC (rev 253689)
@@ -75,6 +75,9 @@
void setViewExposedRect(Optional<WebCore::FloatRect>) override;
Optional<WebCore::FloatRect> viewExposedRect() const override { return m_scrolledViewExposedRect; }
+ WebCore::FloatRect exposedContentRect() const override;
+ void setExposedContentRect(const WebCore::FloatRect&) override;
+
bool supportsAsyncScrolling() const override { return true; }
void dispatchAfterEnsuringUpdatedScrollPosition(WTF::Function<void ()>&&) override;
Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (253688 => 253689)
--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2019-12-18 16:46:15 UTC (rev 253688)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2019-12-18 17:01:24 UTC (rev 253689)
@@ -87,7 +87,7 @@
[m_hostingLayer setOpaque:YES];
[m_hostingLayer setGeometryFlipped:YES];
- m_layerFlushRunLoopObserver = makeUnique<WebCore::RunLoopObserver>(static_cast<CFIndex>(RunLoopObserver::WellKnownRunLoopOrders::LayerFlush), [this]() {
+ m_layerFlushRunLoopObserver = makeUnique<RunLoopObserver>(static_cast<CFIndex>(RunLoopObserver::WellKnownRunLoopOrders::LayerFlush), [this]() {
this->layerFlushRunLoopCallback();
});
@@ -514,7 +514,7 @@
}
}
-void TiledCoreAnimationDrawingArea::activityStateDidChange(OptionSet<WebCore::ActivityState::Flag> changed, ActivityStateChangeID activityStateChangeID, const Vector<CallbackID>& nextActivityStateChangeCallbackIDs)
+void TiledCoreAnimationDrawingArea::activityStateDidChange(OptionSet<ActivityState::Flag> changed, ActivityStateChangeID activityStateChangeID, const Vector<CallbackID>& nextActivityStateChangeCallbackIDs)
{
m_nextActivityStateChangeCallbackIDs.appendVector(nextActivityStateChangeCallbackIDs);
m_activityStateChangeID = std::max(m_activityStateChangeID, activityStateChangeID);
@@ -566,12 +566,23 @@
[[NSNotificationCenter defaultCenter] postNotificationName:@"NSCAViewRenderDidResumeNotification" object:nil userInfo:[NSDictionary dictionaryWithObject:m_hostingLayer.get() forKey:@"layer"]];
}
-void TiledCoreAnimationDrawingArea::setViewExposedRect(Optional<WebCore::FloatRect> viewExposedRect)
+void TiledCoreAnimationDrawingArea::setViewExposedRect(Optional<FloatRect> viewExposedRect)
{
m_viewExposedRect = viewExposedRect;
updateScrolledExposedRect();
}
+FloatRect TiledCoreAnimationDrawingArea::exposedContentRect() const
+{
+ ASSERT_NOT_REACHED();
+ return { };
+}
+
+void TiledCoreAnimationDrawingArea::setExposedContentRect(const FloatRect&)
+{
+ ASSERT_NOT_REACHED();
+}
+
void TiledCoreAnimationDrawingArea::updateScrolledExposedRect()
{
FrameView* frameView = m_webPage.mainFrameView();
@@ -941,11 +952,11 @@
m_layerFlushRunLoopObserver->schedule(CFRunLoopGetCurrent());
}
-bool TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags flags)
+bool TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling(LayerFlushThrottleState::Flags flags)
{
bool wasThrottlingLayerFlushes = m_isThrottlingLayerFlushes;
- m_isThrottlingLayerFlushes = flags & WebCore::LayerFlushThrottleState::Enabled;
- m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = flags & WebCore::LayerFlushThrottleState::UserIsInteracting;
+ m_isThrottlingLayerFlushes = flags & LayerFlushThrottleState::Enabled;
+ m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = flags & LayerFlushThrottleState::UserIsInteracting;
if (wasThrottlingLayerFlushes == m_isThrottlingLayerFlushes)
return true;