Title: [100196] trunk
Revision
100196
Author
[email protected]
Date
2011-11-14 14:47:05 -0800 (Mon, 14 Nov 2011)

Log Message

[Chromium] setPageScaleFactor and associated methods should take scaling limits into account
https://bugs.webkit.org/show_bug.cgi?id=72176

Source/WebKit/chromium:

Reviewed by Darin Fisher.

A couple of changes:

1. setPageScaleFactorLimits now affects the behavior of other scaling methods
   including setPageScaleFactor.
2. setPageScaleFactorPreservingScrollOffset introduced that scales the scroll offset
   along with the page, preserving the scroll position within the page bounds.

* public/WebView.h:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::computePageScaleFactorWithinLimits):
(WebKit::WebViewImpl::clampOffsetAtScale):
(WebKit::WebViewImpl::setPageScaleFactorPreservingScrollOffset):
(WebKit::WebViewImpl::setPageScaleFactor):
(WebKit::WebViewImpl::setPageScaleFactorLimits):
(WebKit::WebViewImpl::applyScrollAndScale):
* src/WebViewImpl.h:

LayoutTests:

Reviewed by Darin Fisher.

Rebaselined some tests that broke because we now clamp pageScaleFactor to 0.25 (these test at 0.2).

Since this is a Chromium only change, the new baselines are only for Chromium.

* platform/chromium-linux/fast/repaint/scale-page-shrink-expected.png:
* platform/chromium-linux/fast/repaint/scale-page-shrink-expected.txt: Added.
* platform/chromium/fast/repaint/background-scaling-expected.png: Copied from LayoutTests/platform/chromium-linux/fast/repaint/scale-page-shrink-expected.png.
* platform/chromium/fast/repaint/background-scaling-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (100195 => 100196)


--- trunk/LayoutTests/ChangeLog	2011-11-14 22:42:36 UTC (rev 100195)
+++ trunk/LayoutTests/ChangeLog	2011-11-14 22:47:05 UTC (rev 100196)
@@ -1,3 +1,19 @@
+2011-11-14  Fady Samuel  <[email protected]>
+
+        [Chromium] setPageScaleFactor and associated methods should take scaling limits into account
+        https://bugs.webkit.org/show_bug.cgi?id=72176
+
+        Reviewed by Darin Fisher.
+
+        Rebaselined some tests that broke because we now clamp pageScaleFactor to 0.25 (these test at 0.2).
+
+        Since this is a Chromium only change, the new baselines are only for Chromium.
+
+        * platform/chromium-linux/fast/repaint/scale-page-shrink-expected.png:
+        * platform/chromium-linux/fast/repaint/scale-page-shrink-expected.txt: Added.
+        * platform/chromium/fast/repaint/background-scaling-expected.png: Copied from LayoutTests/platform/chromium-linux/fast/repaint/scale-page-shrink-expected.png.
+        * platform/chromium/fast/repaint/background-scaling-expected.txt: Added.
+
 2011-11-14  Robert Hogan  <[email protected]>
 
         Platform-specific results for r100177

Copied: trunk/LayoutTests/platform/chromium/fast/repaint/background-scaling-expected.png (from rev 100195, trunk/LayoutTests/platform/chromium-linux/fast/repaint/scale-page-shrink-expected.png) (0 => 100196)


--- trunk/LayoutTests/platform/chromium/fast/repaint/background-scaling-expected.png	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/fast/repaint/background-scaling-expected.png	2011-11-14 22:47:05 UTC (rev 100196)
@@ -0,0 +1,8 @@
+\x89PNG
+
+
+IHDR X')tEXtchecksumd55b52898000c44e044cc91461f9b2d1\xBD<\x81
+\xB5IDATx\x9C\xED\xD8\xC1	\xC00A;\x8D'\x9D_\x9AX0\x98\x99
+\xF4\\xB4׷ 7\xC7<\xA7\xDCF`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L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4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4~\x9C:
+\xA9\xFA\xB7\\x92IEND\xAEB`\x82
\ No newline at end of file

Added: trunk/LayoutTests/platform/chromium/fast/repaint/background-scaling-expected.txt (0 => 100196)


