Print preview doesn't work properly for some SVG unless "print backgrounds" is checked
Categories
(Core :: Print Preview, defect)
Tracking
()
People
(Reporter: glandium, Assigned: emilio)
References
(Regression)
Details
(Keywords: regression)
Attachments
(5 files)
366 bytes,
text/html
|
Details | |
254 bytes,
text/html
|
Details | |
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
RyanVM
:
approval-mozilla-esr128+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-esr128+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
Details | Review |
The attached HTML is reduced from an HTML file containing many things, including a full QR code as an embedded SVG image with more M
instructions in the <path>
. Print preview shows a big black box instead of the SVG as it can be seen on the page, unless "print backgrounds" is checked.
Comment 1•1 year ago
|
||
It looks like we're rendering
<rect x="10" y="10" width="80" height="80" fill="white"></rect>
as having a black fill-color, for some reason (only when "Print Backgrounds" is un-checked).
Here's a testcase. Expected rendering (for a color printer target like our "Save to PDF" print backend) is a lime circle in a cyan square. Actual rendering is that plus an unwanted black square.
Assignee | ||
Comment 2•1 year ago
|
||
Seems like a regression..
Comment 3•1 year ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #2)
Seems like a regression..
Indeed. For some reason there are a year or so worth of mozregression builds that aren't launching at all for me for some reason right now (no Firefox window appears at all), but I narrowed it to this still-quite-wide window:
Good: 2021-09-01
Bad: 2023-04-21
Also: from local testing, I think this is specific to rect
which makes me suspect it's a bug in the rect
-specific WebRender path builder, like bug 1892786 is. Per bug 1892786 comment 35, we have a special codepath for <rect>
-with-fill
-set-to-a-color, which runs some utility code to convert the specified fill
to a color that WebRender can understand. Maybe that's broken in this case for some reason (e.g. because we're compositing over a document with no background, or something).
Assignee | ||
Comment 4•1 year ago
|
||
Assignee | ||
Comment 5•1 year ago
|
||
Assignee | ||
Comment 6•1 year ago
|
||
confirmed by flipping the pref from bug 1686654.
Comment 7•1 year ago
|
||
Set release status flags based on info from the regressing bug 1686654
:nical, since you are the author of the regressor, bug 1686654, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Assignee | ||
Comment 8•1 year ago
|
||
It's intended for text colors only (and it applies auto-darkening in
printing), see nsLayoutUtils::DarkenColorIfNeeded.
Updated•1 year ago
|
Assignee | ||
Comment 9•1 year ago
|
||
It's suitable for foreground colors only.
Comment 10•1 year ago
|
||
no need to needinfo nical; emilio's already taken this.
Assignee | ||
Comment 11•1 year ago
|
||
Comment 12•1 year ago
|
||
Comment 13•1 year ago
|
||
Comment 14•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/465db4e0254f
https://hg.mozilla.org/mozilla-central/rev/8065270635ad
Comment 15•1 year ago
|
||
The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox131
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 16•1 year ago
|
||
Comment on attachment 9423696 [details]
Bug 1917715 - Don't use nsLayoutUtils::GetColor for SVG rects. r=nical,dholbert
Beta/Release Uplift Approval Request
- User impact if declined: comment 0
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: comment 0
- List of other uplifts needed: none
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): It's a long-standing regression, but the patch is rather trivial.
- String changes made/needed: none
- Is Android affected?: Yes
Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 17•1 year ago
|
||
Comment on attachment 9423696 [details]
Bug 1917715 - Don't use nsLayoutUtils::GetColor for SVG rects. r=nical,dholbert
Approved for 131.0b5
Comment 18•1 year ago
|
||
uplift |
Updated•1 year ago
|
Updated•1 year ago
|
Comment 19•1 year ago
|
||
bugherder |
Comment 20•1 year ago
|
||
Comment on attachment 9423696 [details]
Bug 1917715 - Don't use nsLayoutUtils::GetColor for SVG rects. r=nical,dholbert
Approved for 128.3esr. I'm also taking the second patch for easier ESR128 uplift ergonomics down the road.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 21•1 year ago
|
||
uplift |
Comment 22•1 year ago
•
|
||
Updated•1 year ago
|
Comment 23•1 year ago
•
|
||
Verified as fixed for testcase.hmtl from comment 0 on Windows 10x64 using Fx 128esr(treeherder build).
Updated•1 year ago
|
Description
•