mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
LibWeb: Resolve used vertical margins on inline elements
Even though we don't actually make use of these values at the moment, we still want them to be reflected correctly once we start exposing used margin values soon.
This commit is contained in:
parent
591f06f887
commit
cdd2ccac0b
|
|
@ -35,10 +35,17 @@ void InlineLevelIterator::enter_node_with_box_model_metrics(Layout::NodeWithStyl
|
|||
auto& used_values = m_layout_state.get_mutable(node);
|
||||
auto const& computed_values = node.computed_values();
|
||||
|
||||
used_values.margin_top = computed_values.margin().top().to_px(node, m_containing_block_used_values.content_width());
|
||||
used_values.margin_bottom = computed_values.margin().bottom().to_px(node, m_containing_block_used_values.content_width());
|
||||
|
||||
used_values.margin_left = computed_values.margin().left().to_px(node, m_containing_block_used_values.content_width());
|
||||
used_values.border_left = computed_values.border_left().width;
|
||||
used_values.padding_left = computed_values.padding().left().to_px(node, m_containing_block_used_values.content_width());
|
||||
|
||||
used_values.margin_right = computed_values.margin().right().to_px(node, m_containing_block_used_values.content_width());
|
||||
used_values.border_right = computed_values.border_right().width;
|
||||
used_values.padding_right = computed_values.padding().right().to_px(node, m_containing_block_used_values.content_width());
|
||||
|
||||
used_values.border_top = computed_values.border_top().width;
|
||||
used_values.border_bottom = computed_values.border_bottom().width;
|
||||
used_values.padding_bottom = computed_values.padding().bottom().to_px(node, m_containing_block_used_values.content_width());
|
||||
|
|
@ -61,11 +68,6 @@ void InlineLevelIterator::exit_node_with_box_model_metrics()
|
|||
|
||||
auto& node = m_box_model_node_stack.last();
|
||||
auto& used_values = m_layout_state.get_mutable(node);
|
||||
auto const& computed_values = node->computed_values();
|
||||
|
||||
used_values.margin_right = computed_values.margin().right().to_px(node, m_containing_block_used_values.content_width());
|
||||
used_values.border_right = computed_values.border_right().width;
|
||||
used_values.padding_right = computed_values.padding().right().to_px(node, m_containing_block_used_values.content_width());
|
||||
|
||||
m_extra_trailing_metrics->margin += used_values.margin_right;
|
||||
m_extra_trailing_metrics->border += used_values.border_right;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user