Closed Bug 1706939 Opened 3 years ago Closed 3 years ago

svg use elements referring to def elements scaled incorrectly when printing

Categories

(Core :: Printing: Output, defect)

Firefox 88
defect

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: scheschonk, Assigned: emilio)

References

Details

Attachments

(6 files)

Attached image arrangement.svg

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36

Steps to reproduce:

Opened the attached svg file, the arrangement looks as expected.

Actual results:

Upon view of the printing preview and the actual print the USE references elements to DEF elements of the svg are incorrectly scaled (maybe also positioned, hard to see). It looks like the scaling information imposed by the viewbox are ignored while printing, but correctly used in the display, when not printing

Expected results:

The SVG USE elements should be scaled in line with the other components when printing

Attached image Print Preview

This shows the printing preview and the incorrectly scaled def elements

This is the inital view where the scaling is done correctly

Summary: svg use elements scaled incorrectly when printing → svg use elements referring to def elements scaled incorrectly when printing

The Bugbug bot thinks this bug should belong to the 'Toolkit::Printing' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Printing
Product: Firefox → Toolkit
Component: Printing → Printing: Output
Product: Toolkit → Core
Attached file Simpler test-case.

Robert, do you happen to know where are these attributes hooked into rendering off the top of your head by any chance?

Flags: needinfo?(longsonr)

Ah, found it. SVGViewportElement::GetViewBoxTransform is indeed returning wrong values in the print document, somehow.

Flags: needinfo?(longsonr) → needinfo?(emilio)

this code is not running for the print clone.

Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(emilio)

This ensures that the clone that printing does doesn't lose track of
them.

This could still be massively improved... Why the heck are we doing so
many virtual calls to parse an attribute? :(

Attachment #9217877 - Attachment description: Bug 1706939 - Copy <use> attributes as actual DOM attributes. r=longsonr,#layout-reviewers → Bug 1706939 - Copy internal attribute values from SVG elements for printing. r=longsonr,#layout-reviewers
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/62fcb8d1c124
Make the SVG attribute code a bit more generic. r=longsonr
https://hg.mozilla.org/integration/autoland/rev/a470837de091
Copy internal attribute values from SVG elements for printing. r=longsonr
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/28673 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: