diff --git a/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp b/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp index 244bfe251af..702155cd3f8 100644 --- a/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp +++ b/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp @@ -243,7 +243,7 @@ RefPtr ResolvedCSSStyleDeclaration::style_value_for_propert // -> block-size // -> height - // FIXME: -> inline-size + // -> inline-size // -> margin-block-end // -> margin-block-start // -> margin-bottom @@ -277,6 +277,13 @@ RefPtr ResolvedCSSStyleDeclaration::style_value_for_propert return style_value_for_size(Size::make_px(maybe_used_height.release_value())); return style_value_for_size(layout_node.computed_values().height()); } + case PropertyID::InlineSize: { + auto writing_mode = layout_node.computed_values().writing_mode(); + auto is_vertically_oriented = first_is_one_of(writing_mode, WritingMode::VerticalLr, WritingMode::VerticalRl); + if (is_vertically_oriented) + return style_value_for_property(layout_node, PropertyID::Height); + return style_value_for_property(layout_node, PropertyID::Width); + } case PropertyID::MarginBlockEnd: if (auto maybe_used_value = used_value_for_property([&](auto const& paintable_box) { return pixels_for_pixel_box_logical_side(layout_node, paintable_box.box_model().margin, LogicalSide::BlockEnd); }); maybe_used_value.has_value()) return LengthStyleValue::create(Length::make_px(maybe_used_value.release_value())); diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-all-supported-properties-and-default-values.txt b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-all-supported-properties-and-default-values.txt index 8b3ec729747..40e439a2d30 100644 --- a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-all-supported-properties-and-default-values.txt +++ b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-all-supported-properties-and-default-values.txt @@ -374,8 +374,8 @@ All supported properties and their default values exposed from CSSStyleDeclarati 'height': '0px' 'imageRendering': 'auto' 'image-rendering': 'auto' -'inlineSize': 'auto' -'inline-size': 'auto' +'inlineSize': '284px' +'inline-size': '284px' 'inset': 'auto auto auto auto' 'insetBlock': 'auto auto auto auto' 'inset-block': 'auto auto auto auto' diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt index 6eca7cfd63f..6e3bca9d6f2 100644 --- a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt +++ b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt @@ -137,7 +137,7 @@ grid-template-areas: none grid-template-columns: auto grid-template-rows: auto height: 1932px -inline-size: auto +inline-size: 784px inset-block-end: auto inset-block-start: auto inset-inline-end: auto diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-logical/parsing/inline-size-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-logical/parsing/inline-size-computed.txt new file mode 100644 index 00000000000..f4997caa8da --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-logical/parsing/inline-size-computed.txt @@ -0,0 +1,12 @@ +Harness status: OK + +Found 7 tests + +7 Pass +Pass Property inline-size value 'auto' +Pass Property inline-size value '10px' +Pass Property inline-size value '20%' +Pass Property inline-size value 'calc(0.5em + 10px)' +Pass Property inline-size value 'calc(-0.5em + 10px)' +Pass Property inline-size value 'min-content' +Pass Property inline-size value 'max-content' \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-logical/parsing/inline-size-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-logical/parsing/inline-size-computed.html new file mode 100644 index 00000000000..dea34f4d3c8 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-logical/parsing/inline-size-computed.html @@ -0,0 +1,44 @@ + + + + +CSS Logical Properties and Values: getComputedStyle().inlineSize + + + + + + + + +
+
+
+
+
+
+ + +