Title: [200769] trunk
Revision
200769
Author
[email protected]
Date
2016-05-12 05:47:21 -0700 (Thu, 12 May 2016)

Log Message

Correctly handle prefixed and unprefixed variants in CSSStyleDeclaration
https://bugs.webkit.org/show_bug.cgi?id=157569
<rdar://problem/26223115>

Patch by Antoine Quint <[email protected]> on 2016-05-12
Reviewed by Dean Jackson.

Source/WebCore:

Tests: fast/css/prefixed-unprefixed-variant-style-declaration.html
       fast/css/shorthand-omitted-initial-value-overrides-shorthand.html

We essentially revert the code added with https://bugs.webkit.org/show_bug.cgi?id=110011
which duplicated properties that had a prefixed or unprefixed variant. What we do now is
to return the value of the prefixed or unprefixed variant through a CSSStyleDeclaration,
but only return the properties specified by the author when reading from the `cssText` property.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseTransitionShorthand):
(WebCore::CSSParser::addPropertyWithPrefixingVariant): Deleted.
* css/CSSParser.h:
Remove all code adding duplicated properties for the prefixed or unprefixed
variant of properties that exist in both forms.

* css/CSSPropertyNames.in:
Treat transition properties as we do animation properties.

* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
(WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
Make these two methods call into the matching getXXXInternal() variant instead
of going through the property set directly so that they would correctly pick up
on the prefixed or unprefixed variant should there be one when the specified property
is not specified directly.

(WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
(WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
We used to simply return the value for the given property from the property set, which
we still do but now also check if there is prefixed or unprefixed variant for the provided
property in case it was absent.

* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::removeShorthandProperty):
Remove all code adding duplicated properties for the prefixed or unprefixed
variant of properties that exist in both forms.

(WebCore::StyleProperties::asText):
Drive-by fix to also handle the animation-play-state and -webkit-animation-play-state properties
when serializing to the shorthand.

(WebCore::MutableStyleProperties::removeProperty): Deleted.
(WebCore::MutableStyleProperties::removePrefixedOrUnprefixedProperty): Deleted.
(WebCore::MutableStyleProperties::setProperty): Deleted.
(WebCore::getIndexInShorthandVectorForPrefixingVariant): Deleted.
(WebCore::MutableStyleProperties::appendPrefixingVariantProperty): Deleted.
(WebCore::MutableStyleProperties::setPrefixingVariantProperty): Deleted.
* css/StyleProperties.h:
Remove all code adding duplicated properties for the prefixed or unprefixed
variant of properties that exist in both forms.

LayoutTests:

* animations/fill-mode-forwards-zero-duration.html:
* animations/play-state-start-paused.html:
These two tests incorrectly expected a shorthand property not to reset
longhand properties that it covers to their initial values even if left
out of the shorthand.

* animations/unprefixed-properties-expected.txt:
* animations/unprefixed-properties.html:
This test incorrectly expected that setting an unprefixed property only would
lead to reading the prefixed property through the CSSOM return the empty string,
rather than the value set on the unprefixed property.

* fast/css/prefixed-unprefixed-variant-style-declaration-expected.txt: Added.
* fast/css/prefixed-unprefixed-variant-style-declaration.html: Added.
New test checking that setting one of two of a property's unprefixed and prefixed
variants correctly allows to read the style through the CSS OM for both variants,
while only serializing the property that was set through cssText.

* fast/css/shorthand-omitted-initial-value-overrides-shorthand-expected.txt: Added.
* fast/css/shorthand-omitted-initial-value-overrides-shorthand.html: Added.
New test checking that setting a longhand property and then the shorthand for that
longhand correctly resets the initial values, even if they were omitted in the shorthand.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (200768 => 200769)


--- trunk/LayoutTests/ChangeLog	2016-05-12 12:26:55 UTC (rev 200768)
+++ trunk/LayoutTests/ChangeLog	2016-05-12 12:47:21 UTC (rev 200769)
@@ -1,3 +1,34 @@
+2016-05-12  Antoine Quint  <[email protected]>
+
+        Correctly handle prefixed and unprefixed variants in CSSStyleDeclaration
+        https://bugs.webkit.org/show_bug.cgi?id=157569
+        <rdar://problem/26223115>
+
+        Reviewed by Dean Jackson.
+
+        * animations/fill-mode-forwards-zero-duration.html:
+        * animations/play-state-start-paused.html:
+        These two tests incorrectly expected a shorthand property not to reset
+        longhand properties that it covers to their initial values even if left
+        out of the shorthand.
+
+        * animations/unprefixed-properties-expected.txt:
+        * animations/unprefixed-properties.html:
+        This test incorrectly expected that setting an unprefixed property only would
+        lead to reading the prefixed property through the CSSOM return the empty string,
+        rather than the value set on the unprefixed property.
+
+        * fast/css/prefixed-unprefixed-variant-style-declaration-expected.txt: Added.
+        * fast/css/prefixed-unprefixed-variant-style-declaration.html: Added.
+        New test checking that setting one of two of a property's unprefixed and prefixed
+        variants correctly allows to read the style through the CSS OM for both variants,
+        while only serializing the property that was set through cssText.
+
+        * fast/css/shorthand-omitted-initial-value-overrides-shorthand-expected.txt: Added.
+        * fast/css/shorthand-omitted-initial-value-overrides-shorthand.html: Added.
+        New test checking that setting a longhand property and then the shorthand for that
+        longhand correctly resets the initial values, even if they were omitted in the shorthand.
+
 2016-05-12  Manuel Rego Casasnovas  <[email protected]>
 
         [css-grid] Incorrect parsing when using just 'span" as grid-line value

Modified: trunk/LayoutTests/animations/fill-mode-forwards-zero-duration.html (200768 => 200769)


--- trunk/LayoutTests/animations/fill-mode-forwards-zero-duration.html	2016-05-12 12:26:55 UTC (rev 200768)
+++ trunk/LayoutTests/animations/fill-mode-forwards-zero-duration.html	2016-05-12 12:47:21 UTC (rev 200769)
@@ -9,8 +9,7 @@
       height: 100px;
       width: 100px;
       background-color: blue;
-      animation-fill-mode: forwards;
-      animation: anim1 0 2s linear;
+      animation: anim1 0 2s linear forwards;
     }
     @keyframes anim1 {
         from { left: 400px; }

Modified: trunk/LayoutTests/animations/play-state-start-paused.html (200768 => 200769)


--- trunk/LayoutTests/animations/play-state-start-paused.html	2016-05-12 12:26:55 UTC (rev 200768)
+++ trunk/LayoutTests/animations/play-state-start-paused.html	2016-05-12 12:47:21 UTC (rev 200769)
@@ -13,8 +13,6 @@
             width: 100px;
             height: 100px;
             background-color: green;
-            animation-delay: -0.5s;
-            animation-play-state: paused;
         }
         
         /* For manual testing. */
@@ -23,11 +21,11 @@
         }
         
         .mover {
-            animation: move 1s linear;
+            animation: move 1s linear -0.5s paused;
         }
         
         .slider {
-            animation: slide 1s linear;
+            animation: slide 1s linear -0.5s paused;
         }
         
         @keyframes move {

Modified: trunk/LayoutTests/animations/unprefixed-properties-expected.txt (200768 => 200769)


--- trunk/LayoutTests/animations/unprefixed-properties-expected.txt	2016-05-12 12:26:55 UTC (rev 200768)
+++ trunk/LayoutTests/animations/unprefixed-properties-expected.txt	2016-05-12 12:47:21 UTC (rev 200769)
@@ -6,13 +6,13 @@
 
 Parsing - Basic animation-name : waldo
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-name') is 'waldo'
 PASS declaration.getPropertyValue('-webkit-animation-name') is 'waldo'
 
 Parsing - Multiple animation-names : waldo, wally
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-name') is 'waldo, wally'
 PASS declaration.getPropertyValue('-webkit-animation-name') is 'waldo, wally'
 PASS subRule.cssText is 'waldo'
@@ -20,13 +20,13 @@
 
 Parsing - Basic animation-duration : 5s
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-duration') is '5s'
 PASS declaration.getPropertyValue('-webkit-animation-duration') is '5s'
 
 Parsing - Multiple animation-durations : 10s, 20ms
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-duration') is '10s, 20ms'
 PASS declaration.getPropertyValue('-webkit-animation-duration') is '10s, 20ms'
 PASS subRule.cssText is '10s'
@@ -34,13 +34,13 @@
 
 Parsing - Basic animation-delay : 5s
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-delay') is '5s'
 PASS declaration.getPropertyValue('-webkit-animation-delay') is '5s'
 
 Parsing - Multiple animation-delays : 10s, 20ms
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-delay') is '10s, 20ms'
 PASS declaration.getPropertyValue('-webkit-animation-delay') is '10s, 20ms'
 PASS subRule.cssText is '10s'
@@ -48,19 +48,19 @@
 
 Parsing - Basic animation-timing-function : ease-in-out
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-timing-function') is 'ease-in-out'
 PASS declaration.getPropertyValue('-webkit-animation-timing-function') is 'ease-in-out'
 
 Parsing - animation-timing-function with bezier : cubic-bezier(0.2, 0.3, 0.4, 0.5)
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-timing-function') is 'cubic-bezier(0.2, 0.3, 0.4, 0.5)'
 PASS declaration.getPropertyValue('-webkit-animation-timing-function') is 'cubic-bezier(0.2, 0.3, 0.4, 0.5)'
 
 Parsing - Multiple animation-timing-functions : ease-in, ease-out
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-timing-function') is 'ease-in, ease-out'
 PASS declaration.getPropertyValue('-webkit-animation-timing-function') is 'ease-in, ease-out'
 PASS subRule.cssText is 'ease-in'
@@ -68,19 +68,19 @@
 
 Parsing - Basic animation-iteration-count : 4
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-iteration-count') is '4'
 PASS declaration.getPropertyValue('-webkit-animation-iteration-count') is '4'
 
 Parsing - animation-iteration-count with keyword : infinite
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-iteration-count') is 'infinite'
 PASS declaration.getPropertyValue('-webkit-animation-iteration-count') is 'infinite'
 
 Parsing - Multiple animation-iteration-counts : 2, infinite, 4
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-iteration-count') is '2, infinite, 4'
 PASS declaration.getPropertyValue('-webkit-animation-iteration-count') is '2, infinite, 4'
 PASS subRule.cssText is '2'
@@ -89,31 +89,31 @@
 
 Parsing - Normal animation-direction : normal
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-direction') is 'normal'
 PASS declaration.getPropertyValue('-webkit-animation-direction') is 'normal'
 
 Parsing - Alternate animation-direction : alternate
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-direction') is 'alternate'
 PASS declaration.getPropertyValue('-webkit-animation-direction') is 'alternate'
 
 Parsing - Reverse animation-direction : reverse
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-direction') is 'reverse'
 PASS declaration.getPropertyValue('-webkit-animation-direction') is 'reverse'
 
 Parsing - Alternate Reverse animation-direction : alternate-reverse
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-direction') is 'alternate-reverse'
 PASS declaration.getPropertyValue('-webkit-animation-direction') is 'alternate-reverse'
 
 Parsing - Multiple animation-directions : alternate, alternate, normal
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-direction') is 'alternate, alternate, normal'
 PASS declaration.getPropertyValue('-webkit-animation-direction') is 'alternate, alternate, normal'
 PASS subRule.cssText is 'alternate'
@@ -122,31 +122,31 @@
 
 Parsing - None animation-fill-mode : none
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-fill-mode') is 'none'
 PASS declaration.getPropertyValue('-webkit-animation-fill-mode') is 'none'
 
 Parsing - Forwards animation-fill-mode : forwards
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-fill-mode') is 'forwards'
 PASS declaration.getPropertyValue('-webkit-animation-fill-mode') is 'forwards'
 
 Parsing - Backwards animation-fill-mode : backwards
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-fill-mode') is 'backwards'
 PASS declaration.getPropertyValue('-webkit-animation-fill-mode') is 'backwards'
 
 Parsing - Both animation-fill-mode : both
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-fill-mode') is 'both'
 PASS declaration.getPropertyValue('-webkit-animation-fill-mode') is 'both'
 
 Parsing - Multiple animation-fill-modes : none, forwards, backwards, both
 PASS cssRule.type is 1
-PASS declaration.length is 2
+PASS declaration.length is 1
 PASS declaration.getPropertyValue('animation-fill-mode') is 'none, forwards, backwards, both'
 PASS declaration.getPropertyValue('-webkit-animation-fill-mode') is 'none, forwards, backwards, both'
 PASS subRule.cssText is 'none'

Modified: trunk/LayoutTests/animations/unprefixed-properties.html (200768 => 200769)


--- trunk/LayoutTests/animations/unprefixed-properties.html	2016-05-12 12:26:55 UTC (rev 200768)
+++ trunk/LayoutTests/animations/unprefixed-properties.html	2016-05-12 12:47:21 UTC (rev 200769)
@@ -27,7 +27,7 @@
     shouldBe("cssRule.type", "1");
 
     declaration = cssRule.style;
-    shouldBe("declaration.length", "2"); // We set both the prefixed and unprefixed version.
+    shouldBe("declaration.length", "1");
     shouldBe("declaration.getPropertyValue('" + property + "')", "'" + value + "'");
     shouldBe("declaration.getPropertyValue('-webkit-" + property + "')", "'" + value + "'");
 

Added: trunk/LayoutTests/fast/css/prefixed-unprefixed-variant-style-declaration-expected.txt (0 => 200769)


--- trunk/LayoutTests/fast/css/prefixed-unprefixed-variant-style-declaration-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/prefixed-unprefixed-variant-style-declaration-expected.txt	2016-05-12 12:47:21 UTC (rev 200769)
@@ -0,0 +1,369 @@
+Test the prefixed or the unprefixed variant of a property allows reading from the CSS OM with both the prefixed and unprefixed variant.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Setting "transition-property" to "width"
+PASS element.style.transitionProperty
+PASS element.style.webkitTransitionProperty
+PASS element.style.getPropertyValue("transition-property")
+PASS element.style.getPropertyValue("-webkit-transition-property")
+PASS element.style.getPropertyCSSValue("transition-property")
+PASS element.style.getPropertyCSSValue("-webkit-transition-property")
+PASS getComputedStyle(element).transitionProperty
+PASS getComputedStyle(element).webkitTransitionProperty
+PASS getComputedStyle(element).getPropertyValue("transition-property")
+PASS getComputedStyle(element).getPropertyValue("-webkit-transition-property")
+PASS getComputedStyle(element).getPropertyCSSValue("transition-property")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-property")
+PASS element.style.cssText
+
+Setting "-webkit-transition-property" to "width"
+PASS element.style.transitionProperty
+PASS element.style.webkitTransitionProperty
+PASS element.style.getPropertyValue("transition-property")
+PASS element.style.getPropertyValue("-webkit-transition-property")
+PASS element.style.getPropertyCSSValue("transition-property")
+PASS element.style.getPropertyCSSValue("-webkit-transition-property")
+PASS getComputedStyle(element).transitionProperty
+PASS getComputedStyle(element).webkitTransitionProperty
+PASS getComputedStyle(element).getPropertyValue("transition-property")
+PASS getComputedStyle(element).getPropertyValue("-webkit-transition-property")
+PASS getComputedStyle(element).getPropertyCSSValue("transition-property")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-property")
+PASS element.style.cssText
+
+Setting "transition-duration" to "1s"
+PASS element.style.transitionDuration
+PASS element.style.webkitTransitionDuration
+PASS element.style.getPropertyValue("transition-duration")
+PASS element.style.getPropertyValue("-webkit-transition-duration")
+PASS element.style.getPropertyCSSValue("transition-duration")
+PASS element.style.getPropertyCSSValue("-webkit-transition-duration")
+PASS getComputedStyle(element).transitionDuration
+PASS getComputedStyle(element).webkitTransitionDuration
+PASS getComputedStyle(element).getPropertyValue("transition-duration")
+PASS getComputedStyle(element).getPropertyValue("-webkit-transition-duration")
+PASS getComputedStyle(element).getPropertyCSSValue("transition-duration")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-duration")
+PASS element.style.cssText
+
+Setting "-webkit-transition-duration" to "1s"
+PASS element.style.transitionDuration
+PASS element.style.webkitTransitionDuration
+PASS element.style.getPropertyValue("transition-duration")
+PASS element.style.getPropertyValue("-webkit-transition-duration")
+PASS element.style.getPropertyCSSValue("transition-duration")
+PASS element.style.getPropertyCSSValue("-webkit-transition-duration")
+PASS getComputedStyle(element).transitionDuration
+PASS getComputedStyle(element).webkitTransitionDuration
+PASS getComputedStyle(element).getPropertyValue("transition-duration")
+PASS getComputedStyle(element).getPropertyValue("-webkit-transition-duration")
+PASS getComputedStyle(element).getPropertyCSSValue("transition-duration")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-duration")
+PASS element.style.cssText
+
+Setting "transition-timing-function" to "linear"
+PASS element.style.transitionTimingFunction
+PASS element.style.webkitTransitionTimingFunction
+PASS element.style.getPropertyValue("transition-timing-function")
+PASS element.style.getPropertyValue("-webkit-transition-timing-function")
+PASS element.style.getPropertyCSSValue("transition-timing-function")
+PASS element.style.getPropertyCSSValue("-webkit-transition-timing-function")
+PASS getComputedStyle(element).transitionTimingFunction
+PASS getComputedStyle(element).webkitTransitionTimingFunction
+PASS getComputedStyle(element).getPropertyValue("transition-timing-function")
+PASS getComputedStyle(element).getPropertyValue("-webkit-transition-timing-function")
+PASS getComputedStyle(element).getPropertyCSSValue("transition-timing-function")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-timing-function")
+PASS element.style.cssText
+
+Setting "-webkit-transition-timing-function" to "linear"
+PASS element.style.transitionTimingFunction
+PASS element.style.webkitTransitionTimingFunction
+PASS element.style.getPropertyValue("transition-timing-function")
+PASS element.style.getPropertyValue("-webkit-transition-timing-function")
+PASS element.style.getPropertyCSSValue("transition-timing-function")
+PASS element.style.getPropertyCSSValue("-webkit-transition-timing-function")
+PASS getComputedStyle(element).transitionTimingFunction
+PASS getComputedStyle(element).webkitTransitionTimingFunction
+PASS getComputedStyle(element).getPropertyValue("transition-timing-function")
+PASS getComputedStyle(element).getPropertyValue("-webkit-transition-timing-function")
+PASS getComputedStyle(element).getPropertyCSSValue("transition-timing-function")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-timing-function")
+PASS element.style.cssText
+
+Setting "transition-delay" to "0.5s"
+PASS element.style.transitionDelay
+PASS element.style.webkitTransitionDelay
+PASS element.style.getPropertyValue("transition-delay")
+PASS element.style.getPropertyValue("-webkit-transition-delay")
+PASS element.style.getPropertyCSSValue("transition-delay")
+PASS element.style.getPropertyCSSValue("-webkit-transition-delay")
+PASS getComputedStyle(element).transitionDelay
+PASS getComputedStyle(element).webkitTransitionDelay
+PASS getComputedStyle(element).getPropertyValue("transition-delay")
+PASS getComputedStyle(element).getPropertyValue("-webkit-transition-delay")
+PASS getComputedStyle(element).getPropertyCSSValue("transition-delay")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-delay")
+PASS element.style.cssText
+
+Setting "-webkit-transition-delay" to "0.5s"
+PASS element.style.transitionDelay
+PASS element.style.webkitTransitionDelay
+PASS element.style.getPropertyValue("transition-delay")
+PASS element.style.getPropertyValue("-webkit-transition-delay")
+PASS element.style.getPropertyCSSValue("transition-delay")
+PASS element.style.getPropertyCSSValue("-webkit-transition-delay")
+PASS getComputedStyle(element).transitionDelay
+PASS getComputedStyle(element).webkitTransitionDelay
+PASS getComputedStyle(element).getPropertyValue("transition-delay")
+PASS getComputedStyle(element).getPropertyValue("-webkit-transition-delay")
+PASS getComputedStyle(element).getPropertyCSSValue("transition-delay")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-delay")
+PASS element.style.cssText
+
+Setting "animation-name" to "foo"
+PASS element.style.animationName
+PASS element.style.webkitAnimationName
+PASS element.style.getPropertyValue("animation-name")
+PASS element.style.getPropertyValue("-webkit-animation-name")
+PASS element.style.getPropertyCSSValue("animation-name")
+PASS element.style.getPropertyCSSValue("-webkit-animation-name")
+PASS getComputedStyle(element).animationName
+PASS getComputedStyle(element).webkitAnimationName
+PASS getComputedStyle(element).getPropertyValue("animation-name")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-name")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-name")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-name")
+PASS element.style.cssText
+
+Setting "-webkit-animation-name" to "foo"
+PASS element.style.animationName
+PASS element.style.webkitAnimationName
+PASS element.style.getPropertyValue("animation-name")
+PASS element.style.getPropertyValue("-webkit-animation-name")
+PASS element.style.getPropertyCSSValue("animation-name")
+PASS element.style.getPropertyCSSValue("-webkit-animation-name")
+PASS getComputedStyle(element).animationName
+PASS getComputedStyle(element).webkitAnimationName
+PASS getComputedStyle(element).getPropertyValue("animation-name")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-name")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-name")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-name")
+PASS element.style.cssText
+
+Setting "animation-duration" to "1s"
+PASS element.style.animationDuration
+PASS element.style.webkitAnimationDuration
+PASS element.style.getPropertyValue("animation-duration")
+PASS element.style.getPropertyValue("-webkit-animation-duration")
+PASS element.style.getPropertyCSSValue("animation-duration")
+PASS element.style.getPropertyCSSValue("-webkit-animation-duration")
+PASS getComputedStyle(element).animationDuration
+PASS getComputedStyle(element).webkitAnimationDuration
+PASS getComputedStyle(element).getPropertyValue("animation-duration")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-duration")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-duration")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-duration")
+PASS element.style.cssText
+
+Setting "-webkit-animation-duration" to "1s"
+PASS element.style.animationDuration
+PASS element.style.webkitAnimationDuration
+PASS element.style.getPropertyValue("animation-duration")
+PASS element.style.getPropertyValue("-webkit-animation-duration")
+PASS element.style.getPropertyCSSValue("animation-duration")
+PASS element.style.getPropertyCSSValue("-webkit-animation-duration")
+PASS getComputedStyle(element).animationDuration
+PASS getComputedStyle(element).webkitAnimationDuration
+PASS getComputedStyle(element).getPropertyValue("animation-duration")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-duration")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-duration")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-duration")
+PASS element.style.cssText
+
+Setting "animation-timing-function" to "linear"
+PASS element.style.animationTimingFunction
+PASS element.style.webkitAnimationTimingFunction
+PASS element.style.getPropertyValue("animation-timing-function")
+PASS element.style.getPropertyValue("-webkit-animation-timing-function")
+PASS element.style.getPropertyCSSValue("animation-timing-function")
+PASS element.style.getPropertyCSSValue("-webkit-animation-timing-function")
+PASS getComputedStyle(element).animationTimingFunction
+PASS getComputedStyle(element).webkitAnimationTimingFunction
+PASS getComputedStyle(element).getPropertyValue("animation-timing-function")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-timing-function")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-timing-function")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-timing-function")
+PASS element.style.cssText
+
+Setting "-webkit-animation-timing-function" to "linear"
+PASS element.style.animationTimingFunction
+PASS element.style.webkitAnimationTimingFunction
+PASS element.style.getPropertyValue("animation-timing-function")
+PASS element.style.getPropertyValue("-webkit-animation-timing-function")
+PASS element.style.getPropertyCSSValue("animation-timing-function")
+PASS element.style.getPropertyCSSValue("-webkit-animation-timing-function")
+PASS getComputedStyle(element).animationTimingFunction
+PASS getComputedStyle(element).webkitAnimationTimingFunction
+PASS getComputedStyle(element).getPropertyValue("animation-timing-function")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-timing-function")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-timing-function")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-timing-function")
+PASS element.style.cssText
+
+Setting "animation-iteration-count" to "5"
+PASS element.style.animationIterationCount
+PASS element.style.webkitAnimationIterationCount
+PASS element.style.getPropertyValue("animation-iteration-count")
+PASS element.style.getPropertyValue("-webkit-animation-iteration-count")
+PASS element.style.getPropertyCSSValue("animation-iteration-count")
+PASS element.style.getPropertyCSSValue("-webkit-animation-iteration-count")
+PASS getComputedStyle(element).animationIterationCount
+PASS getComputedStyle(element).webkitAnimationIterationCount
+PASS getComputedStyle(element).getPropertyValue("animation-iteration-count")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-iteration-count")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-iteration-count")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-iteration-count")
+PASS element.style.cssText
+
+Setting "-webkit-animation-iteration-count" to "5"
+PASS element.style.animationIterationCount
+PASS element.style.webkitAnimationIterationCount
+PASS element.style.getPropertyValue("animation-iteration-count")
+PASS element.style.getPropertyValue("-webkit-animation-iteration-count")
+PASS element.style.getPropertyCSSValue("animation-iteration-count")
+PASS element.style.getPropertyCSSValue("-webkit-animation-iteration-count")
+PASS getComputedStyle(element).animationIterationCount
+PASS getComputedStyle(element).webkitAnimationIterationCount
+PASS getComputedStyle(element).getPropertyValue("animation-iteration-count")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-iteration-count")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-iteration-count")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-iteration-count")
+PASS element.style.cssText
+
+Setting "animation-direction" to "reverse"
+PASS element.style.animationDirection
+PASS element.style.webkitAnimationDirection
+PASS element.style.getPropertyValue("animation-direction")
+PASS element.style.getPropertyValue("-webkit-animation-direction")
+PASS element.style.getPropertyCSSValue("animation-direction")
+PASS element.style.getPropertyCSSValue("-webkit-animation-direction")
+PASS getComputedStyle(element).animationDirection
+PASS getComputedStyle(element).webkitAnimationDirection
+PASS getComputedStyle(element).getPropertyValue("animation-direction")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-direction")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-direction")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-direction")
+PASS element.style.cssText
+
+Setting "-webkit-animation-direction" to "reverse"
+PASS element.style.animationDirection
+PASS element.style.webkitAnimationDirection
+PASS element.style.getPropertyValue("animation-direction")
+PASS element.style.getPropertyValue("-webkit-animation-direction")
+PASS element.style.getPropertyCSSValue("animation-direction")
+PASS element.style.getPropertyCSSValue("-webkit-animation-direction")
+PASS getComputedStyle(element).animationDirection
+PASS getComputedStyle(element).webkitAnimationDirection
+PASS getComputedStyle(element).getPropertyValue("animation-direction")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-direction")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-direction")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-direction")
+PASS element.style.cssText
+
+Setting "animation-play-state" to "paused"
+PASS element.style.animationPlayState
+PASS element.style.webkitAnimationPlayState
+PASS element.style.getPropertyValue("animation-play-state")
+PASS element.style.getPropertyValue("-webkit-animation-play-state")
+PASS element.style.getPropertyCSSValue("animation-play-state")
+PASS element.style.getPropertyCSSValue("-webkit-animation-play-state")
+PASS getComputedStyle(element).animationPlayState
+PASS getComputedStyle(element).webkitAnimationPlayState
+PASS getComputedStyle(element).getPropertyValue("animation-play-state")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-play-state")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-play-state")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-play-state")
+PASS element.style.cssText
+
+Setting "-webkit-animation-play-state" to "paused"
+PASS element.style.animationPlayState
+PASS element.style.webkitAnimationPlayState
+PASS element.style.getPropertyValue("animation-play-state")
+PASS element.style.getPropertyValue("-webkit-animation-play-state")
+PASS element.style.getPropertyCSSValue("animation-play-state")
+PASS element.style.getPropertyCSSValue("-webkit-animation-play-state")
+PASS getComputedStyle(element).animationPlayState
+PASS getComputedStyle(element).webkitAnimationPlayState
+PASS getComputedStyle(element).getPropertyValue("animation-play-state")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-play-state")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-play-state")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-play-state")
+PASS element.style.cssText
+
+Setting "animation-delay" to "0.5s"
+PASS element.style.animationDelay
+PASS element.style.webkitAnimationDelay
+PASS element.style.getPropertyValue("animation-delay")
+PASS element.style.getPropertyValue("-webkit-animation-delay")
+PASS element.style.getPropertyCSSValue("animation-delay")
+PASS element.style.getPropertyCSSValue("-webkit-animation-delay")
+PASS getComputedStyle(element).animationDelay
+PASS getComputedStyle(element).webkitAnimationDelay
+PASS getComputedStyle(element).getPropertyValue("animation-delay")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-delay")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-delay")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-delay")
+PASS element.style.cssText
+
+Setting "-webkit-animation-delay" to "0.5s"
+PASS element.style.animationDelay
+PASS element.style.webkitAnimationDelay
+PASS element.style.getPropertyValue("animation-delay")
+PASS element.style.getPropertyValue("-webkit-animation-delay")
+PASS element.style.getPropertyCSSValue("animation-delay")
+PASS element.style.getPropertyCSSValue("-webkit-animation-delay")
+PASS getComputedStyle(element).animationDelay
+PASS getComputedStyle(element).webkitAnimationDelay
+PASS getComputedStyle(element).getPropertyValue("animation-delay")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-delay")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-delay")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-delay")
+PASS element.style.cssText
+
+Setting "animation-fill-mode" to "forwards"
+PASS element.style.animationFillMode
+PASS element.style.webkitAnimationFillMode
+PASS element.style.getPropertyValue("animation-fill-mode")
+PASS element.style.getPropertyValue("-webkit-animation-fill-mode")
+PASS element.style.getPropertyCSSValue("animation-fill-mode")
+PASS element.style.getPropertyCSSValue("-webkit-animation-fill-mode")
+PASS getComputedStyle(element).animationFillMode
+PASS getComputedStyle(element).webkitAnimationFillMode
+PASS getComputedStyle(element).getPropertyValue("animation-fill-mode")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-fill-mode")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-fill-mode")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-fill-mode")
+PASS element.style.cssText
+
+Setting "-webkit-animation-fill-mode" to "forwards"
+PASS element.style.animationFillMode
+PASS element.style.webkitAnimationFillMode
+PASS element.style.getPropertyValue("animation-fill-mode")
+PASS element.style.getPropertyValue("-webkit-animation-fill-mode")
+PASS element.style.getPropertyCSSValue("animation-fill-mode")
+PASS element.style.getPropertyCSSValue("-webkit-animation-fill-mode")
+PASS getComputedStyle(element).animationFillMode
+PASS getComputedStyle(element).webkitAnimationFillMode
+PASS getComputedStyle(element).getPropertyValue("animation-fill-mode")
+PASS getComputedStyle(element).getPropertyValue("-webkit-animation-fill-mode")
+PASS getComputedStyle(element).getPropertyCSSValue("animation-fill-mode")
+PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-fill-mode")
+PASS element.style.cssText
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/css/prefixed-unprefixed-variant-style-declaration.html (0 => 200769)


