diff --git a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp index d5dadbd1f64..ab4c8c0e778 100644 --- a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp @@ -523,6 +523,8 @@ Parser::ParseErrorOr> Parser::parse_css_value return parsed_value.release_nonnull(); return ParseError::SyntaxError; case PropertyID::Border: + case PropertyID::BorderBlock: + case PropertyID::BorderInline: if (auto parsed_value = parse_border_value(property_id, tokens); parsed_value && !tokens.has_next_token()) return parsed_value.release_nonnull(); return ParseError::SyntaxError; @@ -1597,6 +1599,17 @@ RefPtr Parser::parse_border_value(PropertyID property_id, T style_property = PropertyID::BorderStyle; width_property = PropertyID::BorderWidth; break; + case PropertyID::BorderBlock: + color_property = PropertyID::BorderBlockColor; + style_property = PropertyID::BorderBlockStyle; + width_property = PropertyID::BorderBlockWidth; + break; + case PropertyID::BorderInline: + color_property = PropertyID::BorderInlineColor; + style_property = PropertyID::BorderInlineStyle; + width_property = PropertyID::BorderInlineWidth; + break; + default: VERIFY_NOT_REACHED(); } diff --git a/Libraries/LibWeb/CSS/Properties.json b/Libraries/LibWeb/CSS/Properties.json index f540c0f9352..99a7b9c82cc 100644 --- a/Libraries/LibWeb/CSS/Properties.json +++ b/Libraries/LibWeb/CSS/Properties.json @@ -497,6 +497,15 @@ "border-color" ] }, + "border-block": { + "inherited": false, + "initial": "medium currentcolor none", + "longhands": [ + "border-block-width", + "border-block-style", + "border-block-color" + ] + }, "border-block-color": { "inherited": false, "initial": "currentcolor", @@ -778,6 +787,15 @@ "auto" ] }, + "border-inline": { + "inherited": false, + "initial": "medium currentcolor none", + "longhands": [ + "border-inline-width", + "border-inline-style", + "border-inline-color" + ] + }, "border-inline-color": { "inherited": false, "initial": "currentcolor", diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt index 64842fd40af..e5756fc1604 100644 --- a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt +++ b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt @@ -201,6 +201,8 @@ All supported properties and their default values exposed from CSSStylePropertie 'blockSize': '0px' 'block-size': '0px' 'border': '0px rgb(0, 0, 0)' +'borderBlock': '0px rgb(0, 0, 0)' +'border-block': '0px rgb(0, 0, 0)' 'borderBlockColor': 'rgb(0, 0, 0)' 'border-block-color': 'rgb(0, 0, 0)' 'borderBlockEnd': '0px rgb(0, 0, 0)' @@ -255,6 +257,8 @@ All supported properties and their default values exposed from CSSStylePropertie 'border-image-source': 'none' 'borderImageWidth': '1' 'border-image-width': '1' +'borderInline': '0px rgb(0, 0, 0)' +'border-inline': '0px rgb(0, 0, 0)' 'borderInlineColor': 'rgb(0, 0, 0)' 'border-inline-color': 'rgb(0, 0, 0)' 'borderInlineEnd': '0px rgb(0, 0, 0)' diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-logical/parsing/border-block-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-logical/parsing/border-block-valid.txt index d93ca08ee50..163a5aa0cf9 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-logical/parsing/border-block-valid.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-logical/parsing/border-block-valid.txt @@ -2,10 +2,9 @@ Harness status: OK Found 6 tests -4 Pass -2 Fail -Fail e.style['border-block'] = "1px dotted red" should set the property value -Fail e.style['border-block'] = "double" should set the property value +6 Pass +Pass e.style['border-block'] = "1px dotted red" should set the property value +Pass e.style['border-block'] = "double" should set the property value Pass e.style['border-block-start'] = "green double thin" should set the property value Pass e.style['border-block-start'] = "green" should set the property value Pass e.style['border-block-end'] = "thin" should set the property value diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-logical/parsing/border-inline-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-logical/parsing/border-inline-valid.txt index cd2af1d9a2c..62ee55cd43e 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-logical/parsing/border-inline-valid.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-logical/parsing/border-inline-valid.txt @@ -2,10 +2,9 @@ Harness status: OK Found 6 tests -4 Pass -2 Fail -Fail e.style['border-inline'] = "1px dotted red" should set the property value -Fail e.style['border-inline'] = "double" should set the property value +6 Pass +Pass e.style['border-inline'] = "1px dotted red" should set the property value +Pass e.style['border-inline'] = "double" should set the property value Pass e.style['border-inline-start'] = "green double thin" should set the property value Pass e.style['border-inline-start'] = "green" should set the property value Pass e.style['border-inline-end'] = "thin" should set the property value