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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/invalidation/class-invalidation-after-adding-sheet.html

Issue 2451893003: Move Document global rule data to CSSGlobalRuleSet. (Closed)
Patch Set: Rebased. Created 4 years, 2 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/Source/core/css/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/invalidation/class-invalidation-after-adding-sheet.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/class-invalidation-after-adding-sheet.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/class-invalidation-after-adding-sheet.html
new file mode 100644
index 0000000000000000000000000000000000000000..5d488a7cc068f63c61903c28f2ed053ca099e80f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/class-invalidation-after-adding-sheet.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<div id="d1">This text should be green</div>
+<script>
+ test(() => {
+ document.body.offsetTop;
+ assert_equals(getComputedStyle(d1).color, "rgb(0, 0, 0)", "Precondition - text is black.");
+
+ var sheet = document.createElement("style");
+ sheet.innerText = ".green { color: green }"
+ document.head.appendChild(sheet);
+ d1.className = "green";
+ assert_equals(getComputedStyle(d1).color, "rgb(0, 128, 0)", "Check that d1 with class 'green' is green.");
+ }, "Check that style invalidation works when class is changed immediately after adding sheet with rule for class.");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698