Closed Bug 646799 Opened 13 years ago Closed 13 years ago

Content area <iframe> is not clipped to content edge curve when using border-radius

Categories

(Core :: Web Painting, defect)

x86_64
All
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla6

People

(Reporter: ottodv, Assigned: tnikkel)

References

()

Details

(Keywords: dev-doc-complete, testcase)

Attachments

(4 files)

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.

Test page:
http://www.7is7.com/devl/firefox/border.html

Reproducible: Always

Steps to Reproduce:
1. Visit http://www.7is7.com/devl/firefox/border.html

Actual Results:  
Rounded corners not respected in one of the two iframes.

Expected Results:  
Rounded corners respected in both iframes.
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
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Product: Firefox → Core
QA Contact: general → general
roc, timothy, what's up here?
Component: General → Layout: View Rendering
QA Contact: general → layout.view-rendering
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>?
Summary: Background color of framed document doesn't respect CSS rounded corners of iframe. → Content area <iframe> is not clipped to content edge curve when using border-radius
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.
Keywords: testcase
Version: unspecified → Trunk
Attached patch patchSplinter Review
Assignee: nobody → tnikkel
Attachment #523942 - Flags: review?(roc)
Keywords: checkin-needed
Whiteboard: [needs landing][needs a tryserver check]
Status: NEW → ASSIGNED
Keywords: checkin-needed
Whiteboard: [needs landing][needs a tryserver check] → [fixed in cedar]
http://hg.mozilla.org/mozilla-central/rev/e1b06f3256c8
http://hg.mozilla.org/mozilla-central/rev/6cc6b44735a7
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Keywords: dev-doc-needed
Resolution: --- → FIXED
Whiteboard: [fixed in cedar]
Target Milestone: --- → mozilla6
Documentation updated:

https://developer.mozilla.org/en/HTML/Element/iframe#Notes

This change is also now mentioned on Firefox 6 for developers.
Thank you.
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?
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.
Status: RESOLVED → VERIFIED
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: