Bug 1802142 - Remove layer="" attribute support from XUL elements. r=tnikkel,layout-reviewers

No remaining users.

Depends on D162851

Differential Revision: https://phabricator.services.mozilla.com/D162852
This commit is contained in:
Emilio Cobos Álvarez 2022-11-29 04:52:33 +00:00
Родитель 13c8a3a563
Коммит af7548c6d5
4 изменённых файлов: 4 добавлений и 77 удалений

Просмотреть файл

@ -3766,15 +3766,6 @@ void nsIFrame::BuildDisplayListForStackingContext(
createdContainer = true;
}
bool createdOwnLayer = false;
CreateOwnLayerIfNeeded(aBuilder, &resultList,
nsDisplayOwnLayer::OwnLayerForStackingContext,
&createdOwnLayer);
if (createdOwnLayer) {
createdContainer = true;
}
if (aBuilder->IsReusingStackingContextItems()) {
if (resultList.IsEmpty()) {
return;
@ -11113,21 +11104,6 @@ void nsIFrame::SetParent(nsContainerFrame* aParent) {
}
}
void nsIFrame::CreateOwnLayerIfNeeded(nsDisplayListBuilder* aBuilder,
nsDisplayList* aList, uint16_t aType,
bool* aCreatedContainerItem) {
if (GetContent() && GetContent()->IsXULElement() &&
GetContent()->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::layer)) {
aList->AppendNewToTopWithIndex<nsDisplayOwnLayer>(
aBuilder, this, /* aIndex = */ aType, aList,
aBuilder->CurrentActiveScrolledRoot(), nsDisplayOwnLayerFlags::None,
ScrollbarData{}, true, false);
if (aCreatedContainerItem) {
*aCreatedContainerItem = true;
}
}
}
bool nsIFrame::IsStackingContext(const nsStyleDisplay* aStyleDisplay,
const nsStyleEffects* aStyleEffects) {
// Properties that influence the output of this function should be handled in

Просмотреть файл

@ -4591,10 +4591,6 @@ class nsIFrame : public nsQueryFrame {
*/
Maybe<mozilla::StyleVerticalAlignKeyword> VerticalAlignEnum() const;
void CreateOwnLayerIfNeeded(nsDisplayListBuilder* aBuilder,
nsDisplayList* aList, uint16_t aType,
bool* aCreatedContainerItem = nullptr);
/**
* Adds the NS_FRAME_IN_POPUP state bit to aFrame, and
* all descendant frames (including cross-doc ones).

Просмотреть файл

@ -843,52 +843,13 @@ nsresult nsBoxFrame::AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
void nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists) {
bool forceLayer = false;
if (GetContent()->IsXULElement()) {
// forcelayer is only supported on XUL elements with box layout
if (GetContent()->AsElement()->HasAttr(kNameSpaceID_None,
nsGkAtoms::layer)) {
forceLayer = true;
}
}
nsDisplayListCollection tempLists(aBuilder);
const nsDisplayListSet& destination = (forceLayer) ? tempLists : aLists;
DisplayBorderBackgroundOutline(aBuilder, aLists);
DisplayBorderBackgroundOutline(aBuilder, destination);
Maybe<nsDisplayListBuilder::AutoContainerASRTracker> contASRTracker;
if (forceLayer) {
contASRTracker.emplace(aBuilder);
}
BuildDisplayListForChildren(aBuilder, destination);
BuildDisplayListForChildren(aBuilder, aLists);
// see if we have to draw a selection frame around this container
DisplaySelectionOverlay(aBuilder, destination.Content());
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
// XUL-only extension anyway.
nsDisplayList masterList(aBuilder);
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();
DisplayListClipState::AutoSaveRestore ownLayerClipState(aBuilder);
// Wrap the list to make it its own layer
aLists.Content()->AppendNewToTopWithIndex<nsDisplayOwnLayer>(
aBuilder, this, /* aIndex = */ nsDisplayOwnLayer::OwnLayerForBoxFrame,
&masterList, ownLayerASR, mozilla::nsDisplayOwnLayerFlags::None,
mozilla::layers::ScrollbarData{}, true, true);
}
DisplaySelectionOverlay(aBuilder, aLists.Content());
}
void nsBoxFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,

Просмотреть файл

@ -316,13 +316,7 @@ void nsImageBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
DisplayListClipState::AutoClipContainingBlockDescendantsToContentBox clip(
aBuilder, this, clipFlags);
nsDisplayList list(aBuilder);
list.AppendNewToTop<nsDisplayXULImage>(aBuilder, this);
CreateOwnLayerIfNeeded(aBuilder, &list,
nsDisplayOwnLayer::OwnLayerForImageBoxFrame);
aLists.Content()->AppendToTop(&list);
aLists.Content()->AppendNewToTop<nsDisplayXULImage>(aBuilder, this);
}
already_AddRefed<imgIContainer> nsImageBoxFrame::GetImageContainerForPainting(