--- trunk/LayoutTests/fast/css/prefixed-unprefixed-variant-style-declaration.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/prefixed-unprefixed-variant-style-declaration.html	2016-05-12 12:47:21 UTC (rev 200769)
@@ -0,0 +1,84 @@
+<script src=""
+<body>
+<script>
+
+description("Test the prefixed or the unprefixed variant of a property allows reading from the CSS OM with both the prefixed and unprefixed variant.");
+
+const PREFIX = "-webkit-";
+
+function testPropertyVariants(property, value) {
+
+    function accessorForProperty(property) {
+        var firstIndexToTranspose = property.indexOf(PREFIX) === 0 ? 2 : 1;
+        return property.split("-").map(function(component, index) {
+            if (index < firstIndexToTranspose)
+                return component;
+            return component.charAt(0).toUpperCase() + component.substr(1);
+        }).join("");
+    }
+
+    var accessor = accessorForProperty(property);
+    var prefixedProperty = PREFIX + property;
+    var prefixedAccessor = accessorForProperty(prefixedProperty);
+
+    testProperty(property, property, prefixedProperty, accessor, prefixedAccessor, value);
+    testProperty(prefixedProperty, property, prefixedProperty, accessor, prefixedAccessor, value);
+}
+
+function testProperty(propertyToSet, unprefixedProperty, prefixedProperty, unprefixedAccessor, prefixedAccessor, value) {
+
+    function test(message, actual, expected) {
+        expected = expected || value;
+        if (actual === expected)
+            testPassed(message);
+        else
+            testFailed(`expected ${message} to be "${expected}" but got "${actual}"`);
+    }
+
+    var element = document.body.appendChild(document.createElement("div"));
+    element.style.setProperty(propertyToSet, value);
+
+    debug(`Setting "${propertyToSet}" to "${value}"`);
+
+    var style = element.style;
+    test(`element.style.${unprefixedAccessor}`, style[unprefixedAccessor]);
+    test(`element.style.${prefixedAccessor}`, style[prefixedAccessor]);
+    test(`element.style.getPropertyValue("${unprefixedProperty}")`, style.getPropertyValue(unprefixedProperty));
+    test(`element.style.getPropertyValue("${prefixedProperty}")`, style.getPropertyValue(prefixedProperty));
+    test(`element.style.getPropertyCSSValue("${unprefixedProperty}")`, style.getPropertyCSSValue(unprefixedProperty).cssText);
+    test(`element.style.getPropertyCSSValue("${prefixedProperty}")`, style.getPropertyCSSValue(prefixedProperty).cssText);
+
+    var computedStyle = window.getComputedStyle(element);
+    test(`getComputedStyle(element).${unprefixedAccessor}`, computedStyle[unprefixedAccessor]);
+    test(`getComputedStyle(element).${prefixedAccessor}`, computedStyle[prefixedAccessor]);
+    test(`getComputedStyle(element).getPropertyValue("${unprefixedProperty}")`, computedStyle.getPropertyValue(unprefixedProperty));
+    test(`getComputedStyle(element).getPropertyValue("${prefixedProperty}")`, computedStyle.getPropertyValue(prefixedProperty));
+    test(`getComputedStyle(element).getPropertyCSSValue("${unprefixedProperty}")`, computedStyle.getPropertyCSSValue(unprefixedProperty).cssText);
+    test(`getComputedStyle(element).getPropertyCSSValue("${prefixedProperty}")`, computedStyle.getPropertyCSSValue(prefixedProperty).cssText);
+
+    test(`element.style.cssText`, element.style.cssText, `${propertyToSet}: ${value};`);
+
+    element.remove();
+
+    debug("");
+}
+
+testPropertyVariants("transition-property", "width");
+testPropertyVariants("transition-duration", "1s");
+testPropertyVariants("transition-timing-function", "linear");
+testPropertyVariants("transition-delay", "0.5s");
+
+testPropertyVariants("animation-name", "foo");
+testPropertyVariants("animation-duration", "1s");
+testPropertyVariants("animation-timing-function", "linear");
+testPropertyVariants("animation-iteration-count", "5");
+testPropertyVariants("animation-direction", "reverse");
+testPropertyVariants("animation-play-state", "paused");
+testPropertyVariants("animation-delay", "0.5s");
+testPropertyVariants("animation-fill-mode", "forwards");
+
+successfullyParsed = true;
+
+</script>
+<script src=""
+</body>
\ No newline at end of file

Added: trunk/LayoutTests/fast/css/shorthand-omitted-initial-value-overrides-shorthand-expected.txt (0 => 200769)


--- trunk/LayoutTests/fast/css/shorthand-omitted-initial-value-overrides-shorthand-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/shorthand-omitted-initial-value-overrides-shorthand-expected.txt	2016-05-12 12:47:21 UTC (rev 200769)
@@ -0,0 +1,25 @@
+Test that initial values implicitly set via a shorthand property override previously defined shorthand properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Transition properties
+PASS transition-property
+PASS transition-duration
+PASS transition-timing-function
+PASS transition-delay
+
+Animation properties
+PASS animation-name
+PASS animation-duration
+PASS animation-timing-function
+PASS animation-iteration-count
+PASS animation-direction
+PASS animation-play-state
+PASS animation-delay
+PASS animation-fill-mode
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/css/shorthand-omitted-initial-value-overrides-shorthand.html (0 => 200769)


--- trunk/LayoutTests/fast/css/shorthand-omitted-initial-value-overrides-shorthand.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/shorthand-omitted-initial-value-overrides-shorthand.html	2016-05-12 12:47:21 UTC (rev 200769)
@@ -0,0 +1,42 @@
+<script src=""
+<body>
+<script>
+
+description("Test that initial values implicitly set via a shorthand property override previously defined shorthand properties.");
+
+function testStyle(cssText, property, expected) {
+    var element = document.body.appendChild(document.createElement("div"));
+    element.setAttribute("style", cssText);
+
+    var actual = getComputedStyle(element).getPropertyValue(property);
+    if (actual === expected)
+        testPassed(property);
+    else
+        testFailed(`expected that setting "${cssText}" would compute ${property} to "${expected}" but got "${actual}"`);
+
+    element.remove();
+}
+
+debug("Transition properties");
+testStyle("transition-property: none; transition: 1s;", "transition-property", "all");
+testStyle("transition-duration: 1s; transition: none;", "transition-duration", "0s");
+testStyle("transition-timing-function: linear; transition: none;", "transition-timing-function", "ease");
+testStyle("transition-delay: 1s; transition: none;", "transition-delay", "0s");
+
+debug("");
+debug("Animation properties");
+testStyle("animation-name: foo; animation: 1s;", "animation-name", "none");
+testStyle("animation-duration: 1s; animation: none;", "animation-duration", "0s");
+testStyle("animation-timing-function: linear; animation: none;", "animation-timing-function", "ease");
+testStyle("animation-iteration-count: 5; animation: none;", "animation-iteration-count", "1");
+testStyle("animation-direction: reverse; animation: none;", "animation-direction", "normal");
+testStyle("animation-play-state: paused; animation: none;", "animation-play-state", "running");
+testStyle("animation-delay: 1s; animation: none;", "animation-delay", "0s");
+testStyle("animation-fill-mode: forwards; animation: none;", "animation-fill-mode", "none");
+
+debug("");
+successfullyParsed = true;
+
+</script>
+<script src=""
+</body>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (200768 => 200769)


