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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/csswg-test/css-snap-size-1/snap-height-dynamic-001.html

Issue 2018883002: Fix testharness paths in imported/csswg-test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 <title>CSS Snap Size: snap-height dynamic change</title> 2 <title>CSS Snap Size: snap-height dynamic change</title>
3 <link rel="author" title="Koji Ishii" href="kojiishi@gmail.com"> 3 <link rel="author" title="Koji Ishii" href="kojiishi@gmail.com">
4 <link rel="help" href="https://drafts.csswg.org/css-snap-size/#snap-height"> 4 <link rel="help" href="https://drafts.csswg.org/css-snap-size/#snap-height">
5 <meta name="assert" content="This test asserts changing the snap-height property takes effects."> 5 <meta name="assert" content="This test asserts changing the snap-height property takes effects.">
6 <meta name="flags" content="dom"> 6 <meta name="flags" content="dom">
7 <script src="../../../resources/testharness.js"></script> 7 <script src="/resources/testharness.js"></script>
8 <script src="../../../resources/testharnessreport.js"></script> 8 <script src="/resources/testharnessreport.js"></script>
9 <style> 9 <style>
10 div { 10 div {
11 font-size: 20px; 11 font-size: 20px;
12 line-height: 1; 12 line-height: 1;
13 } 13 }
14 </style> 14 </style>
15 <div id="log"></div> 15 <div id="log"></div>
16 <div id="target">X</div> 16 <div id="target">X</div>
17 <div id="next">X</div> 17 <div id="next">X</div>
18 <script> 18 <script>
19 var before = next.offsetTop; 19 var before = next.offsetTop;
20 target.style.snapHeight = "40px"; 20 target.style.snapHeight = "40px";
21 var after = next.offsetTop; 21 var after = next.offsetTop;
22 forceRelayout(document.documentElement); 22 forceRelayout(document.documentElement);
23 var afterRelayout = next.offsetTop; 23 var afterRelayout = next.offsetTop;
24 24
25 test(function () { 25 test(function () {
26 assert_not_equals(after, before, "Height must change when snap-height changes" ); 26 assert_not_equals(after, before, "Height must change when snap-height changes" );
27 assert_equals(after, afterRelayout, "Height must not change after relayout"); 27 assert_equals(after, afterRelayout, "Height must not change after relayout");
28 }); 28 });
29 29
30 function forceRelayout(element) { 30 function forceRelayout(element) {
31 var saved = element.style.display; 31 var saved = element.style.display;
32 element.style.display = "none"; 32 element.style.display = "none";
33 element.offsetTop; 33 element.offsetTop;
34 element.style.display = saved; 34 element.style.display = saved;
35 element.offsetTop; 35 element.offsetTop;
36 } 36 }
37 </script> 37 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698