Move internals.settings.setPageScaleFactor to internals.setPageScaleFactor
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Nov 2012 22:14:03 +0000 (22:14 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Nov 2012 22:14:03 +0000 (22:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=103559

Reviewed by Jochen Eisinger.

Source/WebCore:

This method doesn't alter the Settings object, so move it to internals.

No new tests, this is a refactor.

* testing/InternalSettings.cpp: Remove.
* testing/InternalSettings.h: Remove.
* testing/InternalSettings.idl: Remove.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): Add reset code.
(WebCore::Internals::setPageScaleFactor): Add method.
* testing/Internals.h: Add method.
* testing/Internals.idl: Add method.

LayoutTests:

This method doesn't alter the Settings object, so move it to internals.
Update the tests to call the right version.

* compositing/geometry/fixed-position-composited-page-scale-down.html:
* compositing/geometry/fixed-position-composited-page-scale-scroll.html:
* compositing/geometry/fixed-position-composited-page-scale.html:
* compositing/geometry/fixed-position-iframe-composited-page-scale-down.html:
* compositing/geometry/fixed-position-iframe-composited-page-scale.html:
* compositing/geometry/fixed-position-transform-composited-page-scale-down.html:
* compositing/geometry/fixed-position-transform-composited-page-scale.html:
* compositing/overflow/overflow-scaled-descendant-overlapping.html:
* compositing/repaint/page-scale-repaint.html:
* compositing/scaling/tiled-layer-recursion.html:
* fast/dom/Element/scale-page-bounding-client-rect-in-frame.html:
* fast/dom/Element/scale-page-bounding-client-rect.html:
* fast/dom/Element/scale-page-client-rects-in-frame.html:
* fast/dom/Element/scale-page-client-rects.html:
* fast/dom/Range/scale-page-bounding-client-rect.html:
* fast/dom/Range/scale-page-client-rects.html:
* fast/dom/elementFromPoint-scaled-scrolled.html:
* fast/dom/iframe-inner-size-scaling.html:
* fast/dom/window-inner-size-scaling.html:
* fast/dom/window-scroll-scaling.html:
* fast/events/scale-and-scroll-body.html:
* fast/events/scale-and-scroll-iframe-body.html:
* fast/events/scale-and-scroll-iframe-window.html:
* fast/events/scale-and-scroll-window.html:
* fast/events/script-tests/page-scaled-mouse-click-iframe.js:
(iframeLoaded):
* fast/events/script-tests/page-scaled-mouse-click.js:
* fast/events/scroll-in-scaled-page-with-overflow-hidden.html:
* fast/events/touch/page-scaled-touch-gesture-click.html:
* fast/events/touch/touch-scaled-scrolled.html:
* fast/frames/frame-set-rotation-hit.html:
* fast/frames/frame-set-scaling-hit.html:
* fast/frames/iframe-double-scale-contents.html:
* fast/repaint/background-scaling.html:
* fast/repaint/scale-page-shrink.html:
* fast/text/descent-clip-in-scaled-page-expected.html:
* fast/text/descent-clip-in-scaled-page.html:
* fast/transforms/selection-bounds-in-transformed-view.html:
* inspector/elements/highlight-node-scaled.html:
* platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-scaled-document.html:
* svg/as-image/image-respects-pageScaleFactor-change.html:
* svg/as-image/image-respects-pageScaleFactor.html:

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

49 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/geometry/fixed-position-composited-page-scale-down.html
LayoutTests/compositing/geometry/fixed-position-composited-page-scale-scroll.html
LayoutTests/compositing/geometry/fixed-position-composited-page-scale.html
LayoutTests/compositing/geometry/fixed-position-iframe-composited-page-scale-down.html
LayoutTests/compositing/geometry/fixed-position-iframe-composited-page-scale.html
LayoutTests/compositing/geometry/fixed-position-transform-composited-page-scale-down.html
LayoutTests/compositing/geometry/fixed-position-transform-composited-page-scale.html
LayoutTests/compositing/overflow/overflow-scaled-descendant-overlapping.html
LayoutTests/compositing/repaint/page-scale-repaint.html
LayoutTests/compositing/scaling/tiled-layer-recursion.html
LayoutTests/fast/dom/Element/scale-page-bounding-client-rect-in-frame.html
LayoutTests/fast/dom/Element/scale-page-bounding-client-rect.html
LayoutTests/fast/dom/Element/scale-page-client-rects-in-frame.html
LayoutTests/fast/dom/Element/scale-page-client-rects.html
LayoutTests/fast/dom/Range/scale-page-bounding-client-rect.html
LayoutTests/fast/dom/Range/scale-page-client-rects.html
LayoutTests/fast/dom/elementFromPoint-scaled-scrolled.html
LayoutTests/fast/dom/iframe-inner-size-scaling.html
LayoutTests/fast/dom/window-inner-size-scaling.html
LayoutTests/fast/dom/window-scroll-scaling.html
LayoutTests/fast/events/scale-and-scroll-body.html
LayoutTests/fast/events/scale-and-scroll-iframe-body.html
LayoutTests/fast/events/scale-and-scroll-iframe-window.html
LayoutTests/fast/events/scale-and-scroll-window.html
LayoutTests/fast/events/script-tests/page-scaled-mouse-click-iframe.js
LayoutTests/fast/events/script-tests/page-scaled-mouse-click.js
LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html
LayoutTests/fast/events/touch/page-scaled-touch-gesture-click.html
LayoutTests/fast/events/touch/touch-scaled-scrolled.html
LayoutTests/fast/frames/frame-set-rotation-hit.html
LayoutTests/fast/frames/frame-set-scaling-hit.html
LayoutTests/fast/frames/iframe-double-scale-contents.html
LayoutTests/fast/repaint/background-scaling.html
LayoutTests/fast/repaint/scale-page-shrink.html
LayoutTests/fast/text/descent-clip-in-scaled-page-expected.html
LayoutTests/fast/text/descent-clip-in-scaled-page.html
LayoutTests/fast/transforms/selection-bounds-in-transformed-view.html
LayoutTests/inspector/elements/highlight-node-scaled.html
LayoutTests/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-scaled-document.html
LayoutTests/svg/as-image/image-respects-pageScaleFactor-change.html
LayoutTests/svg/as-image/image-respects-pageScaleFactor.html
Source/WebCore/ChangeLog
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl

index 8e945a5..95fba53 100644 (file)
@@ -1,3 +1,56 @@
+2012-11-28  Tony Chang  <tony@chromium.org>
+
+        Move internals.settings.setPageScaleFactor to internals.setPageScaleFactor
+        https://bugs.webkit.org/show_bug.cgi?id=103559
+
+        Reviewed by Jochen Eisinger.
+
+        This method doesn't alter the Settings object, so move it to internals.
+        Update the tests to call the right version.
+
+        * compositing/geometry/fixed-position-composited-page-scale-down.html:
+        * compositing/geometry/fixed-position-composited-page-scale-scroll.html:
+        * compositing/geometry/fixed-position-composited-page-scale.html:
+        * compositing/geometry/fixed-position-iframe-composited-page-scale-down.html:
+        * compositing/geometry/fixed-position-iframe-composited-page-scale.html:
+        * compositing/geometry/fixed-position-transform-composited-page-scale-down.html:
+        * compositing/geometry/fixed-position-transform-composited-page-scale.html:
+        * compositing/overflow/overflow-scaled-descendant-overlapping.html:
+        * compositing/repaint/page-scale-repaint.html:
+        * compositing/scaling/tiled-layer-recursion.html:
+        * fast/dom/Element/scale-page-bounding-client-rect-in-frame.html:
+        * fast/dom/Element/scale-page-bounding-client-rect.html:
+        * fast/dom/Element/scale-page-client-rects-in-frame.html:
+        * fast/dom/Element/scale-page-client-rects.html:
+        * fast/dom/Range/scale-page-bounding-client-rect.html:
+        * fast/dom/Range/scale-page-client-rects.html:
+        * fast/dom/elementFromPoint-scaled-scrolled.html:
+        * fast/dom/iframe-inner-size-scaling.html:
+        * fast/dom/window-inner-size-scaling.html:
+        * fast/dom/window-scroll-scaling.html:
+        * fast/events/scale-and-scroll-body.html:
+        * fast/events/scale-and-scroll-iframe-body.html:
+        * fast/events/scale-and-scroll-iframe-window.html:
+        * fast/events/scale-and-scroll-window.html:
+        * fast/events/script-tests/page-scaled-mouse-click-iframe.js:
+        (iframeLoaded):
+        * fast/events/script-tests/page-scaled-mouse-click.js:
+        * fast/events/scroll-in-scaled-page-with-overflow-hidden.html:
+        * fast/events/touch/page-scaled-touch-gesture-click.html:
+        * fast/events/touch/touch-scaled-scrolled.html:
+        * fast/frames/frame-set-rotation-hit.html:
+        * fast/frames/frame-set-scaling-hit.html:
+        * fast/frames/iframe-double-scale-contents.html:
+        * fast/repaint/background-scaling.html:
+        * fast/repaint/scale-page-shrink.html:
+        * fast/text/descent-clip-in-scaled-page-expected.html:
+        * fast/text/descent-clip-in-scaled-page.html:
+        * fast/transforms/selection-bounds-in-transformed-view.html:
+        * inspector/elements/highlight-node-scaled.html:
+        * platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-scaled-document.html:
+        * svg/as-image/image-respects-pageScaleFactor-change.html:
+        * svg/as-image/image-respects-pageScaleFactor.html:
+
 2012-11-28  Christophe Dumez  <christophe.dumez@intel.com>
 
         CSS3 Multicolumn: column-span should accept value 'none' (instead of '1')
index f335ef2..79e4261 100644 (file)
@@ -16,7 +16,7 @@
   function scale() {
     if (window.internals) {
       window.internals.settings.setEnableCompositingForFixedPosition(true);
-      window.internals.settings.setPageScaleFactor(0.5, 0, 0);
+      window.internals.setPageScaleFactor(0.5, 0, 0);
     }
     if (window.testRunner)
       testRunner.dumpAsText(true);
index 02370d7..452d1db 100644 (file)
@@ -17,7 +17,7 @@
   function scale() {
     if (window.internals) {
       window.internals.settings.setEnableCompositingForFixedPosition(true);
-      window.internals.settings.setPageScaleFactor(2, 0, 0);
+      window.internals.setPageScaleFactor(2, 0, 0);
     }
     window.scrollTo(100,100);
     if (window.testRunner)
index eae7a29..fc63652 100644 (file)
@@ -16,7 +16,7 @@
   function scale() {
     if (window.internals) {
       window.internals.settings.setEnableCompositingForFixedPosition(true);
-      window.internals.settings.setPageScaleFactor(2, 0, 0);
+      window.internals.setPageScaleFactor(2, 0, 0);
     }
     if (window.testRunner)
       testRunner.dumpAsText(true);
index 2c6a01e..c5ad46c 100644 (file)
@@ -16,7 +16,7 @@
   function test() {
     if (window.internals) {
       window.internals.settings.setEnableCompositingForFixedPosition(true);
-      window.internals.settings.setPageScaleFactor(0.5, 0, 0);
+      window.internals.setPageScaleFactor(0.5, 0, 0);
     }
     if (window.testRunner)
       testRunner.dumpAsText(true);
index 8e3d37a..e79b9f2 100644 (file)
@@ -16,7 +16,7 @@
   function test() {
     if (window.internals) {
       window.internals.settings.setEnableCompositingForFixedPosition(true);
-      window.internals.settings.setPageScaleFactor(2, 0, 0);
+      window.internals.setPageScaleFactor(2, 0, 0);
     }
     if (window.testRunner)
       testRunner.dumpAsText(true);
index 21d6082..6c17f96 100644 (file)
@@ -18,7 +18,7 @@
   function scale() {
     if (window.internals) {
       window.internals.settings.setEnableCompositingForFixedPosition(true);
-      window.internals.settings.setPageScaleFactor(0.5, 0, 0);
+      window.internals.setPageScaleFactor(0.5, 0, 0);
     }
     if (window.testRunner)
       testRunner.dumpAsText(true);
index bf888a6..f9a0c37 100644 (file)
@@ -18,7 +18,7 @@
   function scale() {
     if (window.internals) {
       window.internals.settings.setEnableCompositingForFixedPosition(true);
-      window.internals.settings.setPageScaleFactor(2, 0, 0);
+      window.internals.setPageScaleFactor(2, 0, 0);
     }
     if (window.testRunner)
       testRunner.dumpAsText(true);
index 7bb20ed..46b5595 100644 (file)
@@ -8,7 +8,7 @@
             if (window.testRunner)
                 testRunner.dumpAsText(true);
             if (window.internals)
-                window.internals.settings.setPageScaleFactor(0.5, 0, 0);
+                window.internals.setPageScaleFactor(0.5, 0, 0);
         }
     </script>
 
index bd2d16f..de78297 100644 (file)
@@ -6,7 +6,7 @@ function runTest() {
     if (window.testRunner)
         testRunner.display();
     if (window.internals)
-        window.internals.settings.setPageScaleFactor(0.5, 0, 0);
+        window.internals.setPageScaleFactor(0.5, 0, 0);
 }
 </script>
 <div style="-webkit-transform:translateZ(0);"></div>
index 4444808..90bee63 100644 (file)
@@ -17,7 +17,7 @@
     function scalePage()
     {
       if (window.internals)
-        window.internals.settings.setPageScaleFactor(1.50025, 0, 0);
+        window.internals.setPageScaleFactor(1.50025, 0, 0);
     }
   
     window.addEventListener('load', scalePage, false);
index c570c52..3432f3d 100644 (file)
@@ -10,7 +10,7 @@ function testRects()
     
     var div = document.getElementById("frame").contentDocument.getElementById("div");
     var rect = div.getBoundingClientRect();
-    window.internals.settings.setPageScaleFactor(2, 0, 0);
+    window.internals.setPageScaleFactor(2, 0, 0);
     var scaledRect = div.getBoundingClientRect();
 
     var result = document.getElementById("result");
index 028d89b..ca254b5 100644 (file)
@@ -9,7 +9,7 @@ function testRects()
     
     var div = document.getElementById("div");
     var rect = div.getBoundingClientRect();
-    window.internals.settings.setPageScaleFactor(2, 0, 0);
+    window.internals.setPageScaleFactor(2, 0, 0);
     var scaledRect = div.getBoundingClientRect();
 
     var result = document.getElementById("result");
index 4675f68..da79889 100644 (file)
@@ -10,7 +10,7 @@ function testRects()
     
     var div = document.getElementById("frame").contentDocument.getElementById("div");
     var rect = div.getClientRects()[0];
-    window.internals.settings.setPageScaleFactor(2, 0, 0);
+    window.internals.setPageScaleFactor(2, 0, 0);
     var scaledRect = div.getClientRects()[0];
 
     var result = document.getElementById("result");
index fbd5036..e7ecff6 100644 (file)
@@ -9,7 +9,7 @@ function testRects()
     
     var div = document.getElementById("div");
     var rectList = div.getClientRects();
-    window.internals.settings.setPageScaleFactor(2, 0, 0);
+    window.internals.setPageScaleFactor(2, 0, 0);
     var scaledRectList = div.getClientRects();
 
     var result = document.getElementById("result");
index 451af0b..5f206f7 100644 (file)
@@ -11,7 +11,7 @@ function testRects()
     range.selectNodeContents(document.getElementById('div'));
     var rect = range.getBoundingClientRect();
    
-    window.internals.settings.setPageScaleFactor(2, 0, 0);
+    window.internals.setPageScaleFactor(2, 0, 0);
     var scaledRange = document.createRange();
     scaledRange.selectNodeContents(document.getElementById('div'));
     var scaledRect = scaledRange.getBoundingClientRect();
index f8333ff..829f398 100644 (file)
@@ -12,7 +12,7 @@ function testRects()
     var rectList = range.getClientRects();
     var rect = rectList[0];
    
-    window.internals.settings.setPageScaleFactor(2, 0, 0);
+    window.internals.setPageScaleFactor(2, 0, 0);
     var scaledRange = document.createRange();
     scaledRange.selectNodeContents(document.getElementById('div'));
     var scaledRectList = scaledRange.getClientRects();
index 90f258b..1d67d0e 100644 (file)
@@ -10,7 +10,7 @@
 <script>
 function runTest() {
     if (window.internals)
-        window.internals.settings.setPageScaleFactor(2, 0, 0);
+        window.internals.setPageScaleFactor(2, 0, 0);
     window.scrollTo(100,100);
 
     if (window.testRunner)
index b390862..36d78c9 100644 (file)
@@ -10,7 +10,7 @@
             originalHeight = frame.contentWindow.innerHeight;
 
             if (window.internals)
-                window.internals.settings.setPageScaleFactor(2, 0, 0);
+                window.internals.setPageScaleFactor(2, 0, 0);
 
             shouldBeNonZero("frame.contentWindow.innerWidth");
             shouldBeNonZero("frame.contentWindow.innerHeight");
index cf1f98a..4597b23 100644 (file)
@@ -8,7 +8,7 @@
         var scale = 2;
 
         if (window.internals)
-            window.internals.settings.setPageScaleFactor(scale, 0, 0);
+            window.internals.setPageScaleFactor(scale, 0, 0);
 
         shouldBe("window.innerWidth", "Math.floor(originalWidth / scale)");
         shouldBe("window.innerHeight", "Math.floor(originalHeight / scale)");
index d6be792..f3ea593 100644 (file)
@@ -24,7 +24,7 @@
 
         var scale = 1.1;
         if (window.internals)
-            window.internals.settings.setPageScaleFactor(scale, 0, 0);
+            window.internals.setPageScaleFactor(scale, 0, 0);
 
         // As we have increased the scale factor, the innerWidth will be less
         // as fewer CSS pixels will be rendered in the same viewport, so
index d952906..a4b4f49 100644 (file)
       function scrollViaJavascript() {
           var scaleFactor = 2.0;
           if (window.internals) {
-             window.internals.settings.setPageScaleFactor(scaleFactor, 0, 0);
+             window.internals.setPageScaleFactor(scaleFactor, 0, 0);
           }
 
-          // The page scale, as set by window.internals.settings.setPageScaleFactor should not be apparent
+          // The page scale, as set by window.internals.setPageScaleFactor should not be apparent
           // to javascript. So, we expect scrolling to (100,100) to be page coordinates, rather
           // than device pixels.
           document.body.scrollLeft = 100;
@@ -31,7 +31,7 @@
           if (window.internals) {
               // Test that the scroll offset changes even if scaleFactor remains
               // the same.
-              window.internals.settings.setPageScaleFactor(1, 30, 30);
+              window.internals.setPageScaleFactor(1, 30, 30);
               shouldBe("window.document.body.scrollTop", "30");
               shouldBe("window.document.body.scrollLeft", "30");
           }
index 284002c..dcc703c 100644 (file)
@@ -25,7 +25,7 @@
             var scaleFactor = 0.5;
             var scaleOffset = 0;
             if (window.internals) {
-                 window.internals.settings.setPageScaleFactor(scaleFactor, scaleOffset, scaleOffset);
+                 window.internals.setPageScaleFactor(scaleFactor, scaleOffset, scaleOffset);
             }
         }
 
index a7342b5..801de8d 100644 (file)
@@ -24,7 +24,7 @@
             var scaleFactor = 0.5;
             var scaleOffset = 0;
             if (window.internals) {
-                 window.internals.settings.setPageScaleFactor(scaleFactor, scaleOffset, scaleOffset);
+                 window.internals.setPageScaleFactor(scaleFactor, scaleOffset, scaleOffset);
             }
         }
 
index 9b4d34f..2c67664 100644 (file)
@@ -10,7 +10,7 @@
       window.enablePixelTesting = true;
 
       function scroll() {
-          // The page scale, as set by window.internals.settings.setPageScaleFactor should not be apparent
+          // The page scale, as set by window.internals.setPageScaleFactor should not be apparent
           // to javascript. So, we expect scrolling to (100,100) to be page coordinates, rather
           // than device pixels.
           window.scrollTo(100,100);
@@ -25,7 +25,7 @@
           var scaleFactor = 2.0;
           var scaleOffset = 0;
           if (window.internals) {
-             window.internals.settings.setPageScaleFactor(scaleFactor, scaleOffset, scaleOffset);
+             window.internals.setPageScaleFactor(scaleFactor, scaleOffset, scaleOffset);
           }
       }
 
index df455a2..61946ec 100644 (file)
@@ -60,15 +60,15 @@ function iframeLoaded() {
 
     testEvents(0, "Unscaled", "click(10, 10)");
 
-    window.internals.settings.setPageScaleFactor(0.5, 0, 0);
+    window.internals.setPageScaleFactor(0.5, 0, 0);
     testEvents(0, "setPageScale(0.5)", "click(20, 20)");
 
-    window.internals.settings.setPageScaleFactor(1.0, 0, 0);
+    window.internals.setPageScaleFactor(1.0, 0, 0);
     html.style["-webkit-transform"] = "scale(0.5, 2.0)";
     html.style["-webkit-transform-origin"] = "0 0";
     testEvents(0, "CSS scale(0.5, 2.0)", "click(20, 5)");
 
-    window.internals.settings.setPageScaleFactor(0.5, 0, 0);
+    window.internals.setPageScaleFactor(0.5, 0, 0);
     testEvents(0, "setPageScale(0.5), CSS scale(0.5, 2.0)", "click(40, 10)");
   }
 
index 71bf27a..0d80b73 100644 (file)
@@ -50,6 +50,6 @@ if (window.eventSender && window.internals) {
     // parts of the document are under the mouse.
     testEvents(0, "Unscaled", "click(10, 10)");
 
-    window.internals.settings.setPageScaleFactor(0.5, 0, 0);
+    window.internals.setPageScaleFactor(0.5, 0, 0);
     testEvents(0, "setPageScale(0.5)", "click(20, 20)");
 }
index ba5c502..3013cbf 100644 (file)
@@ -23,7 +23,7 @@
         document.body.offsetLeft;
 
         if (window.internals)
-            window.internals.settings.setPageScaleFactor(2, 0, 0);
+            window.internals.setPageScaleFactor(2, 0, 0);
 
         shouldBe("window.document.body.scrollTop", "0");
 
index 1af624b..c366736 100644 (file)
@@ -65,7 +65,7 @@ function endTest()
 
 function runTest() {
     if (window.internals) {
-        window.internals.settings.setPageScaleFactor(0.5, 0, 0);
+        window.internals.setPageScaleFactor(0.5, 0, 0);
     }
 
     var div = document.getElementById('touchtarget');
index 090c097..2276764 100644 (file)
@@ -15,7 +15,7 @@ function touched(e) {
 
 function runTest() {
     if (window.internals)
-        window.internals.settings.setPageScaleFactor(2, 0, 0);
+        window.internals.setPageScaleFactor(2, 0, 0);
     window.scrollTo(100,100);
 
     if (window.testRunner) {
index fc63742..548a1d3 100644 (file)
@@ -9,7 +9,7 @@
             // Scale the page and resize the frames to verify hit testing on the frameset
             var leftPanelWidth = window.innerWidth / 8;
             var panelHeight = window.innerHeight / 2;
-            window.internals.settings.setPageScaleFactor(0.5, 0, 0);
+            window.internals.setPageScaleFactor(0.5, 0, 0);
             eventSender.mouseMoveTo(panelHeight / 2, leftPanelWidth);
             eventSender.mouseDown();
             eventSender.mouseMoveTo(panelHeight / 2, 2 * leftPanelWidth);
index 491ff95..5e28efe 100644 (file)
@@ -9,7 +9,7 @@
             // Scale the page and resize the frames to verify hit testing on the frameset
             var leftPanelWidth = window.innerWidth / 8;
             var panelHeight = window.innerHeight / 2;
-            window.internals.settings.setPageScaleFactor(0.5, 0, 0);
+            window.internals.setPageScaleFactor(0.5, 0, 0);
             eventSender.mouseMoveTo(leftPanelWidth, panelHeight / 2);
             eventSender.mouseDown();
             eventSender.mouseMoveTo(2 * leftPanelWidth, panelHeight / 2);
index c4560e2..2327bd5 100644 (file)
@@ -23,7 +23,7 @@
       function scalePage(scaleFactor) {
           var scaleOffset = 0;
           if (window.internals) {
-            window.internals.settings.setPageScaleFactor(scaleFactor, scaleOffset, scaleOffset);
+            window.internals.setPageScaleFactor(scaleFactor, scaleOffset, scaleOffset);
           }
       }
 
index 6bb911e..29e8469 100644 (file)
@@ -5,7 +5,7 @@
     function repaintTest()
     {
         if (window.internals)
-            window.internals.settings.setPageScaleFactor(0.25, 0, 0);
+            window.internals.setPageScaleFactor(0.25, 0, 0);
     }
 </script> 
 </head> 
index 09bd221..d8e07e1 100644 (file)
@@ -5,7 +5,7 @@
     function repaintTest()
     {
         if (window.internals)
-            window.internals.settings.setPageScaleFactor(0.25, 0, 0);
+            window.internals.setPageScaleFactor(0.25, 0, 0);
     }
 </script>
 </head>
index 6f904dd..90bbe50 100644 (file)
@@ -14,7 +14,7 @@
     if (window.testRunner && window.testRunner.setTextSubpixelPositioning)
         window.testRunner.setTextSubpixelPositioning(true);
     if (window.internals)
-        window.internals.settings.setPageScaleFactor(1.7, 0, 0);
+        window.internals.setPageScaleFactor(1.7, 0, 0);
 </script>
 </head>
 <body>
index c1d1d67..b2c86ef 100644 (file)
@@ -21,7 +21,7 @@
     if (window.testRunner && window.testRunner.setTextSubpixelPositioning)
         window.testRunner.setTextSubpixelPositioning(true);
     if (window.internals)
-        window.internals.settings.setPageScaleFactor(1.7, 0, 0);
+        window.internals.setPageScaleFactor(1.7, 0, 0);
 </script>
 </head>
 <body>
index 207636a..c6e0f6f 100644 (file)
@@ -6,7 +6,7 @@
     <script>
         if (window.testRunner && window.internals) {
             testRunner.dumpAsText();
-            window.internals.settings.setPageScaleFactor(2, 0, 0);
+            window.internals.setPageScaleFactor(2, 0, 0);
         }
 
         document.execCommand("FindString", false, "target");
index 93748e2..db4192d 100644 (file)
@@ -24,7 +24,7 @@ iframe {
 function onload()
 {
     if (window.internals)
-        window.internals.settings.setPageScaleFactor(2, 0, 0);
+        window.internals.setPageScaleFactor(2, 0, 0);
     runTest();
 }
     
index e30697f..b0854e7 100644 (file)
@@ -13,7 +13,7 @@ This test is successful if "Target Link" above is covered in a transparent green
 <script>
 function runTest() {
     if (window.internals) {
-        window.internals.settings.setPageScaleFactor(2, 0, 0);
+        window.internals.setPageScaleFactor(2, 0, 0);
     }
 
     var clientRect = document.getElementById('targetLink').getBoundingClientRect();
index 520c0f5..d4f3163 100644 (file)
         if (!window.internals)
             return;
 
-        window.internals.settings.setPageScaleFactor(2, 0, 0);
+        window.internals.setPageScaleFactor(2, 0, 0);
         
         setTimeout(increasePageScale, 0);
     }
     
     function increasePageScale() {
-        window.internals.settings.setPageScaleFactor(4, 0, 0);
+        window.internals.setPageScaleFactor(4, 0, 0);
         
         if (window.testRunner)
             testRunner.notifyDone();
index 4d6ba94..2b83df5 100644 (file)
@@ -5,7 +5,7 @@
         if (!window.internals)
             return;
 
-        window.internals.settings.setPageScaleFactor(2, 0, 0);
+        window.internals.setPageScaleFactor(2, 0, 0);
     }
     window.onload = init;
     </script>
index 44693e0..7de4491 100644 (file)
@@ -1,3 +1,23 @@
+2012-11-28  Tony Chang  <tony@chromium.org>
+
+        Move internals.settings.setPageScaleFactor to internals.setPageScaleFactor
+        https://bugs.webkit.org/show_bug.cgi?id=103559
+
+        Reviewed by Jochen Eisinger.
+
+        This method doesn't alter the Settings object, so move it to internals.
+
+        No new tests, this is a refactor.
+
+        * testing/InternalSettings.cpp: Remove.
+        * testing/InternalSettings.h: Remove.
+        * testing/InternalSettings.idl: Remove.
+        * testing/Internals.cpp:
+        (WebCore::Internals::resetToConsistentState): Add reset code.
+        (WebCore::Internals::setPageScaleFactor): Add method.
+        * testing/Internals.h: Add method.
+        * testing/Internals.idl: Add method.
+
 2012-11-28  Alexandru Chiculita  <achicu@adobe.com>
 
         [CSS Regions] Elements using transforms are not repainted correctly when rendered in a region
index dda4435..c748eab 100644 (file)
@@ -253,12 +253,6 @@ bool InternalSettings::unifiedTextCheckingEnabled(ExceptionCode& ec)
     return settings()->unifiedTextCheckerEnabled();
 }
 
-void InternalSettings::setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCode& ec)
-{
-    InternalSettingsGuardForPage();
-    page()->setPageScaleFactor(scaleFactor, IntPoint(x, y));
-}
-
 void InternalSettings::setShadowDOMEnabled(bool enabled, ExceptionCode& ec)
 {
 #if ENABLE(SHADOW_DOM)
index b76fd9e..f379f28 100644 (file)
@@ -112,7 +112,6 @@ public:
     void setFixedElementsLayoutRelativeToFrame(bool, ExceptionCode&);
     void setUnifiedTextCheckingEnabled(bool, ExceptionCode&);
     bool unifiedTextCheckingEnabled(ExceptionCode&);
-    void setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCode&);
     void setTouchEventEmulationEnabled(bool enabled, ExceptionCode&);
     void setDeviceSupportsTouch(bool enabled, ExceptionCode&);
     void setDeviceSupportsMouse(bool enabled, ExceptionCode&);
index 09dae1e..d37b3f8 100644 (file)
@@ -37,7 +37,6 @@
     void setFixedElementsLayoutRelativeToFrame(in boolean enabled) raises(DOMException);
     void setUnifiedTextCheckingEnabled(in boolean enabled) raises (DOMException);
     boolean unifiedTextCheckingEnabled() raises (DOMException);
-    void setPageScaleFactor(in float scaleFactor, in long x, in long y) raises(DOMException);
     void setTouchEventEmulationEnabled(in boolean enabled) raises(DOMException);
     void setDeviceSupportsTouch(in boolean enabled) raises(DOMException);
     void setDeviceSupportsMouse(in boolean enabled) raises(DOMException);
index fb932db..94a3b05 100644 (file)
@@ -220,6 +220,7 @@ void Internals::resetToConsistentState(Page* page)
 {
     ASSERT(page);
 
+    page->setPageScaleFactor(1, IntPoint(0, 0));
     page->setPagination(Pagination());
     TextRun::setAllowsRoundingHacks(false);
     WebCore::overrideUserPreferredLanguages(Vector<String>());
@@ -1538,6 +1539,17 @@ String Internals::pageSizeAndMarginsInPixels(int pageNumber, int width, int heig
     return PrintContext::pageSizeAndMarginsInPixels(frame(), pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft);
 }
 
+void Internals::setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCode& ec)
+{
+    Document* document = contextDocument();
+    if (!document || !document->page()) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+    Page* page = document->page();
+    page->setPageScaleFactor(scaleFactor, IntPoint(x, y));
+}
+
 #if ENABLE(FULLSCREEN_API)
 void Internals::webkitWillEnterFullScreenForElement(Document* document, Element* element)
 {
index 8b1afa6..b99f3e3 100644 (file)
@@ -232,6 +232,8 @@ public:
     String pageProperty(String, int, ExceptionCode& = ASSERT_NO_EXCEPTION) const;
     String pageSizeAndMarginsInPixels(int, int, int, int, int, int, int, ExceptionCode& = ASSERT_NO_EXCEPTION) const;
 
+    void setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCode&);
+
 #if ENABLE(FULLSCREEN_API)
     void webkitWillEnterFullScreenForElement(Document*, Element*);
     void webkitDidEnterFullScreenForElement(Document*, Element*);
index 8352bde..167d0e5 100644 (file)
     DOMString pageProperty(in DOMString propertyName, in long pageNumber) raises (DOMException);
     DOMString pageSizeAndMarginsInPixels(in long pageIndex, in long width, in long height, in long marginTop, in long marginRight, in long marginBottom, in long marginLeft) raises (DOMException);
 
+    void setPageScaleFactor(in float scaleFactor, in long x, in long y) raises(DOMException);
 
 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API
     void webkitWillEnterFullScreenForElement(in Document document, in Element element);