mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
LibWeb: Turn <td bgcolor> into background-color
This commit is contained in:
parent
e9e2226544
commit
ca41c2e4a0
2 changed files with 15 additions and 1 deletions
|
@ -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()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,10 +30,13 @@
|
||||||
|
|
||||||
namespace Web {
|
namespace Web {
|
||||||
|
|
||||||
class HTMLTableCellElement : public HTMLElement {
|
class HTMLTableCellElement final : public HTMLElement {
|
||||||
public:
|
public:
|
||||||
HTMLTableCellElement(Document&, const FlyString& tag_name);
|
HTMLTableCellElement(Document&, const FlyString& tag_name);
|
||||||
virtual ~HTMLTableCellElement() override;
|
virtual ~HTMLTableCellElement() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual void apply_presentational_hints(StyleProperties&) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue