LibWeb/CSS: Parse border-inline-* properties

This doesn't currently honor `writing-mode`, `direction` and
`text-orientation`.
This commit is contained in:
Tim Ledbetter 2025-03-10 22:39:22 +00:00 committed by Sam Atkins
commit cd1bba353a
Notes: github-actions[bot] 2025-03-14 16:10:16 +00:00
18 changed files with 500 additions and 133 deletions

View file

@ -560,6 +560,78 @@
"hashless-hex-color"
]
},
"border-inline-end": {
"inherited": false,
"initial": "medium currentcolor none",
"longhands": [
"border-inline-end-width",
"border-inline-end-style",
"border-inline-end-color"
]
},
"border-inline-end-color": {
"logical-alias-for": [
"border-top-color",
"border-right-color",
"border-bottom-color",
"border-left-color"
],
"max-values": 1
},
"border-inline-end-style": {
"logical-alias-for": [
"border-top-style",
"border-right-style",
"border-bottom-style",
"border-left-style"
],
"max-values": 1
},
"border-inline-end-width": {
"logical-alias-for": [
"border-top-width",
"border-right-width",
"border-bottom-width",
"border-left-width"
],
"max-values": 1
},
"border-inline-start": {
"inherited": false,
"initial": "medium currentcolor none",
"longhands": [
"border-inline-start-width",
"border-inline-start-style",
"border-inline-start-color"
]
},
"border-inline-start-color": {
"logical-alias-for": [
"border-top-color",
"border-right-color",
"border-bottom-color",
"border-left-color"
],
"max-values": 1
},
"border-inline-start-style": {
"logical-alias-for": [
"border-top-style",
"border-right-style",
"border-bottom-style",
"border-left-style"
],
"max-values": 1
},
"border-inline-start-width": {
"logical-alias-for": [
"border-top-width",
"border-right-width",
"border-bottom-width",
"border-left-width"
],
"max-values": 1
},
"border-left": {
"inherited": false,
"initial": "medium currentcolor none",

View file

@ -197,8 +197,8 @@ RefPtr<CSSStyleValue const> ResolvedCSSStyleDeclaration::style_value_for_propert
// FIXME: -> border-block-end-color
// FIXME: -> border-block-start-color
// -> border-bottom-color
// FIXME: -> border-inline-end-color
// FIXME: -> border-inline-start-color
// -> border-inline-end-color
// -> border-inline-start-color
// -> border-left-color
// -> border-right-color
// -> border-top-color
@ -212,6 +212,12 @@ RefPtr<CSSStyleValue const> ResolvedCSSStyleDeclaration::style_value_for_propert
return CSSColorValue::create_from_color(layout_node.computed_values().background_color(), ColorSyntax::Modern);
case PropertyID::BorderBottomColor:
return CSSColorValue::create_from_color(layout_node.computed_values().border_bottom().color, ColorSyntax::Modern);
case PropertyID::BorderInlineEndColor:
// FIXME: Honor writing-mode, direction and text-orientation.
return style_value_for_property(layout_node, PropertyID::BorderRightColor);
case PropertyID::BorderInlineStartColor:
// FIXME: Honor writing-mode, direction and text-orientation.
return style_value_for_property(layout_node, PropertyID::BorderLeftColor);
case PropertyID::BorderLeftColor:
return CSSColorValue::create_from_color(layout_node.computed_values().border_left().color, ColorSyntax::Modern);
case PropertyID::BorderRightColor:

View file

@ -600,6 +600,18 @@ void StyleComputer::for_each_property_expanding_shorthands(PropertyID property_i
switch (property_id) {
case PropertyID::BlockSize:
return PropertyID::Height;
case PropertyID::BorderInlineStartColor:
return PropertyID::BorderLeftColor;
case PropertyID::BorderInlineStartStyle:
return PropertyID::BorderLeftStyle;
case PropertyID::BorderInlineStartWidth:
return PropertyID::BorderLeftWidth;
case PropertyID::BorderInlineEndColor:
return PropertyID::BorderRightColor;
case PropertyID::BorderInlineEndStyle:
return PropertyID::BorderRightStyle;
case PropertyID::BorderInlineEndWidth:
return PropertyID::BorderRightWidth;
case PropertyID::MarginBlockStart:
return PropertyID::MarginTop;
case PropertyID::MarginBlockEnd: