Changeset 165493 in webkit


Ignore:
Timestamp:
Mar 12, 2014 11:55:53 AM (10 years ago)
Author:
Simon Fraser
Message:

Have the scrolling tree track the viewport size, not the viewport rect
https://bugs.webkit.org/show_bug.cgi?id=130141

Reviewed by Beth Dakin.

Source/WebCore:

The scrolling tree only needs to know the size of the viewport, not its
origin, since the origin is deduced from the updated scroll position.

  • WebCore.exp.in:
  • page/scrolling/AsyncScrollingCoordinator.cpp:

(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):

  • page/scrolling/ScrollingStateScrollingNode.cpp:

(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setViewportSize):
(WebCore::ScrollingStateScrollingNode::dumpProperties):

  • page/scrolling/ScrollingStateScrollingNode.h:
  • page/scrolling/ScrollingTreeScrollingNode.cpp:

(WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):

  • page/scrolling/ScrollingTreeScrollingNode.h:

(WebCore::ScrollingTreeScrollingNode::viewportSize):

  • page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm:

(WebCore::ScrollingTreeScrollingNodeIOS::setScrollLayerPosition):
(WebCore::ScrollingTreeScrollingNodeIOS::maximumScrollPosition):

  • page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:

(WebCore::ScrollingTreeScrollingNodeMac::updateAfterChildren):
(WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):
(WebCore::ScrollingTreeScrollingNodeMac::maximumScrollPosition):
(WebCore::ScrollingTreeScrollingNodeMac::logExposedUnfilledArea):

Source/WebKit2:

The scrolling tree only needs to know the size of the viewport, not its
origin, since the origin is deduced from the updated scroll position.

  • Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:

(ArgumentCoder<ScrollingStateScrollingNode>::encode):
(ArgumentCoder<ScrollingStateScrollingNode>::decode):

LayoutTests:

The scrolling tree only needs to know the size of the viewport, not its
origin, since the origin is deduced from the updated scroll position.

Tests dump a size, not a rect with a 0,0 origin now.

  • platform/mac-wk2/tiled-drawing/clamp-out-of-bounds-scrolls-expected.txt:
  • platform/mac-wk2/tiled-drawing/fixed/absolute-inside-fixed-expected.txt:
  • platform/mac-wk2/tiled-drawing/fixed/absolute-inside-out-of-view-fixed-expected.txt:
  • platform/mac-wk2/tiled-drawing/fixed/fixed-in-overflow-expected.txt:
  • platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-expected.txt:
  • platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-negative-zindex-expected.txt:
  • platform/mac-wk2/tiled-drawing/fixed/four-bars-expected.txt:
  • platform/mac-wk2/tiled-drawing/fixed/four-bars-with-header-and-footer-expected.txt:
  • platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-expected.txt:
  • platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-in-view-expected.txt:
  • platform/mac-wk2/tiled-drawing/fixed/nested-fixed-expected.txt:
  • platform/mac-wk2/tiled-drawing/fixed/percentage-inside-fixed-expected.txt:
  • platform/mac-wk2/tiled-drawing/scrolling-tree-after-scroll-expected.txt:
  • platform/mac-wk2/tiled-drawing/scrolling-tree-slow-scrolling-expected.txt:
  • platform/mac-wk2/tiled-drawing/sticky/negative-scroll-offset-expected.txt:
  • platform/mac-wk2/tiled-drawing/sticky/sticky-horizontal-expected.txt:
