W3C home > Mailing lists > Public > www-style@w3.org > February 2011

[css3-images] 'contain' radial gradients edge case

From: Lea Verou <leaverou@gmail.com>
Date: Fri, 18 Feb 2011 16:36:53 +0100
Message-ID: <4D5E9215.6080201@gmail.com>
To: www-style@w3.org
Assume the following gradients:

background-image: radial-gradient(contain, white 99%, black 100%);
background-image: radial-gradient(contain, white 100%, black 100%);
background-image: radial-gradient(contain, white 100%, black 101%);

Fiddle for easy testing: http://jsfiddle.net/leaverou/qBurF/

The 1st and 3rd are rendered consistently in Gecko and Webkit and are 
just what somebody would expect.
The 2nd has a rendering that's very disconnected from the 1st and 2nd 
examples: It's a solid color, black in Minefield (which I is probably a 
bug, so I reported it) and white in Webkit. I assume Webkit's rendering 
is consistent with that the spec defines (although I couldn't find any 
explicit instruction in Image Values), and it makes sense as it's 
consistent with how linear gradients or other kinds of radial gradients 
should display. However, in this case it's not what a designer would 
expect (which is a solid ellipse) and it will make interpolation look 
weird. The expected rendering could be useful for some cases, whereas a 
solid color could be easily achieved in other ways.

-- 

Lea Verou
Web designer & developer, specializing in front-end development
leaverou.me <http://leaverou.me> . Twitter <http://twitter.com/LeaVerou> 
. LinkedIn <http://gr.linkedin.com/in/leaverou>
Received on Friday, 18 February 2011 15:37:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:37 GMT