Bug 732667. Only do checks for :hover selectors when hover state changes on nodes which have relevant hover rules. r=dbaron

This commit is contained in:
Boris Zbarsky
2012-03-12 22:54:15 -05:00
parent d0273011c6
commit a79196f052
3 changed files with 17 additions and 3 deletions

View File

@@ -8085,8 +8085,14 @@ nsCSSFrameConstructor::ContentStateChanged(nsIContent* aContent,
primaryFrame->ContentStatesChanged(aStateMask);
}
nsRestyleHint rshint =
styleSet->HasStateDependentStyle(presContext, aElement, aStateMask);
if (aStateMask.HasState(NS_EVENT_STATE_HOVER) &&
!aElement->HasFlag(NODE_HAS_RELEVANT_HOVER_RULES)) {
aStateMask &= ~NS_EVENT_STATE_HOVER;
}
nsRestyleHint rshint = aStateMask.IsEmpty() ?
nsRestyleHint(0) :
styleSet->HasStateDependentStyle(presContext, aElement, aStateMask);
if (aStateMask.HasState(NS_EVENT_STATE_HOVER) && rshint != 0) {
++mHoverGeneration;