mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibWeb: Resolve 2-part and 3-part border-color values
This commit is contained in:
parent
984a39f7c0
commit
b7f00148ad
Notes:
sideshowbarker
2024-07-18 17:54:55 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/b7f00148ad2 Pull-request: https://github.com/SerenityOS/serenity/pull/7224
1 changed files with 19 additions and 0 deletions
|
@ -441,6 +441,25 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
|
|||
style.set_property(CSS::PropertyID::BorderBottomColor, *bottom);
|
||||
style.set_property(CSS::PropertyID::BorderLeftColor, *left);
|
||||
}
|
||||
} else if (value.is_string() && parts.size() == 3) {
|
||||
auto top = parse_css_value(context, parts[0]);
|
||||
auto horizontal = parse_css_value(context, parts[1]);
|
||||
auto bottom = parse_css_value(context, parts[2]);
|
||||
if (top && horizontal && bottom) {
|
||||
style.set_property(CSS::PropertyID::BorderTopColor, *top);
|
||||
style.set_property(CSS::PropertyID::BorderRightColor, *horizontal);
|
||||
style.set_property(CSS::PropertyID::BorderBottomColor, *bottom);
|
||||
style.set_property(CSS::PropertyID::BorderLeftColor, *horizontal);
|
||||
}
|
||||
} else if (value.is_string() && parts.size() == 2) {
|
||||
auto vertical = parse_css_value(context, parts[0]);
|
||||
auto horizontal = parse_css_value(context, parts[1]);
|
||||
if (vertical && horizontal) {
|
||||
style.set_property(CSS::PropertyID::BorderTopColor, *vertical);
|
||||
style.set_property(CSS::PropertyID::BorderRightColor, *horizontal);
|
||||
style.set_property(CSS::PropertyID::BorderBottomColor, *vertical);
|
||||
style.set_property(CSS::PropertyID::BorderLeftColor, *horizontal);
|
||||
}
|
||||
} else {
|
||||
style.set_property(CSS::PropertyID::BorderTopColor, value);
|
||||
style.set_property(CSS::PropertyID::BorderRightColor, value);
|
||||
|
|
Loading…
Reference in a new issue