2008-11-20 Simon Fraser <simon.fraser@apple.com>
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Nov 2008 00:26:29 +0000 (00:26 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Nov 2008 00:26:29 +0000 (00:26 +0000)
        Reviewed by Darin Adler

        https://bugs.webkit.org/show_bug.cgi?id=20368

        Implement getComputedStyle for animation properties. Remove individual
        computed values for transform-origin-x, transform-origin-y, and just
        return transform-origin instead. Return "none" for default animation-name,
        and fix the initial value.

        Tests: animations/computed-style.html
               transforms/computed-style-origin.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::):
        (WebCore::getDelayValue):
        (WebCore::getDurationValue):
        (WebCore::getTimingFunctionValue):
        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
        * rendering/style/RenderStyle.h:
        (WebCore::InheritedFlags::initialAnimationName):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@38642 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/animations/computed-style-expected.txt [new file with mode: 0644]
LayoutTests/animations/computed-style.html [new file with mode: 0644]
LayoutTests/fast/css/computed-style-expected.txt
LayoutTests/fast/css/computed-style-without-renderer-expected.txt
LayoutTests/svg/css/getComputedStyle-basic-expected.txt
LayoutTests/transforms/computed-style-origin-expected.txt [new file with mode: 0644]
LayoutTests/transforms/computed-style-origin.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/css/CSSComputedStyleDeclaration.cpp
WebCore/rendering/style/RenderStyle.h

index 81fa582..f8a31d0 100644 (file)
@@ -1,3 +1,22 @@
+2008-11-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler
+
+        https://bugs.webkit.org/show_bug.cgi?id=20368
+
+        Tests for computed values of animation properties, and
+        change to computed value of transform-origin. Updated tests
+        that dump all computed values, to include animation and changed
+        transform-origin properties.
+
+        * animations/computed-style-expected.txt: Added.
+        * animations/computed-style.html: Added.
+        * fast/css/computed-style-expected.txt:
+        * fast/css/computed-style-without-renderer-expected.txt:
+        * svg/css/getComputedStyle-basic-expected.txt:
+        * transforms/computed-style-origin-expected.txt: Added.
+        * transforms/computed-style-origin.html: Added.
+
 2008-11-20  Pamela Greene  <pam@chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/animations/computed-style-expected.txt b/LayoutTests/animations/computed-style-expected.txt