--- trunk/Source/WebCore/ChangeLog	2016-05-12 12:26:55 UTC (rev 200768)
+++ trunk/Source/WebCore/ChangeLog	2016-05-12 12:47:21 UTC (rev 200769)
@@ -1,3 +1,63 @@
+2016-05-12  Antoine Quint  <[email protected]>
+
+        Correctly handle prefixed and unprefixed variants in CSSStyleDeclaration
+        https://bugs.webkit.org/show_bug.cgi?id=157569
+        <rdar://problem/26223115>
+
+        Reviewed by Dean Jackson.
+
+        Tests: fast/css/prefixed-unprefixed-variant-style-declaration.html
+               fast/css/shorthand-omitted-initial-value-overrides-shorthand.html
+
+        We essentially revert the code added with https://bugs.webkit.org/show_bug.cgi?id=110011
+        which duplicated properties that had a prefixed or unprefixed variant. What we do now is
+        to return the value of the prefixed or unprefixed variant through a CSSStyleDeclaration,
+        but only return the properties specified by the author when reading from the `cssText` property.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseTransitionShorthand):
+        (WebCore::CSSParser::addPropertyWithPrefixingVariant): Deleted.
+        * css/CSSParser.h:
+        Remove all code adding duplicated properties for the prefixed or unprefixed
+        variant of properties that exist in both forms.
+
+        * css/CSSPropertyNames.in:
+        Treat transition properties as we do animation properties. 
+
+        * css/PropertySetCSSStyleDeclaration.cpp:
+        (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
+        (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
+        Make these two methods call into the matching getXXXInternal() variant instead
+        of going through the property set directly so that they would correctly pick up
+        on the prefixed or unprefixed variant should there be one when the specified property
+        is not specified directly.
+
+        (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
+        (WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
+        We used to simply return the value for the given property from the property set, which
+        we still do but now also check if there is prefixed or unprefixed variant for the provided
+        property in case it was absent.
+
+        * css/StyleProperties.cpp:
+        (WebCore::MutableStyleProperties::removeShorthandProperty):
+        Remove all code adding duplicated properties for the prefixed or unprefixed
+        variant of properties that exist in both forms.
+
+        (WebCore::StyleProperties::asText):
+        Drive-by fix to also handle the animation-play-state and -webkit-animation-play-state properties
+        when serializing to the shorthand.
+
+        (WebCore::MutableStyleProperties::removeProperty): Deleted.
+        (WebCore::MutableStyleProperties::removePrefixedOrUnprefixedProperty): Deleted.
+        (WebCore::MutableStyleProperties::setProperty): Deleted.
+        (WebCore::getIndexInShorthandVectorForPrefixingVariant): Deleted.
+        (WebCore::MutableStyleProperties::appendPrefixingVariantProperty): Deleted.
+        (WebCore::MutableStyleProperties::setPrefixingVariantProperty): Deleted.
+        * css/StyleProperties.h:
+        Remove all code adding duplicated properties for the prefixed or unprefixed
+        variant of properties that exist in both forms.
+
 2016-05-12  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r200766.

Modified: trunk/Source/WebCore/css/CSSParser.cpp (200768 => 200769)


--- trunk/Source/WebCore/css/CSSParser.cpp	2016-05-12 12:26:55 UTC (rev 200768)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2016-05-12 12:47:21 UTC (rev 200769)
@@ -1637,24 +1637,6 @@
     return ImmutableStyleProperties::create(results.data(), results.size(), m_context.mode);
 }
 
-void CSSParser::addPropertyWithPrefixingVariant(CSSPropertyID propId, PassRefPtr<CSSValue> value, bool important, bool implicit)
-{
-    RefPtr<CSSValue> val = value.get();
-    addProperty(propId, value, important, implicit);
-
-    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propId);
-    if (prefixingVariant == propId)
-        return;
-
-    if (m_currentShorthand) {
-        // We can't use ShorthandScope here as we can already be inside one (e.g we are parsing CSSTransition).
-        m_currentShorthand = prefixingVariantForPropertyId(m_currentShorthand);
-        addProperty(prefixingVariant, val.release(), important, implicit);
-        m_currentShorthand = prefixingVariantForPropertyId(m_currentShorthand);
-    } else
-        addProperty(prefixingVariant, val.release(), important, implicit);
-}
-
 void CSSParser::addProperty(CSSPropertyID propId, PassRefPtr<CSSValue> value, bool important, bool implicit)
 {
     // This property doesn't belong to a shorthand or is a CSS variable (which will be resolved later).
@@ -2766,7 +2748,7 @@
         RefPtr<CSSValue> val;
         AnimationParseContext context;
         if (parseAnimationProperty(propId, val, context)) {
-            addPropertyWithPrefixingVariant(propId, val.release(), important);
+            addProperty(propId, val.release(), important);
             return true;
         }
         return false;
@@ -3995,7 +3977,7 @@
 
     // Now add all of the properties we found.
     for (i = 0; i < numProperties; ++i)
-        addPropertyWithPrefixingVariant(shorthand.properties()[i], values[i].release(), important);
+        addProperty(shorthand.properties()[i], values[i].release(), important);
 
     return true;
 }

Modified: trunk/Source/WebCore/css/CSSParser.h (200768 => 200769)


--- trunk/Source/WebCore/css/CSSParser.h	2016-05-12 12:26:55 UTC (rev 200768)
+++ trunk/Source/WebCore/css/CSSParser.h	2016-05-12 12:47:21 UTC (rev 200769)
@@ -132,7 +132,6 @@
     static Ref<ImmutableStyleProperties> parseInlineStyleDeclaration(const String&, Element*);
     std::unique_ptr<MediaQuery> parseMediaQuery(const String&);
 
-    void addPropertyWithPrefixingVariant(CSSPropertyID, PassRefPtr<CSSValue>, bool important, bool implicit = false);
     void addProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool important, bool implicit = false);
     void rollbackLastProperties(int num);
     bool hasProperties() const { return !m_parsedProperties.isEmpty(); }

Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (200768 => 200769)


--- trunk/Source/WebCore/css/CSSPropertyNames.in	2016-05-12 12:26:55 UTC (rev 200768)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in	2016-05-12 12:47:21 UTC (rev 200769)
@@ -348,10 +348,10 @@
 text-underline-width [SkipBuilder]
 top [Initial=initialOffset, Converter=LengthOrAuto]
 transition [Longhands=transition-property|transition-duration|transition-timing-function|transition-delay]
-transition-delay [SkipBuilder]
-transition-duration [SkipBuilder]
-transition-property [SkipBuilder]
-transition-timing-function [SkipBuilder]
+transition-delay [AnimationProperty, NameForMethods=Delay]
+transition-duration [AnimationProperty, NameForMethods=Duration]
+transition-property [AnimationProperty, NameForMethods=Property]
+transition-timing-function [AnimationProperty, NameForMethods=TimingFunction]
 
 unicode-bidi
 unicode-range [SkipBuilder]

Modified: trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp (200768 => 200769)


--- trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp	2016-05-12 12:26:55 UTC (rev 200768)
+++ trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp	2016-05-12 12:47:21 UTC (rev 200769)
@@ -171,7 +171,7 @@
     CSSPropertyID propertyID = cssPropertyID(propertyName);
     if (!propertyID)
         return nullptr;
-    return cloneAndCacheForCSSOM(m_propertySet->getPropertyCSSValue(propertyID).get());
+    return cloneAndCacheForCSSOM(getPropertyCSSValueInternal(propertyID).get());
 }
 
 String PropertySetCSSStyleDeclaration::getPropertyValue(const String& propertyName)
