CSS mediaquery (@media) not updated when print(er) settings change
Reported by
glroyla...@gmail.com,
Aug 20 2017
|
||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
Steps to reproduce the problem:
1. Load attached SVG file into Chrome; displays large blue rectange (background) with white lines.
2. Select print; preview shows blue background.
3. Change print parameters to black and white; shows dark gray rectangle (color converted blue).
4. Choose a black and white only printer (eg, fax); still shows dark background with white lines.
What is the expected behavior?
On color monitor, correctly shows blue background and white lines (@media not printer {} CSS active).
On color printer in color mode, preview should show blue background with white lines. (@media printer and (color) {} CSS active)
On color printer in black and white mode or
On monochrome printer, preview should show clear (white) background with black lines. (@media printer and (monochrome) {} CSS active)
What went wrong?
Colors are chosen with CSS @media.
CSS 3.0 media queries:
https://www.w3.org/TR/css3-mediaqueries/#monochrome
Look at example 37 that describes how to specify media CSS for color printer and different CSS for black and white printer.
SVG uses media-selected CSS:
@media not print, print and (color) { ... fill: blue; ... stroke: white; ...}
@media print and (monochrome) {{ ... fill: none; ... stroke: black; ...}
When a color printer is switched to black and white, it should be treated as a monochrome printer.
When a monochome printer is selected, it should be treated as a monochome printer.
Did this work before? No
Does this work in other browsers? No
Edge wants to print image with clear (white) background even with a color printer set to for color.
Firefox not tried
Chrome version: 60.0.3112.90 Channel: n/a
OS Version: 10.0
Flash Version:
,
Aug 21 2017
,
Aug 21 2017
This doesn't appear to be specific to SVG - I saw the same effect with similar @media and HTML. Could be a print preview-only thing (haven't tested actually printing with monochrome.)
,
Aug 22 2017
Is this specific to @media queries for the monochrome / color media feature? All CSS3 media features? @media screen and @media print works, right?
,
Aug 23 2017
@media screen and @media print definitely works. It could be that the change to printer properties don't cause a media properties to be reevaluated, in which case it could be affecting all features that are relevant to the print media. The monochrome and color features are what has been tested though, and hence are known to not respond to changes to the medium.
,
Aug 23 2017
I wonder if any browser actually has monochrome and color working when printing. The attached file should be an even simpler example than the SVG. |
||||
►
Sign in to add a comment |
||||
Comment 1 by glroyla...@gmail.com
, Aug 20 2017even simpler @media all and (color) {} @media all and (monochrome) {} fails.