New issue
Advanced search Search tips

Issue 757249 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

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:
 
TDR_SMA_BNC_BNC_term.svg
14.2 KB Download
even simpler

@media all and (color) {}
@media all and (monochrome) {}

fails.
Labels: Needs-Triage-M60

Comment 3 by f...@opera.com, Aug 21 2017

Components: -Blink>SVG Internals>Printing UI>Browser>PrintPreview
Labels: OS-Linux
Status: Untriaged (was: Unconfirmed)
Summary: CSS mediaquery (@media) not updated when print(er) settings change (was: SVG CSS @media selection)
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.)
Is this specific to @media queries for the monochrome / color media feature? All CSS3 media features? @media screen and @media print works, right?

Comment 5 by f...@opera.com, 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.
Components: -UI>Browser>PrintPreview
Labels: OS-Android OS-Chrome OS-Mac
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.
css_media.html
251 bytes View Download

Sign in to add a comment