-
Notifications
You must be signed in to change notification settings - Fork 756
Closed
Labels
Closed Accepted by CSSWG ResolutionCommenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.Commenter has indicated satisfaction with the resolution / edits.TestedMemory aid - issue has WPT testsMemory aid - issue has WPT testscss-syntax-3
Milestone
Description
The "Serializing <an+b>" matches what Chrome does, but not what Safari or Firefox does. This section is referred to by the "Serializing Selectors" section of CSS OM.
Firefox just writes n when a is 1, while Safari separates fields with spaces.
With the following page, here are some example serializations given by Firefox, Chrome, and Safari:
<style type="text/css">
:nth-child(X){}
</style>
<script type="text/javascript">
console.log(document.styleSheets[0].cssRules[0].cssText);
</script>
| :nth-child(X) | Firefox | Chrome | Safari |
|---|---|---|---|
1n - 0 |
n |
1n |
1n - 0 |
n + 1 |
n+1 |
1n+1 |
n + 1 |
-n - 5 |
-n-5 |
-1n-5 |
-n - 5 |
+1 |
1 |
1 |
+1 |
-1n-5 |
-n-5 |
-1n-5 |
-1n-5* |
-1n -5 |
-n-5 |
-1n-5 |
-1n -5* |
* Does this mean Safari doesn't add spaces if you don't add them, but keeps one if you add one or more?
Metadata
Metadata
Assignees
Labels
Closed Accepted by CSSWG ResolutionCommenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.Commenter has indicated satisfaction with the resolution / edits.TestedMemory aid - issue has WPT testsMemory aid - issue has WPT testscss-syntax-3