@@ -182,7 +182,7 @@
     CSSPropertyID propertyID = cssPropertyID(propertyName);
     if (!propertyID)
         return String();
-    return m_propertySet->getPropertyValue(propertyID);
+    return getPropertyValueInternal(propertyID);
 }
 
 String PropertySetCSSStyleDeclaration::getPropertyPriority(const String& propertyName)
@@ -264,12 +264,28 @@
 
 RefPtr<CSSValue> PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal(CSSPropertyID propertyID)
 {
-    return m_propertySet->getPropertyCSSValue(propertyID);
+    RefPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(propertyID);
+    if (value)
+        return value;
+
+    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propertyID);
+    if (prefixingVariant != propertyID)
+        return m_propertySet->getPropertyCSSValue(prefixingVariant);
+
+    return nullptr;
 }
 
 String PropertySetCSSStyleDeclaration::getPropertyValueInternal(CSSPropertyID propertyID)
-{ 
-    return m_propertySet->getPropertyValue(propertyID);
+{
+    String value = m_propertySet->getPropertyValue(propertyID);
+    if (!value.isEmpty())
+        return value;
+
+    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propertyID);
+    if (prefixingVariant != propertyID)
+        return m_propertySet->getPropertyValue(prefixingVariant);
+
+    return String();
 }
 
 bool PropertySetCSSStyleDeclaration::setPropertyInternal(CSSPropertyID propertyID, const String& value, bool important, ExceptionCode& ec)

Modified: trunk/Source/WebCore/css/StyleProperties.cpp (200768 => 200769)


--- trunk/Source/WebCore/css/StyleProperties.cpp	2016-05-12 12:26:55 UTC (rev 200768)
+++ trunk/Source/WebCore/css/StyleProperties.cpp	2016-05-12 12:47:21 UTC (rev 200769)
@@ -638,15 +638,7 @@
     StylePropertyShorthand shorthand = shorthandForProperty(propertyID);
     if (!shorthand.length())
         return false;
-
-    bool ret = removePropertiesInSet(shorthand.properties(), shorthand.length());
-
-    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propertyID);
-    if (prefixingVariant == propertyID)
-        return ret;
-
-    StylePropertyShorthand shorthandPrefixingVariant = shorthandForProperty(prefixingVariant);
-    return removePropertiesInSet(shorthandPrefixingVariant.properties(), shorthandPrefixingVariant.length());
+    return removePropertiesInSet(shorthand.properties(), shorthand.length());
 }
 
 bool MutableStyleProperties::removeProperty(CSSPropertyID propertyID, String* returnText)
@@ -672,8 +664,6 @@
     // and sweeping them when the vector grows too big.
     m_propertyVector.remove(foundPropertyIndex);
 
-    removePrefixedOrUnprefixedProperty(propertyID);
-
     return true;
 }
 
@@ -696,14 +686,6 @@
     return true;
 }
 
-void MutableStyleProperties::removePrefixedOrUnprefixedProperty(CSSPropertyID propertyID)
-{
-    int foundPropertyIndex = findPropertyIndex(prefixingVariantForPropertyId(propertyID));
-    if (foundPropertyIndex == -1)
-        return;
-    m_propertyVector.remove(foundPropertyIndex);
-}
-
 bool StyleProperties::propertyIsImportant(CSSPropertyID propertyID) const
 {
     int foundPropertyIndex = findPropertyIndex(propertyID);
@@ -801,42 +783,14 @@
                 return false;
 
             *toReplace = property;
-            setPrefixingVariantProperty(property);
             return true;
         }
     }
 
-    return appendPrefixingVariantProperty(property);
-}
-
-static unsigned getIndexInShorthandVectorForPrefixingVariant(const CSSProperty& property, CSSPropertyID prefixingVariant)
-{
-    if (!property.isSetFromShorthand())
-        return 0;
-
-    CSSPropertyID prefixedShorthand = prefixingVariantForPropertyId(property.shorthandID());
-    return indexOfShorthandForLonghand(prefixedShorthand, matchingShorthandsForLonghand(prefixingVariant));
-}
-
-bool MutableStyleProperties::appendPrefixingVariantProperty(const CSSProperty& property)
-{
     m_propertyVector.append(property);
-    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(property.id());
-    if (prefixingVariant == property.id())
-        return true;
-
-    m_propertyVector.append(CSSProperty(prefixingVariant, property.value(), property.isImportant(), property.isSetFromShorthand(), getIndexInShorthandVectorForPrefixingVariant(property, prefixingVariant), property.metadata().m_implicit));
     return true;
 }
 
