Bug 1380106 - Drop style data in DestroyContent. r=heycam,r=bz

MozReview-Commit-ID: 9ydkvlDA9oS
This commit is contained in:
Bobby Holley 2017-07-11 12:57:38 -07:00
Родитель 5c407c8b43
Коммит b2fd3f821c
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -1262,6 +1262,13 @@ FragmentOrElement::SetTextContentInternal(const nsAString& aTextContent,
void
FragmentOrElement::DestroyContent()
{
// Drop any servo data. We do this before the RemovedFromDocument call below
// so that it doesn't need to try to keep the style state sane when shuffling
// around the flattened tree.
if (IsElement() && AsElement()->HasServoData()) {
AsElement()->ClearServoData();
}
nsIDocument *document = OwnerDoc();
document->BindingManager()->RemovedFromDocument(this, document,
nsBindingManager::eRunDtor);