mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
style: Don't remain in an invalid state when encountering an at-rule in the wrong place.
Currently, attempting to parse an at-rule that is out of place, such as an @import rule after a regular style rule, will cause the parser state to be set to Invalid. This will cause any following at-rule to be rejected until we encounter a regular style rule, at which point we'll go back to the Body state. There's nothing in the CSS specs about needing to reject all following at-rules (or, as the comment above Invalid says, ignoring the entire rest of the style sheet).
This commit is contained in:
parent
6b320eaad3
commit
9c0ce7847f
3 changed files with 31 additions and 20 deletions
|
@ -337,6 +337,7 @@ impl Stylesheet {
|
|||
loader: stylesheet_loader,
|
||||
context: context,
|
||||
state: State::Start,
|
||||
had_hierarchy_error: false,
|
||||
namespaces: Some(namespaces),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue