mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +00:00
LibWeb: Support parsing some data: URLs in CSS
For now, data URLs are explicitly limited to expected MIME types. For example, image-related styles accept image MIME types.
This commit is contained in:
parent
1e6afa9fd5
commit
eb0fb38cac
2 changed files with 28 additions and 11 deletions
|
@ -195,7 +195,12 @@ private:
|
|||
static Optional<float> try_parse_float(StringView string);
|
||||
static Optional<Color> parse_color(ParsingContext const&, StyleComponentValueRule const&);
|
||||
static Optional<Length> parse_length(ParsingContext const&, StyleComponentValueRule const&);
|
||||
static Optional<AK::URL> parse_url_function(ParsingContext const&, StyleComponentValueRule const&);
|
||||
|
||||
enum class AllowedDataUrlType {
|
||||
None,
|
||||
Image,
|
||||
};
|
||||
static Optional<AK::URL> parse_url_function(ParsingContext const&, StyleComponentValueRule const&, AllowedDataUrlType = AllowedDataUrlType::None);
|
||||
|
||||
Result<NonnullRefPtr<StyleValue>, ParsingResult> parse_css_value(PropertyID, TokenStream<StyleComponentValueRule>&);
|
||||
static RefPtr<StyleValue> parse_css_value(ParsingContext const&, StyleComponentValueRule const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue