W3C home > Mailing lists > Public > public-svg-wg@w3.org > October to December 2010

should patterns with width/height 0 cause paint fallback?

From: Cameron McCormack <cam@mcc.id.au>
Date: Fri, 5 Nov 2010 14:39:14 +1300
To: public-svg-wg@w3.org
Message-ID: <20101105013914.GA11732@wok.mcc.id.au>
I might’ve raised this already with Erik in a private mail, but I wanted
to ask more broadly a question about paint fillback.  Say you have

  <pattern id="p" width="0" height="0"/>
  <circle r="10" fill="url(#p) blue"/>

How should the circle render?

pservers.html says of width="" on <pattern>:

  A negative value is an error (see Error processing). A value of zero
  disables rendering of the element (i.e., no paint is applied).

paint.html says of paint:

  <funciri> [ none | currentColor | <color> [<icccolor>]
    … The <funciri> points to the paint server (e.g., a gradient or
    pattern) to be used to paint the current object. If the IRI
    reference is not valid (e.g., it points to an object that doesn’t
    exist or the object is not a valid paint server), then the paint
    method following the <funciri> (i.e., none | currentColor | <color>
    [<icccolor>] is used if provided; otherwise, the document is in
    error (see Error processing).

My take is that <pattern width="0"> is not invalid, paint fallback
doesn’t occur, and so the circle should not be filled.  Implementations
I tested do use the fallback, though: Gecko, WebKit, Opera and Batik all
do.  (Not in Windows atm so didn’t test IE.)

Are these implementations in error, or should we clarify the spec to say
that zero-sized patterns do invoke paint fallback?

(And while we’re talking about paint fallback: why does the <icccolor>
specification come *after* the regular <color>?  That seems contrary to
the regular way fallback is handled in CSS properties – i.e., use the
first value in the list that you can.)

-- 
Cameron McCormack ≝ http://mcc.id.au/
Received on Friday, 5 November 2010 01:39:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 5 November 2010 01:39:55 GMT