Don't call SelectorMatches on document fragments. (Bug 437170) r+sr=bzbarsky

This commit is contained in:
L. David Baron 2008-06-05 16:06:34 -07:00
Родитель 9704ef1a8b
Коммит 8aaec8fb44
1 изменённых файлов: 3 добавлений и 1 удалений

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

@ -1741,7 +1741,9 @@ static PRBool SelectorMatchesTree(RuleProcessorData& aPrevData,
data = prevdata->mParentData; data = prevdata->mParentData;
if (!data) { if (!data) {
nsIContent *content = prevdata->mContent->GetParent(); nsIContent *content = prevdata->mContent->GetParent();
if (content) { // GetParent could return a document fragment; we only want
// element parents.
if (content && content->IsNodeOfType(nsINode::eELEMENT)) {
data = new (prevdata->mPresContext) data = new (prevdata->mPresContext)
RuleProcessorData(prevdata->mPresContext, content, RuleProcessorData(prevdata->mPresContext, content,
prevdata->mRuleWalker, prevdata->mRuleWalker,