Title: [121586] trunk/Source/WebKit/blackberry
Revision
121586
Author
[email protected]
Date
2012-06-29 14:11:39 -0700 (Fri, 29 Jun 2012)

Log Message

[BlackBerry] Page jumps after post-pinch-zoom re-render
https://bugs.webkit.org/show_bug.cgi?id=90282

Reviewed by Antonio Gomes.
Patch by Jacky Jiang <[email protected]>

PR: 170255
In r120622, we moved ScrollableArea::setConstrainsScrollingToContentEdge(false|true)
from WebPage::setScrollPosition() to BackingStorePrivate::setScrollingOrZooming()
to address an overscroll reset issue.
However, when we are ending bitmap zooming, UI thread can call
BackingStorePrivate::setScrollingOrZooming(false) before WebKit thread
calls WebPage::setScrollPosition(), in which case it will set
ScrollableArea::m_constrainsScrollingToContentEdge to true earlier.
To fix this, we can cache ScrollableArea::m_constrainsScrollingToContentEdge
and always set it to false before we set scroll position in WebKit
thread to avoid scroll position clamping during scrolling, and restore
it to what it was after that.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::setScrollPosition):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (121585 => 121586)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-06-29 20:32:45 UTC (rev 121585)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-06-29 21:11:39 UTC (rev 121586)
@@ -1325,7 +1325,16 @@
         d->m_userPerformedManualScroll = true;
 
     d->m_backingStoreClient->setIsClientGeneratedScroll(true);
+
+    // UI thread can call BackingStorePrivate::setScrollingOrZooming(false) before WebKit thread calls WebPage::setScrollPosition(),
+    // in which case it will set ScrollableArea::m_constrainsScrollingToContentEdge to true earlier.
+    // We can cache ScrollableArea::m_constrainsScrollingToContentEdge and always set it to false before we set scroll position in
+    // WebKit thread to avoid scroll position clamping during scrolling, and restore it to what it was after that.
+    bool constrainsScrollingToContentEdge = d->m_mainFrame->view()->constrainsScrollingToContentEdge();
+    d->m_mainFrame->view()->setConstrainsScrollingToContentEdge(false);
     d->setScrollPosition(d->mapFromTransformed(point));
+    d->m_mainFrame->view()->setConstrainsScrollingToContentEdge(constrainsScrollingToContentEdge);
+
     d->m_backingStoreClient->setIsClientGeneratedScroll(false);
 }
 

Modified: trunk/Source/WebKit/blackberry/ChangeLog (121585 => 121586)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-06-29 20:32:45 UTC (rev 121585)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-06-29 21:11:39 UTC (rev 121586)
@@ -1,3 +1,26 @@
+2012-06-29  Jacky Jiang  <[email protected]>
+
+        [BlackBerry] Page jumps after post-pinch-zoom re-render
+        https://bugs.webkit.org/show_bug.cgi?id=90282
+
+        Reviewed by Antonio Gomes.
+
+        PR: 170255
+        In r120622, we moved ScrollableArea::setConstrainsScrollingToContentEdge(false|true)
+        from WebPage::setScrollPosition() to BackingStorePrivate::setScrollingOrZooming()
+        to address an overscroll reset issue.
+        However, when we are ending bitmap zooming, UI thread can call
+        BackingStorePrivate::setScrollingOrZooming(false) before WebKit thread
+        calls WebPage::setScrollPosition(), in which case it will set
+        ScrollableArea::m_constrainsScrollingToContentEdge to true earlier.
+        To fix this, we can cache ScrollableArea::m_constrainsScrollingToContentEdge
+        and always set it to false before we set scroll position in WebKit
+        thread to avoid scroll position clamping during scrolling, and restore
+        it to what it was after that.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPage::setScrollPosition):
+
 2012-06-29  Jakob Petsovits  <[email protected]>
 
         Add blitVisibleContents() as public API.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to