diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 69d815019e44..3ae9acb1b963 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -2754,8 +2754,8 @@ void nsCSSFrameConstructor::SetUpDocElementContainingBlock( } void nsCSSFrameConstructor::ConstructAnonymousContentForCanvas( - nsFrameConstructorState& aState, nsIFrame* aFrame, nsIContent* aDocElement, - nsFrameList& aFrameList) { + nsFrameConstructorState& aState, nsContainerFrame* aFrame, + nsIContent* aDocElement, nsFrameList& aFrameList) { NS_ASSERTION(aFrame->IsCanvasFrame(), "aFrame should be canvas frame!"); MOZ_ASSERT(mRootElementFrame->GetContent() == aDocElement); @@ -2766,11 +2766,10 @@ void nsCSSFrameConstructor::ConstructAnonymousContentForCanvas( } AutoFrameConstructionItemList itemsToConstruct(this); - nsContainerFrame* frameAsContainer = do_QueryFrame(aFrame); - AddFCItemsForAnonymousContent(aState, frameAsContainer, anonymousItems, + AddFCItemsForAnonymousContent(aState, aFrame, anonymousItems, itemsToConstruct); - ConstructFramesFromItemList(aState, itemsToConstruct, frameAsContainer, + ConstructFramesFromItemList(aState, itemsToConstruct, aFrame, /* aParentIsWrapperAnonBox = */ false, aFrameList); } diff --git a/layout/base/nsCSSFrameConstructor.h b/layout/base/nsCSSFrameConstructor.h index 4a5a0ab3ebd1..a8416661268b 100644 --- a/layout/base/nsCSSFrameConstructor.h +++ b/layout/base/nsCSSFrameConstructor.h @@ -2124,7 +2124,7 @@ class nsCSSFrameConstructor final : public nsFrameManager { void CountersDirty(); void ConstructAnonymousContentForCanvas(nsFrameConstructorState& aState, - nsIFrame* aFrame, + nsContainerFrame* aFrame, nsIContent* aDocElement, nsFrameList&);