Bug 708431 - Video controls fail to initialize if an extension implementing nsIContentPolicy is present. r=roc r=bz

This commit is contained in:
Jared Wein
2012-01-07 18:43:48 -08:00
parent af8163ab30
commit dedfa54b65
2 changed files with 17 additions and 4 deletions

View File

@@ -381,6 +381,10 @@ ImageDocument::SetScriptGlobalObject(nsIScriptGlobalObject* aScriptGlobalObject)
target = do_QueryInterface(aScriptGlobalObject);
target->AddEventListener(NS_LITERAL_STRING("resize"), this, false);
target->AddEventListener(NS_LITERAL_STRING("keypress"), this, false);
if (!nsContentUtils::IsChildOfSameType(this)) {
LinkStylesheet(NS_LITERAL_STRING("resource://gre/res/TopLevelImageDocument.css"));
}
}
}
@@ -665,8 +669,6 @@ ImageDocument::CreateSyntheticDocument()
styleContent->SetTextContent(NS_LITERAL_STRING("img { display: block; }"));
head->AppendChildTo(styleContent, false);
} else {
LinkStylesheet(NS_LITERAL_STRING("resource://gre/res/TopLevelImageDocument.css"));
}
// Add the image element