mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 996796 patch 10 - Separate the rule node replacement code from the style context handling so that we can make visited handling correct. r=heycam
This commit is contained in:
parent
8a92c2cbcf
commit
d59096e3a0
@ -1327,10 +1327,10 @@ static const CascadeLevel gCascadeLevels[] = {
|
||||
{ nsStyleSet::eTransitionSheet, false, eRestyle_CSSTransitions },
|
||||
};
|
||||
|
||||
already_AddRefed<nsStyleContext>
|
||||
nsStyleSet::ResolveStyleWithReplacement(Element* aElement,
|
||||
nsStyleContext* aNewParentContext,
|
||||
nsStyleContext* aOldStyleContext,
|
||||
nsRuleNode*
|
||||
nsStyleSet::RuleNodeWithReplacement(Element* aElement,
|
||||
nsRuleNode* aOldRuleNode,
|
||||
nsCSSPseudoElements::Type aPseudoType,
|
||||
nsRestyleHint aReplacements)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(!(aReplacements & ~(eRestyle_CSSTransitions |
|
||||
@ -1341,7 +1341,7 @@ nsStyleSet::ResolveStyleWithReplacement(Element* aElement,
|
||||
uint32_t(aReplacements)).get());
|
||||
|
||||
nsTArray<RuleNodeInfo> rules;
|
||||
for (nsRuleNode* ruleNode = aOldStyleContext->RuleNode(); !ruleNode->IsRoot();
|
||||
for (nsRuleNode* ruleNode = aOldRuleNode; !ruleNode->IsRoot();
|
||||
ruleNode = ruleNode->GetParent()) {
|
||||
RuleNodeInfo* curRule = rules.AppendElement();
|
||||
curRule->mRule = ruleNode->GetRule();
|
||||
@ -1364,7 +1364,7 @@ nsStyleSet::ResolveStyleWithReplacement(Element* aElement,
|
||||
nsAnimationManager* animationManager =
|
||||
PresContext()->AnimationManager();
|
||||
ElementAnimationCollection* collection = animationManager->GetElementAnimations(
|
||||
aElement, aOldStyleContext->GetPseudoType(), false);
|
||||
aElement, aPseudoType, false);
|
||||
|
||||
if (collection) {
|
||||
animationManager->UpdateStyleAndEvents(
|
||||
@ -1380,9 +1380,7 @@ nsStyleSet::ResolveStyleWithReplacement(Element* aElement,
|
||||
nsPresContext* presContext = PresContext();
|
||||
ElementAnimationCollection* collection =
|
||||
presContext->TransitionManager()->GetElementTransitions(
|
||||
aElement,
|
||||
aOldStyleContext->GetPseudoType(),
|
||||
false);
|
||||
aElement, aPseudoType, false);
|
||||
|
||||
if (collection) {
|
||||
collection->EnsureStyleRuleFor(
|
||||
@ -1415,6 +1413,19 @@ nsStyleSet::ResolveStyleWithReplacement(Element* aElement,
|
||||
}
|
||||
}
|
||||
|
||||
return ruleWalker.CurrentNode();
|
||||
}
|
||||
|
||||
already_AddRefed<nsStyleContext>
|
||||
nsStyleSet::ResolveStyleWithReplacement(Element* aElement,
|
||||
nsStyleContext* aNewParentContext,
|
||||
nsStyleContext* aOldStyleContext,
|
||||
nsRestyleHint aReplacements)
|
||||
{
|
||||
nsRuleNode* ruleNode =
|
||||
RuleNodeWithReplacement(aElement, aOldStyleContext->RuleNode(),
|
||||
aOldStyleContext->GetPseudoType(), aReplacements);
|
||||
|
||||
// FIXME: Does this handle visited contexts correctly???
|
||||
|
||||
uint32_t flags = eNoFlags;
|
||||
@ -1425,7 +1436,7 @@ nsStyleSet::ResolveStyleWithReplacement(Element* aElement,
|
||||
flags |= eIsVisitedLink;
|
||||
}
|
||||
|
||||
return GetContext(aNewParentContext, ruleWalker.CurrentNode(), nullptr,
|
||||
return GetContext(aNewParentContext, ruleNode, nullptr,
|
||||
nullptr, nsCSSPseudoElements::ePseudo_NotPseudoElement,
|
||||
nullptr, flags);
|
||||
}
|
||||
|
@ -399,6 +399,12 @@ class nsStyleSet
|
||||
ElementDependentRuleProcessorData* aData,
|
||||
bool aWalkAllXBLStylesheets);
|
||||
|
||||
// Helper for ResolveStyleWithReplacement
|
||||
nsRuleNode* RuleNodeWithReplacement(mozilla::dom::Element* aElement,
|
||||
nsRuleNode* aOldRuleNode,
|
||||
nsCSSPseudoElements::Type aPseudoType,
|
||||
nsRestyleHint aReplacements);
|
||||
|
||||
/**
|
||||
* Bit-flags that can be passed to GetContext() in its parameter 'aFlags'.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user