Title: [116830] trunk/Source/WebCore
Revision
116830
Author
[email protected]
Date
2012-05-11 17:56:13 -0700 (Fri, 11 May 2012)

Log Message

Comcast website displays bottom of page when loaded
https://bugs.webkit.org/show_bug.cgi?id=86277
<rdar://problem/11426887>

Reviewed by Beth Dakin.

There were two bugs here. The first bug was that FrameView::setScrollPosition didn't end up calling into the scrolling coordinator
to update the scroll position. The second bug was that ScrollingTreeNodeMac::setScrollPosition didn't constrain the scroll position
to the edge of the page.

* page/FrameView.cpp:
(WebCore::FrameView::setScrollPosition):
Call requestScrollPositionUpdate.

* page/scrolling/ScrollingTree.cpp:
* page/scrolling/ScrollingTree.h:
Remove setMainFrameScrollPosition, it is not called by anyone.

* page/scrolling/mac/ScrollingTreeNodeMac.h:
* page/scrolling/mac/ScrollingTreeNodeMac.mm:
(WebCore::ScrollingTreeNodeMac::setScrollPosition):
Clamp to the page size and call setScrollPositionWithoutContentEdgeConstraints.

(WebCore::ScrollingTreeNodeMac::setScrollPositionWithoutContentEdgeConstraints):
Update the scroll layer position and call back to the main thread.

(WebCore::ScrollingTreeNodeMac::scrollBy):
Call setScrollPosition.

(WebCore::ScrollingTreeNodeMac::scrollByWithoutContentEdgeConstraints):
Call setScrollPositionWithoutContentEdgeConstraints.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (116829 => 116830)


--- trunk/Source/WebCore/ChangeLog	2012-05-12 00:42:16 UTC (rev 116829)
+++ trunk/Source/WebCore/ChangeLog	2012-05-12 00:56:13 UTC (rev 116830)
@@ -1,3 +1,37 @@
+2012-05-11  Anders Carlsson  <[email protected]>
+
+        Comcast website displays bottom of page when loaded
+        https://bugs.webkit.org/show_bug.cgi?id=86277
+        <rdar://problem/11426887>
+
+        Reviewed by Beth Dakin.
+
+        There were two bugs here. The first bug was that FrameView::setScrollPosition didn't end up calling into the scrolling coordinator
+        to update the scroll position. The second bug was that ScrollingTreeNodeMac::setScrollPosition didn't constrain the scroll position
+        to the edge of the page.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setScrollPosition):
+        Call requestScrollPositionUpdate.
+
+        * page/scrolling/ScrollingTree.cpp:
+        * page/scrolling/ScrollingTree.h:
+        Remove setMainFrameScrollPosition, it is not called by anyone.
+
+        * page/scrolling/mac/ScrollingTreeNodeMac.h:
+        * page/scrolling/mac/ScrollingTreeNodeMac.mm:
+        (WebCore::ScrollingTreeNodeMac::setScrollPosition):
+        Clamp to the page size and call setScrollPositionWithoutContentEdgeConstraints.
+
+        (WebCore::ScrollingTreeNodeMac::setScrollPositionWithoutContentEdgeConstraints):
+        Update the scroll layer position and call back to the main thread.
+
+        (WebCore::ScrollingTreeNodeMac::scrollBy):
+        Call setScrollPosition.
+
+        (WebCore::ScrollingTreeNodeMac::scrollByWithoutContentEdgeConstraints):
+        Call setScrollPositionWithoutContentEdgeConstraints.
+
 2012-05-11  Gavin Barraclough  <[email protected]>
 
         Introduce PropertyName class

Modified: trunk/Source/WebCore/page/FrameView.cpp (116829 => 116830)


--- trunk/Source/WebCore/page/FrameView.cpp	2012-05-12 00:42:16 UTC (rev 116829)
+++ trunk/Source/WebCore/page/FrameView.cpp	2012-05-12 00:56:13 UTC (rev 116830)
@@ -1704,6 +1704,10 @@
 {
     TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, true);
     m_maintainScrollPositionAnchor = 0;
+
+    if (requestScrollPositionUpdate(scrollPoint))
+        return;
+
     ScrollView::setScrollPosition(scrollPoint);
 }
 

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (116829 => 116830)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2012-05-12 00:42:16 UTC (rev 116829)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2012-05-12 00:56:13 UTC (rev 116830)
@@ -97,13 +97,6 @@
     m_rootNode->handleWheelEvent(wheelEvent);
 }
 
