mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 14:42:50 +02:00
LibWeb: Map dimension attributes for table elements
(cherry picked from commit 140dc95e6769a41542f98abef333d5bc32b86e39)
This commit is contained in:
committed by
Nico Weber
parent
ea8914aeac
commit
be7110a3a4
@@ -11,6 +11,7 @@
|
||||
#include <LibWeb/CSS/StyleProperties.h>
|
||||
#include <LibWeb/CSS/StyleValues/CSSColorValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/CSSKeywordValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/ImageStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/LengthStyleValue.h>
|
||||
#include <LibWeb/DOM/ElementFactory.h>
|
||||
#include <LibWeb/DOM/HTMLCollection.h>
|
||||
@@ -59,7 +60,7 @@ void HTMLTableElement::apply_presentational_hints(CSS::StyleProperties& style) c
|
||||
return;
|
||||
}
|
||||
if (name == HTML::AttributeNames::height) {
|
||||
if (auto parsed_value = parse_nonzero_dimension_value(value))
|
||||
if (auto parsed_value = parse_dimension_value(value))
|
||||
style.set_property(CSS::PropertyID::Height, parsed_value.release_nonnull());
|
||||
return;
|
||||
}
|
||||
@@ -72,6 +73,11 @@ void HTMLTableElement::apply_presentational_hints(CSS::StyleProperties& style) c
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (name == HTML::AttributeNames::background) {
|
||||
if (auto parsed_value = document().parse_url(value); parsed_value.is_valid())
|
||||
style.set_property(CSS::PropertyID::BackgroundImage, CSS::ImageStyleValue::create(parsed_value));
|
||||
return;
|
||||
}
|
||||
if (name == HTML::AttributeNames::bgcolor) {
|
||||
// https://html.spec.whatwg.org/multipage/rendering.html#tables-2:rules-for-parsing-a-legacy-colour-value
|
||||
auto color = parse_legacy_color_value(value);
|
||||
|
||||
Reference in New Issue
Block a user