LibWeb: Store "text for rendering" in TextPaintable

Instead of TextPaintable fragments being an offset+length view into the
layout node, they are now a view into the paintable instead.

This removes an awkward time window where we'd have bogus state in text
fragments after layout invalidation but before relayout. It also makes
the code slightly nicer in general, since there's less mixing of layout
and painting concepts.
This commit is contained in:
Andreas Kling 2024-03-18 10:25:57 +01:00
parent 2be47c3d7a
commit dd8504c68d
Notes: sideshowbarker 2024-07-17 01:13:25 +09:00
9 changed files with 54 additions and 43 deletions

View file

@ -466,7 +466,7 @@ Optional<TextNode::Chunk> TextNode::ChunkIterator::try_commit_chunk(Utf8View::It
JS::GCPtr<Painting::Paintable> TextNode::create_paintable() const
{
return Painting::TextPaintable::create(*this);
return Painting::TextPaintable::create(*this, text_for_rendering());
}
}