Bug 1364589. Include the custom content container in the list AppendDocumentLevelNativeAnonymousContentTo returns. r=heycam

This commit is contained in:
Boris Zbarsky 2017-05-15 12:25:00 -04:00
Родитель c9c92a390f
Коммит 42bf67a17e
1 изменённых файлов: 7 добавлений и 1 удалений

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

@ -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);
}
}
}
}