Bug 927734 - Loosen assertions about the contents of the style scope stack. r=dbaron

--HG--
extra : rebase_source : 6b9b7e4051bebeb7da640c7878229b1d014841dd
This commit is contained in:
Cameron McCormack 2013-11-01 13:44:27 +11:00
parent 78d8372907
commit 4e7fba2e7b
4 changed files with 17 additions and 12 deletions

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<table>
<tr>
<td>
<style scoped></style>
<span></span>
</td>
</tr>
</table>
<style>div {}</style>

View File

@ -97,3 +97,4 @@ load 867487.html
load 880862.html
load 873222.html
load 915440.html
load 927734-1.html

View File

@ -3410,6 +3410,7 @@ TreeMatchContext::InitAncestors(Element *aElement)
{
MOZ_ASSERT(!mAncestorFilter.mFilter);
MOZ_ASSERT(mAncestorFilter.mHashes.IsEmpty());
MOZ_ASSERT(mStyleScopes.IsEmpty());
mAncestorFilter.mFilter = new AncestorFilter::Filter();

View File

@ -176,20 +176,13 @@ struct MOZ_STACK_CLASS TreeMatchContext {
#ifdef DEBUG
void AssertHasAllStyleScopes(mozilla::dom::Element* aElement)
{
int32_t i = mStyleScopes.Length() - 1;
nsINode* node = aElement->GetParentNode();
while (node && i != -1) {
if (node->IsScopedStyleRoot()) {
MOZ_ASSERT(mStyleScopes[i] == node);
--i;
nsINode* cur = aElement->GetParentNode();
while (cur) {
if (cur->IsScopedStyleRoot()) {
MOZ_ASSERT(mStyleScopes.Contains(cur));
}
node = node->GetParentNode();
cur = cur->GetParentNode();
}
while (node) {
MOZ_ASSERT(!node->IsScopedStyleRoot());
node = node->GetParentNode();
}
MOZ_ASSERT(i == -1);
}
#endif