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

VERIFIED FIXED in mozilla6

Status

()

Core
Layout: View Rendering
VERIFIED FIXED
7 years ago
6 years ago

People

(Reporter: ottodv, Assigned: tnikkel)

Tracking

({dev-doc-complete, testcase})

Trunk
mozilla6
x86_64
All
dev-doc-complete, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(4 attachments)

(Reporter)

Description

7 years ago
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.
(Reporter)

Comment 1

7 years ago
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.

Comment 2

7 years ago
Confirmed on Mozilla/5.0 (Windows NT 6.1; rv:2.2a1pre) Gecko/20110330 Firefox/4.2a1pre

Updated

7 years ago
Status: UNCONFIRMED → NEW
Component: General → General
Ever confirmed: true
OS: Linux → All
Product: Firefox → Core
QA Contact: general → general
Created attachment 523606 [details]
Standalone testcase
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
(Assignee)

Comment 6

7 years ago
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
(Assignee)

Comment 7

7 years ago
Created attachment 523942 [details] [diff] [review]
patch
Assignee: nobody → tnikkel
Attachment #523942 - Flags: review?(roc)
Comment on attachment 523942 [details] [diff] [review]
patch

Need reftest
Attachment #523942 - Flags: review?(roc) → review+
(Assignee)

Comment 9

6 years ago
Created attachment 527446 [details] [diff] [review]
patch for checkin
(Assignee)

Updated

6 years ago
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
Last Resolved: 6 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.
Keywords: dev-doc-needed → dev-doc-complete
(Assignee)

Comment 12

6 years ago
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?
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.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.