mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 846888. Part 1. Update the in popup frame state bits when we swap docshells. r=mattwoodrow
This commit is contained in:
parent
9229fd1990
commit
3184db306f
@ -8090,12 +8090,8 @@ nsFrame::BoxMetrics() const
|
||||
return metrics;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the NS_FRAME_IN_POPUP state bit to the current frame,
|
||||
* and all descendant frames (including cross-doc ones).
|
||||
*/
|
||||
static void
|
||||
AddInPopupStateBitToDescendants(nsIFrame* aFrame)
|
||||
/* static */ void
|
||||
nsIFrame::AddInPopupStateBitToDescendants(nsIFrame* aFrame)
|
||||
{
|
||||
aFrame->AddStateBits(NS_FRAME_IN_POPUP);
|
||||
|
||||
@ -8111,13 +8107,8 @@ AddInPopupStateBitToDescendants(nsIFrame* aFrame)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the NS_FRAME_IN_POPUP state bit from the current
|
||||
* frames and all descendant frames (including cross-doc ones),
|
||||
* unless the frame is a popup itself.
|
||||
*/
|
||||
static void
|
||||
RemoveInPopupStateBitFromDescendants(nsIFrame* aFrame)
|
||||
/* static */ void
|
||||
nsIFrame::RemoveInPopupStateBitFromDescendants(nsIFrame* aFrame)
|
||||
{
|
||||
if (!aFrame->HasAnyStateBits(NS_FRAME_IN_POPUP) ||
|
||||
aFrame->GetType() == nsGkAtoms::listControlFrame ||
|
||||
|
@ -2955,6 +2955,18 @@ NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::ParagraphDepthProperty()))
|
||||
|
||||
void CreateOwnLayerIfNeeded(nsDisplayListBuilder* aBuilder, nsDisplayList* aList);
|
||||
|
||||
/**
|
||||
* Adds the NS_FRAME_IN_POPUP state bit to aFrame, and
|
||||
* all descendant frames (including cross-doc ones).
|
||||
*/
|
||||
static void AddInPopupStateBitToDescendants(nsIFrame* aFrame);
|
||||
/**
|
||||
* Removes the NS_FRAME_IN_POPUP state bit from aFrame and
|
||||
* all descendant frames (including cross-doc ones), unless
|
||||
* the frame is a popup itself.
|
||||
*/
|
||||
static void RemoveInPopupStateBitFromDescendants(nsIFrame* aFrame);
|
||||
|
||||
protected:
|
||||
// Members
|
||||
nsRect mRect;
|
||||
|
@ -1013,9 +1013,6 @@ nsSubDocumentFrame::BeginSwapDocShells(nsIFrame* aOther)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_ASSERTION(HasAnyStateBits(NS_FRAME_IN_POPUP) == other->HasAnyStateBits(NS_FRAME_IN_POPUP),
|
||||
"Can't swap doc shells when only one is within a popup!");
|
||||
|
||||
if (mInnerView && other->mInnerView) {
|
||||
nsView* ourSubdocViews = mInnerView->GetFirstChild();
|
||||
nsView* ourRemovedViews = ::BeginSwapDocShellsForViews(ourSubdocViews);
|
||||
@ -1071,14 +1068,21 @@ EndSwapDocShellsForViews(nsView* aSibling)
|
||||
::EndSwapDocShellsForDocument(doc, nullptr);
|
||||
}
|
||||
nsIFrame *frame = aSibling->GetFrame();
|
||||
if (frame && frame->HasInvalidFrameInSubtree()) {
|
||||
nsIFrame *parent = nsLayoutUtils::GetCrossDocParentFrame(frame);
|
||||
if (frame) {
|
||||
nsIFrame* parent = nsLayoutUtils::GetCrossDocParentFrame(frame);
|
||||
if (parent->HasAnyStateBits(NS_FRAME_IN_POPUP)) {
|
||||
nsIFrame::AddInPopupStateBitToDescendants(frame);
|
||||
} else {
|
||||
nsIFrame::RemoveInPopupStateBitFromDescendants(frame);
|
||||
}
|
||||
if (frame->HasInvalidFrameInSubtree()) {
|
||||
while (parent && !parent->HasAnyStateBits(NS_FRAME_DESCENDANT_NEEDS_PAINT)) {
|
||||
parent->AddStateBits(NS_FRAME_DESCENDANT_NEEDS_PAINT);
|
||||
parent = nsLayoutUtils::GetCrossDocParentFrame(parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user