LibHTML: LayoutNode::set_needs_display() needs to invalidate fragments

If a LayoutNode is split into line box fragments, we need to walk our
fragments and invalidate them. It was not enough to do this only for
LayoutBox nodes.
This commit is contained in:
Andreas Kling 2019-10-15 20:45:52 +02:00
commit 5c2b21705a
Notes: sideshowbarker 2024-07-19 11:41:03 +09:00
2 changed files with 10 additions and 6 deletions

View file

@ -76,4 +76,13 @@ void LayoutNode::split_into_lines(LayoutBlock& container)
void LayoutNode::set_needs_display()
{
auto* frame = document().frame();
ASSERT(frame);
for_each_fragment_of_this([&](auto& fragment) {
if (&fragment.layout_node() == this || is_ancestor_of(fragment.layout_node())) {
const_cast<Frame*>(frame)->set_needs_display(fragment.rect());
}
return IterationDecision::Continue;
});
}