new file mode 100644 (file)
index 0000000..53facaa
--- /dev/null
@@ -0,0 +1,22 @@
+This tests computed style values from animation properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS test1Style.webkitAnimationName is 'anim1'
+PASS test2Style.webkitAnimationName is 'anim2, anim3'
+PASS test1Style.webkitAnimationDuration is '10s'
+PASS test2Style.webkitAnimationDuration is '5s, 2.5s'
+PASS test1Style.webkitAnimationIterationCount is '10'
+PASS test2Style.webkitAnimationIterationCount is '10, infinite'
+PASS test1Style.webkitAnimationPlayState is 'paused'
+PASS test2Style.webkitAnimationPlayState is 'paused, running'
+PASS test1Style.webkitAnimationTimingFunction is 'cubic-bezier(0, 0, 1, 1)'
+PASS test2Style.webkitAnimationTimingFunction is 'cubic-bezier(0, 0, 1, 1), cubic-bezier(0.42, 0, 0.58, 1)'
+PASS test1Style.webkitAnimationDirection is 'normal'
+PASS test2Style.webkitAnimationDirection is 'normal, alternate'
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/animations/computed-style.html b/LayoutTests/animations/computed-style.html
new file mode 100644 (file)
index 0000000..6b15f4b
--- /dev/null
@@ -0,0 +1,83 @@
+<html>
+<head>
+<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
+<style type="text/css" media="screen">
+    #test1 {
+        width: 20px;
+        height: 20px;
+        background-color: blue;
+        position: relative;
+        -webkit-animation-name: anim1;
+        -webkit-animation-duration: 10s;
+        -webkit-animation-iteration-count: 10;
+        -webkit-animation-play-state: paused;
+        -webkit-animation-timing-function: linear;
+        -webkit-animation-direction: normal;
+    }
+    #test2 {
+        width: 20px;
+        height: 20px;
+        background-color: blue;
+        position: relative;
+        -webkit-animation-name: anim2, anim3;
+        -webkit-animation-duration: 5s, 2500ms;
+        -webkit-animation-iteration-count: 10, infinite;
+        -webkit-animation-play-state: paused, running;
+        -webkit-animation-timing-function: linear, ease-in-out;
+        -webkit-animation-direction: normal, alternate;
+    }
+    @-webkit-keyframes anim1 {
+        from { left: 10px; }
+        to { left: 20px; }
+    }
+    @-webkit-keyframes anim2 {
+        from { width: 20px; }
+        to { width: 25px; }
+    }
+    @-webkit-keyframes anim3 {
+        from { left: 10px; }
+        to { left: 20px; }
+    }
+</style>
+<script src="../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="test1"></p>
+<p id="test2"></p>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("This tests computed style values from animation properties.");
+
+var test1 = document.getElementById("test1");
+var test2 = document.getElementById("test2");
+
+var test1Style = window.getComputedStyle(test1);
+var test2Style = window.getComputedStyle(test2);
+
+shouldBe("test1Style.webkitAnimationName", "'anim1'");
+shouldBe("test2Style.webkitAnimationName", "'anim2, anim3'");
+
+shouldBe("test1Style.webkitAnimationDuration", "'10s'");
+shouldBe("test2Style.webkitAnimationDuration", "'5s, 2.5s'");
+
+shouldBe("test1Style.webkitAnimationIterationCount", "'10'");
+shouldBe("test2Style.webkitAnimationIterationCount", "'10, infinite'");
+
+shouldBe("test1Style.webkitAnimationPlayState", "'paused'");
+shouldBe("test2Style.webkitAnimationPlayState", "'paused, running'");
+
+shouldBe("test1Style.webkitAnimationTimingFunction", "'cubic-bezier(0, 0, 1, 1)'");
+shouldBe("test2Style.webkitAnimationTimingFunction", "'cubic-bezier(0, 0, 1, 1), cubic-bezier(0.42, 0, 0.58, 1)'");
+
+shouldBe("test1Style.webkitAnimationDirection", "'normal'");
+shouldBe("test2Style.webkitAnimationDirection", "'normal, alternate'");
+
+debug("");
+successfullyParsed = true;
+
+</script>
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
index bad2e92..02ba105 100644 (file)
@@ -81,6 +81,13 @@ word-spacing: 0px;
 word-wrap: normal;
 z-index: auto;
 zoom: 1;
+-webkit-animation-delay: 0s;
+-webkit-animation-direction: normal;
+-webkit-animation-duration: 0s;
+-webkit-animation-iteration-count: 1;
+-webkit-animation-name: none;
+-webkit-animation-play-state: running;
+-webkit-animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
 -webkit-appearance: none;
 -webkit-background-clip: border;
 -webkit-background-composite: source-over;
@@ -136,8 +143,7 @@ zoom: 1;
 -webkit-text-stroke-color: rgb(0, 0, 0);
 -webkit-text-stroke-width: 0px;
 -webkit-transform: none;
--webkit-transform-origin-x: 392px;
--webkit-transform-origin-y: 288px;
+-webkit-transform-origin: 392px 288px;
 -webkit-transition-delay: 0s;
 -webkit-transition-duration: 0s;
 -webkit-transition-property: all;
index b43b975..9e30845 100644 (file)
@@ -80,6 +80,13 @@ Computed style of an element whose parent's 'display' value is 'none':
     word-wrap: normal
     z-index: auto
     zoom: 1
+    -webkit-animation-delay: 0s
+    -webkit-animation-direction: normal
+    -webkit-animation-duration: 0s
+    -webkit-animation-iteration-count: 1
+    -webkit-animation-name: none
+    -webkit-animation-play-state: running
+    -webkit-animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1)
     -webkit-appearance: none
     -webkit-background-clip: border
     -webkit-background-composite: source-over
@@ -135,8 +142,7 @@ Computed style of an element whose parent's 'display' value is 'none':
     -webkit-text-stroke-color: rgb(0, 0, 0)
     -webkit-text-stroke-width: 0px
     -webkit-transform: none
-    -webkit-transform-origin-x: 50%
-    -webkit-transform-origin-y: 50%
+    -webkit-transform-origin: 50% 50%
     -webkit-transition-delay: 0s
     -webkit-transition-duration: 0s
     -webkit-transition-property: all