-void ScrollingTree::setMainFrameScrollPosition(const IntPoint& scrollPosition)
-{
-    ASSERT(ScrollingThread::isCurrentThread());
-
-    m_rootNode->setScrollPosition(scrollPosition);
-}
-
 static void derefScrollingCoordinator(ScrollingCoordinator* scrollingCoordinator)
 {
     ASSERT(isMainThread());

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (116829 => 116830)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h	2012-05-12 00:42:16 UTC (rev 116829)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h	2012-05-12 00:56:13 UTC (rev 116830)
@@ -75,8 +75,6 @@
     // Must be called from the scrolling thread. Handles the wheel event.
     void handleWheelEvent(const PlatformWheelEvent&);
 
-    void setMainFrameScrollPosition(const IntPoint&);
-
     void invalidate();
     void commitNewTreeState(PassOwnPtr<ScrollingTreeState>);
 

Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.h (116829 => 116830)


--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.h	2012-05-12 00:42:16 UTC (rev 116829)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.h	2012-05-12 00:56:13 UTC (rev 116830)
@@ -45,7 +45,6 @@
     // ScrollingTreeNode member functions.
     virtual void update(ScrollingTreeState*) OVERRIDE;
     virtual void handleWheelEvent(const PlatformWheelEvent&) OVERRIDE;
-    virtual void setScrollPosition(const IntPoint&) OVERRIDE;
 
     // ScrollElasticityController member functions.
     virtual bool allowsHorizontalStretching() OVERRIDE;
@@ -62,6 +61,9 @@
     virtual void stopSnapRubberbandTimer() OVERRIDE;
 
     IntPoint scrollPosition() const;
+    void setScrollPosition(const IntPoint&);
+    void setScrollPositionWithoutContentEdgeConstraints(const IntPoint&);
+
     void setScrollLayerPosition(const IntPoint&);
 
     IntPoint minimumScrollPosition() const;

Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm (116829 => 116830)


--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm	2012-05-12 00:42:16 UTC (rev 116829)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm	2012-05-12 00:56:13 UTC (rev 116830)
@@ -85,20 +85,6 @@
     scrollingTree()->handleWheelEventPhase(wheelEvent.phase());
 }
 
-void ScrollingTreeNodeMac::setScrollPosition(const IntPoint& scrollPosition)
-{
-    updateMainFramePinState(scrollPosition);
-
-    if (shouldUpdateScrollLayerPositionOnMainThread()) {
-        m_probableMainThreadScrollPosition = scrollPosition;
-        scrollingTree()->updateMainFrameScrollPositionAndScrollLayerPosition(scrollPosition);
-        return;
-    }
-
-    setScrollLayerPosition(scrollPosition);
-    scrollingTree()->updateMainFrameScrollPosition(scrollPosition);
-}
-
 bool ScrollingTreeNodeMac::allowsHorizontalStretching()
 {
     switch (horizontalScrollElasticity()) {
@@ -240,6 +226,29 @@
     return IntPoint(-scrollLayerPosition.x + scrollOrigin().x(), -scrollLayerPosition.y + scrollOrigin().y());
 }
 
+void ScrollingTreeNodeMac::setScrollPosition(const IntPoint& scrollPosition)
+{
+    IntPoint newScrollPosition = scrollPosition;
+    newScrollPosition = newScrollPosition.shrunkTo(maximumScrollPosition());
+    newScrollPosition = newScrollPosition.expandedTo(minimumScrollPosition());
+
+    setScrollPositionWithoutContentEdgeConstraints(newScrollPosition);
+}
+
+void ScrollingTreeNodeMac::setScrollPositionWithoutContentEdgeConstraints(const IntPoint& scrollPosition)
+{
+    updateMainFramePinState(scrollPosition);
+
+    if (shouldUpdateScrollLayerPositionOnMainThread()) {
+        m_probableMainThreadScrollPosition = scrollPosition;
+        scrollingTree()->updateMainFrameScrollPositionAndScrollLayerPosition(scrollPosition);
+        return;
+    }
+
+    setScrollLayerPosition(scrollPosition);
+    scrollingTree()->updateMainFrameScrollPosition(scrollPosition);
+}
+
 void ScrollingTreeNodeMac::setScrollLayerPosition(const IntPoint& position)
 {
     ASSERT(!shouldUpdateScrollLayerPositionOnMainThread());
@@ -263,16 +272,12 @@
 
 void ScrollingTreeNodeMac::scrollBy(const IntSize& offset)
 {
-    IntPoint newScrollPosition = scrollPosition() + offset;
-    newScrollPosition = newScrollPosition.shrunkTo(maximumScrollPosition());
-    newScrollPosition = newScrollPosition.expandedTo(minimumScrollPosition());
-
-    setScrollPosition(newScrollPosition);
+    setScrollPosition(scrollPosition() + offset);
 }
 
 void ScrollingTreeNodeMac::scrollByWithoutContentEdgeConstraints(const IntSize& offset)
 {
-    setScrollPosition(scrollPosition() + offset);
+    setScrollPositionWithoutContentEdgeConstraints(scrollPosition() + offset);
 }
 
 void ScrollingTreeNodeMac::updateMainFramePinState(const IntPoint& scrollPosition)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to