mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1180120 - Part 6.1: Factor out some of RestyleUndisplayedDescendants. r=dbaron
This commit is contained in:
parent
2e351825db
commit
a13695522b
@ -2860,6 +2860,22 @@ ElementRestyler::AddPendingRestylesForDescendantsMatchingSelectors(
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
ElementRestyler::MustCheckUndisplayedContent(nsIContent*& aUndisplayedParent)
|
||||
{
|
||||
// When the root element is display:none, we still construct *some*
|
||||
// frames that have the root element as their mContent, down to the
|
||||
// DocElementContainingBlock.
|
||||
if (mFrame->StyleContext()->GetPseudo()) {
|
||||
aUndisplayedParent = nullptr;
|
||||
return mFrame == mPresContext->FrameConstructor()->
|
||||
GetDocElementContainingBlock();
|
||||
}
|
||||
|
||||
aUndisplayedParent = mFrame->GetContent();
|
||||
return !!aUndisplayedParent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recompute style for mFrame (which should not have a prev continuation
|
||||
* with the same style), all of its next continuations with the same
|
||||
@ -3941,20 +3957,8 @@ ElementRestyler::ComputeStyleChangeFor(nsIFrame* aFrame,
|
||||
void
|
||||
ElementRestyler::RestyleUndisplayedDescendants(nsRestyleHint aChildRestyleHint)
|
||||
{
|
||||
// When the root element is display:none, we still construct *some*
|
||||
// frames that have the root element as their mContent, down to the
|
||||
// DocElementContainingBlock.
|
||||
bool checkUndisplayed;
|
||||
nsIContent* undisplayedParent;
|
||||
if (mFrame->StyleContext()->GetPseudo()) {
|
||||
checkUndisplayed = mFrame == mPresContext->FrameConstructor()->
|
||||
GetDocElementContainingBlock();
|
||||
undisplayedParent = nullptr;
|
||||
} else {
|
||||
checkUndisplayed = !!mFrame->GetContent();
|
||||
undisplayedParent = mFrame->GetContent();
|
||||
}
|
||||
if (checkUndisplayed) {
|
||||
if (MustCheckUndisplayedContent(undisplayedParent)) {
|
||||
DoRestyleUndisplayedDescendants(aChildRestyleHint, undisplayedParent,
|
||||
mFrame->StyleContext());
|
||||
}
|
||||
|
@ -686,10 +686,10 @@ private:
|
||||
RestyleResult ComputeRestyleResultFromNewContext(nsIFrame* aSelf,
|
||||
nsStyleContext* aNewContext);
|
||||
|
||||
/**
|
||||
* Helpers for RestyleChildren().
|
||||
*/
|
||||
// Helpers for RestyleChildren().
|
||||
void RestyleUndisplayedDescendants(nsRestyleHint aChildRestyleHint);
|
||||
bool MustCheckUndisplayedContent(nsIContent*& aUndisplayedParent);
|
||||
|
||||
/**
|
||||
* In the following two methods, aParentStyleContext is either
|
||||
* mFrame->StyleContext() if we have a frame, or a display:contents
|
||||
|
Loading…
Reference in New Issue
Block a user