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

Side by Side Diff: third_party/WebKit/LayoutTests/external/csswg-test/css-rhythm-1/line-height-step-dynamic-001.html

Issue 2707203005: Import csswg-test@ed79f8614481e97d61f17f41b65448c211d27c6f (Closed)
Patch Set: Created 3 years, 9 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
(Empty)
1 <!DOCTYPE html>
2 <title>CSS Rhythmic Sizing: line-height-step dynamic change</title>
3 <link rel="author" title="Koji Ishii" href="mailto:kojiishi@gmail.com">
4 <link rel="help" href="https://drafts.csswg.org/css-rhythm-1/#line-height-step">
5 <meta name="assert" content="This test asserts changing the line-height-step pro perty takes effects.">
6 <meta name="flags" content="dom">
7 <script src="/resources/testharness.js"></script>
8 <script src="/resources/testharnessreport.js"></script>
9 <style>
10 div {
11 font-size: 20px;
12 line-height: 1;
13 }
14 </style>
15 <div id="log"></div>
16 <div id="target">X</div>
17 <div id="next">X</div>
18 <script>
19 runTests();
20 function runTests() {
21 var before = next.offsetTop;
22 target.style.lineHeightStep = "40px";
23 var after = next.offsetTop;
24 forceRelayout(document.documentElement);
25 var afterRelayout = next.offsetTop;
26
27 test(function () {
28 assert_not_equals(after, before);
29 }, "Height must change when line-height-step changes");
30 test(function () {
31 assert_equals(after, afterRelayout);
32 }, "Height must not change after relayout");
33 }
34
35 function forceRelayout(element) {
36 var saved = element.style.display;
37 element.style.display = "none";
38 element.offsetTop;
39 element.style.display = saved;
40 element.offsetTop;
41 }
42 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698