Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/css/add-non-blocking-sheet-recalc.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/css/add-non-blocking-sheet-recalc.html b/third_party/WebKit/LayoutTests/fast/css/add-non-blocking-sheet-recalc.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f2780e58279b77abbecd2e8784cf52230aa99aee |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/css/add-non-blocking-sheet-recalc.html |
| @@ -0,0 +1,29 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<link id="media-sheet" rel="stylesheet" media="(min-width: 5000px)"> |
| +<link id="alternate-sheet" rel="alternate stylesheet" title="alternate"> |
| +<script> |
| + var test = async_test("Check that adding a non-blocking stylesheet does not cause a full document recalc."); |
| + |
| + window.onload = () => { |
| + |
|
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.
|
| + document.body.offsetTop; |
| + |
| + test.step(() => { |
| + assert_true(!!window.internals, "Test requires internals object for recalc count."); |
| + }); |
| + |
| + test.step(() => { |
| + document.querySelector("#media-sheet").href = "data:text/css,#x{color:pink}"; |
| + assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 0, "No style recalc adding sheet without matching rules."); |
| + }); |
| + |
| + test.step(() => { |
| + document.querySelector("#alternate-sheet").href = "data:text/css,*{color:pink}"; |
| + assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 0, "No style recalc adding alternate sheet."); |
| + }); |
| + |
| + test.done(); |
| + }; |
| +</script> |