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

Unified Diff: LayoutTests/fast/css/invalidation/content-attr.html

Issue 609813002: Use LocalStyleChange for content:attr() changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added invalidation tests Created 6 years, 3 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
Index: LayoutTests/fast/css/invalidation/content-attr.html
diff --git a/LayoutTests/fast/css/invalidation/content-attr.html b/LayoutTests/fast/css/invalidation/content-attr.html
new file mode 100644
index 0000000000000000000000000000000000000000..19e76b72a51607900d74a7e0d07c352f7622a3ec
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/content-attr.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+#before::before, #after::after { content: attr(my-value); }
+</style>
+<div id="before">
+ <div></div>
+ <div>
+ <div></div>
+ </div>
+</div>
+<div id="after">
+ <div></div>
+ <div>
+ <div></div>
+ </div>
+</div>
+<script>
+description("No subtree recalc when changing attribute used in generated content.");
+
+document.body.offsetTop; // force layout
+
+// Setting attribute neither used in attribute selectors nor content should not
+// cause a recalc.
+
+before.setAttribute("attr-unused", "unused");
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "0");
+
+document.body.offsetTop; // force layout
+
+before.setAttribute("my-value", "before");
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
+
+document.body.offsetTop; // force layout
+
+after.setAttribute("my-value", "after");
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
+</script>

Powered by Google App Engine
This is Rietveld 408576698