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

Side by Side Diff: LayoutTests/css3/device-adapt/opera/descriptor-values-006.html

Issue 23101004: Make configurationForViewport match production code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renamed configurationForViewport to viewportAsText 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <meta charset="UTF-8"> 4 <meta charset="UTF-8">
5 <title>CSS Test: @viewport device-width invalid length</title> 5 <title>CSS Test: @viewport device-width invalid length</title>
6 <link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com"> 6 <link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
7 <link rel="help" href="http://www.w3.org/TR/css-device-adapt/#viewport-descrip tors"> 7 <link rel="help" href="http://www.w3.org/TR/css-device-adapt/#viewport-descrip tors">
8 <meta name="flags" content="visual scroll dom"> 8 <meta name="flags" content="visual scroll dom">
9 <meta name="assert" content="device-width is not a valid <viewport-length> val ue."> 9 <meta name="assert" content="device-width is not a valid <viewport-length> val ue.">
10 <script src="../../../resources/testharness.js" type="text/javascript"></scrip t> 10 <script src="../../../resources/testharness.js" type="text/javascript"></scrip t>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 /* Initialize an object to store viewport values to be used by the test 43 /* Initialize an object to store viewport values to be used by the test
44 asserts. */ 44 asserts. */
45 var viewport = new Object(); 45 var viewport = new Object();
46 46
47 /* An element with the same size as the initial containing block. */ 47 /* An element with the same size as the initial containing block. */
48 var testElm = document.getElementById("test"); 48 var testElm = document.getElementById("test");
49 49
50 if (window.testRunner) { 50 if (window.testRunner) {
51 viewport.fontSize = parseInt(getComputedStyle(testElm, "").fontSize); 51 viewport.fontSize = parseInt(getComputedStyle(testElm, "").fontSize);
52 viewport.deviceWidth = 320;
53 viewport.deviceHeight = 480;
54 viewport.initialWidth = 320; 52 viewport.initialWidth = 320;
55 viewport.initialHeight = 352; 53 viewport.initialHeight = 352;
56 54
57 var vpString = internals.configurationForViewport(document, 1, 55 var vpString = internals.viewportAsText(document, 1,
58 viewport.deviceWidth, 56 viewport.initialWidth,
59 viewport.deviceHeight, 57 viewport.initialHeight);
60 viewport.initialWidth,
61 viewport.initialHeight );
62 58
63 var match = /viewport size (.+)x(.+) scale (.+ )/.exec(vpString); 59 var match = /viewport size (.+)x(.+) scale (.+ )/.exec(vpString);
64 60
65 if (match) { 61 if (match) {
66 viewport.actualWidth = parseFloat(match[1]); 62 viewport.actualWidth = parseFloat(match[1]);
67 viewport.actualHeight = parseFloat(match[2]); 63 viewport.actualHeight = parseFloat(match[2]);
68 viewport.zoom = parseFloat(match[3]); 64 viewport.zoom = parseFloat(match[3]);
69 } 65 }
70 } 66 }
71 else { 67 else {
(...skipping 26 matching lines...) Expand all
98 document.getElementById("log").style.display = "block"; 94 document.getElementById("log").style.display = "block";
99 } 95 }
100 </script> 96 </script>
101 </head> 97 </head>
102 <body> 98 <body>
103 <div id="test"> 99 <div id="test">
104 <div id="log"></div> 100 <div id="log"></div>
105 </div> 101 </div>
106 </body> 102 </body>
107 </html> 103 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698