1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

LibWeb: Make Layout::Node::containing_block() return a Layout::Box

Containing blocks can be formed by boxes that aren't block containers,
so let's make this return a Box and work towards type correctness here.
This commit is contained in:
Andreas Kling 2023-01-23 14:59:51 +01:00
parent d5480a44e5
commit 51555dea7c
6 changed files with 42 additions and 30 deletions

View file

@ -132,7 +132,7 @@ void InlinePaintable::for_each_fragment(Callback callback) const
{
// FIXME: This will be slow if the containing block has a lot of fragments!
Vector<Layout::LineBoxFragment const&> fragments;
containing_block()->paint_box()->for_each_fragment([&](auto& fragment) {
verify_cast<PaintableWithLines>(*containing_block()->paint_box()).for_each_fragment([&](auto& fragment) {
if (layout_node().is_inclusive_ancestor_of(fragment.layout_node()))
fragments.append(fragment);
return IterationDecision::Continue;