diff options
author | Andreas Kling <kling@serenityos.org> | 2022-07-20 18:12:12 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-26 01:53:41 +0200 |
commit | 3ede8dbffb7f5eb4796cabeba63f848d4f15e744 (patch) | |
tree | e90a1aa17acd0f66f0181c4daa850e75a3ad78b3 /Userland/Libraries/LibWeb/Layout | |
parent | 97f53de8a233766106868b1bbbea4e01ce71fac6 (diff) | |
download | serenity-3ede8dbffb7f5eb4796cabeba63f848d4f15e744.zip |
LibWeb: Rename IntrinsicSizeDetermination to IntrinsicSizing
This matches the exact terminology used in CSS-SIZING-3:
https://drafts.csswg.org/css-sizing-3/#intrinsic-sizing
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout')
5 files changed, 16 insertions, 15 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index bd5235dae0..ccb386533f 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -368,7 +368,7 @@ void BlockFormattingContext::layout_inline_children(BlockContainer const& block_ auto& block_container_state = m_state.get_mutable(block_container); - if (layout_mode == LayoutMode::IntrinsicSizeDetermination) { + if (layout_mode == LayoutMode::IntrinsicSizing) { if (block_container.computed_values().width().is_auto() || block_container_state.width_constraint != SizeConstraint::None) block_container_state.set_content_width(containing_block_width_for(block_container)); if (block_container.computed_values().height().is_auto() || block_container_state.height_constraint != SizeConstraint::None) @@ -386,7 +386,7 @@ void BlockFormattingContext::layout_inline_children(BlockContainer const& block_ content_height += line_box.height(); } - if (layout_mode == LayoutMode::IntrinsicSizeDetermination) { + if (layout_mode == LayoutMode::IntrinsicSizing) { if (block_container.computed_values().width().is_auto() || block_container_state.width_constraint != SizeConstraint::None) block_container_state.set_content_width(max_line_width); } @@ -452,7 +452,7 @@ void BlockFormattingContext::layout_block_level_box(Box const& box, BlockContain independent_formatting_context->parent_context_did_dimension_child_root_box(); } -void BlockFormattingContext::run_intrinsic_size_determination(Box const& box) +void BlockFormattingContext::run_intrinsic_sizing(Box const& box) { auto& box_state = m_state.get_mutable(box); @@ -462,7 +462,7 @@ void BlockFormattingContext::run_intrinsic_size_determination(Box const& box) if (box_state.has_definite_height()) box_state.set_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::IntrinsicSizing); } void BlockFormattingContext::layout_block_level_children(BlockContainer const& block_container, LayoutMode layout_mode) @@ -471,7 +471,7 @@ void BlockFormattingContext::layout_block_level_children(BlockContainer const& b float content_height = 0; - if (layout_mode == LayoutMode::IntrinsicSizeDetermination) { + if (layout_mode == LayoutMode::IntrinsicSizing) { auto& block_container_state = m_state.get_mutable(block_container); if (block_container.computed_values().width().is_auto() || block_container_state.width_constraint != SizeConstraint::None) block_container_state.set_content_width(containing_block_width_for(block_container)); @@ -484,7 +484,7 @@ void BlockFormattingContext::layout_block_level_children(BlockContainer const& b return IterationDecision::Continue; }); - if (layout_mode == LayoutMode::IntrinsicSizeDetermination) { + if (layout_mode == LayoutMode::IntrinsicSizing) { auto& block_container_state = m_state.get_mutable(block_container); if (block_container.computed_values().width().is_auto() || block_container_state.width_constraint != SizeConstraint::None) block_container_state.set_content_width(greatest_child_width(block_container)); diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.h b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.h index 5111635142..690b0dfcc1 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.h @@ -22,7 +22,7 @@ public: ~BlockFormattingContext(); virtual void run(Box const&, LayoutMode) override; - virtual void run_intrinsic_size_determination(Box const&) override; + virtual void run_intrinsic_sizing(Box const&) override; bool is_initial() const; diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index 24a29fa6a0..4d37ac4f92 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -28,7 +28,7 @@ FormattingContext::FormattingContext(Type type, LayoutState& state, Box const& c FormattingContext::~FormattingContext() = default; -void FormattingContext::run_intrinsic_size_determination(Box const& box) +void FormattingContext::run_intrinsic_sizing(Box const& box) { auto& box_state = m_state.get_mutable(box); @@ -38,7 +38,7 @@ void FormattingContext::run_intrinsic_size_determination(Box const& box) if (box_state.has_definite_height()) box_state.set_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::IntrinsicSizing); } bool FormattingContext::creates_block_formatting_context(Box const& box) @@ -903,7 +903,7 @@ float FormattingContext::calculate_min_content_width(Layout::Box const& box) con auto context = const_cast<FormattingContext*>(this)->create_independent_formatting_context_if_needed(throwaway_state, box); VERIFY(context); - context->run_intrinsic_size_determination(box); + context->run_intrinsic_sizing(box); if (context->type() == FormattingContext::Type::Flex) { cache.min_content_width = box_state.content_width(); } else { @@ -945,7 +945,7 @@ float FormattingContext::calculate_max_content_width(Layout::Box const& box) con auto context = const_cast<FormattingContext*>(this)->create_independent_formatting_context_if_needed(throwaway_state, box); VERIFY(context); - context->run_intrinsic_size_determination(box); + context->run_intrinsic_sizing(box); if (context->type() == FormattingContext::Type::Flex) { cache.max_content_width = box_state.content_width(); } else { @@ -987,7 +987,7 @@ float FormattingContext::calculate_min_content_height(Layout::Box const& box) co auto context = const_cast<FormattingContext*>(this)->create_independent_formatting_context_if_needed(throwaway_state, box); VERIFY(context); - context->run_intrinsic_size_determination(box); + context->run_intrinsic_sizing(box); if (context->type() == FormattingContext::Type::Flex) { cache.min_content_height = box_state.content_height(); } else { @@ -1029,7 +1029,7 @@ float FormattingContext::calculate_max_content_height(Layout::Box const& box) co auto context = const_cast<FormattingContext*>(this)->create_independent_formatting_context_if_needed(throwaway_state, box); VERIFY(context); - context->run_intrinsic_size_determination(box); + context->run_intrinsic_sizing(box); if (context->type() == FormattingContext::Type::Flex) { cache.max_content_height = box_state.content_height(); } else { diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.h b/Userland/Libraries/LibWeb/Layout/FormattingContext.h index 9e50dbb9fe..e79cc9d406 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.h @@ -61,7 +61,7 @@ public: static float containing_block_width_for(Box const&, LayoutState const&); static float containing_block_height_for(Box const&, LayoutState const&); - virtual void run_intrinsic_size_determination(Box const&); + virtual void run_intrinsic_sizing(Box const&); protected: FormattingContext(Type, LayoutState&, Box const&, FormattingContext* parent = nullptr); diff --git a/Userland/Libraries/LibWeb/Layout/Node.h b/Userland/Libraries/LibWeb/Layout/Node.h index 70fbb42150..7ed26c6c34 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.h +++ b/Userland/Libraries/LibWeb/Layout/Node.h @@ -27,7 +27,8 @@ enum class LayoutMode { // Intrinsic size determination. // Boxes honor min-content and max-content constraints (set via LayoutState::UsedValues::{width,height}_constraint) // by considering their containing block to be 0-sized or infinitely large in the relevant axis. - IntrinsicSizeDetermination, + // https://drafts.csswg.org/css-sizing-3/#intrinsic-sizing + IntrinsicSizing, }; class Node : public TreeNode<Node> { |