Changeset 238665 in webkit


Ignore:
Timestamp:
Nov 29, 2018 3:44:50 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Frederic Wang <fwang@igalia.com> 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):

Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r238661 r238665  
     12018-11-29  Frederic Wang  <fwang@igalia.com>
     2
     3        Add ParentRelativeScrollableRect to ScrollingCoordinator::ScrollingGeometry
     4        https://bugs.webkit.org/show_bug.cgi?id=172914
     5
     6        Reviewed by Simon Fraser.
     7
     8        This patch adds a ParentRelativeScrollableRect ScrollingCoordinator::ScrollingGeometry and
     9        the corresponding set/get/dump APIs. Currently, the setter is never used so the behavior is
     10        unchanged. In the future, this rect will be used for hit testing of subframes during
     11        asynchronous macOS scrolling (but 172917).
     12
     13        No new tests, behavior unchanged.
     14
     15        * page/scrolling/AsyncScrollingCoordinator.cpp:
     16        (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
     17        (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
     18        * page/scrolling/ScrollingCoordinator.h:
     19        * page/scrolling/ScrollingStateScrollingNode.cpp:
     20        (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
     21        (WebCore::ScrollingStateScrollingNode::setParentRelativeScrollableRect):
     22        (WebCore::ScrollingStateScrollingNode::dumpProperties const):
     23        * page/scrolling/ScrollingStateScrollingNode.h:
     24        (WebCore::ScrollingStateScrollingNode::parentRelativeScrollableRect const):
     25        * page/scrolling/ScrollingTreeScrollingNode.cpp:
     26        (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
     27        (WebCore::ScrollingTreeScrollingNode::dumpProperties const):
     28        * page/scrolling/ScrollingTreeScrollingNode.h:
     29        (WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const):
     30
    1312018-11-28  Wenson Hsieh  <wenson_hsieh@apple.com>
    232
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r237266 r238665  
    524524
    525525    if (scrollingGeometry) {
     526        node->setParentRelativeScrollableRect(scrollingGeometry->parentRelativeScrollableRect);
    526527        node->setScrollOrigin(scrollingGeometry->scrollOrigin);
    527528        node->setScrollPosition(scrollingGeometry->scrollPosition);
     
    543544   
    544545    if (scrollingGeometry) {
     546        node->setParentRelativeScrollableRect(scrollingGeometry->parentRelativeScrollableRect);
    545547        node->setScrollOrigin(scrollingGeometry->scrollOrigin);
    546548        node->setScrollPosition(scrollingGeometry->scrollPosition);
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h

    r228264 r238665  
    174174
    175175    struct ScrollingGeometry {
     176        LayoutRect parentRelativeScrollableRect;
    176177        FloatSize scrollableAreaSize;
    177178        FloatSize contentSize;
  • trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp

    r223728 r238665  
    4444    , m_totalContentsSize(stateNode.totalContentsSize())
    4545    , m_reachableContentsSize(stateNode.reachableContentsSize())
     46    , m_parentRelativeScrollableRect(stateNode.parentRelativeScrollableRect())
    4647    , m_scrollPosition(stateNode.scrollPosition())
    4748    , m_requestedScrollPosition(stateNode.requestedScrollPosition())
     
    8788}
    8889
     90void ScrollingStateScrollingNode::setParentRelativeScrollableRect(const LayoutRect& parentRelativeScrollableRect)
     91{
     92    if (m_parentRelativeScrollableRect == parentRelativeScrollableRect)
     93        return;
     94
     95    m_parentRelativeScrollableRect = parentRelativeScrollableRect;
     96    setPropertyChanged(ParentRelativeScrollableRect);
     97}
     98
    8999void ScrollingStateScrollingNode::setScrollPosition(const FloatPoint& scrollPosition)
    90100{
     
    232242        ts.dumpProperty("requested scroll position represents programmatic scroll", m_requestedScrollPositionRepresentsProgrammaticScroll);
    233243
     244    if (!m_parentRelativeScrollableRect.isEmpty())
     245        ts.dumpProperty("parent relative scrollable rect", m_parentRelativeScrollableRect);
     246
    234247    if (m_scrollOrigin != IntPoint())
    235248        ts.dumpProperty("scroll origin", m_scrollOrigin);
  • trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h

    r220503 r238665  
    4343        TotalContentsSize,
    4444        ReachableContentsSize,
     45        ParentRelativeScrollableRect,
    4546        ScrollPosition,
    4647        ScrollOrigin,
     
    6869    const FloatSize& reachableContentsSize() const { return m_reachableContentsSize; }
    6970    WEBCORE_EXPORT void setReachableContentsSize(const FloatSize&);
     71
     72    const LayoutRect& parentRelativeScrollableRect() const { return m_parentRelativeScrollableRect; }
     73    WEBCORE_EXPORT void setParentRelativeScrollableRect(const LayoutRect&);
    7074
    7175    const FloatPoint& scrollPosition() const { return m_scrollPosition; }
     
    119123    FloatSize m_totalContentsSize;
    120124    FloatSize m_reachableContentsSize;
     125    LayoutRect m_parentRelativeScrollableRect;
    121126    FloatPoint m_scrollPosition;
    122127    FloatPoint m_requestedScrollPosition;
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp

    r223728 r238665  
    6363    if (state.hasChangedProperty(ScrollingStateScrollingNode::ScrollPosition))
    6464        m_lastCommittedScrollPosition = state.scrollPosition();
     65
     66    if (state.hasChangedProperty(ScrollingStateScrollingNode::ParentRelativeScrollableRect))
     67        m_parentRelativeScrollableRect = state.parentRelativeScrollableRect();
    6568
    6669    if (state.hasChangedProperty(ScrollingStateScrollingNode::ScrollOrigin))
     
    140143        ts.dumpProperty("reachable content size", m_reachableContentsSize);
    141144    ts.dumpProperty("last committed scroll position", m_lastCommittedScrollPosition);
     145
     146    if (!m_parentRelativeScrollableRect.isEmpty())
     147        ts.dumpProperty("parent relative scrollable rect", m_parentRelativeScrollableRect);
     148
    142149    if (m_scrollOrigin != IntPoint())
    143150        ts.dumpProperty("scroll origin", m_scrollOrigin);
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h

    r237266 r238665  
    8888    const FloatSize& totalContentsSize() const { return m_totalContentsSize; }
    8989    const FloatSize& reachableContentsSize() const { return m_reachableContentsSize; }
     90    const LayoutRect& parentRelativeScrollableRect() const { return m_parentRelativeScrollableRect; }
    9091    const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
    9192
     
    112113    FloatSize m_reachableContentsSize;
    113114    FloatPoint m_lastCommittedScrollPosition;
     115    LayoutRect m_parentRelativeScrollableRect;
    114116    IntPoint m_scrollOrigin;
    115117#if ENABLE(CSS_SCROLL_SNAP)
Note: See TracChangeset for help on using the changeset viewer.