Title: [117954] trunk/LayoutTests
Revision
117954
Author
[email protected]
Date
2012-05-22 04:57:20 -0700 (Tue, 22 May 2012)

Log Message

Add a layout test for attribute selector invalidation triggering recursive style recalc.
<http://webkit.org/b/21346>

Reviewed by Antti Koivisto.

Bug 21346 was already fixed somewhere in the semirecent past, so here's the provided
test case as form of a layout test to make sure we don't regress this again.

* fast/css/attribute-selector-recursive-update-on-setAttribute-expected.txt: Added.
* fast/css/attribute-selector-recursive-update-on-setAttribute.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (117953 => 117954)


--- trunk/LayoutTests/ChangeLog	2012-05-22 11:54:50 UTC (rev 117953)
+++ trunk/LayoutTests/ChangeLog	2012-05-22 11:57:20 UTC (rev 117954)
@@ -1,3 +1,16 @@
+2012-05-22  Andreas Kling  <[email protected]>
+
+        Add a layout test for attribute selector invalidation triggering recursive style recalc.
+        <http://webkit.org/b/21346>
+
+        Reviewed by Antti Koivisto.
+
+        Bug 21346 was already fixed somewhere in the semirecent past, so here's the provided
+        test case as form of a layout test to make sure we don't regress this again.
+
+        * fast/css/attribute-selector-recursive-update-on-setAttribute-expected.txt: Added.
+        * fast/css/attribute-selector-recursive-update-on-setAttribute.html: Added.
+
 2012-05-22  Ilya Tikhonovsky  <[email protected]>
 
         Web Inspector: HeapProfiler: upstream retainedSize calculation.

Added: trunk/LayoutTests/fast/css/attribute-selector-recursive-update-on-setAttribute-expected.txt (0 => 117954)


--- trunk/LayoutTests/fast/css/attribute-selector-recursive-update-on-setAttribute-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/attribute-selector-recursive-update-on-setAttribute-expected.txt	2012-05-22 11:57:20 UTC (rev 117954)
@@ -0,0 +1,11 @@
+This test checks that attribute selectors are recursively re-evaluated when the attribute changes.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS getComputedStyle(toggle).color is 'rgb(0, 128, 0)'
+PASS getComputedStyle(toggle).color is 'rgb(255, 0, 0)'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/css/attribute-selector-recursive-update-on-setAttribute.html (0 => 117954)


--- trunk/LayoutTests/fast/css/attribute-selector-recursive-update-on-setAttribute.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/attribute-selector-recursive-update-on-setAttribute.html	2012-05-22 11:57:20 UTC (rev 117954)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+<style>
+.entry[status="foo"] .toggle {
+    color: green;
+}
+.entry[status="bar"] .toggle {
+    color: red;
+}
+</style>
+</head>
+<body>
+<div class="entry" status="foo">
+    <span class="toggle">Text.</span>
+</div>
+<script>
+
+description("This test checks that attribute selectors are recursively re-evaluated when the attribute changes.");
+
+var entry= document.getElementsByClassName("entry")[0];
+var toggle = document.getElementsByClassName("toggle")[0];
+
+shouldBe("getComputedStyle(toggle).color", "'rgb(0, 128, 0)'");
+entry.setAttribute("status", "bar");
+shouldBe("getComputedStyle(toggle).color", "'rgb(255, 0, 0)'");
+
+document.body.removeChild(entry);
+
+</script>
+<script src=""
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to