-void MutableStyleProperties::setPrefixingVariantProperty(const CSSProperty& property)
-{
-    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(property.id());
-    CSSProperty* toReplace = findCSSPropertyWithID(prefixingVariant);
-    if (toReplace && prefixingVariant != property.id())
-        *toReplace = CSSProperty(prefixingVariant, property.value(), property.isImportant(), property.isSetFromShorthand(), getIndexInShorthandVectorForPrefixingVariant(property, prefixingVariant), property.metadata().m_implicit);
-}
-
 bool MutableStyleProperties::setProperty(CSSPropertyID propertyID, CSSValueID identifier, bool important)
 {
     return setProperty(CSSProperty(propertyID, CSSValuePool::singleton().createIdentifierValue(identifier), important));
@@ -925,6 +879,7 @@
             case CSSPropertyAnimationIterationCount:
             case CSSPropertyAnimationDirection:
             case CSSPropertyAnimationFillMode:
+            case CSSPropertyAnimationPlayState:
                 shorthandPropertyID = CSSPropertyAnimation;
                 break;
             case CSSPropertyBackgroundPositionX:
@@ -1024,6 +979,7 @@
             case CSSPropertyWebkitAnimationIterationCount:
             case CSSPropertyWebkitAnimationDirection:
             case CSSPropertyWebkitAnimationFillMode:
+            case CSSPropertyWebkitAnimationPlayState:
                 shorthandPropertyID = CSSPropertyWebkitAnimation;
                 break;
             case CSSPropertyFlexDirection:

Modified: trunk/Source/WebCore/css/StyleProperties.h (200768 => 200769)


--- trunk/Source/WebCore/css/StyleProperties.h	2016-05-12 12:26:55 UTC (rev 200768)
+++ trunk/Source/WebCore/css/StyleProperties.h	2016-05-12 12:47:21 UTC (rev 200769)
@@ -211,12 +211,9 @@
     // These do not. FIXME: This is too messy, we can do better.
     bool setProperty(CSSPropertyID, CSSValueID identifier, bool important = false);
     bool setProperty(CSSPropertyID, CSSPropertyID identifier, bool important = false);
-    bool appendPrefixingVariantProperty(const CSSProperty&);
-    void setPrefixingVariantProperty(const CSSProperty&);
     bool setProperty(const CSSProperty&, CSSProperty* slot = nullptr);
 
     bool removeProperty(CSSPropertyID, String* returnText = nullptr);
-    void removePrefixedOrUnprefixedProperty(CSSPropertyID);
     void removeBlockProperties();
     bool removePropertiesInSet(const CSSPropertyID* set, unsigned length);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to