mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibWeb: Turn <table bgcolor> into CSS background-color
More presentational attribute stuff. HN looking more and more like it's supposed to. :^)
This commit is contained in:
parent
0b4f92e452
commit
6de937a689
Notes:
sideshowbarker
2024-07-19 05:40:35 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6de937a6894
1 changed files with 7 additions and 0 deletions
|
@ -43,6 +43,13 @@ void HTMLTableElement::apply_presentational_hints(StyleProperties& style) const
|
|||
for_each_attribute([&](auto& name, auto& value) {
|
||||
if (name == HTML::AttributeNames::width) {
|
||||
style.set_property(CSS::PropertyID::Width, parse_css_value(value));
|
||||
return;
|
||||
}
|
||||
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()));
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue