LibWeb: CSS display:position does not imply definite size

Per css-sizing-3:

    Additionally, the size of the containing block of an absolutely
    positioned element is always definite with respect to that element.

As I understand this, it doesn't mean that all absolutely positioned
boxes have definite size, but that the containing block of an absolutely
positioned descendant has definite size from the perspective of the
descendant.
This commit is contained in:
Andreas Kling 2021-10-13 18:54:00 +02:00
parent 5009202038
commit 439721f38c
Notes: sideshowbarker 2024-07-18 02:46:58 +09:00

View File

@ -276,13 +276,8 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& specified_style)
computed_values.set_align_items(align_items.value());
auto position = specified_style.position();
if (position.has_value()) {
if (position.has_value())
computed_values.set_position(position.value());
if (position.value() == CSS::Position::Absolute) {
m_has_definite_width = true;
m_has_definite_height = true;
}
}
auto text_align = specified_style.text_align();
if (text_align.has_value())