Title: [139200] trunk
Revision
139200
Author
[email protected]
Date
2013-01-09 10:04:04 -0800 (Wed, 09 Jan 2013)

Log Message

Implement CSS computed style value for transition shorthand
https://bugs.webkit.org/show_bug.cgi?id=105035

Reviewed by Dean Jackson.

Source/WebCore:

Implement support for query the transition and webkit-transition
shorthand from the computed style.

Test: transitions/transitions-parsing.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTransitionPropertyValue): Factor the code to create the
correct value into a function to reuse it for the shorthand.
(WebCore::getTransitionPropertyValue):
(WebCore::createTimingFunctionValue): Little refactor, the intermediate
local variables are not needed.
(WebCore::getTimingFunctionValue):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

LayoutTests:

Uncomment existing tests to cover the new feature.

* transitions/transitions-parsing-expected.txt:
* transitions/transitions-parsing.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (139199 => 139200)


--- trunk/LayoutTests/ChangeLog	2013-01-09 17:41:10 UTC (rev 139199)
+++ trunk/LayoutTests/ChangeLog	2013-01-09 18:04:04 UTC (rev 139200)
@@ -1,3 +1,15 @@
+2013-01-09  Alexis Menard  <[email protected]>
+
+        Implement CSS computed style value for transition shorthand
+        https://bugs.webkit.org/show_bug.cgi?id=105035
+
+        Reviewed by Dean Jackson.
+
+        Uncomment existing tests to cover the new feature.
+
+        * transitions/transitions-parsing-expected.txt:
+        * transitions/transitions-parsing.html:
+
 2013-01-09  Shinya Kawanaka  <[email protected]>
 
         [Shadow DOM]: ShadowRoot wrong nodeName attribute

Modified: trunk/LayoutTests/transitions/transitions-parsing-expected.txt (139199 => 139200)


--- trunk/LayoutTests/transitions/transitions-parsing-expected.txt	2013-01-09 17:41:10 UTC (rev 139199)
+++ trunk/LayoutTests/transitions/transitions-parsing-expected.txt	2013-01-09 18:04:04 UTC (rev 139200)
@@ -299,6 +299,85 @@
 PASS computedStyle.transitionDelay is '0s'
 PASS style.webkitTransitionDelay is ''
 PASS computedStyle.webkitTransitionDelay is '0s'
