mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-22 10:11:54 +00:00
LibWeb/CSS: Resolve used value for the block-size
property
This commit is contained in:
parent
41927ad9d1
commit
1739e2851d
Notes:
github-actions[bot]
2025-03-10 13:02:15 +00:00
Author: https://github.com/tcl3
Commit: 1739e2851d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3881
Reviewed-by: https://github.com/AtkinsSJ ✅
5 changed files with 67 additions and 4 deletions
|
@ -241,7 +241,7 @@ RefPtr<CSSStyleValue const> ResolvedCSSStyleDeclaration::style_value_for_propert
|
|||
return LengthStyleValue::create(Length::make_px(layout_node.computed_values().line_height()));
|
||||
}
|
||||
|
||||
// FIXME: -> block-size
|
||||
// -> block-size
|
||||
// -> height
|
||||
// FIXME: -> inline-size
|
||||
// -> margin-block-end
|
||||
|
@ -264,6 +264,13 @@ RefPtr<CSSStyleValue const> ResolvedCSSStyleDeclaration::style_value_for_propert
|
|||
// If the property applies to the element or pseudo-element and the resolved value of the
|
||||
// display property is not none or contents, then the resolved value is the used value.
|
||||
// Otherwise the resolved value is the computed value.
|
||||
case PropertyID::BlockSize: {
|
||||
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::Width);
|
||||
return style_value_for_property(layout_node, PropertyID::Height);
|
||||
}
|
||||
case PropertyID::Height: {
|
||||
auto maybe_used_height = used_value_for_property([](auto const& paintable_box) { return paintable_box.content_height(); });
|
||||
if (maybe_used_height.has_value())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue