Bug 1289624 - Clear servo data when nodes are removed from the tree. r=heycam

This commit is contained in:
Bobby Holley 2016-07-21 12:51:10 -07:00
parent 46c7fed6d0
commit 55b3f93f9f
2 changed files with 12 additions and 0 deletions

View File

@ -1787,6 +1787,12 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
ClearInDocument();
#ifdef MOZ_STYLO
// Drop any servo node data, since it will generally need to be recomputed on
// re-insertion anyway.
ServoData().reset();
#endif
// Editable descendant count only counts descendants that
// are in the uncomposed document.
ResetEditableDescendantCount();

View File

@ -590,6 +590,12 @@ nsGenericDOMDataNode::UnbindFromTree(bool aDeep, bool aNullParent)
}
ClearInDocument();
#ifdef MOZ_STYLO
// Drop any servo node data, since it will generally need to be recomputed on
// re-insertion anyway.
ServoData().reset();
#endif
if (aNullParent || !mParent->IsInShadowTree()) {
UnsetFlags(NODE_IS_IN_SHADOW_TREE);