diff --git a/Tests/LibWeb/Layout/expected/css-logical-inset-properties.txt b/Tests/LibWeb/Layout/expected/css-logical-inset-properties.txt new file mode 100644 index 00000000000..5f19f5b9813 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/css-logical-inset-properties.txt @@ -0,0 +1,6 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (1,1) content-size 798x0 [BFC] children: not-inline + BlockContainer at (9,9) content-size 500x400 positioned [BFC] children: inline + BlockContainer at (60,110) content-size 398x198 positioned [BFC] children: not-inline + BlockContainer at (110,210) content-size 248x148 positioned [BFC] children: not-inline + TextNode <#text> diff --git a/Tests/LibWeb/Layout/input/css-logical-inset-properties.html b/Tests/LibWeb/Layout/input/css-logical-inset-properties.html new file mode 100644 index 00000000000..f31e1195800 --- /dev/null +++ b/Tests/LibWeb/Layout/input/css-logical-inset-properties.html @@ -0,0 +1,29 @@ +
diff --git a/Userland/Libraries/LibWeb/CSS/Properties.json b/Userland/Libraries/LibWeb/CSS/Properties.json index f9d28974abe..9f3b381e33e 100644 --- a/Userland/Libraries/LibWeb/CSS/Properties.json +++ b/Userland/Libraries/LibWeb/CSS/Properties.json @@ -1205,6 +1205,54 @@ ], "percentages-resolve-to": "length" }, + "inset-block": { + "logical-alias-for": [ + "inset" + ], + "max-values": 2 + }, + "inset-block-end": { + "logical-alias-for": [ + "top", + "right", + "bottom", + "left" + ], + "max-values": 1 + }, + "inset-block-start": { + "logical-alias-for": [ + "top", + "right", + "bottom", + "left" + ], + "max-values": 1 + }, + "inset-inline": { + "logical-alias-for": [ + "inset" + ], + "max-values": 2 + }, + "inset-inline-end": { + "logical-alias-for": [ + "top", + "right", + "bottom", + "left" + ], + "max-values": 1 + }, + "inset-inline-start": { + "logical-alias-for": [ + "top", + "right", + "bottom", + "left" + ], + "max-values": 1 + }, "justify-content": { "inherited": false, "initial": "flex-start", diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index 9c6cd41d735..da74165e57d 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -304,6 +304,14 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope return PropertyID::PaddingLeft; case PropertyID::PaddingInlineEnd: return PropertyID::PaddingRight; + case PropertyID::InsetBlockStart: + return PropertyID::Top; + case PropertyID::InsetBlockEnd: + return PropertyID::Bottom; + case PropertyID::InsetInlineStart: + return PropertyID::Left; + case PropertyID::InsetInlineEnd: + return PropertyID::Right; default: return {}; } @@ -324,6 +332,10 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope return StartAndEndPropertyIDs { PropertyID::PaddingTop, PropertyID::PaddingBottom }; case PropertyID::PaddingInline: return StartAndEndPropertyIDs { PropertyID::PaddingLeft, PropertyID::PaddingRight }; + case PropertyID::InsetBlock: + return StartAndEndPropertyIDs { PropertyID::Top, PropertyID::Bottom }; + case PropertyID::InsetInline: + return StartAndEndPropertyIDs { PropertyID::Left, PropertyID::Right }; default: return {}; }