mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Store whether sheet being parsed is a UA stylesheet
UA stylesheets allow some things that regular stylesheets don't, for instance allowing use of "non-overridable" `@counter-style` names.
This commit is contained in:
Notes:
github-actions[bot]
2026-02-23 11:22:46 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/3e9cdb2cf4e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8052 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -92,14 +92,21 @@ enum class ParsingMode {
|
||||
SVGPresentationAttribute, // See https://svgwg.org/svg2-draft/types.html#presentation-attribute-css-value
|
||||
};
|
||||
|
||||
enum class IsUAStyleSheet {
|
||||
Yes,
|
||||
No,
|
||||
};
|
||||
|
||||
struct ParsingParams {
|
||||
explicit ParsingParams(ParsingMode = ParsingMode::Normal);
|
||||
explicit ParsingParams(JS::Realm&, ParsingMode = ParsingMode::Normal);
|
||||
explicit ParsingParams(JS::Realm&, IsUAStyleSheet);
|
||||
explicit ParsingParams(DOM::Document const&, ParsingMode = ParsingMode::Normal);
|
||||
|
||||
GC::Ptr<JS::Realm> realm;
|
||||
GC::Ptr<DOM::Document const> document;
|
||||
ParsingMode mode { ParsingMode::Normal };
|
||||
IsUAStyleSheet is_ua_style_sheet { IsUAStyleSheet::No };
|
||||
|
||||
Vector<ValueParsingContext> value_context;
|
||||
Vector<RuleContext> rule_context;
|
||||
@@ -599,6 +606,7 @@ private:
|
||||
GC::Ptr<DOM::Document const> m_document;
|
||||
GC::Ptr<JS::Realm> m_realm;
|
||||
ParsingMode m_parsing_mode { ParsingMode::Normal };
|
||||
IsUAStyleSheet m_is_ua_style_sheet { IsUAStyleSheet::No };
|
||||
|
||||
Vector<Token> m_tokens;
|
||||
TokenStream<Token> m_token_stream;
|
||||
|
||||
Reference in New Issue
Block a user