Location:
trunk
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r165484 r165493  
     12014-03-12  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Have the scrolling tree track the viewport size, not the viewport rect
     4        https://bugs.webkit.org/show_bug.cgi?id=130141
     5
     6        Reviewed by Beth Dakin.
     7
     8        The scrolling tree only needs to know the size of the viewport, not its
     9        origin, since the origin is deduced from the updated scroll position.
     10       
     11        Tests dump a size, not a rect with a 0,0 origin now.
     12
     13        * platform/mac-wk2/tiled-drawing/clamp-out-of-bounds-scrolls-expected.txt:
     14        * platform/mac-wk2/tiled-drawing/fixed/absolute-inside-fixed-expected.txt:
     15        * platform/mac-wk2/tiled-drawing/fixed/absolute-inside-out-of-view-fixed-expected.txt:
     16        * platform/mac-wk2/tiled-drawing/fixed/fixed-in-overflow-expected.txt:
     17        * platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-expected.txt:
     18        * platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-negative-zindex-expected.txt:
     19        * platform/mac-wk2/tiled-drawing/fixed/four-bars-expected.txt:
     20        * platform/mac-wk2/tiled-drawing/fixed/four-bars-with-header-and-footer-expected.txt:
     21        * platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-expected.txt:
     22        * platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-in-view-expected.txt:
     23        * platform/mac-wk2/tiled-drawing/fixed/nested-fixed-expected.txt:
     24        * platform/mac-wk2/tiled-drawing/fixed/percentage-inside-fixed-expected.txt:
     25        * platform/mac-wk2/tiled-drawing/scrolling-tree-after-scroll-expected.txt:
     26        * platform/mac-wk2/tiled-drawing/scrolling-tree-slow-scrolling-expected.txt:
     27        * platform/mac-wk2/tiled-drawing/sticky/negative-scroll-offset-expected.txt:
     28        * platform/mac-wk2/tiled-drawing/sticky/sticky-horizontal-expected.txt:
     29
    1302014-03-12  Simon Fraser  <simon.fraser@apple.com>
    231
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/clamp-out-of-bounds-scrolls-expected.txt

    r142526 r165493  
    11Attempted scroll to -5000, 0
    22(Scrolling node
    3   (viewport rect 0 0 785 585)
     3  (viewport rect 785 585)
    44  (contents size 5008 5021)
    55)
     
    77Attempted scroll to 0, -5000
    88(Scrolling node
    9   (viewport rect 0 0 785 585)
     9  (viewport rect 785 585)
    1010  (contents size 5008 5021)
    1111)
     
    1313Attempted scroll to -5000, -5000
    1414(Scrolling node
    15   (viewport rect 0 0 785 585)
     15  (viewport rect 785 585)
    1616  (contents size 5008 5021)
    1717)
     
    1919Attempted scroll to 10000, 0
    2020(Scrolling node
    21   (viewport rect 0 0 785 585)
     21  (viewport rect 785 585)
    2222  (contents size 5008 5021)
    2323  (requested scroll position 4223 0)
     
    2626Attempted scroll to 0, 10000
    2727(Scrolling node
    28   (viewport rect 0 0 785 585)
     28  (viewport rect 785 585)
    2929  (contents size 5008 5021)
    3030  (requested scroll position 0 4436)
     
    3333Attempted scroll to 10000, 10000
    3434(Scrolling node
    35   (viewport rect 0 0 785 585)
     35  (viewport rect 785 585)
    3636  (contents size 5008 5021)
    3737  (requested scroll position 4223 4436)
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed/absolute-inside-fixed-expected.txt

    r141362 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 785 600)
     2  (viewport rect 785 600)
    33  (contents size 785 2710)
    44  (requested scroll position 0 200)
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed/absolute-inside-out-of-view-fixed-expected.txt

    r141362 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 785 600)
     2  (viewport rect 785 600)
    33  (contents size 785 2513)
    44  (requested scroll position 0 200)
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed/fixed-in-overflow-expected.txt

    r141362 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 785 600)
     2  (viewport rect 785 600)
    33  (contents size 785 2213)
    44  (requested scroll position 0 200)
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-expected.txt

    r141362 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 785 600)
     2  (viewport rect 785 600)
    33  (contents size 785 1021)
    44  (children 1
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-negative-zindex-expected.txt

    r141362 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 785 600)
     2  (viewport rect 785 600)
    33  (contents size 785 1021)
    44  (children 1
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed/four-bars-expected.txt

    r148104 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 785 600)
     2  (viewport rect 785 600)
    33  (contents size 785 2221)
    44  (requested scroll position 0 200)
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed/four-bars-with-header-and-footer-expected.txt

    r148104 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 785 600)
     2  (viewport rect 785 600)
    33  (contents size 785 2421)
    44  (requested scroll position 0 200)
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-expected.txt

    r142526 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 785 600)
     2  (viewport rect 785 600)
    33  (contents size 785 2221)
    44  (children 1
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-in-view-expected.txt

    r148104 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 785 600)
     2  (viewport rect 785 600)
    33  (contents size 785 2221)
    44  (children 1
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed/nested-fixed-expected.txt

    r141362 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 785 600)
     2  (viewport rect 785 600)
    33  (contents size 785 2213)
    44  (requested scroll position 0 200)
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed/percentage-inside-fixed-expected.txt

    r141362 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 785 600)
     2  (viewport rect 785 600)
    33  (contents size 785 2513)
    44  (requested scroll position 0 200)
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling-tree-after-scroll-expected.txt

    r141362 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 785 600)
     2  (viewport rect 785 600)
    33  (contents size 785 5021)
    44  (requested scroll position 0 3000)
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling-tree-slow-scrolling-expected.txt

    r141362 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 800 600)
     2  (viewport rect 800 600)
    33  (contents size 800 600)
    44  (Scrolling on main thread because: Has slow repaint objects)
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/sticky/negative-scroll-offset-expected.txt

    r142526 r165493  
    11(Scrolling node
    2   (viewport rect 0 0 785 600)
     2  (viewport rect 785 600)
    33  (contents size 785 2216)
    44  (children 1
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/sticky/sticky-horizontal-expected.txt

    r141362 r165493  
    11Left sticky Right sticky Left % sticky Right % sticky Left and Right Left and Right %
    22(Scrolling node
    3   (viewport rect 0 0 800 585)
     3  (viewport rect 800 585)
    44  (contents size 2008 585)
    55  (requested scroll position 800 0)
  • trunk/Source/WebCore/ChangeLog

    r165491 r165493  
     12014-03-12  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Have the scrolling tree track the viewport size, not the viewport rect
     4        https://bugs.webkit.org/show_bug.cgi?id=130141
     5
     6        Reviewed by Beth Dakin.
     7
     8        The scrolling tree only needs to know the size of the viewport, not its
     9        origin, since the origin is deduced from the updated scroll position.
     10
     11        * WebCore.exp.in:
     12        * page/scrolling/AsyncScrollingCoordinator.cpp:
     13        (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
     14        * page/scrolling/ScrollingStateScrollingNode.cpp:
     15        (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
     16        (WebCore::ScrollingStateScrollingNode::setViewportSize):
     17        (WebCore::ScrollingStateScrollingNode::dumpProperties):
     18        * page/scrolling/ScrollingStateScrollingNode.h:
     19        * page/scrolling/ScrollingTreeScrollingNode.cpp:
     20        (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
     21        * page/scrolling/ScrollingTreeScrollingNode.h:
     22        (WebCore::ScrollingTreeScrollingNode::viewportSize):
     23        * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm:
     24        (WebCore::ScrollingTreeScrollingNodeIOS::setScrollLayerPosition):
     25        (WebCore::ScrollingTreeScrollingNodeIOS::maximumScrollPosition):
     26        * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
     27        (WebCore::ScrollingTreeScrollingNodeMac::updateAfterChildren):
     28        (WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):
     29        (WebCore::ScrollingTreeScrollingNodeMac::maximumScrollPosition):
     30        (WebCore::ScrollingTreeScrollingNodeMac::logExposedUnfilledArea):
     31
    1322014-03-12  Simon Fraser  <simon.fraser@apple.com>
    233
  • trunk/Source/WebCore/WebCore.exp.in

    r165484 r165493  
    27562756__ZN7WebCore27ScrollingStateScrollingNode15setHeaderHeightEi
    27572757__ZN7WebCore27ScrollingStateScrollingNode15setScrollOriginERKNS_8IntPointE
     2758__ZN7WebCore27ScrollingStateScrollingNode15setViewportSizeERKNS_9FloatSizeE
    27582759__ZN7WebCore27ScrollingStateScrollingNode17setScrollPositionERKNS_10FloatPointE
    27592760__ZN7WebCore27ScrollingStateScrollingNode19setFrameScaleFactorEf
     
    27662767__ZN7WebCore27ScrollingStateScrollingNode27setScrollableAreaParametersERKNS_24ScrollableAreaParametersE
    27672768__ZN7WebCore27ScrollingStateScrollingNode30setSynchronousScrollingReasonsEj
    2768 __ZN7WebCore27ScrollingStateScrollingNode32setViewportConstrainedObjectRectERKNS_9FloatRectE
    27692769__ZN7WebCore27ScrollingStateScrollingNode33setScrollBehaviorForFixedElementsENS_30ScrollBehaviorForFixedElementsE
    27702770__ZNK7WebCore25AsyncScrollingCoordinator24scrollingStateTreeAsTextEv
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r165484 r165493  
    9191    node->setScrollOrigin(frameView->scrollOrigin());
    9292#if PLATFORM(IOS)
    93     node->setViewportConstrainedObjectRect(FloatRect(FloatPoint(), frameView->viewportConstrainedVisibleContentRect().size()));
     93    node->setViewportSize(frameView->viewportConstrainedVisibleContentRect().size());
    9494#else
    95     node->setViewportConstrainedObjectRect(FloatRect(FloatPoint(), frameView->visibleContentRect().size()));
     95    node->setViewportSize(frameView->visibleContentRect().size());
    9696#endif
    9797    node->setTotalContentsSize(frameView->totalContentsSize());
  • trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp

    r164358 r165493  
    6262    , m_horizontalScrollbarPainter(stateNode.horizontalScrollbarPainter())
    6363#endif
    64     , m_viewportConstrainedObjectRect(stateNode.viewportConstrainedObjectRect())
     64    , m_viewportSize(stateNode.viewportSize())
    6565    , m_totalContentsSize(stateNode.totalContentsSize())
    6666    , m_scrollPosition(stateNode.scrollPosition())
     
    9999}
    100100
    101 void ScrollingStateScrollingNode::setViewportConstrainedObjectRect(const FloatRect& viewportConstrainedObjectRect)
    102 {
    103     if (m_viewportConstrainedObjectRect == viewportConstrainedObjectRect)
    104         return;
    105 
    106     m_viewportConstrainedObjectRect = viewportConstrainedObjectRect;
    107     setPropertyChanged(ViewportConstrainedObjectRect);
     101void ScrollingStateScrollingNode::setViewportSize(const FloatSize& size)
     102{
     103    if (m_viewportSize == size)
     104        return;
     105
     106    m_viewportSize = size;
     107    setPropertyChanged(ViewportSize);
    108108}
    109109
     
    262262    ts << "(" << "Scrolling node" << "\n";
    263263
    264     if (!m_viewportConstrainedObjectRect.isEmpty()) {
     264    if (!m_viewportSize.isEmpty()) {
    265265        writeIndent(ts, indent + 1);
    266266        ts << "(viewport rect "
    267             << TextStream::FormatNumberRespectingIntegers(m_viewportConstrainedObjectRect.x()) << " "
    268             << TextStream::FormatNumberRespectingIntegers(m_viewportConstrainedObjectRect.y()) << " "
    269             << TextStream::FormatNumberRespectingIntegers(m_viewportConstrainedObjectRect.width()) << " "
    270             << TextStream::FormatNumberRespectingIntegers(m_viewportConstrainedObjectRect.height()) << ")\n";
     267            << TextStream::FormatNumberRespectingIntegers(m_viewportSize.width()) << " "
     268            << TextStream::FormatNumberRespectingIntegers(m_viewportSize.height()) << ")\n";
    271269    }
    272270
  • trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h

    r164358 r165493  
    5151
    5252    enum ChangedProperty {
    53         ViewportConstrainedObjectRect = NumStateNodeBits,
     53        ViewportSize = NumStateNodeBits,
    5454        TotalContentsSize,
    5555        ScrollPosition,
     
    7171    };
    7272
    73     const FloatRect& viewportConstrainedObjectRect() const { return m_viewportConstrainedObjectRect; }
    74     void setViewportConstrainedObjectRect(const FloatRect&);
     73    const FloatSize& viewportSize() const { return m_viewportSize; }
     74    void setViewportSize(const FloatSize&);
    7575
    7676    const IntSize& totalContentsSize() const { return m_totalContentsSize; }
     
    149149#endif
    150150
    151     FloatRect m_viewportConstrainedObjectRect;
     151    FloatSize m_viewportSize;
    152152    IntSize m_totalContentsSize;
    153153    FloatPoint m_scrollPosition;
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp

    r163231 r165493  
    5252    const ScrollingStateScrollingNode& state = toScrollingStateScrollingNode(stateNode);
    5353
    54     if (state.hasChangedProperty(ScrollingStateScrollingNode::ViewportConstrainedObjectRect))
    55         m_viewportConstrainedObjectRect = state.viewportConstrainedObjectRect();
     54    if (state.hasChangedProperty(ScrollingStateScrollingNode::ViewportSize))
     55        m_viewportSize = state.viewportSize();
    5656
    5757    if (state.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)) {
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h

    r165091 r165493  
    6161
    6262    const FloatPoint& scrollPosition() const { return m_scrollPosition; }
    63     const FloatRect& viewportConstrainedObjectRect() const { return m_viewportConstrainedObjectRect; }
     63    const FloatSize& viewportSize() const { return m_viewportSize; }
    6464    const IntSize& totalContentsSize() const { return m_totalContentsSize; }
    6565    const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
     
    8787
    8888private:
    89     FloatRect m_viewportConstrainedObjectRect;
     89    FloatSize m_viewportSize;
    9090    IntSize m_totalContentsSize;
    9191    IntSize m_totalContentsSizeForRubberBand;
  • trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm

    r165484 r165493  
    137137    ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements();
    138138    FloatPoint scrollOffset = position - toIntSize(scrollOrigin());
    139 
    140     FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingIntRect(viewportConstrainedObjectRect()), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
     139    FloatRect viewportRect(FloatPoint(), viewportSize());
     140   
     141    // FIXME: scrollOffsetForFixedPosition() needs to do float math.
     142    FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
    141143    if (m_counterScrollingLayer)
    142144        m_counterScrollingLayer.get().position = FloatPoint(scrollOffsetForFixedChildren);
     
    148150        float horizontalScrollOffsetForBanner = scrollOffsetForFixedChildren.width();
    149151        if (frameScaleFactor() != 1)
    150             horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingIntRect(viewportConstrainedObjectRect()), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
     152            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
    151153
    152154        if (m_headerLayer)
     
    160162        return;
    161163
    162     FloatRect viewportRect = viewportConstrainedObjectRect();
    163164    viewportRect.setLocation(FloatPoint() + scrollOffsetForFixedChildren);
    164165
     
    180181FloatPoint ScrollingTreeScrollingNodeIOS::maximumScrollPosition() const
    181182{
    182     FloatPoint position(totalContentsSizeForRubberBand().width() - viewportConstrainedObjectRect().width(),
    183         totalContentsSizeForRubberBand().height() - viewportConstrainedObjectRect().height());
     183    FloatPoint position(totalContentsSizeForRubberBand().width() - viewportSize().width(),
     184        totalContentsSizeForRubberBand().height() - viewportSize().height());
    184185
    185186    position = position.expandedTo(FloatPoint());
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm

    r165484 r165493  
    128128        setScrollPosition(scrollingStateNode.requestedScrollPosition());
    129129
    130     if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer) || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize) || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ViewportConstrainedObjectRect))
     130    if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer) || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize) || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ViewportSize))
    131131        updateMainFramePinState(scrollPosition());
    132132}
     
    344344    ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements();
    345345    FloatPoint scrollOffset = position - toFloatSize(scrollOrigin());
    346 
    347     FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingIntRect(viewportConstrainedObjectRect()), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
     346    FloatRect viewportRect(FloatPoint(), viewportSize());
     347   
     348    // FIXME: scrollOffsetForFixedPosition() needs to do float math.
     349    FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect),
     350        totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
     351   
    348352    if (m_counterScrollingLayer)
    349353        m_counterScrollingLayer.get().position = FloatPoint(scrollOffsetForFixedChildren);
     
    355359        float horizontalScrollOffsetForBanner = scrollOffsetForFixedChildren.width();
    356360        if (frameScaleFactor() != 1)
    357             horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingIntRect(viewportConstrainedObjectRect()), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
     361            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
    358362
    359363        if (m_headerLayer)
     
    363367            m_footerLayer.get().position = FloatPoint(horizontalScrollOffsetForBanner, totalContentsSize().height() - footerHeight());
    364368    }
    365 
    366     FloatRect viewportRect = viewportConstrainedObjectRect();
    367369
    368370    if (m_verticalScrollbarPainter || m_horizontalScrollbarPainter) {
     
    411413FloatPoint ScrollingTreeScrollingNodeMac::maximumScrollPosition() const
    412414{
    413     FloatPoint position(totalContentsSizeForRubberBand().width() - viewportConstrainedObjectRect().width(),
    414         totalContentsSizeForRubberBand().height() - viewportConstrainedObjectRect().height());
     415    FloatPoint position(totalContentsSizeForRubberBand().width() - viewportSize().width(),
     416        totalContentsSizeForRubberBand().height() - viewportSize().height());
    415417
    416418    position = position.expandedTo(FloatPoint());
     
    467469
    468470    FloatPoint scrollPosition = this->scrollPosition();
    469     unsigned unfilledArea = TileController::blankPixelCountForTiles(tiles, viewportConstrainedObjectRect(), IntPoint(-scrollPosition.x(), -scrollPosition.y()));
     471    FloatRect viewPortRect(scrollPosition, viewportSize());
     472    unsigned unfilledArea = TileController::blankPixelCountForTiles(tiles, viewPortRect, IntPoint(-scrollPosition.x(), -scrollPosition.y()));
    470473
    471474    if (unfilledArea || m_lastScrollHadUnfilledPixels)
  • trunk/Source/WebKit2/ChangeLog

    r165492 r165493  
     12014-03-12  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Have the scrolling tree track the viewport size, not the viewport rect
     4        https://bugs.webkit.org/show_bug.cgi?id=130141
     5
     6        Reviewed by Beth Dakin.
     7
     8        The scrolling tree only needs to know the size of the viewport, not its
     9        origin, since the origin is deduced from the updated scroll position.
     10
     11        * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
     12        (ArgumentCoder<ScrollingStateScrollingNode>::encode):
     13        (ArgumentCoder<ScrollingStateScrollingNode>::decode):
     14
    1152014-03-12  Commit Queue  <commit-queue@webkit.org>
    216
  • trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp

    r163677 r165493  
    109109    encoder << static_cast<const ScrollingStateNode&>(node);
    110110   
    111     SCROLLING_NODE_ENCODE(ViewportConstrainedObjectRect, viewportConstrainedObjectRect)
     111    SCROLLING_NODE_ENCODE(ViewportSize, viewportSize)
    112112    SCROLLING_NODE_ENCODE(TotalContentsSize, totalContentsSize)
    113113    SCROLLING_NODE_ENCODE(ScrollPosition, scrollPosition)
     
    146146        return false;
    147147
    148     SCROLLING_NODE_DECODE(ViewportConstrainedObjectRect, FloatRect, setViewportConstrainedObjectRect);
     148    SCROLLING_NODE_DECODE(ViewportSize, FloatSize, setViewportSize);
    149149    SCROLLING_NODE_DECODE(TotalContentsSize, IntSize, setTotalContentsSize);
    150150    SCROLLING_NODE_DECODE(ScrollPosition, FloatPoint, setScrollPosition);
Note: See TracChangeset for help on using the changeset viewer.