mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-23 10:41:52 +00:00
LibHTML: Add function for invalidating the document layout
This allows any external actor to signal that the document layout may be stale. This can be used when loading resources, changing the size or placement of an element, adding/removing nodes, or really any time.
This commit is contained in:
parent
15a016d3e3
commit
ef8b754a46
Notes:
sideshowbarker
2024-07-19 11:47:38 +09:00
Author: https://github.com/deoxxa
Commit: ef8b754a46
Pull-request: https://github.com/SerenityOS/serenity/pull/634
3 changed files with 15 additions and 0 deletions
|
@ -31,7 +31,12 @@ void HtmlView::set_document(Document* document)
|
|||
{
|
||||
if (document == m_document)
|
||||
return;
|
||||
|
||||
if (m_document)
|
||||
m_document->on_invalidate_layout = nullptr;
|
||||
|
||||
m_document = document;
|
||||
m_document->on_invalidate_layout = [this]() { layout_and_sync_size(); };
|
||||
|
||||
main_frame().set_document(document);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue