diff --git a/Libraries/LibWeb/DOM/HTMLTableCellElement.cpp b/Libraries/LibWeb/DOM/HTMLTableCellElement.cpp index 19e3fcf95a..3e865bad1d 100644 --- a/Libraries/LibWeb/DOM/HTMLTableCellElement.cpp +++ b/Libraries/LibWeb/DOM/HTMLTableCellElement.cpp @@ -37,4 +37,15 @@ HTMLTableCellElement::~HTMLTableCellElement() { } +void HTMLTableCellElement::apply_presentational_hints(StyleProperties& style) const +{ + for_each_attribute([&](auto& name, auto& value) { + if (name == HTML::AttributeNames::bgcolor) { + auto color = Color::from_string(value); + if (color.has_value()) + style.set_property(CSS::PropertyID::BackgroundColor, ColorStyleValue::create(color.value())); + } + }); +} + } diff --git a/Libraries/LibWeb/DOM/HTMLTableCellElement.h b/Libraries/LibWeb/DOM/HTMLTableCellElement.h index 40272aab9f..15de7c51b0 100644 --- a/Libraries/LibWeb/DOM/HTMLTableCellElement.h +++ b/Libraries/LibWeb/DOM/HTMLTableCellElement.h @@ -30,10 +30,13 @@ namespace Web { -class HTMLTableCellElement : public HTMLElement { +class HTMLTableCellElement final : public HTMLElement { public: HTMLTableCellElement(Document&, const FlyString& tag_name); virtual ~HTMLTableCellElement() override; + +private: + virtual void apply_presentational_hints(StyleProperties&) const override; }; template<>