Closed Bug 567573 Opened 14 years ago Closed 13 years ago

If a @font-face declaration is within a media query @media screen { ..., it will fail in Firefox.

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 511909

People

(Reporter: ben, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3

When using an @font-face declaration for font embedding the declaration will fail if the declaration is within a media query such as @media screen {...}. This is inconvenient and is inconsistent with webkit browsers.

Reproducible: Always

Steps to Reproduce:
1.Create an HTML file in which you intend to embed fonts with @font-face.
2.Link to an external css style sheet in which you are using a media query such as "@media screen" and within that include @font-face embedding for a downloadable font.
3.Visit the HTML file and see that the font that was embedded fails to appear.
Actual Results:  
The @font-face declaration fails to download the font and use it to replace the fallback font.

Expected Results:  
The @font-face declaration should be recognized and take effect even within the media query.

I have verified this issue with others using default installations of Firefox 3.6.3 across multiple hardware configurations and Windows OS's. The problem persists.
per CSS 2.1 : 7.2.1, 
"At-rules inside @media are invalid in CSS2.1."
http://www.w3.org/TR/CSS21/media.html#at-media-rule

This should be invalid, I think.

(I'm surprised that both WebKit and Opera fail to ignore the @font-face at-rule(s))
Component: General → Style System (CSS)
OS: Windows 7 → All
Product: Firefox → Core
QA Contact: general → style-system
Hardware: x86 → All
It seems like a good idea, though.  I think there may have been discussion in the WG about it, although I can't think of what spec would define a difference.
We specifically said "in CSS2.1" rather than "in CSS" to allow for things like this in the future. The @font-face spec just needs to say that @font-face is allowed inside @media and we're all set.
We should really change to allow most @-rules inside of @media and @document, so I'm going to consolidate this bug report with one older one.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.