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

Side by Side Diff: third_party/WebKit/LayoutTests/external/csswg-test/css-rhythm-1/snap-height-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 Snap Size: snap-height 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/#snap-height">
5 <meta name="assert" content="This test asserts changing the snap-height property 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 var before = next.offsetTop;
20 target.style.snapHeight = "40px";
21 var after = next.offsetTop;
22 forceRelayout(document.documentElement);
23 var afterRelayout = next.offsetTop;
24
25 test(function () {
26 assert_not_equals(after, before, "Height must change when snap-height changes" );
27 assert_equals(after, afterRelayout, "Height must not change after relayout");
28 });
29
30 function forceRelayout(element) {
31 var saved = element.style.display;
32 element.style.display = "none";
33 element.offsetTop;
34 element.style.display = saved;
35 element.offsetTop;
36 }
37 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698