Bug 54410 - SVG animation doesn't support attribute value 'inherit'
Summary: SVG animation doesn't support attribute value 'inherit'
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Dirk Schulze
URL:
Keywords:
Depends on:
Blocks: 41761
  Show dependency treegraph
 
Reported: 2011-02-14 13:33 PST by Dirk Schulze
Modified: 2011-02-15 09:03 PST (History)
6 users (show)

See Also:


Attachments
Patch (28.88 KB, patch)
2011-02-14 14:42 PST, Dirk Schulze
no flags Details | Formatted Diff | Diff
Patch (28.89 KB, patch)
2011-02-14 15:00 PST, Dirk Schulze
no flags Details | Formatted Diff | Diff
Patch (29.52 KB, patch)
2011-02-15 01:33 PST, Dirk Schulze
zimmermann: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Schulze 2011-02-14 13:33:09 PST
SVG animation doesn't support attribute value 'inherit' for CSS properties.
Comment 1 Dirk Schulze 2011-02-14 14:42:01 PST
Created attachment 82365 [details]
Patch
Comment 2 WebKit Review Bot 2011-02-14 14:51:21 PST
Attachment 82365 [details] did not build on chromium:
Build output: http://queues.webkit.org/results/7911651
Comment 3 Dirk Schulze 2011-02-14 15:00:46 PST
Created attachment 82367 [details]
Patch
Comment 4 Dirk Schulze 2011-02-14 15:03:13 PST
Forgot to mention that this fixes two more tests of the W3C test suite:

http://dev.w3.org/SVG/profiles/1.1F2/test/svg/animate-elem-84-t.svg
http://dev.w3.org/SVG/profiles/1.1F2/test/svg/animate-elem-85-t.svg
Comment 5 Early Warning System Bot 2011-02-14 15:06:21 PST
Attachment 82365 [details] did not build on qt:
Build output: http://queues.webkit.org/results/7909708
Comment 6 Nikolas Zimmermann 2011-02-15 00:40:01 PST
Comment on attachment 82367 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=82367&action=review

Almost r=me, still some comments to be resolved, setting r- for the meanwhile.

> Source/WebCore/ChangeLog:19
> +        (WebCore::SVGAnimateElement::calculateAnimatedValue): Get the computed style of attribute for 'inherit'
> +        or 'currentColor' during the animation, since the values could be animated themselves.

When a property value is 'inherit' or 'currentColor' during the animation, get the computed style of the property since the values could be animated themselves.

> Source/WebCore/ChangeLog:28
> +        the attribute is an animatable CSS property with the use of a CSS property map in SVGStyledElement.

s/with the use of .../by using the CSS property map in SVGStyledElement/.

> Source/WebCore/ChangeLog:30
> +        (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue): Take targetElement instead of target
> +        for consistency reasons.

s/Take..../ -> s/target/targetElement/ for consistency.

> Source/WebCore/ChangeLog:33
> +        (WebCore::SVGStyledElement::isAnimatableCSSProperty): Check if attribute is a animatable CSS property.

s/Check if/.../ -> Checks if the CSS property is animable.

> Source/WebCore/svg/SVGAnimateElement.cpp:101
> +static inline String adujustForInheritance(SVGElement* targetElement, const String& attributeName)

For consistency: avoid the return value, and use a "String& attributeValue" as parameter?
s/adujust/adjust/

> Source/WebCore/svg/SVGAnimateElement.cpp:103
> +    // FIXME: Needs to handle animation types directly.

What does that mean?

> Source/WebCore/svg/SVGAnimateElement.cpp:163
> +        // Get current values on property value 'currentColor' as well as 'inherit'

Replace 'currentColor' / 'inherit' by their computed property values.

> Source/WebCore/svg/SVGAnimateElement.cpp:192
> +        // Get current values on property value 'currentColor' and 'inherit'

Same comment as I suggested above. And use periods at the end of sentences.

> Source/WebCore/svg/SVGAnimateElement.h:54
> +    // If we have 'currentColor' or 'inherit' as animation value, we need to grep the value during the animation

s/grep/grab/

> Source/WebCore/svg/SVGAnimateElement.h:56
> +    enum BasicValueChange {

Why BasicValueChange? Doesn't make a lot of sense to me.
enum AnimatedPropertyValueType {
RegularPropertyValue,
CurrentColorValue,
InheritValue
}; ?

> Source/WebCore/svg/SVGAnimateElement.h:59
> +        constantBasicValue,
> +        currentColorBasicValue,
> +        inheritBasicValue

Capitalize those enum values.
Comment 7 Dirk Schulze 2011-02-15 01:33:12 PST
Created attachment 82428 [details]
Patch
Comment 8 Nikolas Zimmermann 2011-02-15 02:18:34 PST
Comment on attachment 82428 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=82428&action=review

r=me. Great job!

> Source/WebCore/svg/SVGAnimateElement.cpp:299
> +static bool isCurrentColor(const String& value)

attributeValueIsCurrentColor?
Comment 9 Dirk Schulze 2011-02-15 03:16:53 PST
Committed r78543: <http://trac.webkit.org/changeset/78543>
Comment 10 Dirk Schulze 2011-02-15 06:05:36 PST
Committed r78552: <http://trac.webkit.org/changeset/78552>
Comment 11 WebKit Review Bot 2011-02-15 09:03:24 PST
http://trac.webkit.org/changeset/78560 might have broken GTK Linux 64-bit Debug