Title: [152452] trunk/Source/WebKit/blackberry
Revision
152452
Author
[email protected]
Date
2013-07-08 08:37:17 -0700 (Mon, 08 Jul 2013)

Log Message

[BlackBerry] Block Zoom does not zoom in on narrow paragraphs properly
https://bugs.webkit.org/show_bug.cgi?id=118472

Patch by Jacky Jiang <[email protected]> on 2013-07-08.
Reviewed by Rob Buis.
Internally reviewed Arvid Nilsson and Genevieve Mak.

JIRA 114653
For the narrow paragraphs on www.nytimes.com, the first best node for
block zoom under the point is deprecated due to the limits of maximum
block zoom scale(3) and default maximum WebPage zoom scale(4) and instead
it picks up an ancestor node which is wider so that it looks like doesn't
zoom in properly.
To fix that, enlarge the default maximum WebPage zoom scale slightly
and use maximumScale() instead of maxBlockZoomScale() so that we can
accept more nodes. And also we'll still clamp the new scale by
maxBlockZoomScale() when we block zoom the WebPage, in which way those
nodes can be showed in the center of the viewport and surrounded by a
few other nodes within the viewport which shows better user experience.

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

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (152451 => 152452)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-07-08 15:36:49 UTC (rev 152451)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-07-08 15:37:17 UTC (rev 152452)
@@ -1763,7 +1763,7 @@
     if (m_maximumScale >= m_minimumScale && respectViewport())
         return std::max(zoomToFitScale, m_maximumScale);
 
-    return hasVirtualViewport() ? std::max<double>(zoomToFitScale, 4.0) : 4.0;
+    return hasVirtualViewport() ? std::max<double>(zoomToFitScale, 5.0) : 5.0;
 }
 
 double WebPage::maximumScale() const
@@ -2677,7 +2677,7 @@
 {
     Node* initialNode = node;
     RenderObject* renderer = node->renderer();
-    bool acceptableNodeSize = newScaleForBlockZoomRect(rectForNode(node), 1.0, 0) < maxBlockZoomScale();
+    bool acceptableNodeSize = newScaleForBlockZoomRect(rectForNode(node), 1.0, 0) < maximumScale();
     IntSize actualVisibleSize = this->actualVisibleSize();
 
     while (!renderer || !acceptableNodeSize) {
@@ -2690,7 +2690,7 @@
             return initialNode;
 
         renderer = node->renderer();
-        acceptableNodeSize = newScaleForBlockZoomRect(rectForNode(node), 1.0, 0) < maxBlockZoomScale();
+        acceptableNodeSize = newScaleForBlockZoomRect(rectForNode(node), 1.0, 0) < maximumScale();
     }
 
     return node;

Modified: trunk/Source/WebKit/blackberry/ChangeLog (152451 => 152452)


--- trunk/Source/WebKit/blackberry/ChangeLog	2013-07-08 15:36:49 UTC (rev 152451)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2013-07-08 15:37:17 UTC (rev 152452)
@@ -1,3 +1,28 @@
+2013-07-08  Jacky Jiang  <[email protected]>
+
+        [BlackBerry] Block Zoom does not zoom in on narrow paragraphs properly
+        https://bugs.webkit.org/show_bug.cgi?id=118472
+
+        Reviewed by Rob Buis.
+        Internally reviewed Arvid Nilsson and Genevieve Mak.
+
+        JIRA 114653
+        For the narrow paragraphs on www.nytimes.com, the first best node for
+        block zoom under the point is deprecated due to the limits of maximum
+        block zoom scale(3) and default maximum WebPage zoom scale(4) and instead
+        it picks up an ancestor node which is wider so that it looks like doesn't
+        zoom in properly.
+        To fix that, enlarge the default maximum WebPage zoom scale slightly
+        and use maximumScale() instead of maxBlockZoomScale() so that we can
+        accept more nodes. And also we'll still clamp the new scale by
+        maxBlockZoomScale() when we block zoom the WebPage, in which way those
+        nodes can be showed in the center of the viewport and surrounded by a
+        few other nodes within the viewport which shows better user experience.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::maximumScale):
+        (BlackBerry::WebKit::WebPagePrivate::adjustedBlockZoomNodeForZoomAndExpandingRatioLimits):
+
 2013-07-01  Jochen Eisinger  <[email protected]>
 
         Remove support for consumable user gestures
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to