W3C home > Mailing lists > Public > www-svg@w3.org > October 2012

'clip' property and the behavior on 'auto'

From: Dirk Schulze <dschulze@adobe.com>
Date: Wed, 10 Oct 2012 14:54:16 -0700
To: "www-svg@w3.org list" <www-svg@w3.org>
Message-ID: <6EA7B0CF-4E1A-4D4A-A601-4AC711B9C55C@adobe.com>

After a discussion with the CSS WG, we agreed to move the 'clip' property definition[1][2] to CSS Masking[3] as well. The behavior differs between HTML and SVG on 'auto'. While 'auto' has no effect on HTML elements, it means clipping to the viewport created by the given element in SVG. Note that the property just applies to elements that establish a viewport like svg and patterns or markers.

But content seems not be clipped to the viewport (by the 'clip' property) at the moment. I just tested with SVG yet.

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="500" height="500">
  <rect width="500" height="500" fill="red"/>
    <svg width="200" height="200" overflow="visible" clip="auto">
      <rect width="500" height="500" fill="green" />

In this case, the green rectangle should be clipped to one viewport. Therefore, parts of the red rectangle should be visible, but aren't (Tested with Opera, FF, Chrome/Safari, Batik).

I would suggest following the general definition of CSS 'clip' and let 'auto' have no affect on elements. Or do we need the property to specify the behavior on pattern and marker? (I just checked, unlike for the 'overflow' property, we don't have specific US styles for 'clip' :)).


PS: I noticed that 'rect(0,200px,200px,0)' on the inner SVG element did not work for 'clip' on any browser either.

[1] https://svgwg.org/svg2-draft/masking.html#OverflowAndClipProperties
[2] http://www.w3.org/TR/CSS2/visufx.html#propdef-clip
[3] http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html
Received on Wednesday, 10 October 2012 21:54:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:37 UTC