1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

LibWeb: Re-mark nodes as needing style after moving between documents

Since style update is driven by Document, moving a node with dirty style
from one document to another means that we have to schedule a style
update in the new document.
This commit is contained in:
Andreas Kling 2021-10-12 17:53:38 +02:00
parent 82672da331
commit 1b6f0f857e

View file

@ -529,6 +529,14 @@ void Node::set_document(Badge<Document>, Document& document)
document.ref_from_node({});
m_document->unref_from_node({});
m_document = &document;
if (needs_style_update() || child_needs_style_update()) {
// NOTE: We unset and reset the "needs style update" flag here.
// This ensures that there's a pending style update in the new document
// that will eventually assign some style to this node if needed.
set_needs_style_update(false);
set_needs_style_update(true);
}
}
bool Node::is_editable() const