Title: [136157] trunk/Source/WebKit/blackberry
Revision
136157
Author
[email protected]
Date
2012-11-29 13:25:25 -0800 (Thu, 29 Nov 2012)

Log Message

[BlackBerry] Do not adjust scroll position on viewport resizes that are not orientation change related
https://bugs.webkit.org/show_bug.cgi?id=103659

Patch by Andrew Lo <[email protected]> on 2012-11-29
Reviewed by Rob Buis.
Internally reviewed by Gen Mak.

Internal PR253893.
Only adjust scroll position during an orientation change
when setting viewport size.
We don't want the scroll position jumping around when opening
& closing the VKB.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::setViewportSize):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (136156 => 136157)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-11-29 21:22:22 UTC (rev 136156)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-11-29 21:25:25 UTC (rev 136157)
@@ -3635,9 +3635,11 @@
 
     IntSize viewportSizeAfter = actualVisibleSize();
 
-    IntSize offset(
-        roundf((viewportSizeBefore.width() - viewportSizeAfter.width()) / 2.0),
-        roundf((viewportSizeBefore.height() - viewportSizeAfter.height()) / 2.0));
+    IntSize offset;
+    if (hasPendingOrientation) {
+        offset = IntSize(roundf((viewportSizeBefore.width() - viewportSizeAfter.width()) / 2.0),
+            roundf((viewportSizeBefore.height() - viewportSizeAfter.height()) / 2.0));
+    }
 
     // As a special case, if we were anchored to the top left position at
     // the beginning of the rotation then preserve that anchor.

Modified: trunk/Source/WebKit/blackberry/ChangeLog (136156 => 136157)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-11-29 21:22:22 UTC (rev 136156)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-11-29 21:25:25 UTC (rev 136157)
@@ -1,3 +1,20 @@
+2012-11-29  Andrew Lo  <[email protected]>
+
+        [BlackBerry] Do not adjust scroll position on viewport resizes that are not orientation change related
+        https://bugs.webkit.org/show_bug.cgi?id=103659
+
+        Reviewed by Rob Buis.
+        Internally reviewed by Gen Mak.
+
+        Internal PR253893.
+        Only adjust scroll position during an orientation change
+        when setting viewport size.
+        We don't want the scroll position jumping around when opening
+        & closing the VKB.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::setViewportSize):
+
 2012-11-28  Otto Derek Cheung  <[email protected]>
 
         [BlackBerry] CookieJarBlackBerry will use document settings for cookiesEnabled
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to