Bug 1064843 part 6 - Add backdrop frame list. r=dholbert
This commit is contained in:
@@ -46,6 +46,7 @@ ChildListName(FrameChildListID aListID)
|
||||
case kFloatList: return "FloatList";
|
||||
case kBulletList: return "BulletList";
|
||||
case kPushedFloatsList: return "PushedFloatsList";
|
||||
case kBackdropList: return "BackdropList";
|
||||
case kNoReflowPrincipalList: return "NoReflowPrincipalList";
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,16 @@ nsContainerFrame::SetInitialChildList(ChildListID aListID,
|
||||
MOZ_ASSERT(mFrames.IsEmpty(),
|
||||
"unexpected second call to SetInitialChildList");
|
||||
mFrames.SetFrames(aChildList);
|
||||
} else if (aListID == kBackdropList) {
|
||||
MOZ_ASSERT(StyleDisplay()->mTopLayer != NS_STYLE_TOP_LAYER_NONE,
|
||||
"Only top layer frames should have backdrop");
|
||||
MOZ_ASSERT(GetStateBits() & NS_FRAME_OUT_OF_FLOW,
|
||||
"Top layer frames should be out-of-flow");
|
||||
MOZ_ASSERT(!Properties().Get(BackdropProperty()),
|
||||
"We shouldn't have setup backdrop frame list before");
|
||||
nsFrameList* list =
|
||||
new (PresContext()->PresShell()) nsFrameList(aChildList);
|
||||
Properties().Set(BackdropProperty(), list);
|
||||
} else {
|
||||
MOZ_ASSERT_UNREACHABLE("Unexpected child list");
|
||||
}
|
||||
@@ -207,12 +217,16 @@ nsContainerFrame::DestroyFrom(nsIFrame* aDestructRoot)
|
||||
!(props->Get(this, nsContainerFrame::OverflowContainersProperty()) ||
|
||||
props->Get(this, nsContainerFrame::ExcessOverflowContainersProperty())),
|
||||
"this type of frame should't have overflow containers");
|
||||
|
||||
SafelyDestroyFrameListProp(aDestructRoot, shell, props,
|
||||
OverflowContainersProperty());
|
||||
SafelyDestroyFrameListProp(aDestructRoot, shell, props,
|
||||
ExcessOverflowContainersProperty());
|
||||
|
||||
MOZ_ASSERT(!props->Get(this, BackdropProperty()) ||
|
||||
StyleDisplay()->mTopLayer != NS_STYLE_TOP_LAYER_NONE,
|
||||
"only top layer frame may have backdrop");
|
||||
SafelyDestroyFrameListProp(aDestructRoot, shell, props, BackdropProperty());
|
||||
|
||||
nsSplittableFrame::DestroyFrom(aDestructRoot);
|
||||
}
|
||||
|
||||
@@ -222,7 +236,8 @@ nsContainerFrame::DestroyFrom(nsIFrame* aDestructRoot)
|
||||
const nsFrameList&
|
||||
nsContainerFrame::GetChildList(ChildListID aListID) const
|
||||
{
|
||||
// We only know about the principal child list and the overflow lists.
|
||||
// We only know about the principal child list, the overflow lists,
|
||||
// and the backdrop list.
|
||||
switch (aListID) {
|
||||
case kPrincipalList:
|
||||
return mFrames;
|
||||
@@ -239,6 +254,10 @@ nsContainerFrame::GetChildList(ChildListID aListID) const
|
||||
GetPropTableFrames(ExcessOverflowContainersProperty());
|
||||
return list ? *list : nsFrameList::EmptyList();
|
||||
}
|
||||
case kBackdropList: {
|
||||
nsFrameList* list = GetPropTableFrames(BackdropProperty());
|
||||
return list ? *list : nsFrameList::EmptyList();
|
||||
}
|
||||
default:
|
||||
return nsSplittableFrame::GetChildList(aListID);
|
||||
}
|
||||
@@ -270,6 +289,13 @@ nsContainerFrame::GetChildLists(nsTArray<ChildList>* aLists) const
|
||||
::AppendIfNonempty(this, propTable, ExcessOverflowContainersProperty(),
|
||||
aLists, kExcessOverflowContainersList);
|
||||
}
|
||||
// Bypass BackdropProperty hashtable lookup for any in-flow frames
|
||||
// since frames in the top layer (only which can have backdrop) are
|
||||
// definitely out-of-flow.
|
||||
if (GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
|
||||
::AppendIfNonempty(this, propTable, BackdropProperty(),
|
||||
aLists, kBackdropList);
|
||||
}
|
||||
nsSplittableFrame::GetChildLists(aLists);
|
||||
}
|
||||
|
||||
|
||||
@@ -454,6 +454,7 @@ public:
|
||||
NS_DECLARE_FRAME_PROPERTY_FRAMELIST(OverflowProperty)
|
||||
NS_DECLARE_FRAME_PROPERTY_FRAMELIST(OverflowContainersProperty)
|
||||
NS_DECLARE_FRAME_PROPERTY_FRAMELIST(ExcessOverflowContainersProperty)
|
||||
NS_DECLARE_FRAME_PROPERTY_FRAMELIST(BackdropProperty)
|
||||
|
||||
#ifdef DEBUG
|
||||
// Use this to suppress the CRAZY_SIZE assertions.
|
||||
|
||||
@@ -41,9 +41,10 @@ namespace layout {
|
||||
kFloatList = 0x800,
|
||||
kBulletList = 0x1000,
|
||||
kPushedFloatsList = 0x2000,
|
||||
kBackdropList = 0x4000,
|
||||
// A special alias for kPrincipalList that suppress the reflow request that
|
||||
// is normally done when manipulating child lists.
|
||||
kNoReflowPrincipalList = 0x4000
|
||||
kNoReflowPrincipalList = 0x8000
|
||||
};
|
||||
} // namespace layout
|
||||
} // namespace mozilla
|
||||
|
||||
@@ -1086,6 +1086,7 @@ public:
|
||||
static const ChildListID kPopupList = mozilla::layout::kPopupList;
|
||||
static const ChildListID kPushedFloatsList = mozilla::layout::kPushedFloatsList;
|
||||
static const ChildListID kSelectPopupList = mozilla::layout::kSelectPopupList;
|
||||
static const ChildListID kBackdropList = mozilla::layout::kBackdropList;
|
||||
// A special alias for kPrincipalList that do not request reflow.
|
||||
static const ChildListID kNoReflowPrincipalList = mozilla::layout::kNoReflowPrincipalList;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user