diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 62dbdb77d64c..fd927db6a23d 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -76,6 +76,7 @@ #include "nsAttrValue.h" #include "nsAttrValueInlines.h" #include "nsBindingManager.h" +#include "nsCanvasFrame.h" #include "nsCaret.h" #include "nsCCUncollectableMarker.h" #include "nsCharSeparatedTokenizer.h" @@ -10253,7 +10254,6 @@ nsContentUtils::AppendDocumentLevelNativeAnonymousContentTo( { MOZ_ASSERT(aDocument); - // XXXheycam This probably needs to find the nsCanvasFrame's NAC too. if (nsIPresShell* presShell = aDocument->GetShell()) { if (nsIFrame* scrollFrame = presShell->GetRootScrollFrame()) { nsIAnonymousContentCreator* creator = do_QueryFrame(scrollFrame); @@ -10261,6 +10261,12 @@ nsContentUtils::AppendDocumentLevelNativeAnonymousContentTo( "scroll frame should always implement nsIAnonymousContentCreator"); creator->AppendAnonymousContentTo(aElements, 0); } + + if (nsCanvasFrame* canvasFrame = presShell->GetCanvasFrame()) { + if (Element* container = canvasFrame->GetCustomContentContainer()) { + aElements.AppendElement(container); + } + } } }