diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index bac67e16f4ad..3b125bb5acaa 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -2428,7 +2428,7 @@ class ContainerLayer : public Layer { // be part of mTransform. float mInheritedXScale; float mInheritedYScale; - // For layers corresponding to an nsDisplayResolution, the resolution of the + // For layers corresponding to an nsDisplayAsyncZoom, the resolution of the // associated pres shell; for other layers, 1.0. float mPresShellResolution; bool mUseIntermediateSurface; diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 4a221e52c770..a62043565bce 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -5297,21 +5297,6 @@ void PresShell::SetRenderingState(const RenderingState& aState) { } } - // nsSubDocumentFrame uses a resolution different from 1.0 to determine if it - // needs to build a nsDisplayResolution item. So if we are going from or - // to 1.0 then we need to invalidate the subdoc frame so that item gets - // created/removed. - if (mResolution.valueOr(1.0) != aState.mResolution.valueOr(1.0) && - (mResolution.valueOr(1.0) == 1.0 || - aState.mResolution.valueOr(1.0) == 1.0)) { - if (nsIFrame* frame = GetRootFrame()) { - frame = nsLayoutUtils::GetCrossDocParentFrame(frame); - if (frame) { - frame->InvalidateFrame(); - } - } - } - mRenderingStateFlags = aState.mRenderingStateFlags; mResolution = aState.mResolution; } diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index 37ea484c7ff0..628cdedafd37 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -431,12 +431,9 @@ void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, clipState.ClipContainingBlockDescendantsToContentBox(aBuilder, this); nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollable(); - bool constructResolutionItem = - subdocRootFrame && (presShell->GetResolution() != 1.0); bool constructZoomItem = subdocRootFrame && parentAPD != subdocAPD; bool needsOwnLayer = false; - if (constructResolutionItem || constructZoomItem || - presContext->IsRootContentDocument() || + if (constructZoomItem || presContext->IsRootContentDocument() || (sf && sf->IsScrollingActive(aBuilder))) { needsOwnLayer = true; } @@ -525,7 +522,7 @@ void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, // becomes the topmost. We do this below. if (constructZoomItem) { nsDisplayOwnLayerFlags zoomFlags = flags; - if (ignoreViewportScrolling && !constructResolutionItem) { + if (ignoreViewportScrolling) { zoomFlags |= nsDisplayOwnLayerFlags::GenerateScrollableLayer; } childItems.AppendNewToTop(aBuilder, subdocRootFrame, this, @@ -540,12 +537,6 @@ void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, if (ignoreViewportScrolling) { flags |= nsDisplayOwnLayerFlags::GenerateScrollableLayer; } - if (constructResolutionItem) { - childItems.AppendNewToTop(aBuilder, subdocRootFrame, - this, &childItems, flags); - - needsOwnLayer = false; - } // We always want top level content documents to be in their own layer. nsDisplaySubDocument* layerItem = MakeDisplayItem( diff --git a/layout/painting/nsDisplayItemTypesList.h b/layout/painting/nsDisplayItemTypesList.h index 2699a5b76ebd..1fc05cc17299 100644 --- a/layout/painting/nsDisplayItemTypesList.h +++ b/layout/painting/nsDisplayItemTypesList.h @@ -65,8 +65,6 @@ DECLARE_DISPLAY_ITEM_TYPE(PLUGIN_READBACK, 0) DECLARE_DISPLAY_ITEM_TYPE(PRINT_PLUGIN, 0) DECLARE_DISPLAY_ITEM_TYPE(RANGE_FOCUS_RING, 0) DECLARE_DISPLAY_ITEM_TYPE(REMOTE, TYPE_RENDERS_NO_IMAGES) -DECLARE_DISPLAY_ITEM_TYPE(RESOLUTION, - TYPE_RENDERS_NO_IMAGES | TYPE_IS_CONTAINER) DECLARE_DISPLAY_ITEM_TYPE(SCROLL_INFO_LAYER, TYPE_RENDERS_NO_IMAGES | TYPE_IS_CONTAINER) DECLARE_DISPLAY_ITEM_TYPE(SELECTION_OVERLAY, TYPE_RENDERS_NO_IMAGES) diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index ab9babb1e3e4..44e32d3ea9ef 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -6548,29 +6548,6 @@ nsRegion nsDisplaySubDocument::GetOpaqueRegion(nsDisplayListBuilder* aBuilder, return nsDisplayOwnLayer::GetOpaqueRegion(aBuilder, aSnap); } -nsDisplayResolution::nsDisplayResolution(nsDisplayListBuilder* aBuilder, - nsIFrame* aFrame, - nsSubDocumentFrame* aSubDocFrame, - nsDisplayList* aList, - nsDisplayOwnLayerFlags aFlags) - : nsDisplaySubDocument(aBuilder, aFrame, aSubDocFrame, aList, aFlags) { - MOZ_COUNT_CTOR(nsDisplayResolution); -} - -already_AddRefed nsDisplayResolution::BuildLayer( - nsDisplayListBuilder* aBuilder, LayerManager* aManager, - const ContainerLayerParameters& aContainerParameters) { - float rootLayerResolution = 1.0f; - ContainerLayerParameters containerParameters( - rootLayerResolution, rootLayerResolution, nsIntPoint(), - aContainerParameters); - - RefPtr layer = - nsDisplaySubDocument::BuildLayer(aBuilder, aManager, containerParameters); - - return layer.forget(); -} - /* static */ nsDisplayFixedPosition* nsDisplayFixedPosition::CreateForFixedBackground( nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nsIFrame* aSecondaryFrame, diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h index 04e15ea61926..7ad64e4fc1cb 100644 --- a/layout/painting/nsDisplayList.h +++ b/layout/painting/nsDisplayList.h @@ -6107,25 +6107,6 @@ class nsDisplaySubDocument : public nsDisplayOwnLayer { nsSubDocumentFrame* mSubDocFrame; }; -/** - * A display item for subdocuments to capture the resolution from the presShell - * and ensure that it gets applied to all the right elements. This item creates - * a container layer. - */ -class nsDisplayResolution : public nsDisplaySubDocument { - public: - nsDisplayResolution(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, - nsSubDocumentFrame* aSubDocFrame, nsDisplayList* aList, - nsDisplayOwnLayerFlags aFlags); - MOZ_COUNTED_DTOR_OVERRIDE(nsDisplayResolution) - - NS_DISPLAY_DECL_NAME("Resolution", TYPE_RESOLUTION) - - already_AddRefed BuildLayer( - nsDisplayListBuilder* aBuilder, LayerManager* aManager, - const ContainerLayerParameters& aContainerParameters) override; -}; - /** * A display item used to represent sticky position elements. The contents * gets its own layer and creates a stacking context, and the layer will have