Changeset 144626 in webkit


Ignore:
Timestamp:
Mar 4, 2013 7:09:04 AM (11 years ago)
Author:
alexis@webkit.org
Message:

transition properties can't be found in CSSStyleDeclaration
https://bugs.webkit.org/show_bug.cgi?id=110011

Reviewed by Antti Koivisto.

Source/WebCore:

The previous approach for handling the unprefixing was to alias the
unprefixed properties with the prefixed ones in CSSPropertyNames.in.
Unfortunately it will alias the properties in the parsing code which will just
identically parse the two versions. This means that when we populate StylePropertySet
we do not have information whether we just parsed the prefixed, the
unprefixed properties or we parsed both. The patch takes another
approach by creating two distinct sets of properties (unprefixed and
prefixed). Each properties have their own id and we now handle them in
the parsing code as disctints properties and add both versions to the
declared style. In order to avoid properties getting out of sync,
this patch adds few facilities to StylePropertySet to update the
prefixed and the unprefixed entries. Finally the style resolution
happens only for the prefixed version (to limit the size of this patch)
and the unprefixed versions are not resolved. This is to avoid creating
the animation objects twice for the resolved style.

Test : transitions/transitions-parsing.html

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

  • css/CSSParser.cpp:

(WebCore::CSSParser::addPropertyWithPrefixingVariant): Always add the
prefixed and the unprefixed property even if only one is specified.
(WebCore):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseTransitionShorthand): Add both prefixed and
unprefixed longhands to the declarated style.
(WebCore::CSSParser::parseAnimationProperty):

  • css/CSSParser.h:

(CSSParser):

  • css/CSSProperty.cpp:

(WebCore::CSSProperty::isInheritedProperty):

  • css/CSSProperty.h:

(WebCore:: prefixingVariantForPropertyId): This function takes a given
property id and returns its prefixed or unprefixed id if it exists. If
not it returns the same id.
(WebCore):

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

(WebCore::StylePropertySet::getPropertyValue):
(WebCore::StylePropertySet::removeShorthandProperty):
(WebCore::StylePropertySet::removeProperty):
(WebCore::StylePropertySet::removeProperty): Remove
also the prefixed or unprefixed shorthand if it exists.
(WebCore):
(WebCore::StylePropertySet::setProperty):
(WebCore::StylePropertySet:: appendPrefixingVariantProperty):
(WebCore::StylePropertySet::setPrefixingVariantProperty): If it
exists a unprefixed or prefixed counterpart of the property we're
trying to set, then we update the other one.
(WebCore::StylePropertySet::asText):
(WebCore::StylePropertySet::mergeAndOverrideOnConflict):

  • css/StylePropertySet.h:

(StylePropertySet):

  • css/StylePropertyShorthand.cpp:

(WebCore::transitionShorthand):
(WebCore):
(WebCore::shorthandForProperty): Define the transitions unprefixed
longhands.

  • css/StylePropertyShorthand.h:

(WebCore):

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::applyProperty): StyleBuilder will handle the
resolution and the creation of the animations for the style. As the
declarated style now contains declarations for the prefixed and
unprefixed property we do not want to resolve two times and create duplicate animations.
Therefore when we try to resolve the unprefixed version we just bail out.

LayoutTests:

