-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(css/parser): Add tests for comments (#2364)
- Loading branch information
1 parent
6366d05
commit a36f8e4
Showing
3 changed files
with
710 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* comment */a/* comment */ | ||
{ | ||
/* comment */color/* comment */:/* comment */red/* comment */; | ||
} | ||
|
||
/* a { color: black } */ | ||
/**/ | ||
/* */ | ||
div { | ||
/* inside */ | ||
color: black; | ||
/* between */ | ||
background: red; | ||
/* end */ | ||
} | ||
/* b */ | ||
|
||
a { | ||
color: black; | ||
/* c */ | ||
} | ||
|
||
@media/* comment */screen/* comment */{} | ||
@media /* comment */ screen /* comment */ {} |
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,352 @@ | ||
{ | ||
"type": "Stylesheet", | ||
"span": { | ||
"start": 13, | ||
"end": 360, | ||
"ctxt": 0 | ||
}, | ||
"rules": [ | ||
{ | ||
"type": "StyleRule", | ||
"span": { | ||
"start": 13, | ||
"end": 94, | ||
"ctxt": 0 | ||
}, | ||
"selectors": [ | ||
{ | ||
"type": "ComplexSelector", | ||
"span": { | ||
"start": 13, | ||
"end": 14, | ||
"ctxt": 0 | ||
}, | ||
"selectors": [ | ||
{ | ||
"type": "CompoundSelector", | ||
"span": { | ||
"start": 13, | ||
"end": 14, | ||
"ctxt": 0 | ||
}, | ||
"hasNestPrefix": false, | ||
"combinator": null, | ||
"typeSelector": { | ||
"type": "NamespacedName", | ||
"span": { | ||
"start": 13, | ||
"end": 14, | ||
"ctxt": 0 | ||
}, | ||
"prefix": null, | ||
"name": { | ||
"type": "Text", | ||
"span": { | ||
"start": 13, | ||
"end": 14, | ||
"ctxt": 0 | ||
}, | ||
"value": "a", | ||
"raw": "a" | ||
} | ||
}, | ||
"subclassSelectors": [] | ||
} | ||
] | ||
} | ||
], | ||
"block": { | ||
"type": "DeclBlock", | ||
"span": { | ||
"start": 28, | ||
"end": 94, | ||
"ctxt": 0 | ||
}, | ||
"items": [ | ||
{ | ||
"type": "Property", | ||
"span": { | ||
"start": 43, | ||
"end": 78, | ||
"ctxt": 0 | ||
}, | ||
"name": { | ||
"type": "Text", | ||
"span": { | ||
"start": 43, | ||
"end": 48, | ||
"ctxt": 0 | ||
}, | ||
"value": "color", | ||
"raw": "color" | ||
}, | ||
"values": [ | ||
{ | ||
"type": "Text", | ||
"span": { | ||
"start": 75, | ||
"end": 78, | ||
"ctxt": 0 | ||
}, | ||
"value": "red", | ||
"raw": "red" | ||
} | ||
], | ||
"important": null | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "StyleRule", | ||
"span": { | ||
"start": 132, | ||
"end": 227, | ||
"ctxt": 0 | ||
}, | ||
"selectors": [ | ||
{ | ||
"type": "ComplexSelector", | ||
"span": { | ||
"start": 132, | ||
"end": 135, | ||
"ctxt": 0 | ||
}, | ||
"selectors": [ | ||
{ | ||
"type": "CompoundSelector", | ||
"span": { | ||
"start": 132, | ||
"end": 135, | ||
"ctxt": 0 | ||
}, | ||
"hasNestPrefix": false, | ||
"combinator": null, | ||
"typeSelector": { | ||
"type": "NamespacedName", | ||
"span": { | ||
"start": 132, | ||
"end": 135, | ||
"ctxt": 0 | ||
}, | ||
"prefix": null, | ||
"name": { | ||
"type": "Text", | ||
"span": { | ||
"start": 132, | ||
"end": 135, | ||
"ctxt": 0 | ||
}, | ||
"value": "div", | ||
"raw": "div" | ||
} | ||
}, | ||
"subclassSelectors": [] | ||
} | ||
] | ||
} | ||
], | ||
"block": { | ||
"type": "DeclBlock", | ||
"span": { | ||
"start": 136, | ||
"end": 227, | ||
"ctxt": 0 | ||
}, | ||
"items": [ | ||
{ | ||
"type": "Property", | ||
"span": { | ||
"start": 159, | ||
"end": 171, | ||
"ctxt": 0 | ||
}, | ||
"name": { | ||
"type": "Text", | ||
"span": { | ||
"start": 159, | ||
"end": 164, | ||
"ctxt": 0 | ||
}, | ||
"value": "color", | ||
"raw": "color" | ||
}, | ||
"values": [ | ||
{ | ||
"type": "Text", | ||
"span": { | ||
"start": 166, | ||
"end": 171, | ||
"ctxt": 0 | ||
}, | ||
"value": "black", | ||
"raw": "black" | ||
} | ||
], | ||
"important": null | ||
}, | ||
{ | ||
"type": "Property", | ||
"span": { | ||
"start": 195, | ||
"end": 210, | ||
"ctxt": 0 | ||
}, | ||
"name": { | ||
"type": "Text", | ||
"span": { | ||
"start": 195, | ||
"end": 205, | ||
"ctxt": 0 | ||
}, | ||
"value": "background", | ||
"raw": "background" | ||
}, | ||
"values": [ | ||
{ | ||
"type": "Text", | ||
"span": { | ||
"start": 207, | ||
"end": 210, | ||
"ctxt": 0 | ||
}, | ||
"value": "red", | ||
"raw": "red" | ||
} | ||
], | ||
"important": null | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "StyleRule", | ||
"span": { | ||
"start": 237, | ||
"end": 272, | ||
"ctxt": 0 | ||
}, | ||
"selectors": [ | ||
{ | ||
"type": "ComplexSelector", | ||
"span": { | ||
"start": 237, | ||
"end": 238, | ||
"ctxt": 0 | ||
}, | ||
"selectors": [ | ||
{ | ||
"type": "CompoundSelector", | ||
"span": { | ||
"start": 237, | ||
"end": 238, | ||
"ctxt": 0 | ||
}, | ||
"hasNestPrefix": false, | ||
"combinator": null, | ||
"typeSelector": { | ||
"type": "NamespacedName", | ||
"span": { | ||
"start": 237, | ||
"end": 238, | ||
"ctxt": 0 | ||
}, | ||
"prefix": null, | ||
"name": { | ||
"type": "Text", | ||
"span": { | ||
"start": 237, | ||
"end": 238, | ||
"ctxt": 0 | ||
}, | ||
"value": "a", | ||
"raw": "a" | ||
} | ||
}, | ||
"subclassSelectors": [] | ||
} | ||
] | ||
} | ||
], | ||
"block": { | ||
"type": "DeclBlock", | ||
"span": { | ||
"start": 239, | ||
"end": 272, | ||
"ctxt": 0 | ||
}, | ||
"items": [ | ||
{ | ||
"type": "Property", | ||
"span": { | ||
"start": 245, | ||
"end": 257, | ||
"ctxt": 0 | ||
}, | ||
"name": { | ||
"type": "Text", | ||
"span": { | ||
"start": 245, | ||
"end": 250, | ||
"ctxt": 0 | ||
}, | ||
"value": "color", | ||
"raw": "color" | ||
}, | ||
"values": [ | ||
{ | ||
"type": "Text", | ||
"span": { | ||
"start": 252, | ||
"end": 257, | ||
"ctxt": 0 | ||
}, | ||
"value": "black", | ||
"raw": "black" | ||
} | ||
], | ||
"important": null | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "MediaRule", | ||
"span": { | ||
"start": 274, | ||
"end": 314, | ||
"ctxt": 0 | ||
}, | ||
"query": { | ||
"type": "Text", | ||
"span": { | ||
"start": 293, | ||
"end": 299, | ||
"ctxt": 0 | ||
}, | ||
"value": "screen", | ||
"raw": "screen" | ||
}, | ||
"rules": [] | ||
}, | ||
{ | ||
"type": "MediaRule", | ||
"span": { | ||
"start": 315, | ||
"end": 359, | ||
"ctxt": 0 | ||
}, | ||
"query": { | ||
"type": "Text", | ||
"span": { | ||
"start": 336, | ||
"end": 342, | ||
"ctxt": 0 | ||
}, | ||
"value": "screen", | ||
"raw": "screen" | ||
}, | ||
"rules": [] | ||
} | ||
] | ||
} |
Oops, something went wrong.