mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
LibWeb: Rename LayoutState::NodeState => LayoutState::UsedValues
This object contains all the CSS "used values" as seen during the layout process, so calling it "used values" seems appropriate. :^)
This commit is contained in:
parent
52862c72d0
commit
9b46091f38
10 changed files with 76 additions and 76 deletions
|
@ -13,11 +13,11 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
InlineLevelIterator::InlineLevelIterator(Layout::InlineFormattingContext& inline_formatting_context, Layout::LayoutState& formatting_state, Layout::BlockContainer const& container, LayoutMode layout_mode)
|
||||
InlineLevelIterator::InlineLevelIterator(Layout::InlineFormattingContext& inline_formatting_context, Layout::LayoutState& layout_state, Layout::BlockContainer const& container, LayoutMode layout_mode)
|
||||
: m_inline_formatting_context(inline_formatting_context)
|
||||
, m_formatting_state(formatting_state)
|
||||
, m_layout_state(layout_state)
|
||||
, m_container(container)
|
||||
, m_container_state(formatting_state.get(container))
|
||||
, m_container_state(layout_state.get(container))
|
||||
, m_next_node(container.first_child())
|
||||
, m_layout_mode(layout_mode)
|
||||
{
|
||||
|
@ -31,16 +31,16 @@ void InlineLevelIterator::enter_node_with_box_model_metrics(Layout::NodeWithStyl
|
|||
|
||||
// FIXME: It's really weird that *this* is where we assign box model metrics for these layout nodes..
|
||||
|
||||
auto& node_state = m_formatting_state.get_mutable(node);
|
||||
auto& used_values = m_layout_state.get_mutable(node);
|
||||
auto const& computed_values = node.computed_values();
|
||||
|
||||
node_state.margin_left = computed_values.margin().left.resolved(node, CSS::Length::make_px(m_container_state.content_width)).to_px(node);
|
||||
node_state.border_left = computed_values.border_left().width;
|
||||
node_state.padding_left = computed_values.padding().left.resolved(node, CSS::Length::make_px(m_container_state.content_width)).to_px(node);
|
||||
used_values.margin_left = computed_values.margin().left.resolved(node, CSS::Length::make_px(m_container_state.content_width)).to_px(node);
|
||||
used_values.border_left = computed_values.border_left().width;
|
||||
used_values.padding_left = computed_values.padding().left.resolved(node, CSS::Length::make_px(m_container_state.content_width)).to_px(node);
|
||||
|
||||
m_extra_leading_metrics->margin += node_state.margin_left;
|
||||
m_extra_leading_metrics->border += node_state.border_left;
|
||||
m_extra_leading_metrics->padding += node_state.padding_left;
|
||||
m_extra_leading_metrics->margin += used_values.margin_left;
|
||||
m_extra_leading_metrics->border += used_values.border_left;
|
||||
m_extra_leading_metrics->padding += used_values.padding_left;
|
||||
|
||||
m_box_model_node_stack.append(node);
|
||||
}
|
||||
|
@ -51,16 +51,16 @@ void InlineLevelIterator::exit_node_with_box_model_metrics()
|
|||
m_extra_trailing_metrics = ExtraBoxMetrics {};
|
||||
|
||||
auto& node = m_box_model_node_stack.last();
|
||||
auto& node_state = m_formatting_state.get_mutable(node);
|
||||
auto& used_values = m_layout_state.get_mutable(node);
|
||||
auto const& computed_values = node.computed_values();
|
||||
|
||||
node_state.margin_right = computed_values.margin().right.resolved(node, CSS::Length::make_px(m_container_state.content_width)).to_px(node);
|
||||
node_state.border_right = computed_values.border_right().width;
|
||||
node_state.padding_right = computed_values.padding().right.resolved(node, CSS::Length::make_px(m_container_state.content_width)).to_px(node);
|
||||
used_values.margin_right = computed_values.margin().right.resolved(node, CSS::Length::make_px(m_container_state.content_width)).to_px(node);
|
||||
used_values.border_right = computed_values.border_right().width;
|
||||
used_values.padding_right = computed_values.padding().right.resolved(node, CSS::Length::make_px(m_container_state.content_width)).to_px(node);
|
||||
|
||||
m_extra_trailing_metrics->margin += node_state.margin_right;
|
||||
m_extra_trailing_metrics->border += node_state.border_right;
|
||||
m_extra_trailing_metrics->padding += node_state.padding_right;
|
||||
m_extra_trailing_metrics->margin += used_values.margin_right;
|
||||
m_extra_trailing_metrics->border += used_values.border_right;
|
||||
m_extra_trailing_metrics->padding += used_values.padding_right;
|
||||
|
||||
m_box_model_node_stack.take_last();
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ Optional<InlineLevelIterator::Item> InlineLevelIterator::next(float available_wi
|
|||
}
|
||||
|
||||
auto& box = verify_cast<Layout::Box>(*m_current_node);
|
||||
auto& box_state = m_formatting_state.get(box);
|
||||
auto& box_state = m_layout_state.get(box);
|
||||
m_inline_formatting_context.dimension_box_on_line(box, m_layout_mode);
|
||||
|
||||
skip_to_next();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue