Bug 1403712: Make some assertions not assert for conditions that may happen mid-unbind. r=bholley

MozReview-Commit-ID: DNSphdMismy
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-09-28 14:17:41 +02:00
Родитель 735f73f9e3
Коммит b5ab9820ca
2 изменённых файлов: 5 добавлений и 2 удалений

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

@ -4291,6 +4291,7 @@ BitsArePropagated(const Element* aElement, uint32_t aBits, nsINode* aRestyleRoot
nsINode* parentNode = curr->GetParentNode();
curr = curr->GetFlattenedTreeParentElementForStyle();
MOZ_ASSERT_IF(!curr,
!parentNode || // can only happen mid-unbind.
parentNode == aElement->OwnerDoc() ||
parentNode == parentNode->OwnerDoc()->GetRootElement());
}
@ -4453,7 +4454,10 @@ NoteDirtyElement(Element* aElement, uint32_t aBits)
}
}
// See the comment in nsIDocument::SetServoRestyleRoot about the !IsElement()
// check there. Same justification here.
MOZ_ASSERT(aElement == doc->GetServoRestyleRoot() ||
!doc->GetServoRestyleRoot()->IsElement() ||
nsContentUtils::ContentIsFlattenedTreeDescendantOfForStyle(
aElement, doc->GetServoRestyleRoot()));
MOZ_ASSERT(aElement == doc->GetServoRestyleRoot() ||

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

@ -88,8 +88,7 @@ nsIDocument::SetServoRestyleRoot(nsINode* aRoot, uint32_t aDirtyBits)
mServoRestyleRoot == aRoot ||
!aRoot->IsElement() ||
nsContentUtils::ContentIsFlattenedTreeDescendantOfForStyle(mServoRestyleRoot, aRoot));
MOZ_ASSERT(aRoot == aRoot->OwnerDocAsNode() ||
(aRoot->IsElement() && aRoot->IsInComposedDoc()));
MOZ_ASSERT(aRoot == aRoot->OwnerDocAsNode() || aRoot->IsElement());
mServoRestyleRoot = aRoot;
mServoRestyleRootDirtyBits = aDirtyBits;
}