mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 898888: Transition manager should use SetStyleContext rather than SetStyleContextWithoutNotification. r=nrc
While debugging bug 858937 I noticed that the transition manager was calling nsIFrame::SetStyleContextWithoutNotification rather than nsIFrame::SetStyleContext. SetStyleContextWithoutNotification should only be used for things that aren't really style changes, but are instead changes we make during frame construction before things are really initialized. Anything that's really a dynamic style change, as these are, should use SetStyleContext. I realize I said the opposite in bug 780692 comment 186, and bz said the same in bug 780692 comment 204, which is why this is the state that it is.
This commit is contained in:
parent
dec690eacf
commit
c857e1a9dd
@ -759,7 +759,13 @@ public:
|
||||
oldStyleContext->Release();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* SetStyleContextWithoutNotification is for changes to the style
|
||||
* context that should suppress style change processing, in other
|
||||
* words, those that aren't really changes. This generally means only
|
||||
* changes that happen during frame construction.
|
||||
*/
|
||||
void SetStyleContextWithoutNotification(nsStyleContext* aContext)
|
||||
{
|
||||
if (aContext != mStyleContext) {
|
||||
|
@ -219,13 +219,13 @@ static void ReparentBeforeAndAfter(dom::Element* aElement,
|
||||
nsRefPtr<nsStyleContext> beforeStyle =
|
||||
aStyleSet->ReparentStyleContext(before->StyleContext(),
|
||||
aNewStyle, aElement);
|
||||
before->SetStyleContextWithoutNotification(beforeStyle);
|
||||
before->SetStyleContext(beforeStyle);
|
||||
}
|
||||
if (nsIFrame* after = nsLayoutUtils::GetBeforeFrame(aPrimaryFrame)) {
|
||||
nsRefPtr<nsStyleContext> afterStyle =
|
||||
aStyleSet->ReparentStyleContext(after->StyleContext(),
|
||||
aNewStyle, aElement);
|
||||
after->SetStyleContextWithoutNotification(afterStyle);
|
||||
after->SetStyleContext(afterStyle);
|
||||
}
|
||||
}
|
||||
|
||||
@ -318,7 +318,7 @@ nsTransitionManager::UpdateThrottledStyle(dom::Element* aElement,
|
||||
aChangeList.AppendChange(primaryFrame, primaryFrame->GetContent(),
|
||||
styleChange);
|
||||
|
||||
primaryFrame->SetStyleContextWithoutNotification(newStyle);
|
||||
primaryFrame->SetStyleContext(newStyle);
|
||||
|
||||
ReparentBeforeAndAfter(aElement, primaryFrame, newStyle, mPresContext->PresShell()->StyleSet());
|
||||
|
||||
@ -358,7 +358,7 @@ nsTransitionManager::UpdateThrottledStylesForSubtree(nsIContent* aContent,
|
||||
|
||||
newStyle = styleSet->ReparentStyleContext(primaryFrame->StyleContext(),
|
||||
aParentStyle, element);
|
||||
primaryFrame->SetStyleContextWithoutNotification(newStyle);
|
||||
primaryFrame->SetStyleContext(newStyle);
|
||||
ReparentBeforeAndAfter(element, primaryFrame, newStyle, styleSet);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user