index 32cf883..5cb611e 100644 (file)
@@ -160,6 +160,20 @@ rect: style.getPropertyValue(z-index) : auto
 rect: style.getPropertyCSSValue(z-index) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(zoom) : 1
 rect: style.getPropertyCSSValue(zoom) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-animation-delay) : 0s
+rect: style.getPropertyCSSValue(-webkit-animation-delay) : [object CSSValueList]
+rect: style.getPropertyValue(-webkit-animation-direction) : normal
+rect: style.getPropertyCSSValue(-webkit-animation-direction) : [object CSSValueList]
+rect: style.getPropertyValue(-webkit-animation-duration) : 0s
+rect: style.getPropertyCSSValue(-webkit-animation-duration) : [object CSSValueList]
+rect: style.getPropertyValue(-webkit-animation-iteration-count) : 1
+rect: style.getPropertyCSSValue(-webkit-animation-iteration-count) : [object CSSValueList]
+rect: style.getPropertyValue(-webkit-animation-name) : none
+rect: style.getPropertyCSSValue(-webkit-animation-name) : [object CSSValueList]
+rect: style.getPropertyValue(-webkit-animation-play-state) : running
+rect: style.getPropertyCSSValue(-webkit-animation-play-state) : [object CSSValueList]
+rect: style.getPropertyValue(-webkit-animation-timing-function) : cubic-bezier(0.25, 0.1, 0.25, 1)
+rect: style.getPropertyCSSValue(-webkit-animation-timing-function) : [object CSSValueList]
 rect: style.getPropertyValue(-webkit-appearance) : none
 rect: style.getPropertyCSSValue(-webkit-appearance) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-background-clip) : border
@@ -270,10 +284,8 @@ rect: style.getPropertyValue(-webkit-text-stroke-width) : 0px
 rect: style.getPropertyCSSValue(-webkit-text-stroke-width) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-transform) : none
 rect: style.getPropertyCSSValue(-webkit-transform) : [object CSSPrimitiveValue]
-rect: style.getPropertyValue(-webkit-transform-origin-x) : 0px
-rect: style.getPropertyCSSValue(-webkit-transform-origin-x) : [object CSSPrimitiveValue]
-rect: style.getPropertyValue(-webkit-transform-origin-y) : 0px
-rect: style.getPropertyCSSValue(-webkit-transform-origin-y) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-transform-origin) : 0px 0px
+rect: style.getPropertyCSSValue(-webkit-transform-origin) : [object CSSValueList]
 rect: style.getPropertyValue(-webkit-transition-delay) : 0s
 rect: style.getPropertyCSSValue(-webkit-transition-delay) : [object CSSValueList]
 rect: style.getPropertyValue(-webkit-transition-duration) : 0s
@@ -536,6 +548,20 @@ g: style.getPropertyValue(z-index) : auto
 g: style.getPropertyCSSValue(z-index) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(zoom) : 1
 g: style.getPropertyCSSValue(zoom) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-animation-delay) : 0s
+g: style.getPropertyCSSValue(-webkit-animation-delay) : [object CSSValueList]
+g: style.getPropertyValue(-webkit-animation-direction) : normal
+g: style.getPropertyCSSValue(-webkit-animation-direction) : [object CSSValueList]
+g: style.getPropertyValue(-webkit-animation-duration) : 0s
+g: style.getPropertyCSSValue(-webkit-animation-duration) : [object CSSValueList]
+g: style.getPropertyValue(-webkit-animation-iteration-count) : 1
+g: style.getPropertyCSSValue(-webkit-animation-iteration-count) : [object CSSValueList]
+g: style.getPropertyValue(-webkit-animation-name) : none
+g: style.getPropertyCSSValue(-webkit-animation-name) : [object CSSValueList]
+g: style.getPropertyValue(-webkit-animation-play-state) : running
+g: style.getPropertyCSSValue(-webkit-animation-play-state) : [object CSSValueList]
+g: style.getPropertyValue(-webkit-animation-timing-function) : cubic-bezier(0.25, 0.1, 0.25, 1)
+g: style.getPropertyCSSValue(-webkit-animation-timing-function) : [object CSSValueList]
 g: style.getPropertyValue(-webkit-appearance) : none
 g: style.getPropertyCSSValue(-webkit-appearance) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-background-clip) : border
@@ -646,10 +672,8 @@ g: style.getPropertyValue(-webkit-text-stroke-width) : 0px
 g: style.getPropertyCSSValue(-webkit-text-stroke-width) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-transform) : none
 g: style.getPropertyCSSValue(-webkit-transform) : [object CSSPrimitiveValue]