Updated layout test to cover the bug.

  • transitions/transitions-parsing-expected.txt:
  • transitions/transitions-parsing.html:
Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r144624 r144626  
     12013-03-04  Alexis Menard  <alexis@webkit.org>
     2
     3        transition properties can't be found in CSSStyleDeclaration
     4        https://bugs.webkit.org/show_bug.cgi?id=110011
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Updated layout test to cover the bug.
     9
     10        * transitions/transitions-parsing-expected.txt:
     11        * transitions/transitions-parsing.html:
     12
    1132013-03-04  Antoine Quint  <graouts@apple.com>
    214
  • trunk/LayoutTests/transitions/transitions-parsing-expected.txt

    r143948 r144626  
    77PASS computedStyle.transitionProperty is 'all'
    88PASS computedStyle.webkitTransitionProperty is 'all'
     9PASS Object.keys(style).indexOf('transitionProperty') is not -1
     10PASS Object.keys(style).indexOf('webkitTransitionProperty') is not -1
    911PASS style.transitionProperty is 'none'
    1012PASS computedStyle.transitionProperty is 'none'
     
    99101PASS computedStyle.transitionDuration is '0s'
    100102PASS computedStyle.webkitTransitionDuration is '0s'
     103PASS Object.keys(style).indexOf('transitionDuration') is not -1
     104PASS Object.keys(style).indexOf('webkitTransitionDuration') is not -1
    101105PASS style.transitionDuration is '0s'
    102106PASS computedStyle.transitionDuration is '0s'
     
    147151PASS computedStyle.transitionTimingFunction is 'ease'
    148152PASS computedStyle.webkitTransitionTimingFunction is 'ease'
     153PASS Object.keys(style).indexOf('transitionTimingFunction') is not -1
     154PASS Object.keys(style).indexOf('webkitTransitionTimingFunction') is not -1
    149155PASS style.transitionTimingFunction is 'linear'
    150156PASS computedStyle.transitionTimingFunction is 'linear'
     
    291297PASS computedStyle.transitionDelay is '0s'
    292298PASS computedStyle.webkitTransitionDelay is '0s'
     299PASS Object.keys(style).indexOf('transitionDelay') is not -1
     300PASS Object.keys(style).indexOf('webkitTransitionDelay') is not -1
    293301PASS style.transitionDelay is '0s'
    294302PASS computedStyle.transitionDelay is '0s'
     
    339347PASS computedStyle.transition is 'all 0s ease 0s'
    340348PASS computedStyle.webkitTransition is 'all 0s ease 0s'
     349PASS Object.keys(style).indexOf('transition') is not -1
     350PASS Object.keys(style).indexOf('webkitTransition') is not -1
    341351PASS style.transition is 'none'
    342352PASS computedStyle.transition is 'none 0s ease 0s'
  • trunk/LayoutTests/transitions/transitions-parsing.html

    r143948 r144626  
    3131
    3232style.transitionProperty = "none";
     33shouldNotBe("Object.keys(style).indexOf('transitionProperty')", "-1");
     34shouldNotBe("Object.keys(style).indexOf('webkitTransitionProperty')", "-1");
    3335shouldBe("style.transitionProperty", "'none'");
    3436shouldBe("computedStyle.transitionProperty", "'none'");
     
    173175
    174176style.transitionDuration = "0s";
     177shouldNotBe("Object.keys(style).indexOf('transitionDuration')", "-1");
     178shouldNotBe("Object.keys(style).indexOf('webkitTransitionDuration')", "-1");
    175179shouldBe("style.transitionDuration", "'0s'");
    176180shouldBe("computedStyle.transitionDuration", "'0s'");
     
    251255
    252256style.transitionTimingFunction = "linear";
     257shouldNotBe("Object.keys(style).indexOf('transitionTimingFunction')", "-1");
     258shouldNotBe("Object.keys(style).indexOf('webkitTransitionTimingFunction')", "-1");
    253259shouldBe("style.transitionTimingFunction", "'linear'");
    254260shouldBe("computedStyle.transitionTimingFunction", "'linear'");
     
    472478
    473479style.transitionDelay = "0s";
     480shouldNotBe("Object.keys(style).indexOf('transitionDelay')", "-1");
     481shouldNotBe("Object.keys(style).indexOf('webkitTransitionDelay')", "-1");
    474482shouldBe("style.transitionDelay", "'0s'");
    475483shouldBe("computedStyle.transitionDelay", "'0s'");
     
    550558
    551559style.transition = "none";
     560shouldNotBe("Object.keys(style).indexOf('transition')", "-1");
     561shouldNotBe("Object.keys(style).indexOf('webkitTransition')", "-1");
    552562shouldBe("style.transition", "'none'");
    553563shouldBe("computedStyle.transition", "'none 0s ease 0s'");
  • trunk/Source/WebCore/ChangeLog

    r144625 r144626  
     12013-03-04  Alexis Menard  <alexis@webkit.org>
     2
     3        transition properties can't be found in CSSStyleDeclaration
     4        https://bugs.webkit.org/show_bug.cgi?id=110011
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The previous approach for handling the unprefixing was to alias the
     9        unprefixed properties with the prefixed ones in CSSPropertyNames.in.
     10        Unfortunately it will alias the properties in the parsing code which will just
     11        identically parse the two versions. This means that when we populate StylePropertySet
     12        we do not have information whether we just parsed the prefixed, the
     13        unprefixed properties or we parsed both. The patch takes another
     14        approach by creating two distinct sets of properties (unprefixed and
     15        prefixed). Each properties have their own id and we now handle them in
     16        the parsing code as disctints properties and add both versions to the
     17        declared style. In order to avoid properties getting out of sync,
     18        this patch adds few facilities to StylePropertySet to update the
     19        prefixed and the unprefixed entries. Finally the style resolution
     20        happens only for the prefixed version (to limit the size of this patch)
     21        and the unprefixed versions are not resolved. This is to avoid creating
     22        the animation objects twice for the resolved style.
     23
     24        Test : transitions/transitions-parsing.html
     25
     26        * css/CSSComputedStyleDeclaration.cpp:
     27        (WebCore):
     28        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     29        * css/CSSParser.cpp:
     30        (WebCore::CSSParser::addPropertyWithPrefixingVariant): Always add the
     31        prefixed and the unprefixed property even if only one is specified.
     32        (WebCore):
     33        (WebCore::CSSParser::parseValue):
     34        (WebCore::CSSParser::parseTransitionShorthand): Add both prefixed and
     35        unprefixed longhands to the declarated style.
     36        (WebCore::CSSParser::parseAnimationProperty):
     37        * css/CSSParser.h:
     38        (CSSParser):
     39        * css/CSSProperty.cpp:
     40        (WebCore::CSSProperty::isInheritedProperty):
     41        * css/CSSProperty.h:
     42        (WebCore:: prefixingVariantForPropertyId): This function takes a given
     43        property id and returns its prefixed or unprefixed id if it exists. If
     44        not it returns the same id.
     45        (WebCore):
     46        * css/CSSPropertyNames.in:
     47        * css/StylePropertySet.cpp:
     48        (WebCore::StylePropertySet::getPropertyValue):
     49        (WebCore::StylePropertySet::removeShorthandProperty):
     50        (WebCore::StylePropertySet::removeProperty):
     51        (WebCore::StylePropertySet::removeProperty): Remove
     52        also the prefixed or unprefixed shorthand if it exists.
     53        (WebCore):
     54        (WebCore::StylePropertySet::setProperty):
     55        (WebCore::StylePropertySet:: appendPrefixingVariantProperty):
     56        (WebCore::StylePropertySet::setPrefixingVariantProperty): If it
     57        exists a unprefixed or prefixed counterpart of the property we're
     58        trying to set, then we update the other one.
     59        (WebCore::StylePropertySet::asText):
     60        (WebCore::StylePropertySet::mergeAndOverrideOnConflict):
     61        * css/StylePropertySet.h:
     62        (StylePropertySet):
     63        * css/StylePropertyShorthand.cpp:
     64        (WebCore::transitionShorthand):
     65        (WebCore):
     66        (WebCore::shorthandForProperty): Define the transitions unprefixed
     67        longhands.
     68        * css/StylePropertyShorthand.h:
     69        (WebCore):
     70        * css/StyleResolver.cpp:
     71        (WebCore::StyleResolver::applyProperty): StyleBuilder will handle the
     72        resolution and the creation of the animations for the style. As the
     73        declarated style now contains declarations for the prefixed and
     74        unprefixed property we do not want to resolve two times and create duplicate animations.
     75        Therefore when we try to resolve the unprefixed version we just bail out.
     76
    1772013-03-04  Ilya Tikhonovsky  <loislo@chromium.org>
    278
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r144485 r144626  
    199199    CSSPropertyTextTransform,
    200200    CSSPropertyTop,
     201    CSSPropertyTransitionDelay,
     202    CSSPropertyTransitionDuration,
     203    CSSPropertyTransitionProperty,
     204    CSSPropertyTransitionTimingFunction,
    201205    CSSPropertyUnicodeBidi,
    202206    CSSPropertyVerticalAlign,
     
    25182522        case CSSPropertyWebkitTransformStyle:
    25192523            return cssValuePool().createIdentifierValue((style->transformStyle3D() == TransformStyle3DPreserve3D) ? CSSValuePreserve3d : CSSValueFlat);
     2524        case CSSPropertyTransitionDelay:
    25202525        case CSSPropertyWebkitTransitionDelay:
    25212526            return getDelayValue(style->transitions());
     2527        case CSSPropertyTransitionDuration:
    25222528        case CSSPropertyWebkitTransitionDuration:
    25232529            return getDurationValue(style->transitions());
     2530        case CSSPropertyTransitionProperty:
    25242531        case CSSPropertyWebkitTransitionProperty:
    25252532            return getTransitionPropertyValue(style->transitions());
     2533        case CSSPropertyTransitionTimingFunction:
    25262534        case CSSPropertyWebkitTransitionTimingFunction:
    25272535            return getTimingFunctionValue(style->transitions());
     2536        case CSSPropertyTransition:
    25282537        case CSSPropertyWebkitTransition: {
    25292538            const AnimationList* animList = style->transitions();
  • trunk/Source/WebCore/css/CSSParser.cpp

    r143948 r144626  
    15371537}
    15381538
     1539void CSSParser::addPropertyWithPrefixingVariant(CSSPropertyID propId, PassRefPtr<CSSValue> value, bool important, bool implicit)
     1540{
     1541    RefPtr<CSSValue> val = value.get();
     1542    addProperty(propId, value, important, implicit);
     1543
     1544    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propId);
     1545    if (prefixingVariant == propId)
     1546        return;
     1547    addProperty(prefixingVariant, val.release(), important, implicit);
     1548}
     1549
    15391550void CSSParser::addProperty(CSSPropertyID propId, PassRefPtr<CSSValue> value, bool important, bool implicit)
    15401551{
     
    25662577    case CSSPropertyWebkitAnimationIterationCount:
    25672578    case CSSPropertyWebkitAnimationTimingFunction:
     2579    case CSSPropertyTransitionDelay:
     2580    case CSSPropertyTransitionDuration:
     2581    case CSSPropertyTransitionTimingFunction:
     2582    case CSSPropertyTransitionProperty:
    25682583    case CSSPropertyWebkitTransitionDelay:
    25692584    case CSSPropertyWebkitTransitionDuration:
     
    25732588        AnimationParseContext context;
    25742589        if (parseAnimationProperty(propId, val, context)) {
    2575             addProperty(propId, val.release(), important);
     2590            addPropertyWithPrefixingVariant(propId, val.release(), important);
    25762591            return true;
    25772592        }
     
    28122827    case CSSPropertyWebkitAnimation:
    28132828        return parseAnimationShorthand(important);
     2829    case CSSPropertyTransition:
    28142830    case CSSPropertyWebkitTransition:
    2815         return parseTransitionShorthand(important);
     2831        return parseTransitionShorthand(propId, important);
    28162832    case CSSPropertyInvalid:
    28172833        return false;
     
    33303346}
    33313347
    3332 bool CSSParser::parseTransitionShorthand(bool important)
     3348bool CSSParser::parseTransitionShorthand(CSSPropertyID propId, bool important)
    33333349{
    33343350    const unsigned numProperties = 4;
    3335     ASSERT(numProperties == webkitTransitionShorthand().length());
    3336 
    3337     ShorthandScope scope(this, CSSPropertyWebkitTransition);
     3351    const StylePropertyShorthand& shorthand = shorthandForProperty(propId);
     3352    ASSERT(numProperties == shorthand.length());
     3353
     3354    ShorthandScope scope(this, propId);
    33383355
    33393356    bool parsedProperty[numProperties] = { false };
     
    33613378            if (!parsedProperty[i]) {
    33623379                RefPtr<CSSValue> val;
    3363                 if (parseAnimationProperty(webkitTransitionShorthand().properties()[i], val, context)) {
     3380                if (parseAnimationProperty(shorthand.properties()[i], val, context)) {
    33643381                    parsedProperty[i] = found = true;
    33653382                    addAnimationValue(values[i], val.release());
     
    33863403    // Now add all of the properties we found.
    33873404    for (i = 0; i < numProperties; i++)
    3388         addProperty(webkitTransitionShorthand().properties()[i], values[i].release(), important);
     3405        addPropertyWithPrefixingVariant(shorthand.properties()[i], values[i].release(), important);
    33893406
    33903407    return true;
     
    45654582            switch (propId) {
    45664583                case CSSPropertyWebkitAnimationDelay:
     4584                case CSSPropertyTransitionDelay:
    45674585                case CSSPropertyWebkitTransitionDelay:
    45684586                    currValue = parseAnimationDelay();
     
    45764594                    break;
    45774595                case CSSPropertyWebkitAnimationDuration:
     4596                case CSSPropertyTransitionDuration:
    45784597                case CSSPropertyWebkitTransitionDuration:
    45794598                    currValue = parseAnimationDuration();
     
    46014620                        m_valueList->next();
    46024621                    break;
     4622                case CSSPropertyTransitionProperty:
    46034623                case CSSPropertyWebkitTransitionProperty:
    46044624                    currValue = parseAnimationProperty(context);
     
    46094629                    break;
    46104630                case CSSPropertyWebkitAnimationTimingFunction:
     4631                case CSSPropertyTransitionTimingFunction:
    46114632                case CSSPropertyWebkitTransitionTimingFunction:
    46124633                    currValue = parseAnimationTimingFunction();
  • trunk/Source/WebCore/css/CSSParser.h

    r143028 r144626  
    9595    PassOwnPtr<MediaQuery> parseMediaQuery(const String&);
    9696
     97    void addPropertyWithPrefixingVariant(CSSPropertyID, PassRefPtr<CSSValue>, bool important, bool implicit = false);
    9798    void addProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool important, bool implicit = false);
    9899    void rollbackLastProperties(int num);
     
    152153    bool parseCubicBezierTimingFunctionValue(CSSParserValueList*& args, double& result);
    153154    bool parseAnimationProperty(CSSPropertyID, RefPtr<CSSValue>&, AnimationParseContext&);
    154     bool parseTransitionShorthand(bool important);
     155    bool parseTransitionShorthand(CSSPropertyID, bool important);
    155156    bool parseAnimationShorthand(bool important);
    156157
  • trunk/Source/WebCore/css/CSSProperty.cpp

    r142168 r144626  
    490490    case CSSPropertyTextUnderlineWidth:
    491491    case CSSPropertyTop:
     492    case CSSPropertyTransition:
     493    case CSSPropertyTransitionDelay:
     494    case CSSPropertyTransitionDuration:
     495    case CSSPropertyTransitionProperty:
     496    case CSSPropertyTransitionTimingFunction:
    492497    case CSSPropertyUnicodeBidi:
    493498    case CSSPropertyUnicodeRange:
  • trunk/Source/WebCore/css/CSSProperty.h

    r137984 r144626  
    9393};
    9494
     95inline CSSPropertyID prefixingVariantForPropertyId(CSSPropertyID propId)
     96{
     97    CSSPropertyID propertyId = CSSPropertyInvalid;
     98    switch (propId) {
     99    case CSSPropertyTransitionDelay:
     100        propertyId = CSSPropertyWebkitTransitionDelay;
     101        break;
     102    case CSSPropertyTransitionDuration:
     103        propertyId = CSSPropertyWebkitTransitionDuration;
     104        break;
     105    case CSSPropertyTransitionProperty:
     106        propertyId = CSSPropertyWebkitTransitionProperty;
     107        break;
     108    case CSSPropertyTransitionTimingFunction:
     109        propertyId = CSSPropertyWebkitTransitionTimingFunction;
     110        break;
     111    case CSSPropertyTransition:
     112        propertyId = CSSPropertyWebkitTransition;
     113        break;
     114    case CSSPropertyWebkitTransitionDelay:
     115        propertyId = CSSPropertyTransitionDelay;
     116        break;
     117    case CSSPropertyWebkitTransitionDuration:
     118        propertyId = CSSPropertyTransitionDuration;
     119        break;
     120    case CSSPropertyWebkitTransitionProperty:
     121        propertyId = CSSPropertyTransitionProperty;
     122        break;
     123    case CSSPropertyWebkitTransitionTimingFunction:
     124        propertyId = CSSPropertyTransitionTimingFunction;
     125        break;
     126    case CSSPropertyWebkitTransition:
     127        propertyId = CSSPropertyTransition;
     128        break;
     129    default:
     130        propertyId = propId;
     131        break;
     132    }
     133    ASSERT(propertyId != CSSPropertyInvalid);
     134    return propertyId;
     135}
     136
    95137} // namespace WebCore
    96138
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r142168 r144626  
    183183text-underline-width
    184184top
    185 transition = -webkit-transition
    186 transition-delay = -webkit-transition-delay
    187 transition-duration = -webkit-transition-duration
    188 transition-property = -webkit-transition-property
    189 transition-timing-function = -webkit-transition-timing-function
     185transition
     186transition-delay
     187transition-duration
     188transition-property
     189transition-timing-function
    190190
    191191unicode-bidi
  • trunk/Source/WebCore/css/StylePropertySet.cpp

    r144146 r144626  
    177177    case CSSPropertyPadding:
    178178        return get4Values(paddingShorthand());
     179    case CSSPropertyTransition:
     180        return getLayeredShorthandValue(transitionShorthand());
    179181    case CSSPropertyListStyle:
    180182        return getShorthandValue(listStyleShorthand());
     
    585587    if (!shorthand.length())
    586588        return false;
    587     return removePropertiesInSet(shorthand.properties(), shorthand.length());
     589
     590    bool ret = removePropertiesInSet(shorthand.properties(), shorthand.length());
     591
     592    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propertyID);
     593    if (prefixingVariant == propertyID)
     594        return ret;
     595
     596    StylePropertyShorthand shorthandPrefixingVariant = shorthandForProperty(prefixingVariant);
     597    return removePropertiesInSet(shorthandPrefixingVariant.properties(), shorthandPrefixingVariant.length());
    588598}
    589599
     
    611621    // and sweeping them when the vector grows too big.
    612622    mutablePropertyVector().remove(foundPropertyIndex);
    613    
     623
     624    removePrefixedOrUnprefixedProperty(propertyID);
     625
    614626    return true;
     627}
     628
     629void StylePropertySet::removePrefixedOrUnprefixedProperty(CSSPropertyID propertyID)
     630{
     631    int foundPropertyIndex = findPropertyIndex(prefixingVariantForPropertyId(propertyID));
     632    if (foundPropertyIndex == -1)
     633        return;
     634    mutablePropertyVector().remove(foundPropertyIndex);
    615635}
    616636
     
    686706        if (toReplace) {
    687707            *toReplace = property;
     708            setPrefixingVariantProperty(property);
    688709            return;
    689710        }
    690711    }
     712    appendPrefixingVariantProperty(property);
     713}
     714
     715void StylePropertySet::appendPrefixingVariantProperty(const CSSProperty& property)
     716{
    691717    mutablePropertyVector().append(property);
     718    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(property.id());
     719    if (prefixingVariant == property.id())
     720        return;
     721    mutablePropertyVector().append(CSSProperty(prefixingVariant, property.value(), property.isImportant(), property.shorthandID(), property.metadata().m_implicit));
     722}
     723
     724void StylePropertySet::setPrefixingVariantProperty(const CSSProperty& property)
     725{
     726    CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(property.id());
     727    CSSProperty* toReplace = findMutableCSSPropertyWithID(prefixingVariant);
     728    if (toReplace)
     729        *toReplace = CSSProperty(prefixingVariant, property.value(), property.isImportant(), property.shorthandID(), property.metadata().m_implicit);
    692730}
    693731
     
    840878            shorthandPropertyID = CSSPropertyPadding;
    841879            break;
     880        case CSSPropertyTransitionProperty:
     881        case CSSPropertyTransitionDuration:
     882        case CSSPropertyTransitionTimingFunction:
     883        case CSSPropertyTransitionDelay:
     884            shorthandPropertyID = CSSPropertyTransition;
     885            break;
    842886        case CSSPropertyWebkitAnimationName:
    843887        case CSSPropertyWebkitAnimationDuration:
     
    9981042            setProperty(toMerge.toCSSProperty(), old);
    9991043        else
    1000             mutablePropertyVector().append(toMerge.toCSSProperty());
     1044            appendPrefixingVariantProperty(toMerge.toCSSProperty());
    10011045    }
    10021046}
  • trunk/Source/WebCore/css/StylePropertySet.h

    r143926 r144626  
    115115    // These do not. FIXME: This is too messy, we can do better.
    116116    bool setProperty(CSSPropertyID, int identifier, bool important = false);
     117    void appendPrefixingVariantProperty(const CSSProperty&);
     118    void setPrefixingVariantProperty(const CSSProperty&);
    117119    void setProperty(const CSSProperty&, CSSProperty* slot = 0);
    118120   
    119121    bool removeProperty(CSSPropertyID, String* returnText = 0);
     122    void removePrefixedOrUnprefixedProperty(CSSPropertyID);
    120123
    121124    void parseDeclaration(const String& styleDeclaration, StyleSheetContents* contextStyleSheet);
  • trunk/Source/WebCore/css/StylePropertyShorthand.cpp

    r136080 r144626  
    245245    DEFINE_STATIC_LOCAL(StylePropertyShorthand, paddingLonghands, (paddingProperties, WTF_ARRAY_LENGTH(paddingProperties)));
    246246    return paddingLonghands;
     247}
     248
     249const StylePropertyShorthand& transitionShorthand()
     250{
     251    static const CSSPropertyID transitionProperties[] = {
     252        CSSPropertyTransitionProperty,
     253        CSSPropertyTransitionDuration,
     254        CSSPropertyTransitionTimingFunction,
     255        CSSPropertyTransitionDelay
     256    };
     257    DEFINE_STATIC_LOCAL(StylePropertyShorthand, transitionLonghands, (transitionProperties, WTF_ARRAY_LENGTH(transitionProperties)));
     258    return transitionLonghands;
    247259}
    248260
     
    494506    case CSSPropertyPadding:
    495507        return paddingShorthand();
     508    case CSSPropertyTransition:
     509        return transitionShorthand();
    496510    case CSSPropertyWebkitAnimation:
    497511        return webkitAnimationShorthand();
  • trunk/Source/WebCore/css/StylePropertyShorthand.h

    r128572 r144626  
    8181const StylePropertyShorthand& overflowShorthand();
    8282const StylePropertyShorthand& paddingShorthand();
     83const StylePropertyShorthand& transitionShorthand();
    8384const StylePropertyShorthand& webkitAnimationShorthand();
    8485const StylePropertyShorthand& webkitAnimationShorthandForParsing();
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r144092 r144626  
    35813581        return;
    35823582    }
     3583    // These properties are aliased and StyleBuilder already applied the property on the prefixed version.
     3584    case CSSPropertyTransitionDelay:
     3585    case CSSPropertyTransitionDuration:
     3586    case CSSPropertyTransitionProperty:
     3587    case CSSPropertyTransitionTimingFunction:
     3588        return;
    35833589    // These properties are implemented in the StyleBuilder lookup table.
    35843590    case CSSPropertyBackgroundAttachment:
Note: See TracChangeset for help on using the changeset viewer.