|
@@ -30,6 +30,14 @@ FormattingContext::~FormattingContext() = default;
|
|
|
|
|
|
void FormattingContext::run_intrinsic_size_determination(Box const& box)
|
|
void FormattingContext::run_intrinsic_size_determination(Box const& box)
|
|
{
|
|
{
|
|
|
|
+ auto& box_state = m_state.get_mutable(box);
|
|
|
|
+
|
|
|
|
+ if (box.has_definite_width())
|
|
|
|
+ box_state.content_width = box.computed_values().width().resolved(box, CSS::Length::make_px(containing_block_width_for(box))).to_px(box);
|
|
|
|
+
|
|
|
|
+ if (box.has_definite_height())
|
|
|
|
+ box_state.content_height = box.computed_values().height().resolved(box, CSS::Length::make_px(containing_block_height_for(box))).to_px(box);
|
|
|
|
+
|
|
run(box, LayoutMode::IntrinsicSizeDetermination);
|
|
run(box, LayoutMode::IntrinsicSizeDetermination);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -862,6 +870,9 @@ float FormattingContext::calculate_min_content_width(Layout::Box const& box) con
|
|
auto& containing_block_state = throwaway_state.get_mutable(containing_block);
|
|
auto& containing_block_state = throwaway_state.get_mutable(containing_block);
|
|
containing_block_state.content_width = 0;
|
|
containing_block_state.content_width = 0;
|
|
|
|
|
|
|
|
+ if (!containing_block.has_definite_height())
|
|
|
|
+ containing_block_state.content_height = INFINITY;
|
|
|
|
+
|
|
auto& box_state = throwaway_state.get_mutable(box);
|
|
auto& box_state = throwaway_state.get_mutable(box);
|
|
box_state.width_constraint = SizeConstraint::MinContent;
|
|
box_state.width_constraint = SizeConstraint::MinContent;
|
|
|
|
|
|
@@ -899,6 +910,9 @@ float FormattingContext::calculate_max_content_width(Layout::Box const& box) con
|
|
auto& containing_block_state = throwaway_state.get_mutable(containing_block);
|
|
auto& containing_block_state = throwaway_state.get_mutable(containing_block);
|
|
containing_block_state.content_width = INFINITY;
|
|
containing_block_state.content_width = INFINITY;
|
|
|
|
|
|
|
|
+ if (!containing_block.has_definite_height())
|
|
|
|
+ containing_block_state.content_height = INFINITY;
|
|
|
|
+
|
|
auto& box_state = throwaway_state.get_mutable(box);
|
|
auto& box_state = throwaway_state.get_mutable(box);
|
|
box_state.width_constraint = SizeConstraint::MaxContent;
|
|
box_state.width_constraint = SizeConstraint::MaxContent;
|
|
|
|
|
|
@@ -936,6 +950,9 @@ float FormattingContext::calculate_min_content_height(Layout::Box const& box) co
|
|
auto& containing_block_state = throwaway_state.get_mutable(containing_block);
|
|
auto& containing_block_state = throwaway_state.get_mutable(containing_block);
|
|
containing_block_state.content_height = 0;
|
|
containing_block_state.content_height = 0;
|
|
|
|
|
|
|
|
+ if (!containing_block.has_definite_width())
|
|
|
|
+ containing_block_state.content_width = INFINITY;
|
|
|
|
+
|
|
auto& box_state = throwaway_state.get_mutable(box);
|
|
auto& box_state = throwaway_state.get_mutable(box);
|
|
box_state.height_constraint = SizeConstraint::MinContent;
|
|
box_state.height_constraint = SizeConstraint::MinContent;
|
|
|
|
|
|
@@ -973,6 +990,9 @@ float FormattingContext::calculate_max_content_height(Layout::Box const& box) co
|
|
auto& containing_block_state = throwaway_state.get_mutable(containing_block);
|
|
auto& containing_block_state = throwaway_state.get_mutable(containing_block);
|
|
containing_block_state.content_height = INFINITY;
|
|
containing_block_state.content_height = INFINITY;
|
|
|
|
|
|
|
|
+ if (!containing_block.has_definite_width())
|
|
|
|
+ containing_block_state.content_width = INFINITY;
|
|
|
|
+
|
|
auto& box_state = throwaway_state.get_mutable(box);
|
|
auto& box_state = throwaway_state.get_mutable(box);
|
|
box_state.height_constraint = SizeConstraint::MaxContent;
|
|
box_state.height_constraint = SizeConstraint::MaxContent;
|
|
|
|
|