'@media print' is ignored when '@media screen' present

RESOLVED WORKSFORME

Status

()

--
major
RESOLVED WORKSFORME
9 years ago
7 years ago

People

(Reporter: list-jcr, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [closeme 2011-06-19])

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.9.1.3) Gecko/20091113 whatever
Build Identifier: 3.5.3

With or without the 'only' keyword, if '@media screen' defines a font via 'font-family' css, that font is used when printing regardless if there is another font defined by '@media print'


Reproducible: Always

Steps to Reproduce:
put the following in profile_dir/chrome/userContent.css or within an included CSS file, or within 'STYLE' tags of an HTML page.
******************************************************
@media only screen {
  * {
   font-family: "terminus" !important; 
  }
}

@media only print {
  * {
   font-family: "courier" !important; 
  {
}
******************************************************

Of course, the fonts names will need to be modified to whatever you happen to have installed.
Actual Results:  
If you print the page, it is printed with the font defined in the '@media screen' style rather than the '@media print' style.

Expected Results:  
The printed page should use the font defined in the '@media print' style.

Comment 1

7 years ago
reporter, does this still fail when using Firefox 5 *beta* http://www.mozilla.com/en-US/firefox/channel/ or Firefox 4?
Whiteboard: [closeme 2011-06-19]
(Reporter)

Comment 2

7 years ago
Wane,
I'm unable to test Firefox 4 or 5 beta since they haven't been ported to OpenBSD.

The steps to reproduce should suffice to show the problem if you're able to run the newer versions.
There's a syntax error in the print rule, the 2nd "{" should be "}".
Also, there's no keyword "only" allowed after @media as far as I can tell:
http://www.w3.org/TR/CSS2/media.html

With those corrections it seems to work fine for me, in 3.5, 3.6 and 5.0
on Linux.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.