--- trunk/LayoutTests/platform/chromium/fast/repaint/background-scaling-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/fast/repaint/background-scaling-expected.txt	2011-11-14 22:47:05 UTC (rev 100196)
@@ -0,0 +1,6 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600 [bgcolor=#008000]
+    RenderBody {BODY} at (0,0) size 800x600
+      RenderBlock {DIV} at (0,0) size 800x100 [bgcolor=#008000]

Modified: trunk/LayoutTests/platform/chromium-linux/fast/repaint/scale-page-shrink-expected.png (100195 => 100196)


--- trunk/LayoutTests/platform/chromium-linux/fast/repaint/scale-page-shrink-expected.png	2011-11-14 22:42:36 UTC (rev 100195)
+++ trunk/LayoutTests/platform/chromium-linux/fast/repaint/scale-page-shrink-expected.png	2011-11-14 22:47:05 UTC (rev 100196)
@@ -1,8 +1,4 @@
 \x89PNG
 
 
-IHDR X')tEXtchecksum50f633235423d736b2abb75e4985d605\xC0v\x83oIDATx\x9C\xED\xDB]oUe\xDE\xC0\xE1\xDD\xD2\xF6\x80(\xBE$\x81Lt<\x9B\xC4c?\xC2\xF3)<\x98\x8F\xE1ט̑\x891\xA3bl\x82
-\xA3 h\xA8\xDB:
-jAZ0J \x94\xDD\xFDl\xD3\xF1q\x9C\xC9\xCC<\xBFgr]M\xD7Z\xF7\xFA\xAF{\xEF\xEC\x83_\xFA25\x8Ft\xA6\xF5\xFE\xDB\xFC5\xB0F\xA3\xD1\xCE\xD7\xC6\xDF[\xF9\xCFO\xF8\xF7\xD6\xFF\xFC\x96p\xEF\xAF^\xFA\xC5\xC9\xD1h\xF4\xB7\xCB\xFE\xF1\x99_|\xFF\xF0\xE1\xC3\xED\xED\xED\xBF}\xD0\xDF;\xFF\xAB\xFD7\xDE\xE0\xB7l\xD7믿>\x8E=\xFA\xD1G\xBD\xF4\xD2K\xA7O\x9F>r\xE4\xC8\xE7\x9F\xFE\xF0\xE1ù\xB9\xB9\xD5\xD5կ\xBF\xFE\xFA\xF6\xED\xDBW\xAE\y\xE6\x99g\xD6\xD7\xD7/^\xBC\xB8\xB6\xB6v\xF0\xE0\xC1\xB7\xDEzk4=\xF1\xC4\xB3\xB3\xB3\xE7ϟ\x8DF.\سg\xCF\xEA\xEA\xEA\xF5\xEB\xD7ggg\x8F;\xB6\xBC\xBC\xFC\xF8\xE3\x8Fomm}\xF3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L+sʇC7\xDA\xF3\xDDS\xA7N=z\xB4^\xAFWU5\x8F\xE7)\xB3\x91\xA2̙ݮ\xECa\xB6\xED2\xF3\xAF֜\xAE\xDBo\xBF}2\x99\x949{\xAF\xD5j\xB3\x8B\xB2rUU\x93ɤ|-\x9B/\xDB+o/ߪ\xD5jz\xB3\x967\x96i\xB3\xF1r\xDFr]\xBE\x96[WU\xB5\xE7\xF0g\x9B//\x83A\xBD^/3\xE7\xCF\xE7\x8D7\xDE8p\xE0\xC0SO=5{cY\xF0\xD5W_=z\xF4hy{\x99\xF3\xE4\x93O\x96\x93\xDCs\xC0\xBF\xF6G`\xD5\xFE[\xFBǩ\xC4M\xFF\xE3d\xC0-\xC8_\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2j\xD3\xE9\xF4f\xEF\xE0\x96\xE2,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2\xFE\xEFx\x83\xDD\xE1J\xDDIEND\xAEB`\x82
\ No newline at end of file

Added: trunk/LayoutTests/platform/chromium-linux/fast/repaint/scale-page-shrink-expected.txt (0 => 100196)


--- trunk/LayoutTests/platform/chromium-linux/fast/repaint/scale-page-shrink-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/fast/repaint/scale-page-shrink-expected.txt	2011-11-14 22:47:05 UTC (rev 100196)
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock (anonymous) at (0,0) size 784x20
+        RenderText {#text} at (0,0) size 686x19
+          text run at (0,0) width 686: "This test must be run in DumpRenderTree as a pixel test. There should not be visual aritfacts after scaling the page."
+      RenderBlock {DIV} at (0,20) size 500x500 [bgcolor=#008000]

Modified: trunk/Source/WebKit/chromium/ChangeLog (100195 => 100196)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-11-14 22:42:36 UTC (rev 100195)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-11-14 22:47:05 UTC (rev 100196)
@@ -1,3 +1,29 @@
+2011-11-14  Fady Samuel  <[email protected]>
+
+        [Chromium] setPageScaleFactor and associated methods should take scaling limits into account
+        https://bugs.webkit.org/show_bug.cgi?id=72176
+
+        Reviewed by Darin Fisher.
+ 
+        A couple of changes:
+ 
+        1. setPageScaleFactorLimits now affects the behavior of other scaling methods
+           including setPageScaleFactor.
+        2. setPageScaleFactorPreservingScrollOffset introduced that scales the scroll offset 
+           along with the page, preserving the scroll position within the page bounds.
+ 
+
+        * public/WebView.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::WebViewImpl):
+        (WebKit::WebViewImpl::computePageScaleFactorWithinLimits):
+        (WebKit::WebViewImpl::clampOffsetAtScale):
+        (WebKit::WebViewImpl::setPageScaleFactorPreservingScrollOffset):
+        (WebKit::WebViewImpl::setPageScaleFactor):
+        (WebKit::WebViewImpl::setPageScaleFactorLimits):
+        (WebKit::WebViewImpl::applyScrollAndScale):
+        * src/WebViewImpl.h:
+
 2011-11-14  Vincent Scheib  <[email protected]>
 
         Mouse Lock: Renaming to 'Pointer Lock': Runtime Enable Flags

Modified: trunk/Source/WebKit/chromium/public/WebView.h (100195 => 100196)


--- trunk/Source/WebKit/chromium/public/WebView.h	2011-11-14 22:42:36 UTC (rev 100195)
+++ trunk/Source/WebKit/chromium/public/WebView.h	2011-11-14 22:47:05 UTC (rev 100196)
@@ -61,6 +61,8 @@
     WEBKIT_EXPORT static const double textSizeMultiplierRatio;
     WEBKIT_EXPORT static const double minTextSizeMultiplier;
     WEBKIT_EXPORT static const double maxTextSizeMultiplier;
+    WEBKIT_EXPORT static const float minPageScaleFactor;
+    WEBKIT_EXPORT static const float maxPageScaleFactor;
 
     // Controls the time that user scripts injected into the document run.
     enum UserScriptInjectAt {
@@ -207,20 +209,24 @@
     WEBKIT_EXPORT static double zoomLevelToZoomFactor(double zoomLevel);
     WEBKIT_EXPORT static double zoomFactorToZoomLevel(double factor);
 
-    // PageScaleFactor will be force-clamped between minPageScale and maxPageScale
-    // (and these values will persist until setPageScaleFactorLimits is called
-    // again).
-    virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale) = 0;
-
     // Gets the scale factor of the page, where 1.0 is the normal size, > 1.0
     // is scaled up, < 1.0 is scaled down.
     virtual float pageScaleFactor() const = 0;
 
+    // Scales the page and the scroll offset by a given factor, while ensuring
+    // that the new scroll position does not go beyond the edge of the page.
+    virtual void setPageScaleFactorPreservingScrollOffset(float) = 0;
+
     // Scales a page by a factor of scaleFactor and then sets a scroll position to (x, y).
     // setPageScaleFactor() magnifies and shrinks a page without affecting layout.
     // On the other hand, zooming affects layout of the page.
     virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) = 0;
 
+    // PageScaleFactor will be force-clamped between minPageScale and maxPageScale
+    // (and these values will persist until setPageScaleFactorLimits is called
+    // again).
+    virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale) = 0;
+
     // The ratio of the current device's screen DPI to the target device's screen DPI.
     virtual float deviceScaleFactor() const = 0;
 

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (100195 => 100196)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-11-14 22:42:36 UTC (rev 100195)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-11-14 22:47:05 UTC (rev 100196)
@@ -199,6 +199,8 @@
 const double WebView::textSizeMultiplierRatio = 1.2;
 const double WebView::minTextSizeMultiplier = 0.5;
 const double WebView::maxTextSizeMultiplier = 3.0;
+const float WebView::minPageScaleFactor = 0.25;
+const float WebView::maxPageScaleFactor = 4.0;
 
 
 // The group name identifies a namespace of pages.  Page group is used on OSX
@@ -338,6 +340,8 @@
     , m_zoomLevel(0)
     , m_minimumZoomLevel(zoomFactorToZoomLevel(minTextSizeMultiplier))
     , m_maximumZoomLevel(zoomFactorToZoomLevel(maxTextSizeMultiplier))
+    , m_minimumPageScaleFactor(minPageScaleFactor)
+    , m_maximumPageScaleFactor(maxPageScaleFactor)
     , m_contextMenuAllowed(false)
     , m_doingDragAndDrop(false)
     , m_ignoreInputEvents(false)
@@ -1852,11 +1856,52 @@
     return page()->pageScaleFactor();
 }
 
+float WebViewImpl::computePageScaleFactorWithinLimits(float scaleFactor)
+{
+    return min(max(scaleFactor, m_minimumPageScaleFactor), m_maximumPageScaleFactor);
+}
+
+WebPoint WebViewImpl::clampOffsetAtScale(const WebPoint& offset, float scale)
+{
+    // This is the scaled content size. We need to convert it to the new scale factor.
+    WebSize contentSize = mainFrame()->contentsSize();
+    float deltaScale = scale / pageScaleFactor();
+    int docWidthAtNewScale = contentSize.width * deltaScale;
+    int docHeightAtNewScale = contentSize.height * deltaScale;
+    int viewWidth = m_size.width;
+    int viewHeight = m_size.height;
+
+    // Enforce the maximum and minimum scroll positions at the new scale.
+    IntPoint clampedOffset = offset;
+    clampedOffset.clampNegativeToZero();
+    clampedOffset = clampedOffset.shrunkTo(IntPoint(docWidthAtNewScale - viewWidth, docHeightAtNewScale - viewHeight));
+    return clampedOffset;
+}
+
+void WebViewImpl::setPageScaleFactorPreservingScrollOffset(float scaleFactor)
+{
+    // Pick a scale factor that is within the expected limits
+    scaleFactor = computePageScaleFactorWithinLimits(scaleFactor);
+    if (scaleFactor == pageScaleFactor())
+        return;
+
+    IntPoint scrollOffsetAtNewScale(mainFrame()->scrollOffset().width, mainFrame()->scrollOffset().height);
+    float deltaScale = scaleFactor / pageScaleFactor();
+    scrollOffsetAtNewScale.scale(deltaScale, deltaScale);
+
+    WebPoint clampedOffsetAtNewScale = clampOffsetAtScale(scrollOffsetAtNewScale, scaleFactor);
+    setPageScaleFactor(scaleFactor, clampedOffsetAtNewScale);
+}
+
 void WebViewImpl::setPageScaleFactor(float scaleFactor, const WebPoint& origin)
 {
     if (!page())
         return;
 
+    if (!scaleFactor)
+        scaleFactor = 1;
+
+    scaleFactor = computePageScaleFactorWithinLimits(scaleFactor);
     page()->setPageScaleFactor(scaleFactor, origin);
 }
 