-g: style.getPropertyValue(-webkit-transform-origin-x) : 0px
-g: style.getPropertyCSSValue(-webkit-transform-origin-x) : [object CSSPrimitiveValue]
-g: style.getPropertyValue(-webkit-transform-origin-y) : 0px
-g: style.getPropertyCSSValue(-webkit-transform-origin-y) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-transform-origin) : 0px 0px
+g: style.getPropertyCSSValue(-webkit-transform-origin) : [object CSSValueList]
 g: style.getPropertyValue(-webkit-transition-delay) : 0s
 g: style.getPropertyCSSValue(-webkit-transition-delay) : [object CSSValueList]
 g: style.getPropertyValue(-webkit-transition-duration) : 0s
diff --git a/LayoutTests/transforms/computed-style-origin-expected.txt b/LayoutTests/transforms/computed-style-origin-expected.txt
new file mode 100644 (file)
index 0000000..516699f
--- /dev/null
@@ -0,0 +1,14 @@
+This tests computed style values for transform origin.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS test1Style.webkitTransformOrigin is '10px 10px'
+PASS test2Style.webkitTransformOrigin is '10px 10px'
+PASS test3Style.webkitTransformOrigin is '0px 20px'
+PASS test4Style.webkitTransformOrigin is '5px 7px'
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/transforms/computed-style-origin.html b/LayoutTests/transforms/computed-style-origin.html
new file mode 100644 (file)
index 0000000..bb6038b
--- /dev/null
@@ -0,0 +1,72 @@
+<html>
+<head>
+<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
+<style type="text/css" media="screen">
+    #test1 {
+        width: 20px;
+        height: 20px;
+        background-color: blue;
+        position: relative;
+        -webkit-transform: translate(0);
+        // default transform origin
+    }
+    #test2 {
+        width: 20px;
+        height: 20px;
+        background-color: blue;
+        position: relative;
+        -webkit-transform: translate(0);
+        -webkit-transform-origin: 50% 50%;
+    }
+    #test3 {
+        width: 20px;
+        height: 20px;
+        background-color: blue;
+        position: relative;
+        -webkit-transform: translate(0);
+        -webkit-transform-origin: 0% 100%;
+    }
+    #test4 {
+        width: 20px;
+        height: 20px;
+        background-color: blue;
+        position: relative;
+        -webkit-transform: translate(0);
+        -webkit-transform-origin: 5px 7px;
+    }
+</style>
+<script src="../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="test1"></p>
+<p id="test2"></p>
+<p id="test3"></p>
+<p id="test4"></p>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("This tests computed style values for transform origin.");
+
+var test1 = document.getElementById("test1");
+var test2 = document.getElementById("test2");
+var test3 = document.getElementById("test3");
+var test4 = document.getElementById("test4");
+
+var test1Style = window.getComputedStyle(test1);
+var test2Style = window.getComputedStyle(test2);
+var test3Style = window.getComputedStyle(test3);
+var test4Style = window.getComputedStyle(test4);
+
+shouldBe("test1Style.webkitTransformOrigin", "'10px 10px'");
+shouldBe("test2Style.webkitTransformOrigin", "'10px 10px'");
+shouldBe("test3Style.webkitTransformOrigin", "'0px 20px'");
+shouldBe("test4Style.webkitTransformOrigin", "'5px 7px'");
+
+debug("");
+successfullyParsed = true;
+
+</script>
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
index 0d864fc..ddfb01a 100644 (file)
@@ -1,3 +1,26 @@
+2008-11-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler
+
+        https://bugs.webkit.org/show_bug.cgi?id=20368
+
+        Implement getComputedStyle for animation properties. Remove individual
+        computed values for transform-origin-x, transform-origin-y, and just
+        return transform-origin instead. Return "none" for default animation-name,
+        and fix the initial value.
+        
+        Tests: animations/computed-style.html
+               transforms/computed-style-origin.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::):
+        (WebCore::getDelayValue):
+        (WebCore::getDurationValue):
+        (WebCore::getTimingFunctionValue):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * rendering/style/RenderStyle.h:
+        (WebCore::InheritedFlags::initialAnimationName):
+
 2008-11-20  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by Beth Dakin.
