LibHTML: Split layout invalidation into style and layout invalidation

When style is invalidated (for example when an external stylesheet
finishes loading) we delete the whole layout tree and build a new one.
This is necessary since the new style information may result in a
different layout tree.

When layout is invalidated (window resized, image dimensions learned,
etc..) we keep the existing layout tree but run the layout algorithm
once again.

There's obviously lots of room for improvement here. :^)
This commit is contained in:
Andreas Kling 2019-10-13 12:49:43 +02:00
commit 2c035f5072
Notes: sideshowbarker 2024-07-19 11:42:47 +09:00
3 changed files with 10 additions and 2 deletions

View file

@ -29,7 +29,7 @@ void HTMLLinkElement::inserted_into(Node&)
return;
}
document().add_sheet(*sheet);
document().invalidate_layout();
document().invalidate_style();
});
}
}