⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 202950 in webkit


Ignore:
Timestamp:
Jul 7, 2016, 5:20:38 PM (10 years ago)
Author:
dino@apple.com
Message:

REGRESSION(r200769): animations are no longer overridden
https://bugs.webkit.org/show_bug.cgi?id=159450
<rdar://problem/27120570>

Reviewed by Zalan Bujtas.

Source/WebCore:

The change in r200769 removed a lot of the prefixing variant
handling, but unfortunately we can't be completely rid
of it until we alias the prefixed transitions and animations
to the non-prefixed form. For example, setting the prefixed
shorthand has to reset the non-prefixed longhands.

The fix was to explicitly call the variant forms when
parsing such longhands, and make sure that MutableStyleProperties
removes all prefixed variants when removing shorthands.

The existing test was amended to cover this case:
fast/css/shorthand-omitted-initial-value-overrides-shorthand.html

  • css/CSSParser.cpp:

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

  • css/CSSParser.h:
  • css/StyleProperties.cpp:

(WebCore::MutableStyleProperties::removeShorthandProperty):

LayoutTests:

Update an existing test to exercise a prefixed form applying
to non-prefixed longhands.

  • fast/css/shorthand-omitted-initial-value-overrides-shorthand-expected.txt:
  • fast/css/shorthand-omitted-initial-value-overrides-shorthand.html:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r202948 r202950  
     12016-07-07  Dean Jackson  <dino@apple.com>
     2
     3        REGRESSION(r200769): animations are no longer overridden
     4        https://bugs.webkit.org/show_bug.cgi?id=159450
     5        <rdar://problem/27120570>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Update an existing test to exercise a prefixed form applying
     10        to non-prefixed longhands.
     11
     12        * fast/css/shorthand-omitted-initial-value-overrides-shorthand-expected.txt:
     13        * fast/css/shorthand-omitted-initial-value-overrides-shorthand.html:
     14
    1152016-07-07  Myles C. Maxfield  <mmaxfield@apple.com>
    216
  • trunk/LayoutTests/fast/css/shorthand-omitted-initial-value-overrides-shorthand-expected.txt

    r200769 r202950  
    1010PASS transition-delay
    1111
     12Prefixed transition properties
     13PASS transition-property
     14PASS transition-property
     15PASS transition-property
     16PASS transition-property
     17
    1218Animation properties
    1319PASS animation-name
     
    2026PASS animation-fill-mode
    2127
     28Prefixed animation properties
     29PASS -webkit-animation-name
     30PASS animation-name
     31PASS -webkit-animation-name
     32PASS animation-name
     33
    2234PASS successfullyParsed is true
    2335
  • trunk/LayoutTests/fast/css/shorthand-omitted-initial-value-overrides-shorthand.html

    r200769 r202950  
    2525
    2626debug("");
     27debug("Prefixed transition properties");
     28testStyle("-webkit-transition-property: none; transition: 1s;", "transition-property", "all");
     29testStyle("-webkit-transition-property: none; -webkit-transition: 1s;", "transition-property", "all");
     30testStyle("transition-property: none; transition: 1s;", "transition-property", "all");
     31testStyle("transition-property: none; -webkit-transition: 1s;", "transition-property", "all");
     32
     33debug("");
    2734debug("Animation properties");
    2835testStyle("animation-name: foo; animation: 1s;", "animation-name", "none");
     
    3643
    3744debug("");
     45debug("Prefixed animation properties");
     46testStyle("-webkit-animation-name: foo; -webkit-animation: none;", "-webkit-animation-name", "none");
     47testStyle("-webkit-animation-name: foo; animation: none;", "animation-name", "none");
     48testStyle("animation-name: foo; -webkit-animation: none;", "-webkit-animation-name", "none");
     49testStyle("animation-name: foo; animation: none;", "animation-name", "none");
     50
     51debug("");
    3852successfullyParsed = true;
    3953
  • trunk/Source/WebCore/ChangeLog

    r202949 r202950  
     12016-07-07  Dean Jackson  <dino@apple.com>
     2
     3        REGRESSION(r200769): animations are no longer overridden
     4        https://bugs.webkit.org/show_bug.cgi?id=159450
     5        <rdar://problem/27120570>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        The change in r200769 removed a lot of the prefixing variant
     10        handling, but unfortunately we can't be completely rid
     11        of it until we alias the prefixed transitions and animations
     12        to the non-prefixed form. For example, setting the prefixed
     13        shorthand has to reset the non-prefixed longhands.
     14
     15        The fix was to explicitly call the variant forms when
     16        parsing such longhands, and make sure that MutableStyleProperties
     17        removes all prefixed variants when removing shorthands.
     18
     19        The existing test was amended to cover this case:
     20        fast/css/shorthand-omitted-initial-value-overrides-shorthand.html
     21
     22        * css/CSSParser.cpp:
     23        (WebCore::CSSParser::parseAnimationShorthand):
     24        (WebCore::CSSParser::addPropertyWithPrefixingVariant):
     25        (WebCore::CSSParser::parseTransitionShorthand):
     26        * css/CSSParser.h:
     27        * css/StyleProperties.cpp:
     28        (WebCore::MutableStyleProperties::removeShorthandProperty):
     29
    1302016-07-07  Alex Christensen  <achristensen@webkit.org>
    231
  • trunk/Source/WebCore/css/CSSParser.cpp

    r202765 r202950  
    38133813    }
    38143814
     3815    // Fill in any remaining properties with the initial value.
    38153816    for (i = 0; i < numProperties; ++i) {
    3816         // If we didn't find the property, set an intial value.
    38173817        if (!parsedProperty[i])
    38183818            addAnimationValue(values[i], cssValuePool.createImplicitInitialValue());
    3819 
    3820         addProperty(shorthand.properties()[i], WTFMove(values[i]), important);
    3821     }
     3819    }
     3820
     3821    // Now add all of the properties we found.
     3822    // In this case we have to explicitly set the variant form as well,
     3823    // to make sure that a shorthand clears all existing prefixed and
     3824    // unprefixed values.
     3825    for (i = 0; i < numProperties; ++i)
     3826        addPropertyWithPrefixingVariant(shorthand.properties()[i], WTFMove(values[i]), important);
    38223827
    38233828    return true;
    38243829}
     3830
     3831void CSSParser::addPropertyWithPrefixingVariant(CSSPropertyID propId, RefPtr<CSSValue>&& value, bool important, bool implicit)
     3832{
     3833    addProperty(propId, value.copyRef(), important, implicit);
     3834
     3835    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propId);
     3836    if (prefixingVariant == propId)
     3837        return;
     3838
     3839    if (m_currentShorthand) {
     3840        // We can't use ShorthandScope here as we can already be inside one (e.g we are parsing CSSTransition).
     3841        m_currentShorthand = prefixingVariantForPropertyId(m_currentShorthand);
     3842        addProperty(prefixingVariant, WTFMove(value), important, implicit);
     3843        m_currentShorthand = prefixingVariantForPropertyId(m_currentShorthand);
     3844    } else
     3845        addProperty(prefixingVariant, WTFMove(value), important, implicit);
     3846}
     3847
    38253848
    38263849RefPtr<CSSPrimitiveValue> CSSParser::parseColumnWidth()
     
    39513974
    39523975    // Now add all of the properties we found.
     3976    // In this case we have to explicitly set the variant form as well,
     3977    // to make sure that a shorthand clears all existing prefixed and
     3978    // unprefixed values.
    39533979    for (i = 0; i < numProperties; ++i)
    3954         addProperty(shorthand.properties()[i], WTFMove(values[i]), important);
     3980        addPropertyWithPrefixingVariant(shorthand.properties()[i], WTFMove(values[i]), important);
    39553981
    39563982    return true;
  • trunk/Source/WebCore/css/CSSParser.h

    r201875 r202950  
    150150    std::unique_ptr<MediaQuery> parseMediaQuery(const String&);
    151151
     152    void addPropertyWithPrefixingVariant(CSSPropertyID, RefPtr<CSSValue>&&, bool important, bool implicit = false);
    152153    void addProperty(CSSPropertyID, RefPtr<CSSValue>&&, bool important, bool implicit = false);
    153154    void rollbackLastProperties(int num);
  • trunk/Source/WebCore/css/StyleProperties.cpp

    r202242 r202950  
    640640    if (!shorthand.length())
    641641        return false;
    642     return removePropertiesInSet(shorthand.properties(), shorthand.length());
     642
     643    bool propertiesWereRemoved = removePropertiesInSet(shorthand.properties(), shorthand.length());
     644
     645    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propertyID);
     646    if (prefixingVariant == propertyID)
     647        return propertiesWereRemoved;
     648
     649    StylePropertyShorthand shorthandPrefixingVariant = shorthandForProperty(prefixingVariant);
     650    bool prefixedVariantPropertiesWereRemoved = removePropertiesInSet(shorthandPrefixingVariant.properties(), shorthandPrefixingVariant.length());
     651    return propertiesWereRemoved || prefixedVariantPropertiesWereRemoved;
    643652}
    644653
Note: See TracChangeset for help on using the changeset viewer.