index c0f72ec..ac72ffa 100644 (file)
@@ -131,6 +131,13 @@ static const int computedProperties[] = {
     CSSPropertyZIndex,
     CSSPropertyZoom,
 
+    CSSPropertyWebkitAnimationDelay,
+    CSSPropertyWebkitAnimationDirection,
+    CSSPropertyWebkitAnimationDuration,
+    CSSPropertyWebkitAnimationIterationCount,
+    CSSPropertyWebkitAnimationName,
+    CSSPropertyWebkitAnimationPlayState,
+    CSSPropertyWebkitAnimationTimingFunction,
     CSSPropertyWebkitAppearance,
     CSSPropertyWebkitBackgroundClip,
     CSSPropertyWebkitBackgroundComposite,
@@ -186,8 +193,7 @@ static const int computedProperties[] = {
     CSSPropertyWebkitTextStrokeColor,
     CSSPropertyWebkitTextStrokeWidth,
     CSSPropertyWebkitTransform,
-    CSSPropertyWebkitTransformOriginX,
-    CSSPropertyWebkitTransformOriginY,
+    CSSPropertyWebkitTransformOrigin,
     CSSPropertyWebkitTransitionDelay,
     CSSPropertyWebkitTransitionDuration,
     CSSPropertyWebkitTransitionProperty,
@@ -417,6 +423,48 @@ static PassRefPtr<CSSValue> computedTransform(RenderObject* renderer)
     return list.release();
 }
 
+static PassRefPtr<CSSValue> getDelayValue(const AnimationList* animList)
+{
+    RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+    if (animList) {
+        for (size_t i = 0; i < animList->size(); ++i)
+            list->append(CSSPrimitiveValue::create(animList->animation(i)->delay(), CSSPrimitiveValue::CSS_S));
+    } else {
+        // Note that initialAnimationDelay() is used for both transitions and animations
+        list->append(CSSPrimitiveValue::create(RenderStyle::initialAnimationDelay(), CSSPrimitiveValue::CSS_S));
+    }
+    return list.release();
+}
+
+static PassRefPtr<CSSValue> getDurationValue(const AnimationList* animList)
+{
+    RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+    if (animList) {
+        for (size_t i = 0; i < animList->size(); ++i)
+            list->append(CSSPrimitiveValue::create(animList->animation(i)->duration(), CSSPrimitiveValue::CSS_S));
+    } else {
+        // Note that initialAnimationDuration() is used for both transitions and animations
+        list->append(CSSPrimitiveValue::create(RenderStyle::initialAnimationDuration(), CSSPrimitiveValue::CSS_S));
+    }
+    return list.release();
+}
+
+static PassRefPtr<CSSValue> getTimingFunctionValue(const AnimationList* animList)
+{
+    RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+    if (animList) {
+        for (size_t i = 0; i < animList->size(); ++i) {
+            const TimingFunction& tf = animList->animation(i)->timingFunction();
+            list->append(CSSTimingFunctionValue::create(tf.x1(), tf.y1(), tf.x2(), tf.y2()));
+        }
+    } else {
+        // Note that initialAnimationTimingFunction() is used for both transitions and animations
+        const TimingFunction& tf = RenderStyle::initialAnimationTimingFunction();
+        list->append(CSSTimingFunctionValue::create(tf.x1(), tf.y1(), tf.x2(), tf.y2()));
+    }
+    return list.release();
+}
+
 CSSComputedStyleDeclaration::CSSComputedStyleDeclaration(PassRefPtr<Node> n)
     : m_node(n)
 {
@@ -1003,6 +1051,67 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
             return CSSPrimitiveValue::create(firstRegion.release());
         }
 #endif
+        case CSSPropertyWebkitAnimationDelay:
+            return getDelayValue(style->animations());
+        case CSSPropertyWebkitAnimationDirection: {
+            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+            const AnimationList* t = style->animations();
+            if (t) {
+                for (size_t i = 0; i < t->size(); ++i) {
+                    if (t->animation(i)->direction())
+                        list->append(CSSPrimitiveValue::createIdentifier(CSSValueAlternate));
+                    else
+                        list->append(CSSPrimitiveValue::createIdentifier(CSSValueNormal));
+                }
+            } else
+                list->append(CSSPrimitiveValue::createIdentifier(CSSValueNormal));
+            return list.release();
+        }
+        case CSSPropertyWebkitAnimationDuration:
+            return getDurationValue(style->animations());
+        case CSSPropertyWebkitAnimationIterationCount: {
+            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+            const AnimationList* t = style->animations();
+            if (t) {
+                for (size_t i = 0; i < t->size(); ++i) {
+                    int iterationCount = t->animation(i)->iterationCount();
+                    if (iterationCount < 0)
+                        list->append(CSSPrimitiveValue::createIdentifier(CSSValueInfinite));
+                    else
+                        list->append(CSSPrimitiveValue::create(iterationCount, CSSPrimitiveValue::CSS_NUMBER));
+                }
+            } else
+                list->append(CSSPrimitiveValue::create(RenderStyle::initialAnimationIterationCount(), CSSPrimitiveValue::CSS_NUMBER));
+            return list.release();
+        }
+        case CSSPropertyWebkitAnimationName: {
+            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+            const AnimationList* t = style->animations();
+            if (t) {
+                for (size_t i = 0; i < t->size(); ++i) {
+                    list->append(CSSPrimitiveValue::create(t->animation(i)->name(), CSSPrimitiveValue::CSS_STRING));
+                }
+            } else
+                list->append(CSSPrimitiveValue::createIdentifier(CSSValueNone));
+            return list.release();
+        }
+        case CSSPropertyWebkitAnimationPlayState: {
+            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+            const AnimationList* t = style->animations();
+            if (t) {
+                for (size_t i = 0; i < t->size(); ++i) {
+                    int prop = t->animation(i)->playState();
+                    if (prop == AnimPlayStatePlaying)
+                        list->append(CSSPrimitiveValue::createIdentifier(CSSValueRunning));
+                    else
+                        list->append(CSSPrimitiveValue::createIdentifier(CSSValuePaused));
+                }
+            } else
+                list->append(CSSPrimitiveValue::createIdentifier(CSSValueRunning));
+            return list.release();
+        }
+        case CSSPropertyWebkitAnimationTimingFunction:
+            return getTimingFunctionValue(style->animations());
         case CSSPropertyWebkitAppearance:
             return CSSPrimitiveValue::create(style->appearance());
         case CSSPropertyWebkitBorderImage:
@@ -1046,77 +1155,43 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
         }
         case CSSPropertyWebkitTransform:
             return computedTransform(renderer);
-        case CSSPropertyWebkitTransformOriginX:
-            if (renderer) {
-                IntRect box = sizingBox(renderer);
-                return CSSPrimitiveValue::create(style->transformOriginX().calcMinValue(box.width()), CSSPrimitiveValue::CSS_PX);
-            }
-            else
-                return CSSPrimitiveValue::create(style->transformOriginX());
-        case CSSPropertyWebkitTransformOriginY:
+        case CSSPropertyWebkitTransformOrigin: {
+            RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
             if (renderer) {
                 IntRect box = sizingBox(renderer);
-                return CSSPrimitiveValue::create(style->transformOriginY().calcMinValue(box.height()), CSSPrimitiveValue::CSS_PX);
-            }
-            else
-                return CSSPrimitiveValue::create(style->transformOriginY());
-        case CSSPropertyWebkitTransitionDelay: {
-            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
-            const AnimationList* t = style->transitions();
-            if (t) {
-                for (size_t i = 0; i < t->size(); ++i)
-                    list->append(CSSPrimitiveValue::create(t->animation(i)->delay(), CSSPrimitiveValue::CSS_S));
-            }
-            else
-                list->append(CSSPrimitiveValue::create(RenderStyle::initialAnimationDelay(), CSSPrimitiveValue::CSS_S));
-            return list.release();
-        }
-        case CSSPropertyWebkitTransitionDuration: {
-            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
-            const AnimationList* t = style->transitions();
-            if (t) {
-                for (size_t i = 0; i < t->size(); ++i)
-                    list->append(CSSPrimitiveValue::create(t->animation(i)->duration(), CSSPrimitiveValue::CSS_S));
-            }
-            else
-                list->append(CSSPrimitiveValue::create(RenderStyle::initialAnimationDuration(), CSSPrimitiveValue::CSS_S));
-            return list.release();
-        }
-        case CSSPropertyWebkitTransitionTimingFunction: {
-            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
-            const AnimationList* t = style->transitions();
-            if (t) {
-                for (size_t i = 0; i < t->size(); ++i) {
-                    const TimingFunction& tf = t->animation(i)->timingFunction();
-                    list->append(CSSTimingFunctionValue::create(tf.x1(), tf.y1(), tf.x2(), tf.y2()));
-                }
-            }
-            else {
-                const TimingFunction& tf = RenderStyle::initialAnimationTimingFunction();
-                list->append(CSSTimingFunctionValue::create(tf.x1(), tf.y1(), tf.x2(), tf.y2()));
+                list->append(CSSPrimitiveValue::create(style->transformOriginX().calcMinValue(box.width()), CSSPrimitiveValue::CSS_PX));
+                list->append(CSSPrimitiveValue::create(style->transformOriginY().calcMinValue(box.height()), CSSPrimitiveValue::CSS_PX));
+            } else {
+                list->append(CSSPrimitiveValue::create(style->transformOriginX()));
+                list->append(CSSPrimitiveValue::create(style->transformOriginY()));
             }
             return list.release();
         }
+        case CSSPropertyWebkitTransitionDelay:
+            return getDelayValue(style->transitions());
+        case CSSPropertyWebkitTransitionDuration:
+            return getDurationValue(style->transitions());
         case CSSPropertyWebkitTransitionProperty: {
             RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
             const AnimationList* t = style->transitions();
             if (t) {
                 for (size_t i = 0; i < t->size(); ++i) {
                     int prop = t->animation(i)->property();
-                    const char* name;
+                    RefPtr<CSSValue> propertyValue;
                     if (prop == cAnimateNone)
-                        name = "none";
+                        propertyValue = CSSPrimitiveValue::createIdentifier(CSSValueNone);
                     else if (prop == cAnimateAll)
-                        name = "all";
+                        propertyValue = CSSPrimitiveValue::createIdentifier(CSSValueAll);
                     else
-                        name = getPropertyName(static_cast<CSSPropertyID>(prop));
-                    list->append(CSSPrimitiveValue::create(name, CSSPrimitiveValue::CSS_STRING));
+                        propertyValue = CSSPrimitiveValue::create(getPropertyName(static_cast<CSSPropertyID>(prop)), CSSPrimitiveValue::CSS_STRING);
+                    list->append(propertyValue);
                 }
-            }
-            else
-                list->append(CSSPrimitiveValue::create("all", CSSPrimitiveValue::CSS_STRING));
+            } else
+                list->append(CSSPrimitiveValue::createIdentifier(CSSValueAll));
             return list.release();
         }
