Closed
Bug 818435
Opened 12 years ago
Closed 12 years ago
Inline SVG with a viewBox attribute does not print
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: ghasemkiani, Assigned: jwatt)
References
Details
(Keywords: regression)
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20100101 Firefox/17.0
Build ID: 20121128204232
Steps to reproduce:
I used this HTML code:
<html>
<head>
<title>test</title>
</head>
<body>
<p>test</p>
<svg viewBox="0 0 30 30" width="3cm" height="3cm" style="background-color:yellow">
<circle cx="10" cy="10" r="10" fill="red"/>
</svg>
<p>test</p>
</body>
</html>
Actual results:
In Firefox 17.0.1, the file renders correctly (including coordinate space conversion according to the viewBox attribute), but the SVG does not print (and is not shown in print preview).
If the viewBox attribute is removed, the SVG appears in the print preview. Of course the coordinate system now assumes an ordinary DPI.
Expected results:
The SVG should appear in the printout as rendered on the normal browser page.
Updated•12 years ago
|
Component: Untriaged → SVG
Product: Firefox → Core
The testcase shows various regressions. Old versions are able to print preview both tests but sometimes, yellow square is missing.
Keywords: regressionwindow-wanted
Reporter | ||
Comment 4•12 years ago
|
||
(In reply to Loic from comment #3)
> The testcase shows various regressions. Old versions are able to print
> preview both tests but sometimes, yellow square is missing.
The background (yellow square) can be turned off by unchecking "Print Background (colors and images)" in the Page Setup dialog box.
Updated•12 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 6•12 years ago
|
||
Regression window(m-c)
Good:
http://hg.mozilla.org/mozilla-central/rev/6dae57cd2f85
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 ID:20120720145842
Bad:
http://hg.mozilla.org/mozilla-central/rev/045c11dd41a6
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 ID:20120720205642
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=6dae57cd2f85&tochange=045c11dd41a6
Regression window(m-i)
Good:
http://hg.mozilla.org/integration/mozilla-inbound/rev/a746aaa32b22
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 ID:20120720114508
Bad:
http://hg.mozilla.org/integration/mozilla-inbound/rev/62f19ed60528
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 ID:20120720115241
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=a746aaa32b22&tochange=62f19ed60528
Suspected: Bug 614732
Blocks: 614732
Keywords: regressionwindow-wanted → regression
Updated•12 years ago
|
Flags: in-testsuite?
Assignee: nobody → jwatt
Comment 7•12 years ago
|
||
I came across this same issue in Firefox 17.0.1; updated to nightly build (as of 02:30 GMT - 14 Dec. 2012) and confirmed the issue still existed. Issue did not exist in v16.x while testing.
I reproduced the issue by using an inline SVG with the viewBox attribute (where the SVG did not print at all) then removing the viewBox attribute (at which point the SVG did print properly).
Windows 8 x64
Assignee | ||
Updated•12 years ago
|
OS: Windows XP → All
Hardware: x86 → All
Assignee | ||
Comment 8•12 years ago
|
||
My fix for bug 813531 also fixed this. The fix is in the latest beta (Firefox 18 beta 5).
Status: NEW → RESOLVED
Closed: 12 years ago
status-firefox18:
--- → fixed
status-firefox19:
--- → fixed
status-firefox20:
--- → fixed
Depends on: 813531
Resolution: --- → FIXED
Comment 9•12 years ago
|
||
Mozilla/5.0 (X11; Linux i686; rv:18.0) Gecko/20100101 Firefox/18.0
Confirming that this is fixed while using beta 6 on Windows 7 and Ubuntu 12.04.
The yellow background image is not displayed in print preview, but seems an old existing behavior (prior to Firefox 10).
Comment 10•12 years ago
|
||
Did you check Print Background colours and Images in the Page Setup dialogue? If this isn't checked (the default I think) then you won't see background images in the print preview.
Comment 11•12 years ago
|
||
The page is indeed printed with the yellow background, print preview however doesn't display that. Was comparing this to Opera's print preview.
I assume that Firefox just doesn't enable background colors by default in print preview. Are there any reasons behind that? This seems a bit strange at first.
Comment 12•12 years ago
|
||
print preview respects the Print Background colours and Images setting but printing doesn't? If so that sounds like a bug.
Comment 13•12 years ago
|
||
(In reply to Virgil Dicu [:virgil] [QA] from comment #11)
> I assume that Firefox just doesn't enable background colors by default in
> print preview. Are there any reasons behind that? This seems a bit strange
> at first.
It's to conserve ink, I think. If you print a blog post that happens to have a photo (or just a solid color) as the <body> background image, chances are you don't want that background image in your printout -- you just care about the content. We can't guess perfectly, of course, so we err on the side of wasting less ink. (I'm pretty sure we change text-color, too, so e.g. white text on a dark-purple background will (by default) print black text, instead of printing a fully-white page.)
(In reply to Robert Longson from comment #12)
> print preview respects the Print Background colours and Images setting but
> printing doesn't? If so that sounds like a bug.
This is likely bug 464985. (Note that there's no dialog before Print Preview to let you tick e.g. "print background colors in this print-preview window" -- it just reads from a bundle of settings that were saved (or not saved, in this case) from a previous actual-print.)
Comment 14•12 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #13)
> (In reply to Virgil Dicu [:virgil] [QA] from comment #11)
> > I assume that Firefox just doesn't enable background colors by default in
> > print preview. Are there any reasons behind that? This seems a bit strange
> > at first.
(This is supposed to be default for print _and_ print-preview -- not sure why it's only affecting print-preview for you -- I suspect because you somehow got the "print bgcolors" pref turned on for one printer (and now can't revoke that, due to bug 464985), but your print preview is using the (default) settings associated with a different printer. Or something like that. In any case -- if you try a fresh profile, I suspect you'll get more consistent default behavior there.)
Comment 15•12 years ago
|
||
Given your explanations, Daniel, this works as expected (new profile):
-load testcase
-print preview--->no background colors
-page setup, select print with background colors and images
-print--->page printed with background colors
-print preview again--->background colors shown as expected
All on beta 18.
Comment 16•12 years ago
|
||
Retested on Firefox 19.0 beta 2
Mozilla/5.0 (X11; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0
Mozilla/5.0 (Macintosh: Intel Mac OS X 10.7: rv:19.0) Gecko/20100101 Firefox/19.0)
> Given your explanations, Daniel, this works as expected (new profile):
> -load testcase
> -print preview--->no background colors
> -page setup, select print with background colors and images
> -print--->page printed with background colors
> -print preview again--->background colors shown as expected
You need to log in
before you can comment on or make changes to this bug.
Description
•