+Valid transition shorthand values.
+PASS computedStyle.transition is 'all 0s ease 0s'
+PASS computedStyle.webkitTransition is 'all 0s ease 0s'
+PASS style.transition is 'none'
+PASS computedStyle.transition is 'none 0s ease 0s'
+PASS style.webkitTransition is 'none'
+PASS computedStyle.webkitTransition is 'none 0s ease 0s'
+PASS checkTransitionShorthandValue() is true
+PASS style.transition is 'none 20s'
+PASS computedStyle.transition is 'none 20s ease 0s'
+PASS style.webkitTransition is 'none 20s'
+PASS computedStyle.webkitTransition is 'none 20s ease 0s'
+PASS checkTransitionShorthandValue() is true
+PASS style.transition is 'none 20s ease-in'
+PASS computedStyle.transition is 'none 20s ease-in 0s'
+PASS style.webkitTransition is 'none 20s ease-in'
+PASS computedStyle.webkitTransition is 'none 20s ease-in 0s'
+PASS checkTransitionShorthandValue() is true
+PASS style.transition is 'opacity 20s ease-in'
+PASS computedStyle.transition is 'opacity 20s ease-in 0s'
+PASS style.webkitTransition is 'opacity 20s ease-in'
+PASS computedStyle.webkitTransition is 'opacity 20s ease-in 0s'
+PASS checkTransitionShorthandValue() is true
+PASS style.transition is 'opacity 20s ease-in 10s'
+PASS computedStyle.transition is 'opacity 20s ease-in 10s'
+PASS style.webkitTransition is 'opacity 20s ease-in 10s'
+PASS computedStyle.webkitTransition is 'opacity 20s ease-in 10s'
+PASS computedStyle.transitionDuration is '20s'
+PASS computedStyle.webkitTransitionDuration is '20s'
+PASS computedStyle.transitionDelay is '10s'
+PASS computedStyle.webkitTransitionDelay is '10s'
+PASS checkTransitionShorthandValue() is true
+PASS style.transition is 'opacity 20s ease-in 10s'
+PASS computedStyle.transition is 'opacity 20s ease-in 10s'
+PASS style.webkitTransition is 'opacity 20s ease-in 10s'
+PASS computedStyle.webkitTransition is 'opacity 20s ease-in 10s'
+PASS computedStyle.transitionDuration is '20s'
+PASS computedStyle.webkitTransitionDuration is '20s'
+PASS computedStyle.transitionDelay is '10s'
+PASS computedStyle.webkitTransitionDelay is '10s'
+PASS checkTransitionShorthandValue() is true
+PASS style.transition is 'opacity 20s ease-in 10s, width 10s cubic-bezier(0.32, 0, 1, 1) 20s'
+PASS computedStyle.transition is 'opacity 20s ease-in 10s, width 10s cubic-bezier(0.32, 0, 1, 1) 20s'
+PASS style.webkitTransition is 'opacity 20s ease-in 10s, width 10s cubic-bezier(0.32, 0, 1, 1) 20s'
+PASS computedStyle.webkitTransition is 'opacity 20s ease-in 10s, width 10s cubic-bezier(0.32, 0, 1, 1) 20s'
+PASS computedStyle.transitionDuration is '20s, 10s'
+PASS computedStyle.webkitTransitionDuration is '20s, 10s'
+PASS computedStyle.transitionDelay is '10s, 20s'
+PASS computedStyle.webkitTransitionDelay is '10s, 20s'
+PASS checkTransitionShorthandValue() is true
+Invalid transition shorthand values.
+PASS style.transition is ''
+PASS computedStyle.transition is 'all 0s ease 0s'
+PASS style.webkitTransition is ''
+PASS computedStyle.webkitTransition is 'all 0s ease 0s'
+PASS style.transition is ''
+PASS computedStyle.transition is 'all 0s ease 0s'
+PASS style.webkitTransition is ''
+PASS computedStyle.webkitTransition is 'all 0s ease 0s'
+PASS style.transition is ''
+PASS computedStyle.transition is 'all 0s ease 0s'
+PASS style.webkitTransition is ''
+PASS computedStyle.webkitTransition is 'all 0s ease 0s'
+PASS style.transition is ''
+PASS computedStyle.transition is 'all 0s ease 0s'
+PASS style.webkitTransition is ''
+PASS computedStyle.webkitTransition is 'all 0s ease 0s'
+PASS style.transition is ''
+PASS computedStyle.transition is 'all 0s ease 0s'
+PASS style.webkitTransition is ''
+PASS computedStyle.webkitTransition is 'all 0s ease 0s'
+PASS style.transition is ''
+PASS computedStyle.transition is 'all 0s ease 0s'
+PASS style.webkitTransition is ''
+PASS computedStyle.webkitTransition is 'all 0s ease 0s'
+PASS style.transition is ''
+PASS computedStyle.transition is 'all 0s ease 0s'
+PASS style.webkitTransition is ''
+PASS computedStyle.webkitTransition is 'all 0s ease 0s'
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/transitions/transitions-parsing.html (139199 => 139200)


--- trunk/LayoutTests/transitions/transitions-parsing.html	2013-01-09 17:41:10 UTC (rev 139199)
+++ trunk/LayoutTests/transitions/transitions-parsing.html	2013-01-09 18:04:04 UTC (rev 139200)
@@ -16,6 +16,14 @@
 style = e.style;
 computedStyle = window.getComputedStyle(e, null);
 
+// This function checks the return value of computedStyle.transition and verifies WebKit can parse it.
+function checkTransitionShorthandValue() {
+    var before = computedStyle.getPropertyValue('transition');
+    e.style.transition = '';
+    e.style.transition = before;
+    return (computedStyle.getPropertyValue('transition') == before);
+}
+
 debug("Valid transition-property values.");
 // Initial test.
 shouldBe("computedStyle.transitionProperty", "'all'");
@@ -496,114 +504,121 @@
 
 // Transition and -webkit-transition is not correctly implemented.
 // Tracked by https://bugs.webkit.org/show_bug.cgi?id=105035.
