Last Comment Bug 648875 - SVG use width/height = 0 should disable rendering
: SVG use width/height = 0 should disable rendering
Status: VERIFIED FIXED
:
Product: Core
Classification: Components
Component: SVG (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla7
Assigned To: Robert Longson
:
: Jet Villegas (:jet)
Mentors:
http://hoffmann.bplaced.net/svgtest/u...
Depends on: 652832
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-10 10:15 PDT by Dr. Olaf Hoffmann
Modified: 2011-08-28 23:59 PDT (History)
3 users (show)
longsonr: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Minimal test case (275 bytes, image/svg+xml)
2011-04-25 18:28 PDT, Brian Birtles (:birtles)
no flags Details

Description Dr. Olaf Hoffmann 2011-04-10 10:15:27 PDT
User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20100101 Firefox/4.0

The attributes width and height of the use element do not animate.

The example given above tests only the simplest case of 0 width or height
to disable the rendering of the use completely (available for SVG tiny 1.1 too).
Even for SVG full 1.1 with non trivial values and the use referencing an element
svg or symbol, width and height do not animate (If required, I can provide URIs with samples as well).

About this example:
A defs element contains a g element with a rectangle and
a circle. It is referenced by an use-element.
After 2 seconds for a duration of 2s the width of the use is set to 0.
The shown circle and the rectangle vanish for 2s.
After 6 seconds for a duration of 2s the height of the use is set to 0.
The shown circle and the rectangle vanish for 2s.

The fill of a small circle top left has an animation with the same timing for comparison.

Reproducible: Always

Steps to Reproduce:
1. Try the sample given in the URI above
2. Compare with specification (use element)
3. Compare with Opera (any version 9 to 11)
Actual Results:  
Large rectangle and circle do not vanish, no animation of width and height of use.

Expected Results:  
width and height of use should be animatable.


Note, that for non trivial examples (no zero values as here) the effect depends
on the referenced element (effectively no effect for 'normal' elements like g,
typically visible effect for symbol and svg).

See http://www.w3.org/TR/SVG11/struct.html#UseElement
Comment 1 Brian Birtles (:birtles) 2011-04-25 18:27:53 PDT
This doesn't appear to be an animation bug, but rather that we don't honour the description of the use width/height attributes:

  A value of zero disables rendering of this element.
  (http://dev.w3.org/SVG/profiles/1.1F2/publish/struct.html#UseElementWidthAttribute)

It may be that even after fixing this bug, the test case still fails due to bug 608161.
Comment 2 Brian Birtles (:birtles) 2011-04-25 18:28:40 PDT
Created attachment 528245 [details]
Minimal test case

A minimal test case. The rendering of the circle should be disabled but it is not.
Comment 3 Dr. Olaf Hoffmann 2011-04-26 01:36:03 PDT
As you can see in this SVG 1.1 full test
http://hoffmann.bplaced.net/svgtest/usesvg01.svg
it does not animate for non zero values as well
(blue: test case referenced svg; red: comparison).
Ok for example in Opera, Adobe plugin, Squiggle/Batik, WebKit.
Comment 4 Brian Birtles (:birtles) 2011-04-26 02:33:17 PDT
(In reply to comment #3)
> As you can see in this SVG 1.1 full test
> http://hoffmann.bplaced.net/svgtest/usesvg01.svg
> it does not animate for non zero values as well
> (blue: test case referenced svg; red: comparison).
> Ok for example in Opera, Adobe plugin, Squiggle/Batik, WebKit.

Thanks Olaf. If you don't mind, could you make a minimal test case and file another bug for that issue? If you don't have time though. I'll do it tomorrow.
Comment 5 Dr. Olaf Hoffmann 2011-04-26 02:44:11 PDT
Brian changed the summary, before it was in general about the animation problem -
but if you think it helps, we can spend a new number with the old summary and
a test case with non trivial values for width and height ;o)
Comment 6 Daniel Holbert [:dholbert] 2011-04-26 09:04:02 PDT
(In reply to comment #5)
> Brian changed the summary, before it was in general about the animation problem

It looks to me like there are two separate underlying issues.
 - The testcase that this bug was originally filed for fails because we don't disable rendering when the <use> element itself is zero-sized. (regardless of animation)
 - The new testcase you linked to is different - it animates the *target pointed to* by <use>, and it looks like when that target is inside of a new <svg> fragment, we don't handle that right.

These two issues deserve separate bugs, and Brian's summary-tweak was correct, given the original testcase.
Comment 7 Dr. Olaf Hoffmann 2011-04-26 09:25:30 PDT
Well, no problem - just one number or one for the svg and one for symbol - and
maybe another for g, to ensure, that it is NOT changed, that for g it should have
no effect (I assume, that if it works for g, it will work for typical other
elements as well...)? I have reduced examples already finished - maybe I can put
them together in one new bug number? Then we have this special case with 0 and
another with non zero values, maybe including a mix 0 and non 0 in a values list?
Comment 8 Daniel Holbert [:dholbert] 2011-04-26 10:14:04 PDT
(In reply to comment #6)
>  - The new testcase you linked to is different - it animates the *target
> pointed to* by <use>

(Sorry, I just now noticed that the <use> element gets its height/width animated in your comment 3 testcase, too -- I missed that initially since the <animate> node isn't near the <use> elements (using xlink:href targeting).)

Anyway - thanks for filing the followup bug!
Comment 9 Daniel Holbert [:dholbert] 2011-04-26 10:19:19 PDT
(that followup bug being Bug 652832, for the record)
Comment 10 Robert Longson 2011-06-22 00:44:53 PDT
Fixed by check-in for bug 652832
Comment 11 Vlad [QA] 2011-08-24 07:47:03 PDT
I have followed the steps from the description on
Mozilla/5.0 (Windows NT 6.1; rv:7.0) Gecko/20100101 Firefox/7.0
and the rectangle disappears after two seconds.
Is this the intended behavior?

In Google Chrome this is not happening.
Comment 12 Robert Longson 2011-08-24 07:52:07 PDT
(In reply to Vlad from comment #11)
> I have followed the steps from the description on
> Mozilla/5.0 (Windows NT 6.1; rv:7.0) Gecko/20100101 Firefox/7.0
> and the rectangle disappears after two seconds.
> Is this the intended behavior?
> 

It is as described in comment 0. 

> In Google Chrome this is not happening.

I guess Chrome is broken then.
Comment 13 Vlad [QA] 2011-08-28 23:59:27 PDT
Setting resolution to Verified fixed on Mozilla/5.0 (Windows NT 6.1; rv:7.0) Gecko/20100101 Firefox/7.0 beta 2

Note You need to log in before you can comment on or make changes to this bug.