Bug 1622360 - Delete GetRenderRootForFrame and dependent codepaths. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D67615

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kartikaya Gupta 2020-03-20 13:29:03 +00:00
parent 0da438be4c
commit 29d8eb2643
5 changed files with 6 additions and 63 deletions

View File

@ -1496,10 +1496,6 @@ wr::RenderRoot gfxUtils::GetContentRenderRoot() {
return wr::RenderRoot::Default;
}
Maybe<wr::RenderRoot> gfxUtils::GetRenderRootForFrame(const nsIFrame* aFrame) {
return Nothing();
}
wr::RenderRoot gfxUtils::RecursivelyGetRenderRootForFrame(
const nsIFrame* aFrame) {
return wr::RenderRoot::Default;

View File

@ -314,8 +314,6 @@ class gfxUtils {
static mozilla::wr::RenderRoot GetContentRenderRoot();
static mozilla::Maybe<mozilla::wr::RenderRoot> GetRenderRootForFrame(
const nsIFrame* aFrame);
static mozilla::wr::RenderRoot RecursivelyGetRenderRootForFrame(
const nsIFrame* aFrame);
};

View File

@ -2446,33 +2446,7 @@ void nsFlexContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
GetDisplayFlagsForFlexItem(childFrame));
}
wr::RenderRoot renderRoot =
gfxUtils::GetRenderRootForFrame(this).valueOr(wr::RenderRoot::Default);
if (renderRoot == wr::RenderRoot::Default) {
tempLists.MoveTo(aLists);
return;
}
// This element switches to a new renderroot, so we need to wrap all the
// descendant display items into an nsDisplayRenderRoot.
// This is a bit of a hack. Collect up all descendant display items
// and merge them into a single Content() list. This can cause us
// to violate CSS stacking order, but renderRoots are kind of magic
// anyway.
MOZ_ASSERT(!XRE_IsContentProcess());
nsDisplayListBuilder::AutoContainerASRTracker contASRTracker(aBuilder);
nsDisplayList masterList;
masterList.AppendToTop(tempLists.BorderBackground());
masterList.AppendToTop(tempLists.BlockBorderBackgrounds());
masterList.AppendToTop(tempLists.Floats());
masterList.AppendToTop(tempLists.Content());
masterList.AppendToTop(tempLists.PositionedDescendants());
masterList.AppendToTop(tempLists.Outlines());
const ActiveScrolledRoot* ownLayerASR = contASRTracker.GetContainerASR();
aLists.Content()->AppendNewToTop<nsDisplayRenderRoot>(
aBuilder, this, &masterList, ownLayerASR, renderRoot);
tempLists.MoveTo(aLists);
}
void FlexLine::FreezeItemsEarly(bool aIsUsingFlexGrow,

View File

@ -11039,19 +11039,8 @@ void nsIFrame::SetParent(nsContainerFrame* aParent) {
void nsIFrame::CreateOwnLayerIfNeeded(nsDisplayListBuilder* aBuilder,
nsDisplayList* aList, uint16_t aType,
bool* aCreatedContainerItem) {
wr::RenderRoot renderRoot =
gfxUtils::GetRenderRootForFrame(this).valueOr(wr::RenderRoot::Default);
if (renderRoot != wr::RenderRoot::Default) {
aList->AppendNewToTop<nsDisplayRenderRoot>(
aBuilder, this, aList, aBuilder->CurrentActiveScrolledRoot(),
renderRoot);
if (aCreatedContainerItem) {
*aCreatedContainerItem = true;
}
} else if (GetContent() && GetContent()->IsXULElement() &&
GetContent()->AsElement()->HasAttr(kNameSpaceID_None,
nsGkAtoms::layer)) {
if (GetContent() && GetContent()->IsXULElement() &&
GetContent()->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::layer)) {
aList->AppendNewToTop<nsDisplayOwnLayer>(
aBuilder, this, aList, aBuilder->CurrentActiveScrolledRoot(),
nsDisplayOwnLayerFlags::None, ScrollbarData{}, true, false, aType);

View File

@ -906,13 +906,6 @@ nsresult nsBoxFrame::AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
void nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists) {
bool forceLayer = false;
// We check the renderroot attribute here in nsBoxFrame for lack of a better
// place. This roughly mirrors the pre-existing "layer" attribute. In the
// long term we may want to add a specific element in which we can wrap
// alternate renderroot content, but we're electing to not go down that
// rabbit hole today.
wr::RenderRoot renderRoot =
gfxUtils::GetRenderRootForFrame(this).valueOr(wr::RenderRoot::Default);
if (GetContent()->IsXULElement()) {
// forcelayer is only supported on XUL elements with box layout
@ -930,14 +923,12 @@ void nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
nsDisplayListCollection tempLists(aBuilder);
const nsDisplayListSet& destination =
(forceLayer || renderRoot != wr::RenderRoot::Default) ? tempLists
: aLists;
const nsDisplayListSet& destination = (forceLayer) ? tempLists : aLists;
DisplayBorderBackgroundOutline(aBuilder, destination);
Maybe<nsDisplayListBuilder::AutoContainerASRTracker> contASRTracker;
if (forceLayer || renderRoot != wr::RenderRoot::Default) {
if (forceLayer) {
contASRTracker.emplace(aBuilder);
}
@ -946,7 +937,7 @@ void nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// see if we have to draw a selection frame around this container
DisplaySelectionOverlay(aBuilder, destination.Content());
if (forceLayer || renderRoot != wr::RenderRoot::Default) {
if (forceLayer) {
// This is a bit of a hack. Collect up all descendant display items
// and merge them into a single Content() list. This can cause us
// to violate CSS stacking order, but forceLayer is a magic
@ -962,16 +953,11 @@ void nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
DisplayListClipState::AutoSaveRestore ownLayerClipState(aBuilder);
if (forceLayer) {
MOZ_ASSERT(renderRoot == wr::RenderRoot::Default);
// Wrap the list to make it its own layer
aLists.Content()->AppendNewToTop<nsDisplayOwnLayer>(
aBuilder, this, &masterList, ownLayerASR,
nsDisplayOwnLayerFlags::None, mozilla::layers::ScrollbarData{}, true,
true, nsDisplayOwnLayer::OwnLayerForBoxFrame);
} else {
MOZ_ASSERT(!XRE_IsContentProcess());
aLists.Content()->AppendNewToTop<nsDisplayRenderRoot>(
aBuilder, this, &masterList, ownLayerASR, renderRoot);
}
}
}