forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make selector list pseudos work with class invalidation sets.
Selectors like :not and :-webkit-any have selector lists. Classes, ids and tag names in those lists were not taken into account when building class invalidation sets. Re-introduce a white-list for supported pseudos and disallow :not and :-webkit-any for now. R=esprehn@chromium.org,chrishtr@chromium.org BUG=344893 Review URL: https://codereview.chromium.org/174013010 git-svn-id: svn://svn.chromium.org/blink/trunk@167560 bbb929c8-8fbe-4397-9dbb-9b2b20218538
- Loading branch information
rune@opera.com
committed
Feb 21, 2014
1 parent
f54b22e
commit 8b4d2ba
Showing
3 changed files
with
129 additions
and
3 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
..._party/WebKit/LayoutTests/fast/css/invalidation/dynamic-selector-list-pseudo-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Change classes affecting :-webkit-any and :not. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS getComputedStyle(t1, null).backgroundColor is transparent | ||
PASS getComputedStyle(t1, null).backgroundColor is green | ||
PASS getComputedStyle(t2, null).backgroundColor is transparent | ||
PASS getComputedStyle(t2, null).backgroundColor is green | ||
PASS getComputedStyle(t3, null).backgroundColor is transparent | ||
PASS getComputedStyle(t3, null).backgroundColor is green | ||
PASS getComputedStyle(t4, null).backgroundColor is transparent | ||
PASS getComputedStyle(t4, null).backgroundColor is green | ||
PASS getComputedStyle(t5, null).backgroundColor is transparent | ||
PASS getComputedStyle(t5, null).backgroundColor is green | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Background should be green | ||
Background should be green | ||
Background should be green | ||
Background should be green | ||
Background should be green |
57 changes: 57 additions & 0 deletions
57
third_party/WebKit/LayoutTests/fast/css/invalidation/dynamic-selector-list-pseudo.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE html> | ||
<script src="../../../resources/js-test.js"></script> | ||
<style> | ||
.a1 .a2:-webkit-any(.a3, .a4) { background-color: green } | ||
.b1 .b2:not(.b3) { background-color: green } | ||
.c1 .c2:-webkit-any(:not(.c3)) { background-color: green } | ||
.d1:not(.d2) .d3 { background-color: green; } | ||
.e1 :not(.e2) { background-color: green; } | ||
</style> | ||
<div class="a1"> | ||
<div class="a2" id="t1">Background should be green</div> | ||
</div> | ||
<div class="b1"> | ||
<div class="b2 b3" id="t2">Background should be green</div> | ||
</div> | ||
<div class="c1"> | ||
<div class="c2 c3" id="t3">Background should be green</div> | ||
</div> | ||
<div id="outer-d" class="d1 d2"> | ||
<div id="t4" class="d3">Background should be green</div> | ||
</div> | ||
<div id="outer-e"> | ||
<div id="t5">Background should be green</div> | ||
</div> | ||
<script> | ||
description("Change classes affecting :-webkit-any and :not.") | ||
|
||
document.body.offsetTop; // force style recalc. | ||
|
||
var transparent = 'rgba(0, 0, 0, 0)'; | ||
var green = 'rgb(0, 128, 0)'; | ||
|
||
var t1 = document.getElementById("t1"); | ||
shouldBe("getComputedStyle(t1, null).backgroundColor", "transparent"); | ||
t1.className = "a2 a3"; | ||
shouldBe("getComputedStyle(t1, null).backgroundColor", "green"); | ||
|
||
var t2 = document.getElementById("t2"); | ||
shouldBe("getComputedStyle(t2, null).backgroundColor", "transparent"); | ||
t2.className = "b2"; | ||
shouldBe("getComputedStyle(t2, null).backgroundColor", "green"); | ||
|
||
var t3 = document.getElementById("t3"); | ||
shouldBe("getComputedStyle(t3, null).backgroundColor", "transparent"); | ||
t3.className = "c2"; | ||
shouldBe("getComputedStyle(t3, null).backgroundColor", "green"); | ||
|
||
var t4 = document.getElementById("t4"); | ||
shouldBe("getComputedStyle(t4, null).backgroundColor", "transparent"); | ||
document.getElementById("outer-d").className = "d1"; | ||
shouldBe("getComputedStyle(t4, null).backgroundColor", "green"); | ||
|
||
var t5 = document.getElementById("t5"); | ||
shouldBe("getComputedStyle(t5, null).backgroundColor", "transparent"); | ||
document.getElementById("outer-e").className = "e1"; | ||
shouldBe("getComputedStyle(t5, null).backgroundColor", "green"); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters