mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
LibWeb: Respect the bgcolor attribute on <marquee> elements
We don't yet animate marquees, but we can at least fill them with the right background color.
This commit is contained in:
parent
5e91e61900
commit
acd46dcb0c
2 changed files with 15 additions and 0 deletions
|
@ -37,4 +37,16 @@ HTMLMarqueeElement::~HTMLMarqueeElement()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HTMLMarqueeElement::apply_presentational_hints(CSS::StyleProperties& style) const
|
||||||
|
{
|
||||||
|
HTMLElement::apply_presentational_hints(style);
|
||||||
|
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, CSS::ColorStyleValue::create(color.value()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,9 @@ public:
|
||||||
|
|
||||||
HTMLMarqueeElement(DOM::Document&, QualifiedName);
|
HTMLMarqueeElement(DOM::Document&, QualifiedName);
|
||||||
virtual ~HTMLMarqueeElement() override;
|
virtual ~HTMLMarqueeElement() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue