Re: Correct behavior of "visibility" tag

On Monday, March 1, 2004, 5:56:43 PM, ruben wrote:

rT> Hi 

rT>  

rT> I am in the process of developing a SVGTiny player. I am
rT> having little trouble in understanding the correct behavior of
rT> "visibility" tag. From SVG specification (
rT> http://www.w3.org/TR/SVG11/painting.html#VisibilityControl ) "Note
rT> that 'visibility' is not an inheritable".

Correct. Setting the value of visibility does not inherit the value
down to its children.

http://www.w3.org/TR/REC-CSS2/visufx.html#propdef-visibility

Value:          visible | hidden | collapse | inherit
Initial:        inherit
Applies to:     all elements
Inherited:      no
Percentages:    N/A
Media:          visual

rT>  But in the next
rT> paragraph spec indicates that "inherit" is one of the possible
rT> value of visibility.

Correct. An element can set the value to 'inherit' to force the value
to be copied from its parent.
 

rT> The following example behaves in Adobe SVG player -- "for
rT> first 2 seconds you cann't see the polygon(star shape) and then
rT> from 2 second until 18th second you will see the polygon on the
rT> screen"

Yes.

rT> But my understanding is that, since the polygon inherits from
rT> the group element, (group element is specified as hidden) it will
rT> remain hidden all the time.

Note however that the initial value of the visibility property is
'inherit' so the computed value of visibility on the polygon at the
start of the timeline is 'hidden'.

Note also that visibility can be set to visible on a child of a parent
that is not visible, and it will show. This is a crucial difference
between the visibility and display properties.

So the animation is correct and the polygon will show at the times
specified.

Yes, there should be a test for this in the test suite.


rT> Our SVGTiny player does not show the polygon at all.

It should.
  

rT> Could anyone explain what should be the right behavior of
rT> visibility tag? What would be the behavior of the following
rT> example? 


rT> <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
rT> baseProfile="tiny" xml:space="preserve" width="176" height="208"
rT> viewBox="-88 -104 400 400">

rT> <g transform="scale(0.6, 0.6)">
rT> <g transform="translate(-50, -30)">
rT> <g visibility="hidden">
rT>  
rT>  <polygon fill="#883655" stroke="rgb(0%,0%,255%)" stroke-width="15"
rT>               points="130,75  159,161 249,161 177,215
rT>                     203,301 130,250 57,301 83,215
rT>                     11,161 101,161" >
rT>   <animateTransform attributeName="transform" type="rotate"
rT> values="0 130 200;360 130 200" begin="2s" dur="5s"
rT> repeatDur="indefinite"/>
rT>         <animateColor attributeName="stroke" begin="1s"
rT> dur="3s" fill="freeze" from="rgb(0%,0%,255%)"
rT> to="rgb(255%,0%,255%)"/>
rT>  <animateColor attributeName="str oke" begin="3s" dur="2s"
rT> fill="freeze" from="rgb(255%,0%,255%)" to="rgb(0%,255%,255%)"/>
rT>  <set attributeName="visibility" to="inherit" begin="2s" end="18s"/>
rT>     
rT>  </polygon>
rT> </g>


(two closing g elements should be added here to make it well formed)

rT> </svg>
  


-- 
 Chris Lilley                    mailto:chris@w3.org
 Chair, W3C SVG Working Group
 Member, W3C Technical Architecture Group

Received on Tuesday, 2 March 2004 09:01:16 UTC