Bug 19942 - Printing of CSS gradients does not work properly
Summary: Printing of CSS gradients does not work properly
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Printing (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2008-07-08 06:24 PDT by Torsten Radtke
Modified: 2016-04-11 22:12 PDT (History)
5 users (show)

See Also:


Attachments
Test case XML file (124 bytes, application/xml)
2008-07-22 01:28 PDT, Torsten Radtke
no flags Details
Test case CSS file (230 bytes, text/plain)
2008-07-22 01:28 PDT, Torsten Radtke
no flags Details
another HTML test case for linear gradients not printing (647 bytes, text/html)
2011-12-06 21:29 PST, Dan Beam
no flags Details
what's expected (74.14 KB, image/png)
2011-12-06 21:37 PST, Dan Beam
no flags Details
result on linux (53.64 KB, image/png)
2011-12-06 21:38 PST, Dan Beam
no flags Details
result on windows (79.13 KB, image/png)
2011-12-06 21:38 PST, Dan Beam
no flags Details
result on mac (89.15 KB, image/png)
2011-12-06 21:38 PST, Dan Beam
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Torsten Radtke 2008-07-08 06:24:39 PDT
CSS gradients lack their transparency and boundaries if printed from r35024 on a Mac OS X 10.5.4 system. Iff the background-repeat property is set to "no-repeat" the transparency of the gradient colors seems to be ignored as well as the size (gradient fills the element even if its size is smaller). No problems are visible when background-repeat is set to "repeat", "repeat-x", or "repeat-y".

Example:

test.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="test.css"?>
<book>
Lorem ipsum dolor.
</book>

test.css:

book {
	display: block;
	width: 200px; border:1px solid black; padding: 10px; margin: 10px; 
	background-image: -webkit-gradient(linear, 0 0, 0 20, from(rgba(127,0,0,0.5)), to(rgba(0,127,0,0.0)));
	background-repeat: no-repeat;
}
Comment 1 Torsten Radtke 2008-07-22 01:28:14 PDT
Created attachment 22420 [details]
Test case XML file
Comment 2 Torsten Radtke 2008-07-22 01:28:43 PDT
Created attachment 22421 [details]
Test case CSS file
Comment 3 Robert Blaut 2008-07-29 11:39:25 PDT
Confirmed.
Comment 4 Tim Horton 2011-06-29 16:20:04 PDT
(In reply to comment #0)
> CSS gradients lack their transparency and boundaries if printed from r35024 on a Mac OS X 10.5.4 system. Iff the background-repeat property is set to "no-repeat" the transparency of the gradient colors seems to be ignored as well as the size (gradient fills the element even if its size is smaller). No problems are visible when background-repeat is set to "repeat", "repeat-x", or "repeat-y".

I don't know about size, but transparency is also broken when printing SVG gradients. See https://bugs.webkit.org/show_bug.cgi?id=63371
Comment 5 Tim Horton 2011-07-05 17:57:28 PDT
<rdar://problem/9724098>
Comment 6 Dan Beam 2011-12-06 21:29:46 PST
Created attachment 118169 [details]
another HTML test case for linear gradients not printing
Comment 7 Dan Beam 2011-12-06 21:31:23 PST
I believe the scope of this goes further than just MacOS 10.5.  Printing linear gradients with rgba() still doesn't work for me today using Chromium 17.0.963.0 (Chromium r113143, Webkit r101876) and the behavior seems to be incorrect on all platforms that I tried (Windows, Mac, Linux).

On Windows and Linux the gradient simply wasn't shown and on MacOS the gradient was shown without alpha (so an rgba(255,255,255,1) -> rgba(255,255,255,.5) gradient like I was using just looked white).

Here's the text case I was looking at:
http://fiddle.jshell.net/qjRxP/27/show/ (also attached).

Screenshots of each OS will be attached shortly.
Comment 8 Dan Beam 2011-12-06 21:37:51 PST
Created attachment 118170 [details]
what's expected
Comment 9 Dan Beam 2011-12-06 21:38:05 PST
Created attachment 118171 [details]
result on linux
Comment 10 Dan Beam 2011-12-06 21:38:25 PST
Created attachment 118172 [details]
result on windows
Comment 11 Dan Beam 2011-12-06 21:38:45 PST
Created attachment 118173 [details]
result on mac
Comment 12 Dan Beam 2011-12-13 13:56:18 PST
Removing MacOS qualifier in title as this has issues on all platforms (please change back if this is wrong thing to do).
Comment 13 Allan Sandfeld Jensen 2013-03-28 06:07:53 PDT
It prints correctly in the Qt port.
Comment 14 Chris Rebert 2016-04-11 22:12:52 PDT
Still repros in recent Nightly.