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

Side by Side Diff: LayoutTests/css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rebased.. Created 7 years 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
(Empty)
1 <!DOCTYPE html>
2 <meta charset="UTF-8">
esprehn 2013/12/04 06:02:28 This charset is not needed.
Timothy Loh 2013/12/04 07:17:39 Done.
3 <style>
4 #test {
5 font-size: 5vh;
6 width: 50vw;
7 }
8 </style>
9 <script src="/usr/local/google/home/timloh/Coding/Chromium/src/third_party/WebKi t/LayoutTests/resources/js-test.js"></script>
10 <body>
esprehn 2013/12/04 06:02:28 I'd leave out the body, but it's not a big deal.
Timothy Loh 2013/12/04 07:17:39 Done.
11 This test of viewport units and resizing depends on window.resizeTo.
12
13 <div id="test"></div>
14
15 <script>
16 if (window.testRunner) {
17 testRunner.useUnfortunateSynchronousResizeMode();
18 testRunner.dumpAsText();
19 testRunner.waitUntilDone();
20 }
21 var sizes = [[800, 600], [900, 600], [900, 700], [700, 500], [800, 600]]
22 var test = document.getElementById("test");
23 for (var i = 0; i < sizes.length; ++i) {
24 var width = sizes[i][0];
25 var height = sizes[i][1];
26 window.resizeTo(width, height);
27 shouldBe("window.innerWidth", "" + width);
28 shouldBe("window.innerHeight", "" + height);
29 shouldBe("getComputedStyle(test).fontSize", "'" + height/20 + "px'");
30 shouldBe("getComputedStyle(test).width", "'" + width/2 + "px'");
31 }
32 if (window.testRunner)
33 testRunner.notifyDone();
34 </script>
35 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698