mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-23 16:14:23 +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:
committed by
Andreas Kling
parent
15a016d3e3
commit
ef8b754a46
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user