@@ -1910,8 +1955,17 @@
 
 void WebViewImpl::setPageScaleFactorLimits(float minPageScale, float maxPageScale)
 {
+    m_minimumPageScaleFactor = min(max(minPageScale, minPageScaleFactor), maxPageScaleFactor) * deviceScaleFactor();
+    m_maximumPageScaleFactor = max(min(maxPageScale, maxPageScaleFactor), minPageScaleFactor) * deviceScaleFactor();
+
+    // Limit page scaling down to the document width.
+    int viewWidth = m_size.width;
+    int unscaledContentWidth = mainFrame()->contentsSize().width / pageScaleFactor();
+    m_minimumPageScaleFactor = max(m_minimumPageScaleFactor,  static_cast<float>(viewWidth) / unscaledContentWidth);
+    ASSERT(minPageScale <= maxPageScale);
 #if USE(ACCELERATED_COMPOSITING)
-    m_layerTreeHost->setPageScaleFactorLimits(minPageScale, maxPageScale);
+    if (m_layerTreeHost)
+        m_layerTreeHost->setPageScaleFactorLimits(m_minimumPageScaleFactor, m_maximumPageScaleFactor);
 #endif
 }
 
@@ -2730,7 +2784,7 @@
 
     float oldScale = pageScaleFactor();
     if (!oldScale)
-        oldScale = 1.0f;
+        oldScale = 1;
 
     if (!scaleFactor || oldScale == scaleFactor)
         mainFrameImpl()->frameView()->scrollBy(scrollDelta);

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (100195 => 100196)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.h	2011-11-14 22:42:36 UTC (rev 100195)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h	2011-11-14 22:47:05 UTC (rev 100196)
@@ -158,6 +158,7 @@
     virtual void zoomLimitsChanged(double minimumZoomLevel,
                                    double maximumZoomLevel);
     virtual float pageScaleFactor() const;
+    virtual void setPageScaleFactorPreservingScrollOffset(float);
     virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin);
     virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale);
     virtual float deviceScaleFactor() const;
@@ -417,6 +418,9 @@
     void loseCompositorContext(int numTimes);
 
 private:
+    float computePageScaleFactorWithinLimits(float scale);
+    WebPoint clampOffsetAtScale(const WebPoint& offset, float scale);
+
     friend class WebView;  // So WebView::Create can call our constructor
     friend class WTF::RefCounted<WebViewImpl>;
 
@@ -513,6 +517,10 @@
 
     double m_maximumZoomLevel;
 
+    float m_minimumPageScaleFactor;
+
+    float m_maximumPageScaleFactor;
+
     bool m_contextMenuAllowed;
 
     bool m_doingDragAndDrop;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to