Bug 962628. Make '+' and '~' combinators work at the top level of an anonymous content forest. r=heycam

This commit is contained in:
Boris Zbarsky
2014-01-23 15:18:06 -05:00
parent 9ea80db404
commit 06d2416317
5 changed files with 75 additions and 8 deletions

View File

@@ -2332,14 +2332,7 @@ static bool SelectorMatchesTree(Element* aPrevElement,
if (aTreeMatchContext.mForStyling)
parent->SetFlags(NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS);
int32_t index = parent->IndexOf(prevElement);
while (0 <= --index) {
nsIContent* content = parent->GetChildAt(index);
if (content->IsElement()) {
element = content->AsElement();
break;
}
}
element = prevElement->GetPreviousElementSibling();
}
}
// for descendant combinators and child combinators, the element