+        case CSSPropertyWebkitTransitionTimingFunction:
+            return getTimingFunctionValue(style->transitions());
         case CSSPropertyBackground:
         case CSSPropertyBorder:
         case CSSPropertyBorderBottom:
@@ -1165,13 +1240,6 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
         case CSSPropertyTextUnderlineWidth:
         case CSSPropertyUnicodeRange: // Only used in @font-face rules.
         case CSSPropertyWebkitAnimation:
-        case CSSPropertyWebkitAnimationDelay:
-        case CSSPropertyWebkitAnimationDirection:
-        case CSSPropertyWebkitAnimationDuration:
-        case CSSPropertyWebkitAnimationIterationCount:
-        case CSSPropertyWebkitAnimationName:
-        case CSSPropertyWebkitAnimationPlayState:
-        case CSSPropertyWebkitAnimationTimingFunction:
         case CSSPropertyWebkitBorderRadius:
         case CSSPropertyWebkitColumns:
         case CSSPropertyWebkitColumnRule:
@@ -1182,7 +1250,6 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
         case CSSPropertyWebkitMask:
         case CSSPropertyWebkitPaddingStart:
         case CSSPropertyWebkitTextStroke:
-        case CSSPropertyWebkitTransformOrigin:
         case CSSPropertyWebkitTransition:
         case CSSPropertyWebkitVariableDeclarationBlock:
             // FIXME: The above are unimplemented.
index a97dea4..2f4cbce 100644 (file)
@@ -1109,7 +1109,7 @@ public:
     static bool initialAnimationDirection() { return false; }
     static double initialAnimationDuration() { return 0; }
     static int initialAnimationIterationCount() { return 1; }
-    static String initialAnimationName() { return String(); }
+    static String initialAnimationName() { return String("none"); }
     static unsigned initialAnimationPlayState() { return AnimPlayStatePlaying; }
     static int initialAnimationProperty() { return cAnimateAll; }
     static TimingFunction initialAnimationTimingFunction() { return TimingFunction(); }