-/*debug("Valid transition shorthand values.");
+debug("Valid transition shorthand values.");
 style.transition = "";
 // Initial test.
-shouldBe("computedStyle.transition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
-shouldBe("computedStyle.webkitTransition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.transition", "'all 0s ease 0s'");
+shouldBe("computedStyle.webkitTransition", "'all 0s ease 0s'");
 
 style.transition = "none";
 shouldBe("style.transition", "'none'");
-shouldBe("computedStyle.transition", "'none 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.transition", "'none 0s ease 0s'");
 shouldBe("style.webkitTransition", "'none'");
-shouldBe("computedStyle.webkitTransition", "'none 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.webkitTransition", "'none 0s ease 0s'");
+shouldBe("checkTransitionShorthandValue()", "true");
 
 style.transition = "none 20s";
 shouldBe("style.transition", "'none 20s'");
-shouldBe("computedStyle.transition", "'none 20s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.transition", "'none 20s ease 0s'");
 shouldBe("style.webkitTransition", "'none 20s'");
-shouldBe("computedStyle.webkitTransition", "'none 20s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.webkitTransition", "'none 20s ease 0s'");
+shouldBe("checkTransitionShorthandValue()", "true");
 
 style.transition = "ease-in none 20s";
-shouldBe("style.transition", "'ease-in none 20s'");
-shouldBe("computedStyle.transition", "'none 20s cubic-bezier(0.42, 0, 1, 1) 0s'");
-shouldBe("style.webkitTransition", "'ease-in none 20s'");
-shouldBe("computedStyle.webkitTransition", "'none 20s cubic-bezier(0.42, 0, 1, 1) 0s'");
+shouldBe("style.transition", "'none 20s ease-in'");
+shouldBe("computedStyle.transition", "'none 20s ease-in 0s'");
+shouldBe("style.webkitTransition", "'none 20s ease-in'");
+shouldBe("computedStyle.webkitTransition", "'none 20s ease-in 0s'");
+shouldBe("checkTransitionShorthandValue()", "true");
 
 style.transition = "ease-in opacity 20s";
-shouldBe("style.transition", "'ease-in opacity 20s'");
-shouldBe("computedStyle.transition", "'opacity 20s cubic-bezier(0.42, 0, 1, 1) 0s'");
-shouldBe("style.webkitTransition", "'ease-in opacity 20s'");
-shouldBe("computedStyle.webkitTransition", "'opacity 20s cubic-bezier(0.42, 0, 1, 1) 0s'");
+shouldBe("style.transition", "'opacity 20s ease-in'");
+shouldBe("computedStyle.transition", "'opacity 20s ease-in 0s'");
+shouldBe("style.webkitTransition", "'opacity 20s ease-in'");
+shouldBe("computedStyle.webkitTransition", "'opacity 20s ease-in 0s'");
+shouldBe("checkTransitionShorthandValue()", "true");
 
 style.transition = "ease-in opacity 20s 10s";
-shouldBe("style.transition", "'ease-in opacity 20s 10s'");
-shouldBe("computedStyle.transition", "'opacity 20s cubic-bezier(0.42, 0, 1, 1) 10s'");
-shouldBe("style.webkitTransition", "'ease-in opacity 20s 10s'");
-shouldBe("computedStyle.webkitTransition", "'opacity 20s cubic-bezier(0.42, 0, 1, 1) 10s'");
+shouldBe("style.transition", "'opacity 20s ease-in 10s'");
+shouldBe("computedStyle.transition", "'opacity 20s ease-in 10s'");
+shouldBe("style.webkitTransition", "'opacity 20s ease-in 10s'");
+shouldBe("computedStyle.webkitTransition", "'opacity 20s ease-in 10s'");
 // Let's double check here the delay and duration. As stated in the spec the first value parsed
 // is assigned to the duration.
 shouldBe("computedStyle.transitionDuration", "'20s'");
 shouldBe("computedStyle.webkitTransitionDuration", "'20s'");
 shouldBe("computedStyle.transitionDelay", "'10s'");
 shouldBe("computedStyle.webkitTransitionDelay", "'10s'");
+shouldBe("checkTransitionShorthandValue()", "true");
 
 style.transition = "20s ease-in opacity 10s";
-shouldBe("style.transition", "'20s ease-in opacity 10s'");
-shouldBe("computedStyle.transition", "'opacity 20s cubic-bezier(0.42, 0, 1, 1) 10s'");
-shouldBe("style.webkitTransition", "'20s ease-in opacity 10s'");
-shouldBe("computedStyle.webkitTransition", "'opacity 20s cubic-bezier(0.42, 0, 1, 1) 10s'");
+shouldBe("style.transition", "'opacity 20s ease-in 10s'");
+shouldBe("computedStyle.transition", "'opacity 20s ease-in 10s'");
+shouldBe("style.webkitTransition", "'opacity 20s ease-in 10s'");
+shouldBe("computedStyle.webkitTransition", "'opacity 20s ease-in 10s'");
 shouldBe("computedStyle.transitionDuration", "'20s'");
 shouldBe("computedStyle.webkitTransitionDuration", "'20s'");
 shouldBe("computedStyle.transitionDelay", "'10s'");
 shouldBe("computedStyle.webkitTransitionDelay", "'10s'");
+shouldBe("checkTransitionShorthandValue()", "true");
 
 style.transition = "ease-in opacity 20s 10s, cubic-bezier(0.32, 0, 1, 1) 10s width 20s";
-shouldBe("style.transition", "'ease-in opacity 20s 10s, cubic-bezier(0.32, 0, 1, 1) 10s width 20s'");
-shouldBe("computedStyle.transition", "'opacity 20s cubic-bezier(0.42, 0, 1, 1) 10s, width 10s cubic-bezier(0.32, 0, 1, 1) 20s'");
-shouldBe("style.webkitTransition", "'ease-in opacity 20s 10s, cubic-bezier(0.32, 0, 1, 1) 10s width 20s'");
-shouldBe("computedStyle.webkitTransition", "'opacity 20s cubic-bezier(0.42, 0, 1, 1) 10s, width 10s cubic-bezier(0.32, 0, 1, 1) 20s'");
+shouldBe("style.transition", "'opacity 20s ease-in 10s, width 10s cubic-bezier(0.32, 0, 1, 1) 20s'");
+shouldBe("computedStyle.transition", "'opacity 20s ease-in 10s, width 10s cubic-bezier(0.32, 0, 1, 1) 20s'");
+shouldBe("style.webkitTransition", "'opacity 20s ease-in 10s, width 10s cubic-bezier(0.32, 0, 1, 1) 20s'");
+shouldBe("computedStyle.webkitTransition", "'opacity 20s ease-in 10s, width 10s cubic-bezier(0.32, 0, 1, 1) 20s'");
 // Let's double check here the delay and duration. As stated in the spec the first value parsed
 // is assigned to the duration.
 shouldBe("computedStyle.transitionDuration", "'20s, 10s'");
 shouldBe("computedStyle.webkitTransitionDuration", "'20s, 10s'");
 shouldBe("computedStyle.transitionDelay", "'10s, 20s'");
 shouldBe("computedStyle.webkitTransitionDelay", "'10s, 20s'");
+shouldBe("checkTransitionShorthandValue()", "true");
 
 debug("Invalid transition shorthand values.");
 style.transition = "";
 
 style.transition = "20";
 shouldBe("style.transition", "''");
-shouldBe("computedStyle.transition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.transition", "'all 0s ease 0s'");
 shouldBe("style.webkitTransition", "''");
-shouldBe("computedStyle.webkitTransition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.webkitTransition", "'all 0s ease 0s'");
 
 style.transition = "20, 20";
 shouldBe("style.transition", "''");
-shouldBe("computedStyle.transition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.transition", "'all 0s ease 0s'");
 shouldBe("style.webkitTransition", "''");
-shouldBe("computedStyle.webkitTransition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.webkitTransition", "'all 0s ease 0s'");
 
 style.transition = "widthFoo";
 shouldBe("style.transition", "''");
-shouldBe("computedStyle.transition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.transition", "'all 0s ease 0s'");
 shouldBe("style.webkitTransition", "''");
-shouldBe("computedStyle.webkitTransition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.webkitTransition", "'all 0s ease 0s'");
 
 style.transition = "all 30s width ease-in";
 shouldBe("style.transition", "''");
-shouldBe("computedStyle.transition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.transition", "'all 0s ease 0s'");
 shouldBe("style.webkitTransition", "''");
-shouldBe("computedStyle.webkitTransition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.webkitTransition", "'all 0s ease 0s'");
 
 style.transition = "all 30s ease-in 20px";
 shouldBe("style.transition", "''");
-shouldBe("computedStyle.transition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.transition", "'all 0s ease 0s'");
 shouldBe("style.webkitTransition", "''");
-shouldBe("computedStyle.webkitTransition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.webkitTransition", "'all 0s ease 0s'");
 
 style.transition = "all 30s ease-in 20s, 20px";
 shouldBe("style.transition", "''");
-shouldBe("computedStyle.transition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.transition", "'all 0s ease 0s'");
 shouldBe("style.webkitTransition", "''");
-shouldBe("computedStyle.webkitTransition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.webkitTransition", "'all 0s ease 0s'");
 
 style.transition = "all 30s ease-in 20s, step-start(2)";
 shouldBe("style.transition", "''");
-shouldBe("computedStyle.transition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");
+shouldBe("computedStyle.transition", "'all 0s ease 0s'");
 shouldBe("style.webkitTransition", "''");
-shouldBe("computedStyle.webkitTransition", "'all 0s cubic-bezier(0.25, 0.1, 0.25, 1) 0s'");*/
+shouldBe("computedStyle.webkitTransition", "'all 0s ease 0s'");
 
 document.body.removeChild(testContainer);
 </script>

