mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:47:35 +00:00
LibWeb: Fix double-sized box model metrics on inline replaced elements
We were mistakenly treating inline replaced elements as if they are the start of a regular display:inline element. This meant that we collected the horizontal start and end metrics from the box model, and then added those to the inline-level item produced by InlineLevelIterator. This effectively meant that <img>, <svg> and other replaced elements got double-sized values for margin/border/padding on the left and right sides. (Which manifested as a mysterious margin around the element.)
This commit is contained in:
parent
6e70670e0b
commit
45db35ad04
1 changed files with 1 additions and 1 deletions
|
@ -108,7 +108,7 @@ void InlineLevelIterator::compute_next()
|
|||
|
||||
void InlineLevelIterator::skip_to_next()
|
||||
{
|
||||
if (m_next_node && is<Layout::NodeWithStyleAndBoxModelMetrics>(*m_next_node) && !m_next_node->is_inline_block() && !m_next_node->is_out_of_flow(m_inline_formatting_context))
|
||||
if (m_next_node && is<Layout::NodeWithStyleAndBoxModelMetrics>(*m_next_node) && !m_next_node->is_inline_block() && !m_next_node->is_out_of_flow(m_inline_formatting_context) && !is<ReplacedBox>(m_next_node))
|
||||
enter_node_with_box_model_metrics(static_cast<Layout::NodeWithStyleAndBoxModelMetrics const&>(*m_next_node));
|
||||
|
||||
m_current_node = m_next_node;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue