W3C home > Mailing lists > Public > www-svg@w3.org > May 2008

percentages in clipPath/pattern/filter/mask content

From: Robert O'Callahan <robert@ocallahan.org>
Date: Tue, 27 May 2008 12:15:40 +1200
Message-ID: <11e306600805261715i17ab55e5m5c1ec0f2afb21fe3@mail.gmail.com>
To: www-svg <www-svg@w3.org>
http://www.w3.org/TR/SVG/coords.html#ObjectBoundingBox says

> If percentages are used within the content of a 'pattern'<http://www.w3.org/TR/SVG/pservers.html#PatternElement>,
> 'clipPath' <http://www.w3.org/TR/SVG/masking.html#ClipPathElement>, 'mask'<http://www.w3.org/TR/SVG/masking.html#MaskElement>or
> 'filter' <http://www.w3.org/TR/SVG/filters.html#FilterElement> element,
> these values are treated according to the processing rules for percentages
> as defined in Units <http://www.w3.org/TR/SVG/coords.html#Units>.
>

This seems counter-intuitive. E.g.

<svg xmlns="http://www.w3.org/2000/svg">
  <defs>
    <clipPath id="r" clipPathUnits="objectBoundingBox">
      <rect width="10%" height="10%"/>
    </clipPath>
  </defs>
  <rect width="500" height="500" fill="lime" clip-path="url(#r)"/>
</svg>

Seems authors would expect the clip to be 10% of the object. But instead,
10% is interpreted relative to the viewport, so it's likely to be 10% of
1000 or thereabouts. But clipPath coordinates are expected to be in the
range (0,0)-(1,1), so nothing is clipped out. So "percentage of the
viewport" is pretty much useless for objectBoundingBox coordinates. Can
anyone explain why it was specced this way?

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
Received on Tuesday, 27 May 2008 00:16:20 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:39 GMT