Modified: trunk/Source/WebCore/ChangeLog (139199 => 139200)


--- trunk/Source/WebCore/ChangeLog	2013-01-09 17:41:10 UTC (rev 139199)
+++ trunk/Source/WebCore/ChangeLog	2013-01-09 18:04:04 UTC (rev 139200)
@@ -1,3 +1,24 @@
+2013-01-09  Alexis Menard  <[email protected]>
+
+        Implement CSS computed style value for transition shorthand
+        https://bugs.webkit.org/show_bug.cgi?id=105035
+
+        Reviewed by Dean Jackson.
+
+        Implement support for query the transition and webkit-transition
+        shorthand from the computed style.
+
+        Test: transitions/transitions-parsing.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::createTransitionPropertyValue): Factor the code to create the
+        correct value into a function to reuse it for the shorthand.
+        (WebCore::getTransitionPropertyValue):
+        (WebCore::createTimingFunctionValue): Little refactor, the intermediate
+        local variables are not needed.
+        (WebCore::getTimingFunctionValue):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+
 2013-01-09  Hajime Morrita  <[email protected]>
 
         Document::setActiveNode() should be Document::setActiveElement()

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (139199 => 139200)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2013-01-09 17:41:10 UTC (rev 139199)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2013-01-09 18:04:04 UTC (rev 139200)
@@ -1047,6 +1047,27 @@
 
     return cssValuePool().createValue(position.integerPosition(), CSSPrimitiveValue::CSS_NUMBER);
 }
