[chromium] Set min/max page scale factors when calling eventSender.scalePageBy to...
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Nov 2011 02:25:54 +0000 (02:25 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Nov 2011 02:25:54 +0000 (02:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72778

Reviewed by Kenneth Russell.

Set the min/max page scale clamps when a test calls eventSender.scalePageBy() so that the scale isn't clamped.

* DumpRenderTree/chromium/EventSender.cpp:
(EventSender::scalePageBy):

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

Tools/ChangeLog
Tools/DumpRenderTree/chromium/EventSender.cpp

index 58c57a3..c0e3cf1 100644 (file)
@@ -1,3 +1,15 @@
+2011-11-18  James Robinson  <jamesr@chromium.org>
+
+        [chromium] Set min/max page scale factors when calling eventSender.scalePageBy to avoid clamping
+        https://bugs.webkit.org/show_bug.cgi?id=72778
+
+        Reviewed by Kenneth Russell.
+
+        Set the min/max page scale clamps when a test calls eventSender.scalePageBy() so that the scale isn't clamped.
+
+        * DumpRenderTree/chromium/EventSender.cpp:
+        (EventSender::scalePageBy):
+
 2011-11-18  Scott Graham  <scottmg@chromium.org>
 
         IDL changes for gamepad support
index 20d77a7..f3bb933 100644 (file)
@@ -716,6 +716,9 @@ void EventSender::scalePageBy(const CppArgumentList& arguments, CppVariant* resu
     float scaleFactor = static_cast<float>(arguments[0].toDouble());
     int x = arguments[1].toInt32();
     int y = arguments[2].toInt32();
+    float minimumPageScaleFactor = min(webview()->minimumPageScaleFactor(), scaleFactor);
+    float maximumPageScaleFactor = max(webview()->maximumPageScaleFactor(), scaleFactor);
+    webview()->setPageScaleFactorLimits(minimumPageScaleFactor, maximumPageScaleFactor);
     webview()->setPageScaleFactor(scaleFactor, WebPoint(x, y));
     result->setNull();
 }