mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-27 01:56:21 +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:
@@ -42,7 +42,7 @@ void HTMLTableElement::apply_presentational_hints(StyleProperties& style) const
|
||||
{
|
||||
for_each_attribute([&](auto& name, auto& value) {
|
||||
if (name == HTML::AttributeNames::width) {
|
||||
if (auto parsed_value = parse_css_value(CSS::ParsingContext(document()), value))
|
||||
if (auto parsed_value = parse_html_length(document(), value))
|
||||
style.set_property(CSS::PropertyID::Width, parsed_value.release_nonnull());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user