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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-under-browser-zoom.html

Issue 2105473002: Rename visualViewport.pageScale to visualViewport.scale (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix broken tests Created 4 years, 5 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <style> 2 <style>
3 body { 3 body {
4 height: 2000px; 4 height: 2000px;
5 width: 2000px; 5 width: 2000px;
6 } 6 }
7 ::-webkit-scrollbar { 7 ::-webkit-scrollbar {
8 width: 0px; 8 width: 0px;
9 height: 0px; 9 height: 0px;
10 } 10 }
(...skipping 12 matching lines...) Expand all
23 internals.setPageScaleFactor(2); 23 internals.setPageScaleFactor(2);
24 24
25 // Offset visual viewport by 10px. 25 // Offset visual viewport by 10px.
26 window.visualViewport.scrollTop = 10; 26 window.visualViewport.scrollTop = 10;
27 window.visualViewport.scrollLeft = 10; 27 window.visualViewport.scrollLeft = 10;
28 28
29 assert_equals(window.visualViewport.scrollTop, 10); 29 assert_equals(window.visualViewport.scrollTop, 10);
30 assert_equals(window.visualViewport.scrollLeft, 10); 30 assert_equals(window.visualViewport.scrollLeft, 10);
31 assert_equals(window.visualViewport.clientWidth, 400); 31 assert_equals(window.visualViewport.clientWidth, 400);
32 assert_equals(window.visualViewport.clientHeight, 300); 32 assert_equals(window.visualViewport.clientHeight, 300);
33 assert_equals(window.visualViewport.pageScale, 2); 33 assert_equals(window.visualViewport.scale, 2);
34 34
35 // Apply browser zoom. 35 // Apply browser zoom.
36 window.internals.setZoomFactor(browserZoomFactor); 36 window.internals.setZoomFactor(browserZoomFactor);
37 37
38 // Visual viewport dimensions should be scaled by the browser zoom factor. 38 // Visual viewport dimensions should be scaled by the browser zoom factor.
39 assert_equals(window.visualViewport.scrollTop, 10 / browserZoomFactor); 39 assert_equals(window.visualViewport.scrollTop, 10 / browserZoomFactor);
40 assert_equals(window.visualViewport.scrollLeft, 10 / browserZoomFactor); 40 assert_equals(window.visualViewport.scrollLeft, 10 / browserZoomFactor);
41 assert_equals(window.visualViewport.clientWidth, 400 / browserZoomFactor); 41 assert_equals(window.visualViewport.clientWidth, 400 / browserZoomFactor);
42 assert_equals(window.visualViewport.clientHeight, 300 / browserZoomFactor) ; 42 assert_equals(window.visualViewport.clientHeight, 300 / browserZoomFactor) ;
43 assert_equals(window.visualViewport.pageScale, 2); 43 assert_equals(window.visualViewport.scale, 2);
44 44
45 // Verify setting the visual viewport offset under browser zoom. 45 // Verify setting the visual viewport offset under browser zoom.
46 window.visualViewport.scrollTop = 12.5; 46 window.visualViewport.scrollTop = 12.5;
47 window.visualViewport.scrollLeft = 12.5; 47 window.visualViewport.scrollLeft = 12.5;
48 assert_equals(window.visualViewport.scrollTop, 12.5); 48 assert_equals(window.visualViewport.scrollTop, 12.5);
49 assert_equals(window.visualViewport.scrollLeft, 12.5); 49 assert_equals(window.visualViewport.scrollLeft, 12.5);
50 assert_equals(window.visualViewport.clientWidth, 400 / browserZoomFactor); 50 assert_equals(window.visualViewport.clientWidth, 400 / browserZoomFactor);
51 assert_equals(window.visualViewport.clientHeight, 300 / browserZoomFactor) ; 51 assert_equals(window.visualViewport.clientHeight, 300 / browserZoomFactor) ;
52 assert_equals(window.visualViewport.pageScale, 2); 52 assert_equals(window.visualViewport.scale, 2);
53 t.done(); 53 t.done();
54 }); 54 });
55 }, 'Verify viewport dimensions under bowser zoom.'); 55 }, 'Verify viewport dimensions under bowser zoom.');
56 </script> 56 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698