diff options
author | Andreas Kling <kling@serenityos.org> | 2022-07-10 22:04:06 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-11 18:57:45 +0200 |
commit | 28eec22c836caab338d0326cf33cdf5c9c91949b (patch) | |
tree | fba1373790fe56b1a992cb4c5b162e58595f182e /Userland | |
parent | 7b4a86ab80735d9f19e763bce0108047280dbf00 (diff) | |
download | serenity-28eec22c836caab338d0326cf33cdf5c9c91949b.zip |
LibWeb: Don't iterate over text content inside replaced elements
This fixes an issue where whitespace inside embedded <svg> elements
would create unexpected whitespace text content on the page.
When combined with something like `white-space: pre-wrap`, it ended
up generating a lot of surprising vertical offsets.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp b/Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp index cc76581386..b913ffe1eb 100644 --- a/Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp +++ b/Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp @@ -68,7 +68,7 @@ void InlineLevelIterator::exit_node_with_box_model_metrics() // This is similar to Layout::Node::next_in_pre_order() but will not descend into inline-block nodes. Layout::Node const* InlineLevelIterator::next_inline_node_in_pre_order(Layout::Node const& current, Layout::Node const* stay_within) { - if (current.first_child() && current.first_child()->is_inline() && !current.is_inline_block()) { + if (current.first_child() && current.first_child()->is_inline() && !current.is_inline_block() && !current.is_replaced_box()) { if (!current.is_box() || !static_cast<Box const&>(current).is_out_of_flow(m_inline_formatting_context)) return current.first_child(); } |