+static PassRefPtr<CSSValue> createTransitionPropertyValue(const Animation* animation)
+{
+    RefPtr<CSSValue> propertyValue;
+    if (animation->animationMode() == Animation::AnimateNone)
+        propertyValue = cssValuePool().createIdentifierValue(CSSValueNone);
+    else if (animation->animationMode() == Animation::AnimateAll)
+        propertyValue = cssValuePool().createIdentifierValue(CSSValueAll);
+    else
+        propertyValue = cssValuePool().createValue(getPropertyNameString(animation->property()), CSSPrimitiveValue::CSS_STRING);
+    return propertyValue.release();
+}
+static PassRefPtr<CSSValue> getTransitionPropertyValue(const AnimationList* animList)
+{
+    RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+    if (animList) {
+        for (size_t i = 0; i < animList->size(); ++i)
+            list->append(createTransitionPropertyValue(animList->animation(i)));
+    } else
+        list->append(cssValuePool().createIdentifierValue(CSSValueAll));
+    return list.release();
+}
 
 static PassRefPtr<CSSValue> getDelayValue(const AnimationList* animList)
 {
@@ -1074,7 +1095,7 @@
     return list.release();
 }
 
-static PassRefPtr<CSSValue> createAnimationValue(const TimingFunction* timingFunction)
+static PassRefPtr<CSSValue> createTimingFunctionValue(const TimingFunction* timingFunction)
 {
     if (timingFunction->isCubicBezierTimingFunction()) {
         const CubicBezierTimingFunction* bezierTimingFunction = static_cast<const CubicBezierTimingFunction*>(timingFunction);
@@ -1114,15 +1135,11 @@
 {
     RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
     if (animList) {
-        for (size_t i = 0; i < animList->size(); ++i) {
-            RefPtr<TimingFunction> timingFunction = animList->animation(i)->timingFunction();
-            list->append(createAnimationValue(timingFunction.get()));
-        }
-    } else {
+        for (size_t i = 0; i < animList->size(); ++i)
+            list->append(createTimingFunctionValue(animList->animation(i)->timingFunction().get()));
+    } else
         // Note that initialAnimationTimingFunction() is used for both transitions and animations
-        RefPtr<TimingFunction> timingFunction = Animation::initialAnimationTimingFunction();
-        list->append(createAnimationValue(timingFunction.get()));
-    }
+        list->append(createTimingFunctionValue(Animation::initialAnimationTimingFunction().get()));
     return list.release();
 }
 
@@ -2469,27 +2486,34 @@
             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) {
-                    RefPtr<CSSValue> propertyValue;
-                    const Animation* animation = t->animation(i);
-                    if (animation->animationMode() == Animation::AnimateNone)
-                        propertyValue = cssValuePool().createIdentifierValue(CSSValueNone);
-                    else if (animation->animationMode() == Animation::AnimateAll)
-                        propertyValue = cssValuePool().createIdentifierValue(CSSValueAll);
-                    else
-                        propertyValue = cssValuePool().createValue(getPropertyNameString(animation->property()), CSSPrimitiveValue::CSS_STRING);
-                    list->append(propertyValue);
+        case CSSPropertyWebkitTransitionProperty:
+            return getTransitionPropertyValue(style->transitions());
+        case CSSPropertyWebkitTransitionTimingFunction:
+            return getTimingFunctionValue(style->transitions());
+        case CSSPropertyWebkitTransition: {
+            const AnimationList* animList = style->transitions();
+            if (animList) {
+                RefPtr<CSSValueList> transitionsList = CSSValueList::createCommaSeparated();
+                for (size_t i = 0; i < animList->size(); ++i) {
+                    RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+                    const Animation* animation = animList->animation(i);
+                    list->append(createTransitionPropertyValue(animation));
+                    list->append(cssValuePool().createValue(animation->duration(), CSSPrimitiveValue::CSS_S));
+                    list->append(createTimingFunctionValue(animation->timingFunction().get()));
+                    list->append(cssValuePool().createValue(animation->delay(), CSSPrimitiveValue::CSS_S));
+                    transitionsList->append(list);
                 }
-            } else
-                list->append(cssValuePool().createIdentifierValue(CSSValueAll));
+                return transitionsList.release();
+            }
+
+            RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+            // transition-property default value.
+            list->append(cssValuePool().createIdentifierValue(CSSValueAll));
+            list->append(cssValuePool().createValue(Animation::initialAnimationDuration(), CSSPrimitiveValue::CSS_S));
+            list->append(createTimingFunctionValue(Animation::initialAnimationTimingFunction().get()));
+            list->append(cssValuePool().createValue(Animation::initialAnimationDelay(), CSSPrimitiveValue::CSS_S));
             return list.release();
         }
-        case CSSPropertyWebkitTransitionTimingFunction:
-            return getTimingFunctionValue(style->transitions());
         case CSSPropertyPointerEvents:
             return cssValuePool().createValue(style->pointerEvents());
         case CSSPropertyWebkitColorCorrection:
@@ -2695,7 +2719,6 @@
         case CSSPropertyWebkitTransformOriginX:
         case CSSPropertyWebkitTransformOriginY:
         case CSSPropertyWebkitTransformOriginZ:
-        case CSSPropertyWebkitTransition:
 #if ENABLE(CSS_EXCLUSIONS)
         case CSSPropertyWebkitWrap:
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to