diff options
Diffstat (limited to 'layout/generic/nsCanvasFrame.cpp')
-rw-r--r-- | layout/generic/nsCanvasFrame.cpp | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp index 64c56b1c00..36b579ed60 100644 --- a/layout/generic/nsCanvasFrame.cpp +++ b/layout/generic/nsCanvasFrame.cpp @@ -546,6 +546,8 @@ void nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, layers.mImageCount > 0 && layers.mLayers[0].mAttachment == StyleImageLayerAttachment::Fixed; + nsDisplayList list(aBuilder); + if (!hasFixedBottomLayer || needBlendContainer) { // Put a scrolled background color item in place, at the bottom of the // list. The color of this item will be filled in during @@ -557,20 +559,18 @@ void nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, // interleaving the two with a scrolled background color. // PresShell::AddCanvasBackgroundColorItem makes sure there always is a // non-scrolled background color item at the bottom. - aLists.BorderBackground()->AppendNewToTop<nsDisplayCanvasBackgroundColor>( - aBuilder, this); + list.AppendNewToTop<nsDisplayCanvasBackgroundColor>(aBuilder, this); } - aLists.BorderBackground()->AppendToTop(&layerItems); + list.AppendToTop(&layerItems); if (needBlendContainer) { const ActiveScrolledRoot* containerASR = contASRTracker.GetContainerASR(); DisplayListClipState::AutoSaveRestore blendContainerClip(aBuilder); - aLists.BorderBackground()->AppendToTop( - nsDisplayBlendContainer::CreateForBackgroundBlendMode( - aBuilder, this, nullptr, aLists.BorderBackground(), - containerASR)); + list.AppendToTop(nsDisplayBlendContainer::CreateForBackgroundBlendMode( + aBuilder, this, nullptr, &list, containerASR)); } + aLists.BorderBackground()->AppendToTop(&list); } for (nsIFrame* kid : PrincipalChildList()) { @@ -606,24 +606,16 @@ void nsCanvasFrame::PaintFocus(DrawTarget* aDrawTarget, nsPoint aPt) { /* virtual */ nscoord nsCanvasFrame::GetMinISize(gfxContext* aRenderingContext) { - nscoord result; - DISPLAY_MIN_INLINE_SIZE(this, result); - if (mFrames.IsEmpty()) - result = 0; - else - result = mFrames.FirstChild()->GetMinISize(aRenderingContext); - return result; + return mFrames.IsEmpty() + ? 0 + : mFrames.FirstChild()->GetMinISize(aRenderingContext); } /* virtual */ nscoord nsCanvasFrame::GetPrefISize(gfxContext* aRenderingContext) { - nscoord result; - DISPLAY_PREF_INLINE_SIZE(this, result); - if (mFrames.IsEmpty()) - result = 0; - else - result = mFrames.FirstChild()->GetPrefISize(aRenderingContext); - return result; + return mFrames.IsEmpty() + ? 0 + : mFrames.FirstChild()->GetPrefISize(aRenderingContext); } void nsCanvasFrame::Reflow(nsPresContext* aPresContext, @@ -632,7 +624,6 @@ void nsCanvasFrame::Reflow(nsPresContext* aPresContext, nsReflowStatus& aStatus) { MarkInReflow(); DO_GLOBAL_REFLOW_COUNT("nsCanvasFrame"); - DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus); MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!"); NS_FRAME_TRACE_REFLOW_IN("nsCanvasFrame::Reflow"); |