1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

LibWeb: Spec-comment parse_a_stylesheet()

Also introduce a `location` parameter when parsing a CSSStyleSheet. This
is not provided by anyone yet.
This commit is contained in:
Sam Atkins 2022-03-29 16:51:31 +01:00 committed by Andreas Kling
parent 05bd0ca3ee
commit 87b125dcb9
4 changed files with 29 additions and 14 deletions

View file

@ -90,7 +90,7 @@ public:
~Parser() = default;
// The normal parser entry point, for parsing stylesheets.
NonnullRefPtr<CSSStyleSheet> parse_as_stylesheet();
NonnullRefPtr<CSSStyleSheet> parse_as_stylesheet(Optional<AK::URL> location);
// For the content of at-rules such as @media. It differs from "Parse a stylesheet" in the handling of <CDO-token> and <CDC-token>.
NonnullRefPtrVector<CSSRule> parse_as_list_of_rules();
// For use by the CSSStyleSheet#insertRule method, and similar functions which might exist, which parse text into a single rule.
@ -135,7 +135,7 @@ private:
};
template<typename T>
NonnullRefPtr<CSSStyleSheet> parse_a_stylesheet(TokenStream<T>&);
NonnullRefPtr<CSSStyleSheet> parse_a_stylesheet(TokenStream<T>&, Optional<AK::URL> location);
template<typename T>
NonnullRefPtrVector<CSSRule> parse_a_list_of_rules(TokenStream<T>&);
template<typename T>
@ -361,7 +361,7 @@ private:
namespace Web {
RefPtr<CSS::CSSStyleSheet> parse_css_stylesheet(CSS::ParsingContext const&, StringView);
RefPtr<CSS::CSSStyleSheet> parse_css_stylesheet(CSS::ParsingContext const&, StringView, Optional<AK::URL> location = {});
RefPtr<CSS::ElementInlineCSSStyleDeclaration> parse_css_style_attribute(CSS::ParsingContext const&, StringView, DOM::Element&);
RefPtr<CSS::StyleValue> parse_css_value(CSS::ParsingContext const&, StringView, CSS::PropertyID property_id = CSS::PropertyID::Invalid);
Optional<CSS::SelectorList> parse_selector(CSS::ParsingContext const&, StringView);