Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] error when using combinator incorrectly (#7650)
* error when using combinator incorrectly * add new test case
- Loading branch information
Showing
10 changed files
with
92 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
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
9 changes: 9 additions & 0 deletions
9
test/validator/samples/css-invalid-combinator-selector-1/errors.json
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,9 @@ | ||
[ | ||
{ | ||
"code": "css-invalid-selector", | ||
"message": "Invalid selector \"> span\"", | ||
"start": { "line": 10, "column": 1, "character": 88 }, | ||
"end": { "line": 10, "column": 7, "character": 94 }, | ||
"pos": 88 | ||
} | ||
] |
13 changes: 13 additions & 0 deletions
13
test/validator/samples/css-invalid-combinator-selector-1/input.svelte
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 @@ | ||
<p><span /></p> | ||
|
||
<style> | ||
p > span { | ||
color: red; | ||
} | ||
:has(> span) { | ||
color: red; | ||
} | ||
> span { | ||
color: red; | ||
} | ||
</style> |
9 changes: 9 additions & 0 deletions
9
test/validator/samples/css-invalid-combinator-selector-2/errors.json
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,9 @@ | ||
[ | ||
{ | ||
"code": "css-invalid-selector", | ||
"message": "Invalid selector \"+ p\"", | ||
"start": { "line": 8, "column": 1, "character": 68 }, | ||
"end": { "line": 8, "column": 4, "character": 71 }, | ||
"pos": 68 | ||
} | ||
] |
11 changes: 11 additions & 0 deletions
11
test/validator/samples/css-invalid-combinator-selector-2/input.svelte
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,11 @@ | ||
<p><span /></p> | ||
<p><span /></p> | ||
|
||
<style> | ||
p + p { | ||
color: red; | ||
} | ||
+ p { | ||
color: red; | ||
} | ||
</style> |
9 changes: 9 additions & 0 deletions
9
test/validator/samples/css-invalid-combinator-selector-3/errors.json
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,9 @@ | ||
[ | ||
{ | ||
"code": "css-invalid-selector", | ||
"message": "Invalid selector \"> span\"", | ||
"start": { "line": 5, "column": 2, "character": 44 }, | ||
"end": { "line": 5, "column": 8, "character": 50 }, | ||
"pos": 44 | ||
} | ||
] |
9 changes: 9 additions & 0 deletions
9
test/validator/samples/css-invalid-combinator-selector-3/input.svelte
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,9 @@ | ||
<p><span /></p> | ||
|
||
<style> | ||
@media screen { | ||
> span { | ||
color: red; | ||
} | ||
} | ||
</style> |
9 changes: 9 additions & 0 deletions
9
test/validator/samples/css-invalid-combinator-selector-4/errors.json
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,9 @@ | ||
[ | ||
{ | ||
"code": "css-invalid-selector", | ||
"message": "Invalid selector \"p >\"", | ||
"start": { "line": 4, "column": 1, "character": 26 }, | ||
"end": { "line": 4, "column": 4, "character": 29 }, | ||
"pos": 26 | ||
} | ||
] |
7 changes: 7 additions & 0 deletions
7
test/validator/samples/css-invalid-combinator-selector-4/input.svelte
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,7 @@ | ||
<p><span /></p> | ||
|
||
<style> | ||
p > { | ||
color: red; | ||
} | ||
</style> |