mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00: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
Notes:
github-actions[bot]
2025-02-22 19:03:14 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/cdd2ccac0bb Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3654
1 changed files with 7 additions and 5 deletions
|
@ -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…
Add table
Reference in a new issue