Bug 992488 - Return false early from inDOMUtils::SelectorMatchesElement if the selector is for a pseudo-element. r=bzbarsky

This commit is contained in:
Cameron McCormack 2014-04-15 12:28:57 +10:00
parent b7b0beb7d8
commit 2777b01fc9

View File

@ -370,6 +370,15 @@ inDOMUtils::SelectorMatchesElement(nsIDOMElement* aElement,
// We want just the one list item, not the whole list tail
nsAutoPtr<nsCSSSelectorList> sel(tail->Clone(false));
// SelectorListMatches does not handle selectors that begin with a
// pseudo-element, which you can get from selectors like
// |input::-moz-placeholder:hover|. This function doesn't take
// a pseudo-element nsIAtom*, so we know we can't match.
if (sel->mSelectors->IsPseudoElement()) {
*aMatches = false;
return NS_OK;
}
element->OwnerDoc()->FlushPendingLinkUpdates();
// XXXbz what exactly should we do with visited state here?
TreeMatchContext matchingContext(false,