Title: [238665] trunk/Source/WebCore
Revision
238665
Author
[email protected]
Date
2018-11-29 03:44:50 -0800 (Thu, 29 Nov 2018)

Log Message

Add ParentRelativeScrollableRect to ScrollingCoordinator::ScrollingGeometry
https://bugs.webkit.org/show_bug.cgi?id=172914

Patch by Frederic Wang <[email protected]> on 2018-11-29
Reviewed by Simon Fraser.

This patch adds a ParentRelativeScrollableRect ScrollingCoordinator::ScrollingGeometry and
the corresponding set/get/dump APIs. Currently, the setter is never used so the behavior is
unchanged. In the future, this rect will be used for hit testing of subframes during
asynchronous macOS scrolling (but 172917).

No new tests, behavior unchanged.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
(WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setParentRelativeScrollableRect):
(WebCore::ScrollingStateScrollingNode::dumpProperties const):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::parentRelativeScrollableRect const):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeScrollingNode::dumpProperties const):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (238664 => 238665)


--- trunk/Source/WebCore/ChangeLog	2018-11-29 10:30:29 UTC (rev 238664)
+++ trunk/Source/WebCore/ChangeLog	2018-11-29 11:44:50 UTC (rev 238665)
@@ -1,3 +1,33 @@
+2018-11-29  Frederic Wang  <[email protected]>
+
+        Add ParentRelativeScrollableRect to ScrollingCoordinator::ScrollingGeometry
+        https://bugs.webkit.org/show_bug.cgi?id=172914
+
+        Reviewed by Simon Fraser.
+
+        This patch adds a ParentRelativeScrollableRect ScrollingCoordinator::ScrollingGeometry and
+        the corresponding set/get/dump APIs. Currently, the setter is never used so the behavior is
+        unchanged. In the future, this rect will be used for hit testing of subframes during
+        asynchronous macOS scrolling (but 172917).
+
+        No new tests, behavior unchanged.
+
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
+        (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
+        * page/scrolling/ScrollingCoordinator.h:
+        * page/scrolling/ScrollingStateScrollingNode.cpp:
+        (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
+        (WebCore::ScrollingStateScrollingNode::setParentRelativeScrollableRect):
+        (WebCore::ScrollingStateScrollingNode::dumpProperties const):
+        * page/scrolling/ScrollingStateScrollingNode.h:
+        (WebCore::ScrollingStateScrollingNode::parentRelativeScrollableRect const):
+        * page/scrolling/ScrollingTreeScrollingNode.cpp:
+        (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
+        (WebCore::ScrollingTreeScrollingNode::dumpProperties const):
+        * page/scrolling/ScrollingTreeScrollingNode.h:
+        (WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const):
+
 2018-11-28  Wenson Hsieh  <[email protected]>
 
         [iOSMac] Dropping text selections from web content into editable elements crashes the web process

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (238664 => 238665)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2018-11-29 10:30:29 UTC (rev 238664)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2018-11-29 11:44:50 UTC (rev 238665)
@@ -523,6 +523,7 @@
     node->setCounterScrollingLayer(counterScrollingLayer);
 
     if (scrollingGeometry) {
+        node->setParentRelativeScrollableRect(scrollingGeometry->parentRelativeScrollableRect);
         node->setScrollOrigin(scrollingGeometry->scrollOrigin);
         node->setScrollPosition(scrollingGeometry->scrollPosition);
         node->setTotalContentsSize(scrollingGeometry->contentSize);
@@ -542,6 +543,7 @@
     node->setScrolledContentsLayer(scrolledContentsLayer);
     
     if (scrollingGeometry) {
+        node->setParentRelativeScrollableRect(scrollingGeometry->parentRelativeScrollableRect);
         node->setScrollOrigin(scrollingGeometry->scrollOrigin);
         node->setScrollPosition(scrollingGeometry->scrollPosition);
         node->setTotalContentsSize(scrollingGeometry->contentSize);

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (238664 => 238665)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2018-11-29 10:30:29 UTC (rev 238664)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2018-11-29 11:44:50 UTC (rev 238665)
@@ -173,6 +173,7 @@
     virtual void updateNodeViewportConstraints(ScrollingNodeID, const ViewportConstraints&) { }
 
     struct ScrollingGeometry {
+        LayoutRect parentRelativeScrollableRect;
         FloatSize scrollableAreaSize;
         FloatSize contentSize;
         FloatSize reachableContentSize; // Smaller than contentSize when overflow is hidden on one axis.

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp (238664 => 238665)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp	2018-11-29 10:30:29 UTC (rev 238664)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp	2018-11-29 11:44:50 UTC (rev 238665)
@@ -43,6 +43,7 @@
     , m_scrollableAreaSize(stateNode.scrollableAreaSize())
     , m_totalContentsSize(stateNode.totalContentsSize())
     , m_reachableContentsSize(stateNode.reachableContentsSize())
+    , m_parentRelativeScrollableRect(stateNode.parentRelativeScrollableRect())
     , m_scrollPosition(stateNode.scrollPosition())
     , m_requestedScrollPosition(stateNode.requestedScrollPosition())
     , m_scrollOrigin(stateNode.scrollOrigin())
@@ -86,6 +87,15 @@
     setPropertyChanged(ReachableContentsSize);
 }
 
+void ScrollingStateScrollingNode::setParentRelativeScrollableRect(const LayoutRect& parentRelativeScrollableRect)
+{
+    if (m_parentRelativeScrollableRect == parentRelativeScrollableRect)
+        return;
+
+    m_parentRelativeScrollableRect = parentRelativeScrollableRect;
+    setPropertyChanged(ParentRelativeScrollableRect);
+}
+
 void ScrollingStateScrollingNode::setScrollPosition(const FloatPoint& scrollPosition)
 {
     if (m_scrollPosition == scrollPosition)
@@ -231,6 +241,9 @@
     if (m_requestedScrollPositionRepresentsProgrammaticScroll)
         ts.dumpProperty("requested scroll position represents programmatic scroll", m_requestedScrollPositionRepresentsProgrammaticScroll);
 
+    if (!m_parentRelativeScrollableRect.isEmpty())
+        ts.dumpProperty("parent relative scrollable rect", m_parentRelativeScrollableRect);
+
     if (m_scrollOrigin != IntPoint())
         ts.dumpProperty("scroll origin", m_scrollOrigin);
 

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h (238664 => 238665)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h	2018-11-29 10:30:29 UTC (rev 238664)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h	2018-11-29 11:44:50 UTC (rev 238665)
@@ -42,6 +42,7 @@
         ScrollableAreaSize = NumStateNodeBits,
         TotalContentsSize,
         ReachableContentsSize,
+        ParentRelativeScrollableRect,
         ScrollPosition,
         ScrollOrigin,
         ScrollableAreaParams,
@@ -68,6 +69,9 @@
     const FloatSize& reachableContentsSize() const { return m_reachableContentsSize; }
     WEBCORE_EXPORT void setReachableContentsSize(const FloatSize&);
 
+    const LayoutRect& parentRelativeScrollableRect() const { return m_parentRelativeScrollableRect; }
+    WEBCORE_EXPORT void setParentRelativeScrollableRect(const LayoutRect&);
+
     const FloatPoint& scrollPosition() const { return m_scrollPosition; }
     WEBCORE_EXPORT void setScrollPosition(const FloatPoint&);
 
@@ -118,6 +122,7 @@
     FloatSize m_scrollableAreaSize;
     FloatSize m_totalContentsSize;
     FloatSize m_reachableContentsSize;
+    LayoutRect m_parentRelativeScrollableRect;
     FloatPoint m_scrollPosition;
     FloatPoint m_requestedScrollPosition;
     IntPoint m_scrollOrigin;

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (238664 => 238665)


--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp	2018-11-29 10:30:29 UTC (rev 238664)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp	2018-11-29 11:44:50 UTC (rev 238665)
@@ -63,6 +63,9 @@
     if (state.hasChangedProperty(ScrollingStateScrollingNode::ScrollPosition))
         m_lastCommittedScrollPosition = state.scrollPosition();
 
+    if (state.hasChangedProperty(ScrollingStateScrollingNode::ParentRelativeScrollableRect))
+        m_parentRelativeScrollableRect = state.parentRelativeScrollableRect();
+
     if (state.hasChangedProperty(ScrollingStateScrollingNode::ScrollOrigin))
         m_scrollOrigin = state.scrollOrigin();
 
@@ -139,6 +142,10 @@
     if (m_reachableContentsSize != m_totalContentsSize)
         ts.dumpProperty("reachable content size", m_reachableContentsSize);
     ts.dumpProperty("last committed scroll position", m_lastCommittedScrollPosition);
+
+    if (!m_parentRelativeScrollableRect.isEmpty())
+        ts.dumpProperty("parent relative scrollable rect", m_parentRelativeScrollableRect);
+
     if (m_scrollOrigin != IntPoint())
         ts.dumpProperty("scroll origin", m_scrollOrigin);
 

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h (238664 => 238665)


--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h	2018-11-29 10:30:29 UTC (rev 238664)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h	2018-11-29 11:44:50 UTC (rev 238665)
@@ -87,6 +87,7 @@
     const FloatSize& scrollableAreaSize() const { return m_scrollableAreaSize; }
     const FloatSize& totalContentsSize() const { return m_totalContentsSize; }
     const FloatSize& reachableContentsSize() const { return m_reachableContentsSize; }
+    const LayoutRect& parentRelativeScrollableRect() const { return m_parentRelativeScrollableRect; }
     const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
 
     // If the totalContentsSize changes in the middle of a rubber-band, we still want to use the old totalContentsSize for the sake of
@@ -111,6 +112,7 @@
     FloatSize m_totalContentsSizeForRubberBand;
     FloatSize m_reachableContentsSize;
     FloatPoint m_lastCommittedScrollPosition;
+    LayoutRect m_parentRelativeScrollableRect;
     IntPoint m_scrollOrigin;
 #if ENABLE(CSS_SCROLL_SNAP)
     ScrollSnapOffsetsInfo<float> m_snapOffsetsInfo;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to