Closed
Bug 603917
Opened 14 years ago
Closed 14 years ago
SMIL animation on "fill" fails when base value is a paint server (even when base value isn't ultimately needed)
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
mozilla2.0b8
Tracking | Status | |
---|---|---|
blocking2.0 | --- | final+ |
People
(Reporter: jay, Assigned: birtles)
References
()
Details
(Keywords: testcase)
Attachments
(6 files, 9 obsolete files)
when using xsltProcessor.transformToFragment styles in the root document are followed by mozilla, however when using set they are not. wfm Opera and Safari
Reporter | ||
Comment 1•14 years ago
|
||
URL testcase demonstrates styles are used, blackStoneFill is styled in root document, however they should have been 'set' to whiteStoneFill.
Reporter | ||
Comment 2•14 years ago
|
||
Reporter | ||
Comment 3•14 years ago
|
||
Reporter | ||
Comment 4•14 years ago
|
||
Reporter | ||
Comment 5•14 years ago
|
||
http://www.peepo.com is the use case.
I have not attempted to link the three attachments, as in the past this did not work for me when using xsltProcessor.transformToFragment
Reporter | ||
Comment 6•14 years ago
|
||
in fact set is broken for styles in fragments, amending testcases
Summary: Set broken for styles in root document when appending fragment → Set broken for styles when appending fragment
Reporter | ||
Comment 7•14 years ago
|
||
now the blackStoneFill is correctly loaded from root document,
but 'set' fails to use style in xsl stylesheet.
in fact neither style in root or xsl stylesheet are used.
finally note visibility is used to show that 'set' does effect visibility
Reporter | ||
Comment 8•14 years ago
|
||
Attachment #482818 -
Attachment is obsolete: true
Reporter | ||
Comment 9•14 years ago
|
||
Attachment #482821 -
Attachment is obsolete: true
Reporter | ||
Comment 10•14 years ago
|
||
changed style to 'red' to simplify testcase
Comment 11•14 years ago
|
||
What do I do with the attached files?
Furthermore why is this an SVG bug and not XSLT. If you can't produce a single file SVG example then it probably doesn't belong to CORE->SVG.
Comment 12•14 years ago
|
||
You seem to have produced an SVG file that has set nodes underneath the g this is not a valid SVG file. Do you want to retarget this bug to some other component or shall I close it as invalid?
Reporter | ||
Comment 13•14 years ago
|
||
Robert,
http://honte.eu/bugs/mozilla/set-xslt/test-all.svg
validates at w3c, and is similar to the result of the transform,
Reporter | ||
Comment 14•14 years ago
|
||
#11
set fill is the only part that is broken
set visibility is fine.
I cannot see how this is part of xslt, as the transform is correct,
might this be related to the issue that set is initiated onload,
whereas the xslt is added later? this has come up before.
Comment 15•14 years ago
|
||
Use DOM inspector to look at the generated code. It looks like
<g>
<set />
<set />
<set />
<set />
</g>
Whatever you've generated is not SVG so this is not an SVG bug.
Comment 16•14 years ago
|
||
Hmm wait a minute maybe I'm wrong there. I'll take another look.
Reporter | ||
Comment 17•14 years ago
|
||
please try the url:
http://honte.eu/bugs/mozilla/set-xslt/test.svg
and compare in different browsers
Reporter | ||
Comment 18•14 years ago
|
||
mozilla displays the result fine, it is visible, just the style is wrong, it has not been set to red
Reporter | ||
Comment 19•14 years ago
|
||
bug 386856 is the one I remembered #14 which may be relevant.
the potential relation being that set refers to timing, hence onload which is addressed there.
Assignee | ||
Comment 20•14 years ago
|
||
Hi Jonathan,
Sorry, I don't have time to look at this now, I'll look tomorrow. But have you tried using the syntax 'rgb(255,0,0)' instead of 'red'
Reporter | ||
Comment 21•14 years ago
|
||
Reporter | ||
Comment 22•14 years ago
|
||
Attachment #482833 -
Attachment is obsolete: true
Attachment #483106 -
Attachment is obsolete: true
Reporter | ||
Comment 23•14 years ago
|
||
Reporter | ||
Comment 24•14 years ago
|
||
Attachment #482817 -
Attachment is obsolete: true
Attachment #483109 -
Attachment is obsolete: true
Reporter | ||
Comment 25•14 years ago
|
||
Attachment #482819 -
Attachment is obsolete: true
Reporter | ||
Comment 26•14 years ago
|
||
excuse bug-spam, now the root document attachment should show 2 green circles.
the URL has an additional test 'redder' with the linearGradient in the xslt stylesheet, that mozilla also fails
There seems to be more than one way to break the fill styling, these are just an example. clearly set visibility and fill, work in some circumstances. in my experiments it was not clear that this was limited to linearGradient.
Reporter | ||
Comment 27•14 years ago
|
||
added test to url, dark green circle should be changed to #reddish
Summary: Set broken for styles when appending fragment → Set broken for style: linearGradient when appending fragment
Assignee | ||
Comment 28•14 years ago
|
||
Reduced test case.
Assignee | ||
Comment 29•14 years ago
|
||
The problem appears to be that if the base fill is a gradient GetBaseValue fails when we try to animate it. When that happens the compositor simply bails out:
http://mxr.mozilla.org/mozilla-central/source/content/smil/nsSMILCompositor.cpp#110
However, for <set> animation it shouldn't even be necessary to read the base value since <set> never interpolates from a base value, nor is it ever additive.
Updated•14 years ago
|
Summary: Set broken for style: linearGradient when appending fragment → SMIL animation on "fill" fails when base value is a paint server (even when base value isn't ultimately needed)
Version: unspecified → Trunk
Assignee | ||
Comment 30•14 years ago
|
||
This seems fixable with a bit of special casing in nsSMILCompositor.
e.g.
a) In ComposeAttribute, get the first function to affect the sandwich (we already do this)
b) If WillReplace() returns true on that function, then proceed with a null smil value of some sort.
We'll need special handling later on and in nsSMILAnimationFunction plus a few assertions to make sure that null value doesn't crop up where we're not expecting it, plus I'm not sure yet how we'll work out what type it should be in advance, but at a glance anyway, it seems fixable and worth doing.
Assignee: nobody → birtles
Status: NEW → ASSIGNED
blocking2.0: --- → ?
blocking2.0: ? → final+
Assignee | ||
Comment 31•14 years ago
|
||
First attempt at fixing this.
This patch reworks our compositing so that null base values are only checked at the last moment. It means that in cases where we're replacing the base value we don't need to worry if that base value is able to be represented as an nsSMILValue or not.
This patches also leverages this flexibility to skip fetching the base value if we won't need it which I imagine is a useful optimisation when animating CSS properties as it saves us the unset style/get base value/reset style step we normally do there.
It does however mean that if the first animation function in the sandwich fails unexpectedly the next animation will operate on a null base value rather than the actual base value.
Until error handling in SVG is more widely agreed upon I think this is reasonable behaviour. (Currently SVG's error handling is quite strict and most vendors don't adhere, sometimes importing SVG 1.2's more lax behaviour.) It is a trivial matter to remove this optimisation later if need be.
Note that all the behaviour in the original test case is not covered by this patch. Particularly the behaviour in comment 27 of setting a gradient fill still will not work (only animating over the top of a gradient fill). I will file a separate bug for this (although bug 552087 is perhaps the same?)
Attachment #486250 -
Flags: review?(dholbert)
Comment 32•14 years ago
|
||
Comment on attachment 486250 [details] [diff] [review]
Patch v1a
>+++ b/content/smil/nsSMILCSSProperty.cpp
>@@ -106,24 +106,21 @@ nsSMILCSSProperty::GetBaseValue() const
> // We can't look up the base (computed-style) value of shorthand
> // properties, because they aren't guaranteed to have a consistent computed
> // value. However, that's not a problem, because it turns out the caller
> // isn't going to end up using the value we return anyway. Base values only
> // get used when there's interpolation or addition, and the shorthand
> // properties we know about don't support those operations. So, we can just
>- // return a dummy value (initialized with the right type, so as not to
>- // indicate failure).
>+ // return a null value.
[...]
>- nsSMILValue tmpVal(&nsSMILCSSValueType::sSingleton);
>- baseValue.Swap(tmpVal);
> return baseValue;
I have mixed feelings about this chunk, because the documentation in nsISMILAttr.h for GetBaseValue still says that a null-typed return-value indicates failure (even if we care less about failure now). So as long as this method intends to return "success", it should be returning a nsSMILValue with a non-null type.
Alternately -- since (with your patch) GetBaseValue() failure isn't as big of a deal now, you could leave this as-is but tweak the comment above it to effectively say "Can't get shorthand property's base value -- FAIL! (but failure won't cause problems because this value won't get used)"
You should do one or the other of these things -- either keep it nsSMILCSSValueType-typed (to indicate weak "success"), or make it Null-typed & edit the comment to indicate that we're failing & that it's OK.
>diff --git a/content/smil/nsSMILCompositor.cpp b/content/smil/nsSMILCompositor.cpp
>+++ b/layout/reftests/svg/smil/anim-fill-overpaintserver-2.svg
>+ <animate attributeName="fill" to="lime" dur="10s"/>
Could you increase 10s there to, say, 500s?
I'm probably being paranoid, but I think it's possible (though pretty unlikely) that 11s might elapse between pageload & the snapshot-time (maybe on a mobile device under huge load), and we don't want sporadic failures from that. 500s is a safer "never-actually-reached" animation duration for a reftest, I think.
r=dholbert with the above addressed.
Attachment #486250 -
Flags: review?(dholbert) → review+
Assignee | ||
Comment 33•14 years ago
|
||
Address review feedback. Thanks Daniel!
Attachment #486250 -
Attachment is obsolete: true
Attachment #487466 -
Flags: review+
Assignee | ||
Updated•14 years ago
|
Flags: in-testsuite?
Whiteboard: [waiting to checkin]
Comment 34•14 years ago
|
||
Comment on attachment 487466 [details] [diff] [review]
Patch v1b, r=dholbert
>@@ -101,29 +101,27 @@ nsSMILCSSProperty::GetBaseValue() const
>+ // In either case, simply returning null to indicate failure is acceptable
>+ // because the caller only uses base values when there's interpolation or
>+ // addition, and for both the shorthand properties we know about and the
>+ // display property those operations aren't supported.
> return baseValue;
Nit: s/returning null/returning a null-typed nsSMILValue/
Otherwise looks good! :)
Assignee | ||
Comment 35•14 years ago
|
||
Fix nit from comment 34.
Attachment #487466 -
Attachment is obsolete: true
Attachment #488378 -
Flags: review+
Assignee | ||
Comment 36•14 years ago
|
||
The original patch (v1c) was causing assertions on TryServer.
Specifically, the assertions described in bug 535691. Rather than getting 0-2 assertions as expected we were getting up to 10 in some cases.
The problem appears to be that nsSVGTransformSMILAttr::ClearAnimValue was occasionally running into trouble when notifying observers.
In that file it seems we normally call DidAnimateTransform on the SVG element that owns the transform, except in the case of clearing the transform where we call Will/DidModify on the transform. Occasionally we were doing this in a state where the observable wasn't known. I haven't analysed exactly what circumstances this arises in.
With the original patch (v1c) we end up calling ClearAnimValue more frequently and hence run into this assertion more frequently.
I'm attaching a new patch, Part 2, which revises nsSVGTransformSMILAttr::ClearAnimValue to use DidAnimateTransform instead. This patch fixes the assertions for me (including fixing bug 535691 if we decide to go with this).
Will run it through TryServer now to check it works on other platforms too.
Attachment #489085 -
Flags: review?(dholbert)
Comment 37•14 years ago
|
||
Comment on attachment 489085 [details] [diff] [review]
Part 2 - Fix transform assertion
Looks good to me.
Attachment #489085 -
Flags: review?(dholbert) → review+
Assignee | ||
Comment 38•14 years ago
|
||
Pushed:
http://hg.mozilla.org/mozilla-central/rev/edf3071a4fdb
http://hg.mozilla.org/mozilla-central/rev/4e06966e8dfe
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite? → in-testsuite+
Resolution: --- → FIXED
Whiteboard: [waiting to checkin]
Target Milestone: --- → mozilla2.0b8
Comment 39•14 years ago
|
||
Did part 2 fix bug 531550 too?
Assignee | ||
Comment 40•14 years ago
|
||
(In reply to comment #39)
> Did part 2 fix bug 531550 too?
I'm afraid not :(
Reporter | ||
Comment 41•14 years ago
|
||
will this be in tomorrow's trunk nightly?
Comment 42•14 years ago
|
||
Yes.
(Since I've seen you ask that question on a few bugs now -- for future reference, the answer to that question is basically always "yes", if you see that a bug has had its patch checked in to mozilla-central & has been marked "fixed". Unless of course it gets backed out, but if that were to happen, you'd see another comment mentioning the backout.)
Reporter | ||
Comment 43•14 years ago
|
||
are there tests at w3c for xslt transforms?
if not please make sure you cover the bases, rather than relying on bug files.
I also have things to do....
I already stated that I had only included 'some' of the possible variations.
obviously at some stage it is likely that someone(s) will get around to it.
in practice it just needs a little careful thought.
in #27 I refer to a test:
http://honte.eu/bugs/mozilla/set-xslt/test.svg
that remains broken for latest mozilla builds,
number 4,
though the other tests now pass.
in fact this is the test in the original description,
hence my decision to reopen.
There remains a small suite of further tests that need to be checked,
anyway, please check before closing my bugs,
not sure whether thanks are due ~:"
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 44•14 years ago
|
||
This bug has a fix that has landed. The rules are that it can only be reopened if the fix is backed out. If you still have issues you must create another bug.
Status: REOPENED → RESOLVED
Closed: 14 years ago → 14 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 45•14 years ago
|
||
the fix needs to be backed out, or should not have landed.
whatever may be fixed it is not this bug.
Robert, please back-off.
you may be well intentioned but...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Reporter | ||
Comment 46•14 years ago
|
||
description of bug clearly states:
when using xsltProcessor.transformToFragment styles in the root document are
followed by mozilla, however when using set they are not. wfm Opera and Safari
this has not been fixed at all.
what has been fixed is where the style is in the style sheet, which is a different matter.
Comment 47•14 years ago
|
||
Do not reopen this bug. Raise a new one.
Status: REOPENED → RESOLVED
Closed: 14 years ago → 14 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 48•14 years ago
|
||
(In reply to comment #43)
> in #27 I refer to a test:
> http://honte.eu/bugs/mozilla/set-xslt/test.svg
> that remains broken for latest mozilla builds,
> number 4,
> though the other tests now pass.
Jonathan, please note my comment 31:
> Note that all the behaviour in the original test case is not covered by this
> patch. Particularly the behaviour in comment 27 of setting a gradient fill
> still will not work (only animating over the top of a gradient fill). I will
> file a separate bug for this (although bug 552087 is perhaps the same?)
Specifically, the separate bug I filed is bug 607537 on which you're cc'ed. I think that bugs covers the remaining missing functionality right?
Reporter | ||
Comment 49•14 years ago
|
||
Brian,
many thanks, for filing a bug, I had not received any notice of this, which is poor communication.
There are a considerable number of people at Mozilla who consider they are above filing bugs, I consider this grossly irresponsible.
Daniel and Robert's responses insisting I file a bug, when I had already created a broad bug with a variety of tests and explanation, and the fact that I was unaware that you had filed a bug had led me to consider dropping Mozilla bug filing and support until 2012.
Mozilla needs to consider this, as I for one find the hierarchical systems embedded by Mozilla most unreasonable.
Comment 50•14 years ago
|
||
Broad bugs are unlikely to be completely fixed in all cases. We cannot rewrite everything all at once.
There are a considerable number of volunteers who give up their free time to help you it's unfair of you to demand that they put any more time in than they have for this free service to you.
We're not above filing bugs either the point is that if you file the bug you will get notified when things happen on it and fling bugs should pretty straigtforward for someone that's been around as long as you have.
Assignee | ||
Comment 51•14 years ago
|
||
Hi Jonathan,
Sorry you didn't get the bugmail for that bug I filed, I've got no idea why that would be. At any rate, you're right, it would have been good to mention that bug in the comments here. I'll make sure to do so next time. Sorry about that.
You need to log in
before you can comment on or make changes to this bug.
Description
•