Bug 734406. Fix printing and print preview for <canvas> by checking for script-enabled on the original document, not on the printing document. r=tnikkel

This commit is contained in:
Boris Zbarsky 2012-03-09 22:32:51 -06:00
Родитель d3e8819329
Коммит af87cb12df
1 изменённых файлов: 9 добавлений и 1 удалений

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

@ -3534,7 +3534,15 @@ const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindCanvasData(Element* aElement,
nsStyleContext* aStyleContext)
{
if (!aElement->OwnerDoc()->IsScriptEnabled()) {
// We want to check whether script is enabled on the document that
// could be painting to the canvas. That's the owner document of
// the canvas, except when the owner document is a static document,
// in which case it's the original document it was cloned from.
nsIDocument* doc = aElement->OwnerDoc();
if (doc->IsStaticDocument()) {
doc = doc->GetOriginalDocument();
}
if (!doc->IsScriptEnabled()) {
return nsnull;
}