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

Side by Side Diff: LayoutTests/css3/device-adapt/viewport-height-extend-to-zoom.html

Issue 19632002: Support 'extend-to-zoom' viewport descriptor value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated after review comments Created 7 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
« no previous file with comments | « no previous file | LayoutTests/css3/device-adapt/viewport-height-extend-to-zoom-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>User stylesheet containing an @viewport rule</title> 4 <title>Viewport 'height' descriptor has 'extend-to-zoom' value</title>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 <style> 7 <style>
8 html, body { width: 100%; height: 100%; margin: 0 } 8 html, body { width: 100%; height: 100%; margin: 0 }
9 9 @viewport { height: -internal-extend-to-zoom; zoom: 2.0; }
10 @viewport {
11 height: 2000px;
12 }
13 </style> 10 </style>
14 <script> 11 <script>
15 test(function(){ 12 test(function(){
16 assert_own_property(window, "testRunner"); 13 assert_own_property(window, "testRunner");
17 }, "Check that window.testRunner is present. Required to add a user styl esheet."); 14 }, "Check that window.testRunner is present. Required to add a user styl esheet.");
18 15
19 if (window.testRunner) { 16 if (window.testRunner) {
20 testRunner.addUserStyleSheet("@viewport { width: 450px; height: auto ; zoom: auto; min-zoom: auto; max-zoom: auto }", true); 17 testRunner.addUserStyleSheet("@viewport { width: -internal-extend-to -zoom 980px; min-zoom: 0.25; max-zoom: 5; height: auto ; zoom: auto; }", true);
kenneth.r.christiansen 2013/07/18 14:55:35 There is no auto for zoom, according to the spec
21 } 18 }
22 </script> 19 </script>
23 </head> 20 </head>
24 <body> 21 <body>
25 <div id="log"></div> 22 <div id="log"></div>
26 <script> 23 <script>
27 test(function(){ 24 test(function(){
28 assert_own_property(window, "internals"); 25 assert_own_property(window, "internals");
29 }, "Check that window.internals is present. Required to call configurati onForViewport."); 26 }, "Check that window.internals is present. Required to call configurati onForViewport.");
30 27
31 var actualWidth; 28 var actualWidth;
32 var actualHeight; 29 var actualHeight;
33 30
34 var vpString = internals.configurationForViewport(document, 1, 320, 480, 320, 352); 31 var vpString = internals.configurationForViewport(document, 1, 320, 480, 320, 352);
35 var match = /viewport size (.+)x(.+) scale (.+ )/.exec(vpString); 32 var match = /viewport size (.+)x(.+) scale (.+ )/.exec(vpString);
36 33
37 if (match) { 34 if (match) {
38 actualWidth = parseFloat(match[1]);
39 actualHeight = parseFloat(match[2]); 35 actualHeight = parseFloat(match[2]);
40 } 36 }
41 37
42 test(function(){ 38 test(function(){
43 assert_equals(actualWidth, 450); 39 assert_equals(actualHeight, 176);
44 }, "Check that we get the viewport width from the user stylesheet."); 40 }, "Check viewport height is 'initial-height / extend-zoom'.");
45 document.body.offsetHeight;
46
47 test(function(){
48 assert_equals(actualHeight, 2000);
49 }, "Check that we get the viewport height from the author stylesheet.");
50 </script> 41 </script>
51 </body> 42 </body>
52 </html> 43 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/css3/device-adapt/viewport-height-extend-to-zoom-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698