Bug 646799. Clip the contents of iframes to border-radius. r=roc
authorTimothy Nikkel <tnikkel@gmail.com>
Fri, 22 Apr 2011 01:15:44 +0200
changeset 68426 6cc6b44735a76bfe85162d3f3e829cd2b8703850
parent 68425 ee77fdc1f57cfa2d520272d7c9e3dd20abf140ea
child 68427 b0c37efbd9a7bb70081cc2de8dc8504b7272c7c1
push id19633
push usermlamouri@mozilla.com
push dateFri, 22 Apr 2011 13:27:10 +0000
treeherdermozilla-central@49dd65bf8092 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs646799
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 646799. Clip the contents of iframes to border-radius. r=roc
layout/generic/nsSubDocumentFrame.cpp
layout/reftests/border-radius/iframe-1-ref.html
layout/reftests/border-radius/iframe-1.html
layout/reftests/border-radius/reftest.list
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -414,20 +414,27 @@ nsSubDocumentFrame::BuildDisplayList(nsD
     
     if (!addedLayer && presContext->IsRootContentDocument()) {
       // We always want top level content documents to be in their own layer.
       nsDisplayOwnLayer* layerItem = new (aBuilder) nsDisplayOwnLayer(
         aBuilder, subdocRootFrame ? subdocRootFrame : this, &childItems);
       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();
 
   if (subdocRootFrame) {
     aBuilder->LeavePresShell(subdocRootFrame, dirty);
   }
 
new file mode 100644
--- /dev/null
+++ b/layout/reftests/border-radius/iframe-1-ref.html
@@ -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>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/border-radius/iframe-1.html
@@ -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>
--- a/layout/reftests/border-radius/reftest.list
+++ b/layout/reftests/border-radius/reftest.list
@@ -72,8 +72,10 @@ fails-if(Android) == scrollbar-clamping-
 
 # Test for bad corner joins.
 == corner-joins-1.xhtml corner-joins-1-ref.xhtml
 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