1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 14:35:07 +00:00

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
parent 49ac0c2e24
commit 2c035f5072
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();
});
}
}