Have the scrolling tree track the viewport size, not the viewport rect
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Mar 2014 18:55:53 +0000 (18:55 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Mar 2014 18:55:53 +0000 (18:55 +0000)
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165493 268f45cc-cd09-0410-ab3c-d52691b4dbfc

28 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/tiled-drawing/clamp-out-of-bounds-scrolls-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/absolute-inside-fixed-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/absolute-inside-out-of-view-fixed-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/fixed-in-overflow-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-negative-zindex-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/four-bars-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/four-bars-with-header-and-footer-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-in-view-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/nested-fixed-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/percentage-inside-fixed-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling-tree-after-scroll-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling-tree-slow-scrolling-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/sticky/negative-scroll-offset-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/sticky/sticky-horizontal-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm
Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp

index b4bbc58..d208d1c 100644 (file)
@@ -1,5 +1,34 @@
 2014-03-12  Simon Fraser  <simon.fraser@apple.com>
 
 2014-03-12  Simon Fraser  <simon.fraser@apple.com>
 
+        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.
+
+        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:
+
+2014-03-12  Simon Fraser  <simon.fraser@apple.com>
+
         Change scrollOffsetForFixedPosition() to do LayoutUnit math
         https://bugs.webkit.org/show_bug.cgi?id=129981
 
         Change scrollOffsetForFixedPosition() to do LayoutUnit math
         https://bugs.webkit.org/show_bug.cgi?id=129981
 
index 8d64d71..4213027 100644 (file)
@@ -1,38 +1,38 @@
 Attempted scroll to -5000, 0
 (Scrolling node
 Attempted scroll to -5000, 0
 (Scrolling node
-  (viewport rect 0 0 785 585)
+  (viewport rect 785 585)
   (contents size 5008 5021)
 )
 
 Attempted scroll to 0, -5000
 (Scrolling node
   (contents size 5008 5021)
 )
 
 Attempted scroll to 0, -5000
 (Scrolling node
-  (viewport rect 0 0 785 585)
+  (viewport rect 785 585)
   (contents size 5008 5021)
 )
 
 Attempted scroll to -5000, -5000
 (Scrolling node
   (contents size 5008 5021)
 )
 
 Attempted scroll to -5000, -5000
 (Scrolling node
-  (viewport rect 0 0 785 585)
+  (viewport rect 785 585)
   (contents size 5008 5021)
 )
 
 Attempted scroll to 10000, 0
 (Scrolling node
   (contents size 5008 5021)
 )
 
 Attempted scroll to 10000, 0
 (Scrolling node
-  (viewport rect 0 0 785 585)
+  (viewport rect 785 585)
   (contents size 5008 5021)
   (requested scroll position 4223 0)
 )
 
 Attempted scroll to 0, 10000
 (Scrolling node
   (contents size 5008 5021)
   (requested scroll position 4223 0)
 )
 
 Attempted scroll to 0, 10000
 (Scrolling node
-  (viewport rect 0 0 785 585)
+  (viewport rect 785 585)
   (contents size 5008 5021)
   (requested scroll position 0 4436)
 )
 
 Attempted scroll to 10000, 10000
 (Scrolling node
   (contents size 5008 5021)
   (requested scroll position 0 4436)
 )
 
 Attempted scroll to 10000, 10000
 (Scrolling node
-  (viewport rect 0 0 785 585)
+  (viewport rect 785 585)
   (contents size 5008 5021)
   (requested scroll position 4223 4436)
 )
   (contents size 5008 5021)
   (requested scroll position 4223 4436)
 )
index 1ceadec..52be7b8 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 785 600)
+  (viewport rect 785 600)
   (contents size 785 2710)
   (requested scroll position 0 200)
   (children 1
   (contents size 785 2710)
   (requested scroll position 0 200)
   (children 1
index f8227bc..f88d628 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 785 600)
+  (viewport rect 785 600)
   (contents size 785 2513)
   (requested scroll position 0 200)
   (children 1
   (contents size 785 2513)
   (requested scroll position 0 200)
   (children 1
index 6da5054..9583eea 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 785 600)
+  (viewport rect 785 600)
   (contents size 785 2213)
   (requested scroll position 0 200)
   (children 1
   (contents size 785 2213)
   (requested scroll position 0 200)
   (children 1
index 2a20f73..6acbe84 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 785 600)
+  (viewport rect 785 600)
   (contents size 785 1021)
   (children 1
     (Fixed node
   (contents size 785 1021)
   (children 1
     (Fixed node
index 2a20f73..6acbe84 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 785 600)
+  (viewport rect 785 600)
   (contents size 785 1021)
   (children 1
     (Fixed node
   (contents size 785 1021)
   (children 1
     (Fixed node
index 95e5d19..259d293 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 785 600)
+  (viewport rect 785 600)
   (contents size 785 2221)
   (requested scroll position 0 200)
   (children 4
   (contents size 785 2221)
   (requested scroll position 0 200)
   (children 4
index 1ab7661..912d625 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 785 600)
+  (viewport rect 785 600)
   (contents size 785 2421)
   (requested scroll position 0 200)
   (children 4
   (contents size 785 2421)
   (requested scroll position 0 200)
   (children 4
index e9302b2..eb90191 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 785 600)
+  (viewport rect 785 600)
   (contents size 785 2221)
   (children 1
     (Fixed node
   (contents size 785 2221)
   (children 1
     (Fixed node
index 5e4156b..40c9ad5 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 785 600)
+  (viewport rect 785 600)
   (contents size 785 2221)
   (children 1
     (Fixed node
   (contents size 785 2221)
   (children 1
     (Fixed node
index 3fd5fdd..cbe2ca6 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 785 600)
+  (viewport rect 785 600)
   (contents size 785 2213)
   (requested scroll position 0 200)
   (children 1
   (contents size 785 2213)
   (requested scroll position 0 200)
   (children 1
index 6a96107..3b7f06b 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 785 600)
+  (viewport rect 785 600)
   (contents size 785 2513)
   (requested scroll position 0 200)
   (children 1
   (contents size 785 2513)
   (requested scroll position 0 200)
   (children 1
index d2abf04..8905af7 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 785 600)
+  (viewport rect 785 600)
   (contents size 785 5021)
   (requested scroll position 0 3000)
 )
   (contents size 785 5021)
   (requested scroll position 0 3000)
 )
index 32ef0ce..fe2ba3d 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 800 600)
+  (viewport rect 800 600)
   (contents size 800 600)
   (Scrolling on main thread because: Has slow repaint objects)
 )
   (contents size 800 600)
   (Scrolling on main thread because: Has slow repaint objects)
 )
index cfaa507..5d7697e 100644 (file)
@@ -1,5 +1,5 @@
 (Scrolling node
 (Scrolling node
-  (viewport rect 0 0 785 600)
+  (viewport rect 785 600)
   (contents size 785 2216)
   (children 1
     (Sticky node
   (contents size 785 2216)
   (children 1
     (Sticky node
index 5e8f5aa..d7827c0 100644 (file)
@@ -1,6 +1,6 @@
 Left sticky Right sticky Left % sticky Right % sticky Left and Right Left and Right %
 (Scrolling node
 Left sticky Right sticky Left % sticky Right % sticky Left and Right Left and Right %
 (Scrolling node
-  (viewport rect 0 0 800 585)
+  (viewport rect 800 585)
   (contents size 2008 585)
   (requested scroll position 800 0)
   (children 6
   (contents size 2008 585)
   (requested scroll position 800 0)
   (children 6
index 7940b32..c58fba8 100644 (file)
@@ -1,5 +1,36 @@
 2014-03-12  Simon Fraser  <simon.fraser@apple.com>
 
 2014-03-12  Simon Fraser  <simon.fraser@apple.com>
 
+        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.
+
+        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):
+
+2014-03-12  Simon Fraser  <simon.fraser@apple.com>
+
         Spelling is hard
         https://bugs.webkit.org/show_bug.cgi?id=130146
 
         Spelling is hard
         https://bugs.webkit.org/show_bug.cgi?id=130146
 
index 332826f..6d903fd 100644 (file)
@@ -2755,6 +2755,7 @@ __ZN7WebCore27ScrollingStateScrollingNode14setHeaderLayerERKNS_19LayerRepresenta
 __ZN7WebCore27ScrollingStateScrollingNode15setFooterHeightEi
 __ZN7WebCore27ScrollingStateScrollingNode15setHeaderHeightEi
 __ZN7WebCore27ScrollingStateScrollingNode15setScrollOriginERKNS_8IntPointE
 __ZN7WebCore27ScrollingStateScrollingNode15setFooterHeightEi
 __ZN7WebCore27ScrollingStateScrollingNode15setHeaderHeightEi
 __ZN7WebCore27ScrollingStateScrollingNode15setScrollOriginERKNS_8IntPointE
+__ZN7WebCore27ScrollingStateScrollingNode15setViewportSizeERKNS_9FloatSizeE
 __ZN7WebCore27ScrollingStateScrollingNode17setScrollPositionERKNS_10FloatPointE
 __ZN7WebCore27ScrollingStateScrollingNode19setFrameScaleFactorEf
 __ZN7WebCore27ScrollingStateScrollingNode20setTotalContentsSizeERKNS_7IntSizeE
 __ZN7WebCore27ScrollingStateScrollingNode17setScrollPositionERKNS_10FloatPointE
 __ZN7WebCore27ScrollingStateScrollingNode19setFrameScaleFactorEf
 __ZN7WebCore27ScrollingStateScrollingNode20setTotalContentsSizeERKNS_7IntSizeE
@@ -2765,7 +2766,6 @@ __ZN7WebCore27ScrollingStateScrollingNode26setNonFastScrollableRegionERKNS_6Regi
 __ZN7WebCore27ScrollingStateScrollingNode26setRequestedScrollPositionERKNS_10FloatPointEb
 __ZN7WebCore27ScrollingStateScrollingNode27setScrollableAreaParametersERKNS_24ScrollableAreaParametersE
 __ZN7WebCore27ScrollingStateScrollingNode30setSynchronousScrollingReasonsEj
 __ZN7WebCore27ScrollingStateScrollingNode26setRequestedScrollPositionERKNS_10FloatPointEb
 __ZN7WebCore27ScrollingStateScrollingNode27setScrollableAreaParametersERKNS_24ScrollableAreaParametersE
 __ZN7WebCore27ScrollingStateScrollingNode30setSynchronousScrollingReasonsEj
-__ZN7WebCore27ScrollingStateScrollingNode32setViewportConstrainedObjectRectERKNS_9FloatRectE
 __ZN7WebCore27ScrollingStateScrollingNode33setScrollBehaviorForFixedElementsENS_30ScrollBehaviorForFixedElementsE
 __ZNK7WebCore25AsyncScrollingCoordinator24scrollingStateTreeAsTextEv
 #endif
 __ZN7WebCore27ScrollingStateScrollingNode33setScrollBehaviorForFixedElementsENS_30ScrollBehaviorForFixedElementsE
 __ZNK7WebCore25AsyncScrollingCoordinator24scrollingStateTreeAsTextEv
 #endif
index 30f7778..87508c7 100644 (file)
@@ -90,9 +90,9 @@ void AsyncScrollingCoordinator::frameViewLayoutUpdated(FrameView* frameView)
 
     node->setScrollOrigin(frameView->scrollOrigin());
 #if PLATFORM(IOS)
 
     node->setScrollOrigin(frameView->scrollOrigin());
 #if PLATFORM(IOS)
-    node->setViewportConstrainedObjectRect(FloatRect(FloatPoint(), frameView->viewportConstrainedVisibleContentRect().size()));
+    node->setViewportSize(frameView->viewportConstrainedVisibleContentRect().size());
 #else
 #else
-    node->setViewportConstrainedObjectRect(FloatRect(FloatPoint(), frameView->visibleContentRect().size()));
+    node->setViewportSize(frameView->visibleContentRect().size());
 #endif
     node->setTotalContentsSize(frameView->totalContentsSize());
 
 #endif
     node->setTotalContentsSize(frameView->totalContentsSize());
 
index 64885af..a04eec5 100644 (file)
@@ -61,7 +61,7 @@ ScrollingStateScrollingNode::ScrollingStateScrollingNode(const ScrollingStateScr
     , m_verticalScrollbarPainter(stateNode.verticalScrollbarPainter())
     , m_horizontalScrollbarPainter(stateNode.horizontalScrollbarPainter())
 #endif
     , m_verticalScrollbarPainter(stateNode.verticalScrollbarPainter())
     , m_horizontalScrollbarPainter(stateNode.horizontalScrollbarPainter())
 #endif
-    , m_viewportConstrainedObjectRect(stateNode.viewportConstrainedObjectRect())
+    , m_viewportSize(stateNode.viewportSize())
     , m_totalContentsSize(stateNode.totalContentsSize())
     , m_scrollPosition(stateNode.scrollPosition())
     , m_scrollOrigin(stateNode.scrollOrigin())
     , m_totalContentsSize(stateNode.totalContentsSize())
     , m_scrollPosition(stateNode.scrollPosition())
     , m_scrollOrigin(stateNode.scrollOrigin())
@@ -98,13 +98,13 @@ PassOwnPtr<ScrollingStateNode> ScrollingStateScrollingNode::clone(ScrollingState
     return adoptPtr(new ScrollingStateScrollingNode(*this, adoptiveTree));
 }
 
     return adoptPtr(new ScrollingStateScrollingNode(*this, adoptiveTree));
 }
 
-void ScrollingStateScrollingNode::setViewportConstrainedObjectRect(const FloatRect& viewportConstrainedObjectRect)
+void ScrollingStateScrollingNode::setViewportSize(const FloatSize& size)
 {
 {
-    if (m_viewportConstrainedObjectRect == viewportConstrainedObjectRect)
+    if (m_viewportSize == size)
         return;
 
         return;
 
-    m_viewportConstrainedObjectRect = viewportConstrainedObjectRect;
-    setPropertyChanged(ViewportConstrainedObjectRect);
+    m_viewportSize = size;
+    setPropertyChanged(ViewportSize);
 }
 
 void ScrollingStateScrollingNode::setTotalContentsSize(const IntSize& totalContentsSize)
 }
 
 void ScrollingStateScrollingNode::setTotalContentsSize(const IntSize& totalContentsSize)
@@ -261,13 +261,11 @@ void ScrollingStateScrollingNode::dumpProperties(TextStream& ts, int indent) con
 {
     ts << "(" << "Scrolling node" << "\n";
 
 {
     ts << "(" << "Scrolling node" << "\n";
 
-    if (!m_viewportConstrainedObjectRect.isEmpty()) {
+    if (!m_viewportSize.isEmpty()) {
         writeIndent(ts, indent + 1);
         ts << "(viewport rect "
         writeIndent(ts, indent + 1);
         ts << "(viewport rect "
-            << TextStream::FormatNumberRespectingIntegers(m_viewportConstrainedObjectRect.x()) << " "
-            << TextStream::FormatNumberRespectingIntegers(m_viewportConstrainedObjectRect.y()) << " "
-            << TextStream::FormatNumberRespectingIntegers(m_viewportConstrainedObjectRect.width()) << " "
-            << TextStream::FormatNumberRespectingIntegers(m_viewportConstrainedObjectRect.height()) << ")\n";
+            << TextStream::FormatNumberRespectingIntegers(m_viewportSize.width()) << " "
+            << TextStream::FormatNumberRespectingIntegers(m_viewportSize.height()) << ")\n";
     }
 
     if (m_scrollPosition != FloatPoint()) {
     }
 
     if (m_scrollPosition != FloatPoint()) {
index eb8e63d..b24d86b 100644 (file)
@@ -50,7 +50,7 @@ public:
     virtual ~ScrollingStateScrollingNode();
 
     enum ChangedProperty {
     virtual ~ScrollingStateScrollingNode();
 
     enum ChangedProperty {
-        ViewportConstrainedObjectRect = NumStateNodeBits,
+        ViewportSize = NumStateNodeBits,
         TotalContentsSize,
         ScrollPosition,
         ScrollOrigin,
         TotalContentsSize,
         ScrollPosition,
         ScrollOrigin,
@@ -70,8 +70,8 @@ public:
         BehaviorForFixedElements
     };
 
         BehaviorForFixedElements
     };
 
-    const FloatRect& viewportConstrainedObjectRect() const { return m_viewportConstrainedObjectRect; }
-    void setViewportConstrainedObjectRect(const FloatRect&);
+    const FloatSize& viewportSize() const { return m_viewportSize; }
+    void setViewportSize(const FloatSize&);
 
     const IntSize& totalContentsSize() const { return m_totalContentsSize; }
     void setTotalContentsSize(const IntSize&);
 
     const IntSize& totalContentsSize() const { return m_totalContentsSize; }
     void setTotalContentsSize(const IntSize&);
@@ -148,7 +148,7 @@ private:
     RetainPtr<ScrollbarPainter> m_horizontalScrollbarPainter;
 #endif
 
     RetainPtr<ScrollbarPainter> m_horizontalScrollbarPainter;
 #endif
 
-    FloatRect m_viewportConstrainedObjectRect;
+    FloatSize m_viewportSize;
     IntSize m_totalContentsSize;
     FloatPoint m_scrollPosition;
     IntPoint m_scrollOrigin;
     IntSize m_totalContentsSize;
     FloatPoint m_scrollPosition;
     IntPoint m_scrollOrigin;
index 3872aec..31a7174 100644 (file)
@@ -51,8 +51,8 @@ void ScrollingTreeScrollingNode::updateBeforeChildren(const ScrollingStateNode&
 {
     const ScrollingStateScrollingNode& state = toScrollingStateScrollingNode(stateNode);
 
 {
     const ScrollingStateScrollingNode& state = toScrollingStateScrollingNode(stateNode);
 
-    if (state.hasChangedProperty(ScrollingStateScrollingNode::ViewportConstrainedObjectRect))
-        m_viewportConstrainedObjectRect = state.viewportConstrainedObjectRect();
+    if (state.hasChangedProperty(ScrollingStateScrollingNode::ViewportSize))
+        m_viewportSize = state.viewportSize();
 
     if (state.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)) {
         if (scrollingTree().isRubberBandInProgress())
 
     if (state.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)) {
         if (scrollingTree().isRubberBandInProgress())
index 20feea0..8ff3fc7 100644 (file)
@@ -60,7 +60,7 @@ protected:
     ScrollingTreeScrollingNode(ScrollingTree&, ScrollingNodeID);
 
     const FloatPoint& scrollPosition() const { return m_scrollPosition; }
     ScrollingTreeScrollingNode(ScrollingTree&, ScrollingNodeID);
 
     const FloatPoint& scrollPosition() const { return m_scrollPosition; }
-    const FloatRect& viewportConstrainedObjectRect() const { return m_viewportConstrainedObjectRect; }
+    const FloatSize& viewportSize() const { return m_viewportSize; }
     const IntSize& totalContentsSize() const { return m_totalContentsSize; }
     const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
 
     const IntSize& totalContentsSize() const { return m_totalContentsSize; }
     const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
 
@@ -86,7 +86,7 @@ protected:
     ScrollBehaviorForFixedElements scrollBehaviorForFixedElements() const { return m_behaviorForFixed; }
 
 private:
     ScrollBehaviorForFixedElements scrollBehaviorForFixedElements() const { return m_behaviorForFixed; }
 
 private:
-    FloatRect m_viewportConstrainedObjectRect;
+    FloatSize m_viewportSize;
     IntSize m_totalContentsSize;
     IntSize m_totalContentsSizeForRubberBand;
     FloatPoint m_scrollPosition;
     IntSize m_totalContentsSize;
     IntSize m_totalContentsSizeForRubberBand;
     FloatPoint m_scrollPosition;
index b8e1a44..2c5d75c 100644 (file)
@@ -136,8 +136,10 @@ void ScrollingTreeScrollingNodeIOS::setScrollLayerPosition(const FloatPoint& pos
 
     ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements();
     FloatPoint scrollOffset = position - toIntSize(scrollOrigin());
 
     ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements();
     FloatPoint scrollOffset = position - toIntSize(scrollOrigin());
-
-    FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingIntRect(viewportConstrainedObjectRect()), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
+    FloatRect viewportRect(FloatPoint(), viewportSize());
+    
+    // FIXME: scrollOffsetForFixedPosition() needs to do float math.
+    FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
     if (m_counterScrollingLayer)
         m_counterScrollingLayer.get().position = FloatPoint(scrollOffsetForFixedChildren);
 
     if (m_counterScrollingLayer)
         m_counterScrollingLayer.get().position = FloatPoint(scrollOffsetForFixedChildren);
 
@@ -147,7 +149,7 @@ void ScrollingTreeScrollingNodeIOS::setScrollLayerPosition(const FloatPoint& pos
         // then we should recompute scrollOffsetForFixedChildren for the banner with a scale factor of 1.
         float horizontalScrollOffsetForBanner = scrollOffsetForFixedChildren.width();
         if (frameScaleFactor() != 1)
         // then we should recompute scrollOffsetForFixedChildren for the banner with a scale factor of 1.
         float horizontalScrollOffsetForBanner = scrollOffsetForFixedChildren.width();
         if (frameScaleFactor() != 1)
-            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingIntRect(viewportConstrainedObjectRect()), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
+            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
 
         if (m_headerLayer)
             m_headerLayer.get().position = FloatPoint(horizontalScrollOffsetForBanner, 0);
 
         if (m_headerLayer)
             m_headerLayer.get().position = FloatPoint(horizontalScrollOffsetForBanner, 0);
@@ -159,7 +161,6 @@ void ScrollingTreeScrollingNodeIOS::setScrollLayerPosition(const FloatPoint& pos
     if (!m_children)
         return;
 
     if (!m_children)
         return;
 
-    FloatRect viewportRect = viewportConstrainedObjectRect();
     viewportRect.setLocation(FloatPoint() + scrollOffsetForFixedChildren);
 
     size_t size = m_children->size();
     viewportRect.setLocation(FloatPoint() + scrollOffsetForFixedChildren);
 
     size_t size = m_children->size();
@@ -179,8 +180,8 @@ FloatPoint ScrollingTreeScrollingNodeIOS::minimumScrollPosition() const
 
 FloatPoint ScrollingTreeScrollingNodeIOS::maximumScrollPosition() const
 {
 
 FloatPoint ScrollingTreeScrollingNodeIOS::maximumScrollPosition() const
 {
-    FloatPoint position(totalContentsSizeForRubberBand().width() - viewportConstrainedObjectRect().width(),
-        totalContentsSizeForRubberBand().height() - viewportConstrainedObjectRect().height());
+    FloatPoint position(totalContentsSizeForRubberBand().width() - viewportSize().width(),
+        totalContentsSizeForRubberBand().height() - viewportSize().height());
 
     position = position.expandedTo(FloatPoint());
 
 
     position = position.expandedTo(FloatPoint());
 
index d58aed6..9e4ff45 100644 (file)
@@ -127,7 +127,7 @@ void ScrollingTreeScrollingNodeMac::updateAfterChildren(const ScrollingStateNode
     if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
         setScrollPosition(scrollingStateNode.requestedScrollPosition());
 
     if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
         setScrollPosition(scrollingStateNode.requestedScrollPosition());
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer) || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize) || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ViewportConstrainedObjectRect))
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer) || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize) || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ViewportSize))
         updateMainFramePinState(scrollPosition());
 }
 
         updateMainFramePinState(scrollPosition());
 }
 
@@ -343,8 +343,12 @@ void ScrollingTreeScrollingNodeMac::setScrollLayerPosition(const FloatPoint& pos
 
     ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements();
     FloatPoint scrollOffset = position - toFloatSize(scrollOrigin());
 
     ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements();
     FloatPoint scrollOffset = position - toFloatSize(scrollOrigin());
-
-    FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingIntRect(viewportConstrainedObjectRect()), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
+    FloatRect viewportRect(FloatPoint(), viewportSize());
+    
+    // FIXME: scrollOffsetForFixedPosition() needs to do float math.
+    FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect),
+        totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
+    
     if (m_counterScrollingLayer)
         m_counterScrollingLayer.get().position = FloatPoint(scrollOffsetForFixedChildren);
 
     if (m_counterScrollingLayer)
         m_counterScrollingLayer.get().position = FloatPoint(scrollOffsetForFixedChildren);
 
@@ -354,7 +358,7 @@ void ScrollingTreeScrollingNodeMac::setScrollLayerPosition(const FloatPoint& pos
         // then we should recompute scrollOffsetForFixedChildren for the banner with a scale factor of 1.
         float horizontalScrollOffsetForBanner = scrollOffsetForFixedChildren.width();
         if (frameScaleFactor() != 1)
         // then we should recompute scrollOffsetForFixedChildren for the banner with a scale factor of 1.
         float horizontalScrollOffsetForBanner = scrollOffsetForFixedChildren.width();
         if (frameScaleFactor() != 1)
-            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingIntRect(viewportConstrainedObjectRect()), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
+            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
 
         if (m_headerLayer)
             m_headerLayer.get().position = FloatPoint(horizontalScrollOffsetForBanner, 0);
 
         if (m_headerLayer)
             m_headerLayer.get().position = FloatPoint(horizontalScrollOffsetForBanner, 0);
@@ -363,8 +367,6 @@ void ScrollingTreeScrollingNodeMac::setScrollLayerPosition(const FloatPoint& pos
             m_footerLayer.get().position = FloatPoint(horizontalScrollOffsetForBanner, totalContentsSize().height() - footerHeight());
     }
 
             m_footerLayer.get().position = FloatPoint(horizontalScrollOffsetForBanner, totalContentsSize().height() - footerHeight());
     }
 
-    FloatRect viewportRect = viewportConstrainedObjectRect();
-
     if (m_verticalScrollbarPainter || m_horizontalScrollbarPainter) {
         [CATransaction begin];
         [CATransaction lock];
     if (m_verticalScrollbarPainter || m_horizontalScrollbarPainter) {
         [CATransaction begin];
         [CATransaction lock];
@@ -410,8 +412,8 @@ FloatPoint ScrollingTreeScrollingNodeMac::minimumScrollPosition() const
 
 FloatPoint ScrollingTreeScrollingNodeMac::maximumScrollPosition() const
 {
 
 FloatPoint ScrollingTreeScrollingNodeMac::maximumScrollPosition() const
 {
-    FloatPoint position(totalContentsSizeForRubberBand().width() - viewportConstrainedObjectRect().width(),
-        totalContentsSizeForRubberBand().height() - viewportConstrainedObjectRect().height());
+    FloatPoint position(totalContentsSizeForRubberBand().width() - viewportSize().width(),
+        totalContentsSizeForRubberBand().height() - viewportSize().height());
 
     position = position.expandedTo(FloatPoint());
 
 
     position = position.expandedTo(FloatPoint());
 
@@ -466,7 +468,8 @@ void ScrollingTreeScrollingNodeMac::logExposedUnfilledArea()
     }
 
     FloatPoint scrollPosition = this->scrollPosition();
     }
 
     FloatPoint scrollPosition = this->scrollPosition();
-    unsigned unfilledArea = TileController::blankPixelCountForTiles(tiles, viewportConstrainedObjectRect(), IntPoint(-scrollPosition.x(), -scrollPosition.y()));
+    FloatRect viewPortRect(scrollPosition, viewportSize());
+    unsigned unfilledArea = TileController::blankPixelCountForTiles(tiles, viewPortRect, IntPoint(-scrollPosition.x(), -scrollPosition.y()));
 
     if (unfilledArea || m_lastScrollHadUnfilledPixels)
         WTFLogAlways("SCROLLING: Exposed tileless area. Time: %f Unfilled Pixels: %u\n", WTF::monotonicallyIncreasingTime(), unfilledArea);
 
     if (unfilledArea || m_lastScrollHadUnfilledPixels)
         WTFLogAlways("SCROLLING: Exposed tileless area. Time: %f Unfilled Pixels: %u\n", WTF::monotonicallyIncreasingTime(), unfilledArea);
index 2aa6941..8f1dd36 100644 (file)
@@ -1,3 +1,17 @@
+2014-03-12  Simon Fraser  <simon.fraser@apple.com>
+
+        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.
+
+        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):
+
 2014-03-12  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r165481.
 2014-03-12  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r165481.
index b089a10..23cc468 100644 (file)
@@ -108,7 +108,7 @@ void ArgumentCoder<ScrollingStateScrollingNode>::encode(ArgumentEncoder& encoder
 {
     encoder << static_cast<const ScrollingStateNode&>(node);
     
 {
     encoder << static_cast<const ScrollingStateNode&>(node);
     
-    SCROLLING_NODE_ENCODE(ViewportConstrainedObjectRect, viewportConstrainedObjectRect)
+    SCROLLING_NODE_ENCODE(ViewportSize, viewportSize)
     SCROLLING_NODE_ENCODE(TotalContentsSize, totalContentsSize)
     SCROLLING_NODE_ENCODE(ScrollPosition, scrollPosition)
     SCROLLING_NODE_ENCODE(ScrollOrigin, scrollOrigin)
     SCROLLING_NODE_ENCODE(TotalContentsSize, totalContentsSize)
     SCROLLING_NODE_ENCODE(ScrollPosition, scrollPosition)
     SCROLLING_NODE_ENCODE(ScrollOrigin, scrollOrigin)
@@ -145,7 +145,7 @@ bool ArgumentCoder<ScrollingStateScrollingNode>::decode(ArgumentDecoder& decoder
     if (!decoder.decode(static_cast<ScrollingStateNode&>(node)))
         return false;
 
     if (!decoder.decode(static_cast<ScrollingStateNode&>(node)))
         return false;
 
-    SCROLLING_NODE_DECODE(ViewportConstrainedObjectRect, FloatRect, setViewportConstrainedObjectRect);
+    SCROLLING_NODE_DECODE(ViewportSize, FloatSize, setViewportSize);
     SCROLLING_NODE_DECODE(TotalContentsSize, IntSize, setTotalContentsSize);
     SCROLLING_NODE_DECODE(ScrollPosition, FloatPoint, setScrollPosition);
     SCROLLING_NODE_DECODE(ScrollOrigin, IntPoint, setScrollOrigin);
     SCROLLING_NODE_DECODE(TotalContentsSize, IntSize, setTotalContentsSize);
     SCROLLING_NODE_DECODE(ScrollPosition, FloatPoint, setScrollPosition);
     SCROLLING_NODE_DECODE(ScrollOrigin, IntPoint, setScrollOrigin);