Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: LayoutTests/fast/dom/window-scroll-scaling.html

Issue 18546003: Fix tests to avoid page scale reset when setting page scale. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use setPageScaleFactorLimits(). Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <body> 2 <body>
3 <script src="../js/resources/js-test-pre.js"></script> 3 <script src="../js/resources/js-test-pre.js"></script>
4 <script> 4 <script>
5 description("This test ensures that document content width (height) as r eported by scrollWidth (scrollHeight) is invariant to changes in page scale fact or."); 5 description("This test ensures that document content width (height) as r eported by scrollWidth (scrollHeight) is invariant to changes in page scale fact or.");
6 6
7 if (window.internals) 7 if (window.internals)
8 window.internals.settings.setMockScrollbarsEnabled(true); 8 window.internals.settings.setMockScrollbarsEnabled(true);
9 9
10 var body = document.body; 10 var body = document.body;
11 11
12 // According to CSSOM (http://dev.w3.org/csswg/cssom-view/#dom-element-s crollwidth) 12 // According to CSSOM (http://dev.w3.org/csswg/cssom-view/#dom-element-s crollwidth)
13 // the scrollWidth of the body element (in Quirks mode) is defined as 13 // the scrollWidth of the body element (in Quirks mode) is defined as
14 // max(document content width, value of innerWidth). 14 // max(document content width, value of innerWidth).
15 // In this test, we want to measure the document content width (height), 15 // In this test, we want to measure the document content width (height),
16 // rather than innerWidth (innerHeight), so we make the body element 16 // rather than innerWidth (innerHeight), so we make the body element
17 // larger than the innerWidth (innerHeight). 17 // larger than the innerWidth (innerHeight).
18 18
19 body.style["width"] = window.innerWidth + 100 + "px"; 19 body.style["width"] = window.innerWidth + 100 + "px";
20 body.style["height"] = window.innerHeight + 100 + "px"; 20 body.style["height"] = window.innerHeight + 100 + "px";
21 21
22 var originalScrollWidth = body.scrollWidth; 22 var originalScrollWidth = body.scrollWidth;
23 var originalScrollHeight = body.scrollHeight; 23 var originalScrollHeight = body.scrollHeight;
24 24
25 var scale = 1.1; 25 var scale = 1.1;
26 if (window.internals) 26 if (window.eventSender)
27 window.internals.setPageScaleFactor(scale, 0, 0); 27 window.eventSender.setPageScaleFactor(scale, 0, 0);
28 28
29 // As we have increased the scale factor, the innerWidth will be less 29 // As we have increased the scale factor, the innerWidth will be less
30 // as fewer CSS pixels will be rendered in the same viewport, so 30 // as fewer CSS pixels will be rendered in the same viewport, so
31 // body.scrollWidth (scrollHeight) will still be measuring the document 31 // body.scrollWidth (scrollHeight) will still be measuring the document
32 // content width (height). 32 // content width (height).
33 33
34 shouldBe("body.scrollWidth", "originalScrollWidth"); 34 shouldBe("body.scrollWidth", "originalScrollWidth");
35 shouldBe("body.scrollHeight", "originalScrollHeight"); 35 shouldBe("body.scrollHeight", "originalScrollHeight");
36 </script> 36 </script>
37 <script src="../js/resources/js-test-post.js"></script> 37 <script src="../js/resources/js-test-post.js"></script>
38 </body> 38 </body>
39 </html> 39 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/window-inner-size-scaling.html ('k') | LayoutTests/fast/dom/zoom-scroll-page-test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698