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

LibWeb: Add a dedicated function for parsing HTML length values

Presentation attribute lengths (width, height, etc.) can always be
unit-less (e.g "400") so going via the normal CSS parsing path only
works when the document is in quirks mode.

Add a separate parse_html_length() that always allows unit-less values.
This commit is contained in:
Andreas Kling 2020-07-22 01:13:18 +02:00
parent 9fc00d5d12
commit 5a7e57457e
4 changed files with 12 additions and 2 deletions

View file

@ -53,4 +53,6 @@ RefPtr<LengthStyleValue> parse_line_width(const CSS::ParsingContext&, const Stri
RefPtr<ColorStyleValue> parse_color(const CSS::ParsingContext&, const StringView&);
RefPtr<StringStyleValue> parse_line_style(const CSS::ParsingContext&, const StringView&);
RefPtr<StyleValue> parse_html_length(const Document&, const StringView&);
}