Fixed a bug where right-to-left frames incorrectly reported that they were pinned...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Apr 2011 00:57:35 +0000 (00:57 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Apr 2011 00:57:35 +0000 (00:57 +0000)
when they were actually not.

Reviewed by Adele Peterson.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didChangeScrollOffsetForMainFrame): Do not assume that the minimum scroll offset
is zero, because it is not.

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index c0190119e68ce0213f31dd1184352da55cc23e7f..6483dcc0a64a88c71c2d5227247dc81f59d02aed 100644 (file)
@@ -1,3 +1,14 @@
+2011-04-08  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        Fixed a bug where right-to-left frames incorrectly reported that they were pinned to the left
+        when they were actually not.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::didChangeScrollOffsetForMainFrame): Do not assume that the minimum scroll offset
+        is zero, because it is not.
+
 2011-04-08  Anders Carlsson  <andersca@apple.com>
 
         Fix the Windows build.
index 752c15f31d2f45210c54403829b7fb5f3cd8330e..5f0eb6273fcc263e750ec65da1cf899d62b2a41d 100644 (file)
@@ -1736,8 +1736,9 @@ void WebPage::didChangeScrollOffsetForMainFrame()
     Frame* frame = m_page->mainFrame();
     IntPoint scrollPosition = frame->view()->scrollPosition();
     IntPoint maximumScrollPosition = frame->view()->maximumScrollPosition();
+    IntPoint minimumScrollPosition = frame->view()->minimumScrollPosition();
 
-    bool isPinnedToLeftSide = (scrollPosition.x() <= 0);
+    bool isPinnedToLeftSide = (scrollPosition.x() <= minimumScrollPosition.x());
     bool isPinnedToRightSide = (scrollPosition.x() >= maximumScrollPosition.x());
 
     if (isPinnedToLeftSide != m_cachedMainFrameIsPinnedToLeftSide || isPinnedToRightSide != m_cachedMainFrameIsPinnedToRightSide) {