OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../../resources/testharness.js"></script> | |
3 <script src="../../resources/testharnessreport.js"></script> | |
4 <link id="media-sheet" rel="stylesheet" media="(min-width: 5000px)"> | |
5 <link id="alternate-sheet" rel="alternate stylesheet" title="alternate"> | |
6 <script> | |
7 var test = async_test("Check that adding a non-blocking stylesheet does not cause a full document recalc."); | |
8 | |
9 window.onload = () => { | |
10 | |
sashab
2016/08/25 23:25:12
Remove blank line
sashab
2016/08/25 23:25:13
Remove blank line
rune
2016/08/26 07:15:34
Done.
| |
11 document.body.offsetTop; | |
12 | |
13 test.step(() => { | |
14 assert_true(!!window.internals, "Test requires internals object for recalc count."); | |
15 }); | |
16 | |
17 test.step(() => { | |
18 document.querySelector("#media-sheet").href = "data:text/css,#x{colo r:pink}"; | |
19 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 0, "No style recalc adding sheet without matching rules."); | |
20 }); | |
21 | |
22 test.step(() => { | |
23 document.querySelector("#alternate-sheet").href = "data:text/css,*{c olor:pink}"; | |
24 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 0, "No style recalc adding alternate sheet."); | |
25 }); | |
26 | |
27 test.done(); | |
28 }; | |
29 </script> | |
OLD | NEW |