User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: Mozilla/5.0 (X11; Linux x86_64; rv:2.0) Gecko/20100101 Firefox/4.0
We have an iframe with rounded corners using CSS (border-radius), the background color does not always respect the rounded corners of the iframe.
We have two situations:
1. The background color is defined within the framed document itself. In this case the rounded corners are not respected by the background color.
2. The background color is defined by the iframe (style of the iframe tag), in which case the rounded corners are respected.
I have a test page showing these two situations and will attach a screenshot to show what I see.
Steps to Reproduce:
1. Visit http://www.7is7.com/devl/firefox/border.html
Rounded corners not respected in one of the two iframes.
Rounded corners respected in both iframes.
Created attachment 523280 [details]
Screenshot of iframes with rounded corners and background colors.
The left iframe does not respect rounded corners, the right one does. In the left iframe the background color is defined in the framed document. In the right iframe it is defined in the iframe tag.
Confirmed on Mozilla/5.0 (Windows NT 6.1; rv:2.2a1pre) Gecko/20110330 Firefox/4.2a1pre
Created attachment 523606 [details]
roc, timothy, what's up here?
Compare what happens if you take out the background in the subframe and replace it with text. The text will also bleed out of the curved area. The same effect is observed in Opera 11. IE9 has the Webkit behavior of clipping to the border.
The relevant part of CSS3 background is this, from <http://www.w3.org/TR/css3-background/#corner-clipping>:
The content of replaced elements is always trimmed to the content edge curve.
We implement this for <img>, but apparently it doesn't work for <iframe>?
I think we just haven't implemented that clipping for iframes yet. http://hg.mozilla.org/mozilla-central/rev/0aa1272e932f added it for most replaced elements, it doesn't seem like it should be too hard to modify nsSubDocumentFrame::BuildDisplayList to clip using the same method.
Created attachment 523942 [details] [diff] [review]
Comment on attachment 523942 [details] [diff] [review]
Created attachment 527446 [details] [diff] [review]
patch for checkin
This change is also now mentioned on Firefox 6 for developers.
This patch might have cause a regression, see bug 610305 comment 13 to 21.
(In reply to comment #13)
> This patch might have cause a regression, see bug 610305 comment 13 to 21.
Will this patch be backed out?
No, see bug 610305 comment 22.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0) Gecko/20100101 Firefox/6.0
Verified issue on Mac OS X 10.6, Windows 7x86_64 and Ubuntu 86_64 - rounded corners respect iframes.
Setting resolution to VERIFIED FIXED.