Bug 646799. Clip the contents of iframes to border-radius. r=roc

This commit is contained in:
Timothy Nikkel 2011-04-22 01:15:44 +02:00
parent 0f133018de
commit 0b7ef49a81
4 changed files with 24 additions and 1 deletions

View File

@ -419,10 +419,17 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
childItems.AppendToTop(layerItem);
}
nsDisplayList list;
// Clip children to the child root frame's rectangle
rv = aLists.Content()->AppendNewToTop(
rv = list.AppendNewToTop(
new (aBuilder) nsDisplayClip(aBuilder, this, &childItems,
subdocBoundsInParentUnits));
if (mIsInline) {
WrapReplacedContentForBorderRadius(aBuilder, &list, aLists);
} else {
aLists.Content()->AppendToTop(&list);
}
}
// delete childItems in case of OOM
childItems.DeleteAll();

View File

@ -0,0 +1,7 @@
<html>
<body>
<iframe style="position: absolute; left: 0px; top: 0px; width: 300px; height: 150px; border: none; border-radius: 50px; background: green;" src="data:text/html,<body>"></iframe>
<div style="position: absolute; left: 10px; top: 0px; width: 280px; height: 150px; background: red;"></div>
<div style="position: absolute; left: 0px; top: 10px; width: 300px; height: 130px; background: red;"></div>
</body>
</html>

View File

@ -0,0 +1,7 @@
<html>
<body>
<iframe style="position: absolute; left: 0px; top: 0px; width: 300px; height: 150px; border: none; border-radius: 50px; background: green;" src="data:text/html,<body bgcolor=green>"></iframe>
<div style="position: absolute; left: 10px; top: 0px; width: 280px; height: 150px; background: red;"></div>
<div style="position: absolute; left: 0px; top: 10px; width: 300px; height: 130px; background: red;"></div>
</body>
</html>

View File

@ -77,3 +77,5 @@ random-if(winWidget) HTTP(..) == corner-joins-2.xhtml corner-joins-2-ref.xhtml
== scroll-1.html scroll-1-ref.html # see bug 602892
== zero-radius-clip-1.html zero-radius-clip-ref.html
== iframe-1.html iframe-1-ref.html