mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 758885. Don't apply the dynamic :hover reresolution skipping optimization to selectors which can match on mutable state other than :hover. r=dbaron
This commit is contained in:
parent
d8425605ad
commit
e7ff5ec8dd
@ -8092,13 +8092,8 @@ nsCSSFrameConstructor::ContentStateChanged(nsIContent* aContent,
|
|||||||
primaryFrame->ContentStatesChanged(aStateMask);
|
primaryFrame->ContentStatesChanged(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 rshint =
|
||||||
nsRestyleHint(0) :
|
|
||||||
styleSet->HasStateDependentStyle(presContext, aElement, aStateMask);
|
styleSet->HasStateDependentStyle(presContext, aElement, aStateMask);
|
||||||
|
|
||||||
if (aStateMask.HasState(NS_EVENT_STATE_HOVER) && rshint != 0) {
|
if (aStateMask.HasState(NS_EVENT_STATE_HOVER) && rshint != 0) {
|
||||||
|
@ -2391,6 +2391,24 @@ nsCSSRuleProcessor::HasStateDependentStyle(StateRuleProcessorData* aData)
|
|||||||
// states passed in are relevant here.
|
// states passed in are relevant here.
|
||||||
if ((possibleChange & ~hint) &&
|
if ((possibleChange & ~hint) &&
|
||||||
states.HasAtLeastOneOfStates(aData->mStateMask) &&
|
states.HasAtLeastOneOfStates(aData->mStateMask) &&
|
||||||
|
// We can optimize away testing selectors that only involve :hover, a
|
||||||
|
// namespace, and a tag name against nodes that don't have the
|
||||||
|
// NODE_HAS_RELEVANT_HOVER_RULES flag: such a selector didn't match
|
||||||
|
// the tag name or namespace the first time around (since the :hover
|
||||||
|
// didn't set the NODE_HAS_RELEVANT_HOVER_RULES flag), so it won't
|
||||||
|
// match it now. Check for our selector only having :hover states, or
|
||||||
|
// the element having the hover rules flag, or the selector having
|
||||||
|
// some sort of non-namespace, non-tagname data in it.
|
||||||
|
(states != NS_EVENT_STATE_HOVER ||
|
||||||
|
aData->mElement->HasFlag(NODE_HAS_RELEVANT_HOVER_RULES) ||
|
||||||
|
selector->mIDList || selector->mClassList ||
|
||||||
|
// We generally expect an mPseudoClassList, since we have a :hover.
|
||||||
|
// The question is whether we have anything else in there.
|
||||||
|
(selector->mPseudoClassList &&
|
||||||
|
(selector->mPseudoClassList->mNext ||
|
||||||
|
selector->mPseudoClassList->mType !=
|
||||||
|
nsCSSPseudoClasses::ePseudoClass_hover)) ||
|
||||||
|
selector->mAttrList || selector->mNegations) &&
|
||||||
SelectorMatches(aData->mElement, selector, nodeContext,
|
SelectorMatches(aData->mElement, selector, nodeContext,
|
||||||
aData->mTreeMatchContext) &&
|
aData->mTreeMatchContext) &&
|
||||||
SelectorMatchesTree(aData->mElement, selector->mNext,
|
SelectorMatchesTree(aData->mElement, selector->mNext,
|
||||||
|
Loading…
Reference in New Issue
Block a user