Bug 596765 followup: Disable plugin instantiation in SVG-as-an-image. r+a=roc

This commit is contained in:
Daniel Holbert 2011-02-17 21:52:03 -08:00
Родитель 854fa255a9
Коммит 79bedfb7ed
4 изменённых файлов: 26 добавлений и 2 удалений

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

@ -934,10 +934,10 @@ nsObjectLoadingContent::HasNewFrame(nsIObjectFrame* aFrame)
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
NS_ASSERTION(thisContent, "must be a content");
nsIDocument* doc = thisContent->GetOwnerDoc();
if (!doc || doc->IsStaticDocument()) {
if (!doc || doc->IsStaticDocument() || doc->IsBeingUsedAsImage()) {
return NS_OK;
}
// "revoke" any existing instantiate event as it likely has out of
// date data (frame pointer etc).
mPendingInstantiateEvent = nsnull;

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

@ -0,0 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg">
<foreignObject x="0" y="0" width="100px" height="100px">
<!-- lime background -->
<div xmlns="http://www.w3.org/1999/xhtml"
style="background:lime; width:100%; height:100%;">
<!-- Use an unrecognized media type, so that if we're honoring plugins,
the "download plugin" placeholder will be shown. -->
<embed xmlns="http://www.w3.org/1999/xhtml"
src="data:audio/hahaThisIsntReallyAFormat,"
width="100px" height="50px"/>
<!-- Also try a possibly-recognized media format, for completeness. -->
<embed xmlns="http://www.w3.org/1999/xhtml"
src="data:audio/wav,"
width="100px" height="50px"/>
</div>
</foreignObject>
</svg>

После

Ширина:  |  Высота:  |  Размер: 771 B

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

@ -0,0 +1,5 @@
<html>
<body>
<img src="img-foreignObject-embed-2-helper.svg" height="100px" width="100px">
</body>
</html>

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

@ -61,6 +61,7 @@ random-if(gtk2Widget) == img-anim-1.html lime100x100-ref.html # bug 612214
== img-dyn-1.html img-dyn-1-ref.html
== img-foreignObject-1.html lime100x100-ref.html
== img-foreignObject-embed-1.html lime100x100-ref.html
== img-foreignObject-embed-2.html lime100x100-ref.html
fails-if(d2d) == img-widthAndHeight-meet-1.html img-widthAndHeight-meet-1-ref.html # bug 633072
== img-widthAndHeight-meet-2.html img-widthAndHeight-meet-2-ref.html