mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-16 07:11:52 +00:00
LibWeb: Apply rules for parsing a legacy color value
This commit is contained in:
parent
bc54560e59
commit
500552df54
Notes:
sideshowbarker
2024-07-17 01:27:18 +09:00
Author: https://github.com/shannonbooth
Commit: 500552df54
Pull-request: https://github.com/SerenityOS/serenity/pull/19099
5 changed files with 21 additions and 9 deletions
|
@ -33,7 +33,8 @@ void HTMLTableCellElement::apply_presentational_hints(CSS::StyleProperties& styl
|
|||
{
|
||||
for_each_attribute([&](auto& name, auto& value) {
|
||||
if (name == HTML::AttributeNames::bgcolor) {
|
||||
auto color = Color::from_string(value);
|
||||
// https://html.spec.whatwg.org/multipage/rendering.html#tables-2:rules-for-parsing-a-legacy-colour-value
|
||||
auto color = parse_legacy_color_value(value);
|
||||
if (color.has_value())
|
||||
style.set_property(CSS::PropertyID::BackgroundColor, CSS::ColorStyleValue::create(color.value()).release_value_but_fixme_should_propagate_errors());
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue