-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement CSSStyleRule.selectorText.
We parse when assigning using the namespaces of the stylesheet. It isn't clear if the spec says to do that (Firefox doesn't support the setter at all, Chrome does, Safari doesn't); the spec issue is here: w3c/csswg-drafts#1511 Also fix ToCss implementation of AttrSelectorOperator to not pad with spaces, to conform with CSSOM. This means we have to update some unit tests that expect operators with spaces around them in attribute selectors to roundtrip. See the "attribute selector" section of "Serializing Selectors" here: https://drafts.csswg.org/cssom/#serializing-selectors CSSStyleRule.selectorText is specified here: https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext
- Loading branch information
Showing
14 changed files
with
109 additions
and
100 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -15,6 +15,3 @@ | |
[StyleRule_properties] | ||
expected: FAIL | ||
|
||
[StyleRule_properties_values] | ||
expected: FAIL | ||
|
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
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
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
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
68 changes: 0 additions & 68 deletions
68
tests/wpt/metadata/selectors/attribute-selectors/attribute-case/cssom.html.ini
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
tests/wpt/web-platform-tests/cssom/selectorText-modification-restyle-001-ref.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,13 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>(Ref #1) CSSOM - CSSStyleRule.selectorText Modification Restyle - Reference #1</title> | ||
|
||
<style> | ||
div { | ||
color: green; | ||
} | ||
</style> | ||
|
||
<body> | ||
<div>I should be green.</div> | ||
</body> |
21 changes: 21 additions & 0 deletions
21
tests/wpt/web-platform-tests/cssom/selectorText-modification-restyle-001.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,21 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>(Test #1) CSSOM - CSSStyleRule.selectorText Modification Restyle - Test #1</title> | ||
<link rel="match" href="selectorText-modification-restyle-001-ref.html"> | ||
|
||
<style> | ||
@namespace bogus url(http://example.com/bogus); | ||
|
||
bogus|div { | ||
color: green; | ||
} | ||
</style> | ||
|
||
<body> | ||
<div>I should be green.</div> | ||
<script> | ||
// Remove the "bogus" namespace--now it should apply to the div above. | ||
// We also expect to see a restyle. | ||
document.querySelector("style").sheet.cssRules[1].selectorText = "div"; | ||
</script> | ||
</body> |