LibWeb/CSS: Make @page selector parsing accessible

Mostly minor changes - the code has moved, and has to support Token or
ComponentValue TokenStreams, but otherwise it's the same.
This commit is contained in:
Sam Atkins 2025-05-16 11:37:53 +01:00
parent 107b47f884
commit d852ae17e8
Notes: github-actions[bot] 2025-05-16 15:45:11 +00:00
4 changed files with 87 additions and 64 deletions

View file

@ -106,6 +106,11 @@ Optional<CSS::SelectorList> parse_selector_for_nested_style_rule(CSS::Parser::Pa
return adapt_nested_relative_selector_list(*maybe_selectors);
}
Optional<CSS::PageSelectorList> parse_page_selector_list(CSS::Parser::ParsingParams const& params, StringView selector_text)
{
return CSS::Parser::Parser::create(params, selector_text).parse_as_page_selector_list();
}
Optional<CSS::Selector::PseudoElementSelector> parse_pseudo_element_selector(CSS::Parser::ParsingParams const& context, StringView selector_text)
{
return CSS::Parser::Parser::create(context, selector_text).parse_as_pseudo_element_selector();