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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/add-non-blocking-sheet-recalc.html

Issue 2278803002: Use AnalyzedStyleUpdate for non-blocking sheets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed blank line. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/link-alternate-style-recalc.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..14fab58ea7a463b3fc7ab25e00602e058a451648
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/add-non-blocking-sheet-recalc.html
@@ -0,0 +1,28 @@
+<!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 = () => {
+ 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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/link-alternate-style-recalc.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698