Bug 331809. Make nsSubdocumentFrame explicitly clip its contents; content can bleed out otherwise, for example if there is no scrollframe associated with the subdocument's viewport. r+sr=mats

This commit is contained in:
roc+@cs.cmu.edu 2007-11-18 14:20:16 -08:00
parent 9fb6803953
commit cfd185cf42
4 changed files with 46 additions and 1 deletions

View File

@ -337,7 +337,16 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
aBuilder->EnterPresShell(f, dirty);
rv = f->BuildDisplayListForStackingContext(aBuilder, dirty, aLists.Content());
// Clip children to the child root frame's rectangle
nsDisplayList childItems;
rv = f->BuildDisplayListForStackingContext(aBuilder, dirty, &childItems);
if (NS_SUCCEEDED(rv)) {
rv = aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayClip(nsnull, &childItems,
nsRect(aBuilder->ToReferenceFrame(f), f->GetSize())));
// delete childItems in case of OOM
childItems.DeleteAll();
}
aBuilder->LeavePresShell(f, dirty);
return rv;

View File

@ -0,0 +1,21 @@
<html>
<head>
<style>
iframe {
width:100px;
height:400px;
border:0;
}
span {
display:inline-block;
width:1000px;
height:400px;
background:white;
}
</style>
</head>
<body style="width:2000px; background:white;">
<iframe src="data:application/vnd.mozilla.xul+xml,%3Cwizard%20xmlns%3D%22http%3A%2F%2Fwww.mozilla.org%2Fkeymaster%2Fgatekeeper%2Fthere.is.only.xul%22%3E%3C%2Fwizard%3E%0D%0A%0D%0A"></iframe>
<span></span>
</body>
</html>

View File

@ -0,0 +1,14 @@
<html>
<head>
<style>
iframe {
width:100px;
height:400px;
border:0;
}
</style>
</head>
<body style="width:2000px; background:white;">
<iframe src="data:application/vnd.mozilla.xul+xml,%3Cwizard%20xmlns%3D%22http%3A%2F%2Fwww.mozilla.org%2Fkeymaster%2Fgatekeeper%2Fthere.is.only.xul%22%3E%3C%2Fwizard%3E%0D%0A%0D%0A"></iframe>
</body>
</html>

View File

@ -147,6 +147,7 @@ fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 28811-2a.html 28811-2-ref.html # bug 38
== 325486-1.html 325486-1-ref.html
random == 328829-1.xhtml 328829-1-ref.xhtml # bug 369046 (intermittent)
== 328829-2.xhtml 328829-2-ref.xhtml
== 331809-1.html 331809-1-ref.html
== 332360.html 332360-ref.html
== 332360-ltr.html 332360-ltr-ref.html
== 332360-width.html 332360-ref.html