Changeset 204052 in webkit


Ignore:
Timestamp:
Aug 2, 2016 4:43:30 PM (8 years ago)
Author:
dino@apple.com
Message:

Reapply fixes for webkit.org/b/159450 and webkit.org/b/157569
https://bugs.webkit.org/show_bug.cgi?id=160474
<rdar://problem/27668170>

Reviewed by Simon Fraser.

The fixes are behaviour we want. They just caused a regression
on medium.com (reverted in http://trac.webkit.org/r203380).

Now that we've branched, revert the reversion (which itself
was a reversion), so we can fix the actual bug:
https://bugs.webkit.org/show_bug.cgi?id=160478

Source/WebCore:

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseAnimationShorthand):
(WebCore::CSSParser::addPropertyWithPrefixingVariant):
(WebCore::CSSParser::parseTransitionShorthand):

  • css/CSSPropertyNames.in:
  • css/PropertySetCSSStyleDeclaration.cpp:

(WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
(WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
(WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
(WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):

  • css/StyleProperties.cpp:

(WebCore::MutableStyleProperties::removeShorthandProperty):
(WebCore::StyleProperties::asText):
(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:

LayoutTests:

  • animations/fill-mode-forwards-zero-duration.html:
  • animations/play-state-start-paused.html:
  • animations/script-tests/spring-parsing.js:

(testSpring):

  • animations/spring-parsing-expected.txt:
  • animations/unprefixed-properties-expected.txt:
  • animations/unprefixed-properties.html:
  • fast/css/prefixed-unprefixed-variant-style-declaration-expected.txt:
  • fast/css/shorthand-omitted-initial-value-overrides-shorthand-expected.txt:
Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r204050 r204052  
     12016-08-02  Dean Jackson  <dino@apple.com>
     2
     3        Reapply fixes for webkit.org/b/159450 and webkit.org/b/157569
     4        https://bugs.webkit.org/show_bug.cgi?id=160474
     5        <rdar://problem/27668170>
     6
     7        Reviewed by Simon Fraser.
     8
     9        The fixes are behaviour we want. They just caused a regression
     10        on medium.com (reverted in http://trac.webkit.org/r203380).
     11
     12        Now that we've branched, revert the reversion (which itself
     13        was a reversion), so we can fix the actual bug:
     14        https://bugs.webkit.org/show_bug.cgi?id=160478
     15
     16        * animations/fill-mode-forwards-zero-duration.html:
     17        * animations/play-state-start-paused.html:
     18        * animations/script-tests/spring-parsing.js:
     19        (testSpring):
     20        * animations/spring-parsing-expected.txt:
     21        * animations/unprefixed-properties-expected.txt:
     22        * animations/unprefixed-properties.html:
     23        * fast/css/prefixed-unprefixed-variant-style-declaration-expected.txt:
     24        * fast/css/shorthand-omitted-initial-value-overrides-shorthand-expected.txt:
     25
    1262016-08-02  Eric Carlson  <eric.carlson@apple.com>
    227
  • trunk/LayoutTests/animations/fill-mode-forwards-zero-duration.html

    r203380 r204052  
    1010      width: 100px;
    1111      background-color: blue;
    12       animation-fill-mode: forwards;
    13       animation: anim1 0 2s linear;
     12      animation: anim1 0 2s linear forwards;
    1413    }
    1514    @keyframes anim1 {
  • trunk/LayoutTests/animations/play-state-start-paused.html

    r203380 r204052  
    1414            height: 100px;
    1515            background-color: green;
    16             animation-delay: -0.5s;
    17             animation-play-state: paused;
    1816        }
    1917       
     
    2422       
    2523        .mover {
    26             animation: move 1s linear;
     24            animation: move 1s linear -0.5s paused;
    2725        }
    2826       
    2927        .slider {
    30             animation: slide 1s linear;
     28            animation: slide 1s linear -0.5s paused;
    3129        }
    3230       
  • trunk/LayoutTests/animations/script-tests/spring-parsing.js

    r203380 r204052  
    3030    }
    3131
    32     shouldBe("declaration.length", "2");
     32    shouldBe("declaration.length", "1");
    3333    shouldBe("declaration.getPropertyValue('transition-timing-function')", "'" + expectedValue + "'");
    3434
  • trunk/LayoutTests/animations/spring-parsing-expected.txt

    r203380 r204052  
    1010Basic : spring(1 100 10 0)
    1111PASS cssRule.type is 1
    12 PASS declaration.length is 2
     12PASS declaration.length is 1
    1313PASS declaration.getPropertyValue('transition-timing-function') is 'spring(1 100 10 0)'
    1414PASS propertyValue.cssText is 'spring(1 100 10 0)'
     
    1616Negative Velocity : spring(1 100 10 -10)
    1717PASS cssRule.type is 1
    18 PASS declaration.length is 2
     18PASS declaration.length is 1
    1919PASS declaration.getPropertyValue('transition-timing-function') is 'spring(1 100 10 -10)'
    2020PASS propertyValue.cssText is 'spring(1 100 10 -10)'
     
    2222Positive Velocity : spring(1 100 10 10)
    2323PASS cssRule.type is 1
    24 PASS declaration.length is 2
     24PASS declaration.length is 1
    2525PASS declaration.getPropertyValue('transition-timing-function') is 'spring(1 100 10 10)'
    2626PASS propertyValue.cssText is 'spring(1 100 10 10)'
     
    2828Zero Damping : spring(1 100 0 10)
    2929PASS cssRule.type is 1
    30 PASS declaration.length is 2
     30PASS declaration.length is 1
    3131PASS declaration.getPropertyValue('transition-timing-function') is 'spring(1 100 0 10)'
    3232PASS propertyValue.cssText is 'spring(1 100 0 10)'
     
    3434Minimum Values : spring(1 1 0 -999999)
    3535PASS cssRule.type is 1
    36 PASS declaration.length is 2
     36PASS declaration.length is 1
    3737PASS declaration.getPropertyValue('transition-timing-function') is 'spring(1 1 0 -999999)'
    3838PASS propertyValue.cssText is 'spring(1 1 0 -999999)'
     
    4040Floating Point Values : spring(1.5 2.3 3.7 -1.8)
    4141PASS cssRule.type is 1
    42 PASS declaration.length is 2
     42PASS declaration.length is 1
    4343PASS declaration.getPropertyValue('transition-timing-function') is 'spring(1.5 2.3 3.7 -1.8)'
    4444PASS propertyValue.cssText is 'spring(1.5 2.3 3.7 -1.8)'
  • trunk/LayoutTests/animations/unprefixed-properties-expected.txt

    r203380 r204052  
    77Parsing - Basic animation-name : waldo
    88PASS cssRule.type is 1
    9 PASS declaration.length is 2
     9PASS declaration.length is 1
    1010PASS declaration.getPropertyValue('animation-name') is 'waldo'
    1111PASS declaration.getPropertyValue('-webkit-animation-name') is 'waldo'
     
    1313Parsing - Multiple animation-names : waldo, wally
    1414PASS cssRule.type is 1
    15 PASS declaration.length is 2
     15PASS declaration.length is 1
    1616PASS declaration.getPropertyValue('animation-name') is 'waldo, wally'
    1717PASS declaration.getPropertyValue('-webkit-animation-name') is 'waldo, wally'
     
    2121Parsing - Basic animation-duration : 5s
    2222PASS cssRule.type is 1
    23 PASS declaration.length is 2
     23PASS declaration.length is 1
    2424PASS declaration.getPropertyValue('animation-duration') is '5s'
    2525PASS declaration.getPropertyValue('-webkit-animation-duration') is '5s'
     
    2727Parsing - Multiple animation-durations : 10s, 20ms
    2828PASS cssRule.type is 1
    29 PASS declaration.length is 2
     29PASS declaration.length is 1
    3030PASS declaration.getPropertyValue('animation-duration') is '10s, 20ms'
    3131PASS declaration.getPropertyValue('-webkit-animation-duration') is '10s, 20ms'
     
    3535Parsing - Basic animation-delay : 5s
    3636PASS cssRule.type is 1
    37 PASS declaration.length is 2
     37PASS declaration.length is 1
    3838PASS declaration.getPropertyValue('animation-delay') is '5s'
    3939PASS declaration.getPropertyValue('-webkit-animation-delay') is '5s'
     
    4141Parsing - Multiple animation-delays : 10s, 20ms
    4242PASS cssRule.type is 1
    43 PASS declaration.length is 2
     43PASS declaration.length is 1
    4444PASS declaration.getPropertyValue('animation-delay') is '10s, 20ms'
    4545PASS declaration.getPropertyValue('-webkit-animation-delay') is '10s, 20ms'
     
    4949Parsing - Basic animation-timing-function : ease-in-out
    5050PASS cssRule.type is 1
    51 PASS declaration.length is 2
     51PASS declaration.length is 1
    5252PASS declaration.getPropertyValue('animation-timing-function') is 'ease-in-out'
    5353PASS declaration.getPropertyValue('-webkit-animation-timing-function') is 'ease-in-out'
     
    5555Parsing - animation-timing-function with bezier : cubic-bezier(0.2, 0.3, 0.4, 0.5)
    5656PASS cssRule.type is 1
    57 PASS declaration.length is 2
     57PASS declaration.length is 1
    5858PASS declaration.getPropertyValue('animation-timing-function') is 'cubic-bezier(0.2, 0.3, 0.4, 0.5)'
    5959PASS declaration.getPropertyValue('-webkit-animation-timing-function') is 'cubic-bezier(0.2, 0.3, 0.4, 0.5)'
     
    6161Parsing - Multiple animation-timing-functions : ease-in, ease-out
    6262PASS cssRule.type is 1
    63 PASS declaration.length is 2
     63PASS declaration.length is 1
    6464PASS declaration.getPropertyValue('animation-timing-function') is 'ease-in, ease-out'
    6565PASS declaration.getPropertyValue('-webkit-animation-timing-function') is 'ease-in, ease-out'
     
    6969Parsing - Basic animation-iteration-count : 4
    7070PASS cssRule.type is 1
    71 PASS declaration.length is 2
     71PASS declaration.length is 1
    7272PASS declaration.getPropertyValue('animation-iteration-count') is '4'
    7373PASS declaration.getPropertyValue('-webkit-animation-iteration-count') is '4'
     
    7575Parsing - animation-iteration-count with keyword : infinite
    7676PASS cssRule.type is 1
    77 PASS declaration.length is 2
     77PASS declaration.length is 1
    7878PASS declaration.getPropertyValue('animation-iteration-count') is 'infinite'
    7979PASS declaration.getPropertyValue('-webkit-animation-iteration-count') is 'infinite'
     
    8181Parsing - Multiple animation-iteration-counts : 2, infinite, 4
    8282PASS cssRule.type is 1
    83 PASS declaration.length is 2
     83PASS declaration.length is 1
    8484PASS declaration.getPropertyValue('animation-iteration-count') is '2, infinite, 4'
    8585PASS declaration.getPropertyValue('-webkit-animation-iteration-count') is '2, infinite, 4'
     
    9090Parsing - Normal animation-direction : normal
    9191PASS cssRule.type is 1
    92 PASS declaration.length is 2
     92PASS declaration.length is 1
    9393PASS declaration.getPropertyValue('animation-direction') is 'normal'
    9494PASS declaration.getPropertyValue('-webkit-animation-direction') is 'normal'
     
    9696Parsing - Alternate animation-direction : alternate
    9797PASS cssRule.type is 1
    98 PASS declaration.length is 2
     98PASS declaration.length is 1
    9999PASS declaration.getPropertyValue('animation-direction') is 'alternate'
    100100PASS declaration.getPropertyValue('-webkit-animation-direction') is 'alternate'
     
    102102Parsing - Reverse animation-direction : reverse
    103103PASS cssRule.type is 1
    104 PASS declaration.length is 2
     104PASS declaration.length is 1
    105105PASS declaration.getPropertyValue('animation-direction') is 'reverse'
    106106PASS declaration.getPropertyValue('-webkit-animation-direction') is 'reverse'
     
    108108Parsing - Alternate Reverse animation-direction : alternate-reverse
    109109PASS cssRule.type is 1
    110 PASS declaration.length is 2
     110PASS declaration.length is 1
    111111PASS declaration.getPropertyValue('animation-direction') is 'alternate-reverse'
    112112PASS declaration.getPropertyValue('-webkit-animation-direction') is 'alternate-reverse'
     
    114114Parsing - Multiple animation-directions : alternate, alternate, normal
    115115PASS cssRule.type is 1
    116 PASS declaration.length is 2
     116PASS declaration.length is 1
    117117PASS declaration.getPropertyValue('animation-direction') is 'alternate, alternate, normal'
    118118PASS declaration.getPropertyValue('-webkit-animation-direction') is 'alternate, alternate, normal'
     
    123123Parsing - None animation-fill-mode : none
    124124PASS cssRule.type is 1
    125 PASS declaration.length is 2
     125PASS declaration.length is 1
    126126PASS declaration.getPropertyValue('animation-fill-mode') is 'none'
    127127PASS declaration.getPropertyValue('-webkit-animation-fill-mode') is 'none'
     
    129129Parsing - Forwards animation-fill-mode : forwards
    130130PASS cssRule.type is 1
    131 PASS declaration.length is 2
     131PASS declaration.length is 1
    132132PASS declaration.getPropertyValue('animation-fill-mode') is 'forwards'
    133133PASS declaration.getPropertyValue('-webkit-animation-fill-mode') is 'forwards'
     
    135135Parsing - Backwards animation-fill-mode : backwards
    136136PASS cssRule.type is 1
    137 PASS declaration.length is 2
     137PASS declaration.length is 1
    138138PASS declaration.getPropertyValue('animation-fill-mode') is 'backwards'
    139139PASS declaration.getPropertyValue('-webkit-animation-fill-mode') is 'backwards'
     
    141141Parsing - Both animation-fill-mode : both
    142142PASS cssRule.type is 1
    143 PASS declaration.length is 2
     143PASS declaration.length is 1
    144144PASS declaration.getPropertyValue('animation-fill-mode') is 'both'
    145145PASS declaration.getPropertyValue('-webkit-animation-fill-mode') is 'both'
     
    147147Parsing - Multiple animation-fill-modes : none, forwards, backwards, both
    148148PASS cssRule.type is 1
    149 PASS declaration.length is 2
     149PASS declaration.length is 1
    150150PASS declaration.getPropertyValue('animation-fill-mode') is 'none, forwards, backwards, both'
    151151PASS declaration.getPropertyValue('-webkit-animation-fill-mode') is 'none, forwards, backwards, both'
  • trunk/LayoutTests/animations/unprefixed-properties.html

    r203380 r204052  
    2828
    2929    declaration = cssRule.style;
    30     shouldBe("declaration.length", "2"); // We set both the prefixed and unprefixed version.
     30    shouldBe("declaration.length", "1");
    3131    shouldBe("declaration.getPropertyValue('" + property + "')", "'" + value + "'");
    3232    shouldBe("declaration.getPropertyValue('-webkit-" + property + "')", "'" + value + "'");
  • trunk/LayoutTests/fast/css/prefixed-unprefixed-variant-style-declaration-expected.txt

    r203380 r204052  
    1717PASS getComputedStyle(element).getPropertyCSSValue("transition-property")
    1818PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-property")
    19 FAIL expected element.style.cssText to be "transition-property: width;" but got "transition-property: width; -webkit-transition-property: width;"
     19PASS element.style.cssText
    2020
    2121Setting "-webkit-transition-property" to "width"
     
    3232PASS getComputedStyle(element).getPropertyCSSValue("transition-property")
    3333PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-property")
    34 FAIL expected element.style.cssText to be "-webkit-transition-property: width;" but got "-webkit-transition-property: width; transition-property: width;"
     34PASS element.style.cssText
    3535
    3636Setting "transition-duration" to "1s"
     
    4747PASS getComputedStyle(element).getPropertyCSSValue("transition-duration")
    4848PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-duration")
    49 FAIL expected element.style.cssText to be "transition-duration: 1s;" but got "transition-duration: 1s; -webkit-transition-duration: 1s;"
     49PASS element.style.cssText
    5050
    5151Setting "-webkit-transition-duration" to "1s"
     
    6262PASS getComputedStyle(element).getPropertyCSSValue("transition-duration")
    6363PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-duration")
    64 FAIL expected element.style.cssText to be "-webkit-transition-duration: 1s;" but got "-webkit-transition-duration: 1s; transition-duration: 1s;"
     64PASS element.style.cssText
    6565
    6666Setting "transition-timing-function" to "linear"
     
    7777PASS getComputedStyle(element).getPropertyCSSValue("transition-timing-function")
    7878PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-timing-function")
    79 FAIL expected element.style.cssText to be "transition-timing-function: linear;" but got "transition-timing-function: linear; -webkit-transition-timing-function: linear;"
     79PASS element.style.cssText
    8080
    8181Setting "-webkit-transition-timing-function" to "linear"
     
    9292PASS getComputedStyle(element).getPropertyCSSValue("transition-timing-function")
    9393PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-timing-function")
    94 FAIL expected element.style.cssText to be "-webkit-transition-timing-function: linear;" but got "-webkit-transition-timing-function: linear; transition-timing-function: linear;"
     94PASS element.style.cssText
    9595
    9696Setting "transition-delay" to "0.5s"
     
    107107PASS getComputedStyle(element).getPropertyCSSValue("transition-delay")
    108108PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-delay")
    109 FAIL expected element.style.cssText to be "transition-delay: 0.5s;" but got "transition-delay: 0.5s; -webkit-transition-delay: 0.5s;"
     109PASS element.style.cssText
    110110
    111111Setting "-webkit-transition-delay" to "0.5s"
     
    122122PASS getComputedStyle(element).getPropertyCSSValue("transition-delay")
    123123PASS getComputedStyle(element).getPropertyCSSValue("-webkit-transition-delay")
    124 FAIL expected element.style.cssText to be "-webkit-transition-delay: 0.5s;" but got "-webkit-transition-delay: 0.5s; transition-delay: 0.5s;"
     124PASS element.style.cssText
    125125
    126126Setting "animation-name" to "foo"
     
    137137PASS getComputedStyle(element).getPropertyCSSValue("animation-name")
    138138PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-name")
    139 FAIL expected element.style.cssText to be "animation-name: foo;" but got "animation-name: foo; -webkit-animation-name: foo;"
     139PASS element.style.cssText
    140140
    141141Setting "-webkit-animation-name" to "foo"
     
    152152PASS getComputedStyle(element).getPropertyCSSValue("animation-name")
    153153PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-name")
    154 FAIL expected element.style.cssText to be "-webkit-animation-name: foo;" but got "-webkit-animation-name: foo; animation-name: foo;"
     154PASS element.style.cssText
    155155
    156156Setting "animation-duration" to "1s"
     
    167167PASS getComputedStyle(element).getPropertyCSSValue("animation-duration")
    168168PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-duration")
    169 FAIL expected element.style.cssText to be "animation-duration: 1s;" but got "animation-duration: 1s; -webkit-animation-duration: 1s;"
     169PASS element.style.cssText
    170170
    171171Setting "-webkit-animation-duration" to "1s"
     
    182182PASS getComputedStyle(element).getPropertyCSSValue("animation-duration")
    183183PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-duration")
    184 FAIL expected element.style.cssText to be "-webkit-animation-duration: 1s;" but got "-webkit-animation-duration: 1s; animation-duration: 1s;"
     184PASS element.style.cssText
    185185
    186186Setting "animation-timing-function" to "linear"
     
    197197PASS getComputedStyle(element).getPropertyCSSValue("animation-timing-function")
    198198PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-timing-function")
    199 FAIL expected element.style.cssText to be "animation-timing-function: linear;" but got "animation-timing-function: linear; -webkit-animation-timing-function: linear;"
     199PASS element.style.cssText
    200200
    201201Setting "-webkit-animation-timing-function" to "linear"
     
    212212PASS getComputedStyle(element).getPropertyCSSValue("animation-timing-function")
    213213PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-timing-function")
    214 FAIL expected element.style.cssText to be "-webkit-animation-timing-function: linear;" but got "-webkit-animation-timing-function: linear; animation-timing-function: linear;"
     214PASS element.style.cssText
    215215
    216216Setting "animation-iteration-count" to "5"
     
    227227PASS getComputedStyle(element).getPropertyCSSValue("animation-iteration-count")
    228228PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-iteration-count")
    229 FAIL expected element.style.cssText to be "animation-iteration-count: 5;" but got "animation-iteration-count: 5; -webkit-animation-iteration-count: 5;"
     229PASS element.style.cssText
    230230
    231231Setting "-webkit-animation-iteration-count" to "5"
     
    242242PASS getComputedStyle(element).getPropertyCSSValue("animation-iteration-count")
    243243PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-iteration-count")
    244 FAIL expected element.style.cssText to be "-webkit-animation-iteration-count: 5;" but got "-webkit-animation-iteration-count: 5; animation-iteration-count: 5;"
     244PASS element.style.cssText
    245245
    246246Setting "animation-direction" to "reverse"
     
    257257PASS getComputedStyle(element).getPropertyCSSValue("animation-direction")
    258258PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-direction")
    259 FAIL expected element.style.cssText to be "animation-direction: reverse;" but got "animation-direction: reverse; -webkit-animation-direction: reverse;"
     259PASS element.style.cssText
    260260
    261261Setting "-webkit-animation-direction" to "reverse"
     
    272272PASS getComputedStyle(element).getPropertyCSSValue("animation-direction")
    273273PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-direction")
    274 FAIL expected element.style.cssText to be "-webkit-animation-direction: reverse;" but got "-webkit-animation-direction: reverse; animation-direction: reverse;"
     274PASS element.style.cssText
    275275
    276276Setting "animation-play-state" to "paused"
     
    287287PASS getComputedStyle(element).getPropertyCSSValue("animation-play-state")
    288288PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-play-state")
    289 FAIL expected element.style.cssText to be "animation-play-state: paused;" but got "animation-play-state: paused; -webkit-animation-play-state: paused;"
     289PASS element.style.cssText
    290290
    291291Setting "-webkit-animation-play-state" to "paused"
     
    302302PASS getComputedStyle(element).getPropertyCSSValue("animation-play-state")
    303303PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-play-state")
    304 FAIL expected element.style.cssText to be "-webkit-animation-play-state: paused;" but got "-webkit-animation-play-state: paused; animation-play-state: paused;"
     304PASS element.style.cssText
    305305
    306306Setting "animation-delay" to "0.5s"
     
    317317PASS getComputedStyle(element).getPropertyCSSValue("animation-delay")
    318318PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-delay")
    319 FAIL expected element.style.cssText to be "animation-delay: 0.5s;" but got "animation-delay: 0.5s; -webkit-animation-delay: 0.5s;"
     319PASS element.style.cssText
    320320
    321321Setting "-webkit-animation-delay" to "0.5s"
     
    332332PASS getComputedStyle(element).getPropertyCSSValue("animation-delay")
    333333PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-delay")
    334 FAIL expected element.style.cssText to be "-webkit-animation-delay: 0.5s;" but got "-webkit-animation-delay: 0.5s; animation-delay: 0.5s;"
     334PASS element.style.cssText
    335335
    336336Setting "animation-fill-mode" to "forwards"
     
    347347PASS getComputedStyle(element).getPropertyCSSValue("animation-fill-mode")
    348348PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-fill-mode")
    349 FAIL expected element.style.cssText to be "animation-fill-mode: forwards;" but got "animation-fill-mode: forwards; -webkit-animation-fill-mode: forwards;"
     349PASS element.style.cssText
    350350
    351351Setting "-webkit-animation-fill-mode" to "forwards"
     
    362362PASS getComputedStyle(element).getPropertyCSSValue("animation-fill-mode")
    363363PASS getComputedStyle(element).getPropertyCSSValue("-webkit-animation-fill-mode")
    364 FAIL expected element.style.cssText to be "-webkit-animation-fill-mode: forwards;" but got "-webkit-animation-fill-mode: forwards; animation-fill-mode: forwards;"
     364PASS element.style.cssText
    365365
    366366PASS successfullyParsed is true
  • trunk/LayoutTests/fast/css/shorthand-omitted-initial-value-overrides-shorthand-expected.txt

    r203380 r204052  
    1717
    1818Animation properties
    19 FAIL expected that setting "animation-name: foo; animation: 1s;" would compute animation-name to "none" but got "foo"
    20 FAIL expected that setting "animation-duration: 1s; animation: none;" would compute animation-duration to "0s" but got "1s"
    21 FAIL expected that setting "animation-timing-function: linear; animation: none;" would compute animation-timing-function to "ease" but got "linear"
    22 FAIL expected that setting "animation-iteration-count: 5; animation: none;" would compute animation-iteration-count to "1" but got "5"
    23 FAIL expected that setting "animation-direction: reverse; animation: none;" would compute animation-direction to "normal" but got "reverse"
    24 FAIL expected that setting "animation-play-state: paused; animation: none;" would compute animation-play-state to "running" but got "paused"
    25 FAIL expected that setting "animation-delay: 1s; animation: none;" would compute animation-delay to "0s" but got "1s"
    26 FAIL expected that setting "animation-fill-mode: forwards; animation: none;" would compute animation-fill-mode to "none" but got "forwards"
     19PASS animation-name
     20PASS animation-duration
     21PASS animation-timing-function
     22PASS animation-iteration-count
     23PASS animation-direction
     24PASS animation-play-state
     25PASS animation-delay
     26PASS animation-fill-mode
    2727
    2828Prefixed animation properties
    2929PASS -webkit-animation-name
    30 FAIL expected that setting "-webkit-animation-name: foo; animation: none;" would compute animation-name to "none" but got "foo"
     30PASS animation-name
    3131PASS -webkit-animation-name
    32 FAIL expected that setting "animation-name: foo; animation: none;" would compute animation-name to "none" but got "foo"
     32PASS animation-name
    3333
    3434PASS successfullyParsed is true
  • trunk/Source/WebCore/ChangeLog

    r204050 r204052  
     12016-08-02  Dean Jackson  <dino@apple.com>
     2
     3        Reapply fixes for webkit.org/b/159450 and webkit.org/b/157569
     4        https://bugs.webkit.org/show_bug.cgi?id=160474
     5        <rdar://problem/27668170>
     6
     7        Reviewed by Simon Fraser.
     8
     9        The fixes are behaviour we want. They just caused a regression
     10        on medium.com (reverted in http://trac.webkit.org/r203380).
     11
     12        Now that we've branched, revert the reversion (which itself
     13        was a reversion), so we can fix the actual bug:
     14        https://bugs.webkit.org/show_bug.cgi?id=160478
     15
     16        * css/CSSParser.cpp:
     17        (WebCore::CSSParser::parseValue):
     18        (WebCore::CSSParser::parseAnimationShorthand):
     19        (WebCore::CSSParser::addPropertyWithPrefixingVariant):
     20        (WebCore::CSSParser::parseTransitionShorthand):
     21        * css/CSSPropertyNames.in:
     22        * css/PropertySetCSSStyleDeclaration.cpp:
     23        (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
     24        (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
     25        (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
     26        (WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
     27        * css/StyleProperties.cpp:
     28        (WebCore::MutableStyleProperties::removeShorthandProperty):
     29        (WebCore::StyleProperties::asText):
     30        (WebCore::MutableStyleProperties::removeProperty): Deleted.
     31        (WebCore::MutableStyleProperties::removePrefixedOrUnprefixedProperty): Deleted.
     32        (WebCore::MutableStyleProperties::setProperty): Deleted.
     33        (WebCore::getIndexInShorthandVectorForPrefixingVariant): Deleted.
     34        (WebCore::MutableStyleProperties::appendPrefixingVariantProperty): Deleted.
     35        (WebCore::MutableStyleProperties::setPrefixingVariantProperty): Deleted.
     36        * css/StyleProperties.h:
     37
    1382016-08-02  Eric Carlson  <eric.carlson@apple.com>
    239
  • trunk/Source/WebCore/css/CSSParser.cpp

    r204006 r204052  
    16061606}
    16071607
    1608 void CSSParser::addPropertyWithPrefixingVariant(CSSPropertyID propId, RefPtr<CSSValue>&& value, bool important, bool implicit)
    1609 {
    1610     addProperty(propId, value.copyRef(), important, implicit);
    1611 
    1612     CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propId);
    1613     if (prefixingVariant == propId)
    1614         return;
    1615 
    1616     if (m_currentShorthand) {
    1617         // We can't use ShorthandScope here as we can already be inside one (e.g we are parsing CSSTransition).
    1618         m_currentShorthand = prefixingVariantForPropertyId(m_currentShorthand);
    1619         addProperty(prefixingVariant, WTFMove(value), important, implicit);
    1620         m_currentShorthand = prefixingVariantForPropertyId(m_currentShorthand);
    1621     } else
    1622         addProperty(prefixingVariant, WTFMove(value), important, implicit);
    1623 }
    1624 
    16251608void CSSParser::addProperty(CSSPropertyID propId, RefPtr<CSSValue>&& value, bool important, bool implicit)
    16261609{
     
    27402723        AnimationParseContext context;
    27412724        if (parseAnimationProperty(propId, val, context)) {
    2742             addPropertyWithPrefixingVariant(propId, WTFMove(val), important);
     2725            addProperty(propId, WTFMove(val), important);
    27432726            return true;
    27442727        }
     
    38343817    }
    38353818
     3819    // Fill in any remaining properties with the initial value.
    38363820    for (i = 0; i < numProperties; ++i) {
    3837         // If we didn't find the property, set an intial value.
    38383821        if (!parsedProperty[i])
    38393822            addAnimationValue(values[i], cssValuePool.createImplicitInitialValue());
    3840 
    3841         addProperty(shorthand.properties()[i], WTFMove(values[i]), important);
    3842     }
     3823    }
     3824
     3825    // Now add all of the properties we found.
     3826    // In this case we have to explicitly set the variant form as well,
     3827    // to make sure that a shorthand clears all existing prefixed and
     3828    // unprefixed values.
     3829    for (i = 0; i < numProperties; ++i)
     3830        addPropertyWithPrefixingVariant(shorthand.properties()[i], WTFMove(values[i]), important);
    38433831
    38443832    return true;
    38453833}
     3834
     3835void CSSParser::addPropertyWithPrefixingVariant(CSSPropertyID propId, RefPtr<CSSValue>&& value, bool important, bool implicit)
     3836{
     3837    addProperty(propId, value.copyRef(), important, implicit);
     3838
     3839    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propId);
     3840    if (prefixingVariant == propId)
     3841        return;
     3842
     3843    if (m_currentShorthand) {
     3844        // We can't use ShorthandScope here as we can already be inside one (e.g we are parsing CSSTransition).
     3845        m_currentShorthand = prefixingVariantForPropertyId(m_currentShorthand);
     3846        addProperty(prefixingVariant, WTFMove(value), important, implicit);
     3847        m_currentShorthand = prefixingVariantForPropertyId(m_currentShorthand);
     3848    } else
     3849        addProperty(prefixingVariant, WTFMove(value), important, implicit);
     3850}
     3851
    38463852
    38473853RefPtr<CSSPrimitiveValue> CSSParser::parseColumnWidth()
     
    39723978
    39733979    // Now add all of the properties we found.
     3980    // In this case we have to explicitly set the variant form as well,
     3981    // to make sure that a shorthand clears all existing prefixed and
     3982    // unprefixed values.
    39743983    for (i = 0; i < numProperties; ++i)
    39753984        addPropertyWithPrefixingVariant(shorthand.properties()[i], WTFMove(values[i]), important);
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r203716 r204052  
    349349top [Initial=initialOffset, Converter=LengthOrAuto]
    350350transition [Longhands=transition-property|transition-duration|transition-timing-function|transition-delay]
    351 transition-delay [SkipBuilder]
    352 transition-duration [SkipBuilder]
    353 transition-property [SkipBuilder]
    354 transition-timing-function [SkipBuilder]
     351transition-delay [AnimationProperty, NameForMethods=Delay]
     352transition-duration [AnimationProperty, NameForMethods=Duration]
     353transition-property [AnimationProperty, NameForMethods=Property]
     354transition-timing-function [AnimationProperty, NameForMethods=TimingFunction]
    355355
    356356unicode-bidi
  • trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp

    r203437 r204052  
    173173    if (!propertyID)
    174174        return nullptr;
    175     return cloneAndCacheForCSSOM(m_propertySet->getPropertyCSSValue(propertyID).get());
     175    return cloneAndCacheForCSSOM(getPropertyCSSValueInternal(propertyID).get());
    176176}
    177177
     
    184184    if (!propertyID)
    185185        return String();
    186     return m_propertySet->getPropertyValue(propertyID);
     186    return getPropertyValueInternal(propertyID);
    187187}
    188188
     
    268268RefPtr<CSSValue> PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal(CSSPropertyID propertyID)
    269269{
    270     return m_propertySet->getPropertyCSSValue(propertyID);
     270    RefPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(propertyID);
     271    if (value)
     272        return value;
     273
     274    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propertyID);
     275    if (prefixingVariant != propertyID)
     276        return m_propertySet->getPropertyCSSValue(prefixingVariant);
     277
     278    return nullptr;
    271279}
    272280
    273281String PropertySetCSSStyleDeclaration::getPropertyValueInternal(CSSPropertyID propertyID)
    274 {
    275     return m_propertySet->getPropertyValue(propertyID);
     282{
     283    String value = m_propertySet->getPropertyValue(propertyID);
     284    if (!value.isEmpty())
     285        return value;
     286
     287    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propertyID);
     288    if (prefixingVariant != propertyID)
     289        return m_propertySet->getPropertyValue(prefixingVariant);
     290
     291    return String();
    276292}
    277293
  • trunk/Source/WebCore/css/StyleProperties.cpp

    r203460 r204052  
    641641        return false;
    642642
    643     bool ret = removePropertiesInSet(shorthand.properties(), shorthand.length());
     643    bool propertiesWereRemoved = removePropertiesInSet(shorthand.properties(), shorthand.length());
    644644
    645645    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propertyID);
    646646    if (prefixingVariant == propertyID)
    647         return ret;
     647        return propertiesWereRemoved;
    648648
    649649    StylePropertyShorthand shorthandPrefixingVariant = shorthandForProperty(prefixingVariant);
    650     return removePropertiesInSet(shorthandPrefixingVariant.properties(), shorthandPrefixingVariant.length());
     650    bool prefixedVariantPropertiesWereRemoved = removePropertiesInSet(shorthandPrefixingVariant.properties(), shorthandPrefixingVariant.length());
     651    return propertiesWereRemoved || prefixedVariantPropertiesWereRemoved;
    651652}
    652653
     
    674675    m_propertyVector.remove(foundPropertyIndex);
    675676
    676     removePrefixedOrUnprefixedProperty(propertyID);
    677 
    678677    return true;
    679678}
     
    696695
    697696    return true;
    698 }
    699 
    700 void MutableStyleProperties::removePrefixedOrUnprefixedProperty(CSSPropertyID propertyID)
    701 {
    702     int foundPropertyIndex = findPropertyIndex(prefixingVariantForPropertyId(propertyID));
    703     if (foundPropertyIndex == -1)
    704         return;
    705     m_propertyVector.remove(foundPropertyIndex);
    706697}
    707698
     
    802793
    803794            *toReplace = property;
    804             setPrefixingVariantProperty(property);
    805795            return true;
    806796        }
    807797    }
    808798
    809     return appendPrefixingVariantProperty(property);
    810 }
    811 
    812 static unsigned getIndexInShorthandVectorForPrefixingVariant(const CSSProperty& property, CSSPropertyID prefixingVariant)
    813 {
    814     if (!property.isSetFromShorthand())
    815         return 0;
    816 
    817     CSSPropertyID prefixedShorthand = prefixingVariantForPropertyId(property.shorthandID());
    818     return indexOfShorthandForLonghand(prefixedShorthand, matchingShorthandsForLonghand(prefixingVariant));
    819 }
    820 
    821 bool MutableStyleProperties::appendPrefixingVariantProperty(const CSSProperty& property)
    822 {
    823799    m_propertyVector.append(property);
    824     CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(property.id());
    825     if (prefixingVariant == property.id())
    826         return true;
    827 
    828     m_propertyVector.append(CSSProperty(prefixingVariant, property.value(), property.isImportant(), property.isSetFromShorthand(), getIndexInShorthandVectorForPrefixingVariant(property, prefixingVariant), property.metadata().m_implicit));
    829800    return true;
    830 }
    831 
    832 void MutableStyleProperties::setPrefixingVariantProperty(const CSSProperty& property)
    833 {
    834     CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(property.id());
    835     CSSProperty* toReplace = findCSSPropertyWithID(prefixingVariant);
    836     if (toReplace && prefixingVariant != property.id())
    837         *toReplace = CSSProperty(prefixingVariant, property.value(), property.isImportant(), property.isSetFromShorthand(), getIndexInShorthandVectorForPrefixingVariant(property, prefixingVariant), property.metadata().m_implicit);
    838801}
    839802
     
    921884            case CSSPropertyAnimationDirection:
    922885            case CSSPropertyAnimationFillMode:
     886            case CSSPropertyAnimationPlayState:
    923887                shorthandPropertyID = CSSPropertyAnimation;
    924888                break;
     
    1020984            case CSSPropertyWebkitAnimationDirection:
    1021985            case CSSPropertyWebkitAnimationFillMode:
     986            case CSSPropertyWebkitAnimationPlayState:
    1022987                shorthandPropertyID = CSSPropertyWebkitAnimation;
    1023988                break;
  • trunk/Source/WebCore/css/StyleProperties.h

    r203380 r204052  
    208208    bool setProperty(CSSPropertyID, CSSValueID identifier, bool important = false);
    209209    bool setProperty(CSSPropertyID, CSSPropertyID identifier, bool important = false);
    210     bool appendPrefixingVariantProperty(const CSSProperty&);
    211     void setPrefixingVariantProperty(const CSSProperty&);
    212210    bool setProperty(const CSSProperty&, CSSProperty* slot = nullptr);
    213211
    214212    bool removeProperty(CSSPropertyID, String* returnText = nullptr);
    215     void removePrefixedOrUnprefixedProperty(CSSPropertyID);
    216213    void removeBlockProperties();
    217214    bool removePropertiesInSet(const CSSPropertyID* set, unsigned length);
Note: See TracChangeset for help on using the changeset viewer.