Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Unified Diff: Source/WebCore/css/StylePropertySet.cpp

Issue 12470005: Merge 144626 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/css/StylePropertySet.h ('k') | Source/WebCore/css/StylePropertyShorthand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/css/StylePropertySet.cpp
===================================================================
--- Source/WebCore/css/StylePropertySet.cpp (revision 145343)
+++ Source/WebCore/css/StylePropertySet.cpp (working copy)
@@ -172,6 +172,8 @@
return getCommonValue(overflowShorthand());
case CSSPropertyPadding:
return get4Values(paddingShorthand());
+ case CSSPropertyTransition:
+ return getLayeredShorthandValue(transitionShorthand());
case CSSPropertyListStyle:
return getShorthandValue(listStyleShorthand());
case CSSPropertyWebkitMaskPosition:
@@ -578,7 +580,15 @@
StylePropertyShorthand shorthand = shorthandForProperty(propertyID);
if (!shorthand.length())
return false;
- return removePropertiesInSet(shorthand.properties(), shorthand.length());
+
+ 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());
}
bool StylePropertySet::removeProperty(CSSPropertyID propertyID, String* returnText)
@@ -604,10 +614,20 @@
// A more efficient removal strategy would involve marking entries as empty
// and sweeping them when the vector grows too big.
mutablePropertyVector().remove(foundPropertyIndex);
-
+
+ removePrefixedOrUnprefixedProperty(propertyID);
+
return true;
}
+void StylePropertySet::removePrefixedOrUnprefixedProperty(CSSPropertyID propertyID)
+{
+ int foundPropertyIndex = findPropertyIndex(prefixingVariantForPropertyId(propertyID));
+ if (foundPropertyIndex == -1)
+ return;
+ mutablePropertyVector().remove(foundPropertyIndex);
+}
+
bool StylePropertySet::propertyIsImportant(CSSPropertyID propertyID) const
{
int foundPropertyIndex = findPropertyIndex(propertyID);
@@ -679,12 +699,30 @@
CSSProperty* toReplace = slot ? slot : findMutableCSSPropertyWithID(property.id());
if (toReplace) {
*toReplace = property;
+ setPrefixingVariantProperty(property);
return;
}
}
+ appendPrefixingVariantProperty(property);
+}
+
+void StylePropertySet::appendPrefixingVariantProperty(const CSSProperty& property)
+{
mutablePropertyVector().append(property);
+ CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(property.id());
+ if (prefixingVariant == property.id())
+ return;
+ mutablePropertyVector().append(CSSProperty(prefixingVariant, property.value(), property.isImportant(), property.shorthandID(), property.metadata().m_implicit));
}
+void StylePropertySet::setPrefixingVariantProperty(const CSSProperty& property)
+{
+ CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(property.id());
+ CSSProperty* toReplace = findMutableCSSPropertyWithID(prefixingVariant);
+ if (toReplace)
+ *toReplace = CSSProperty(prefixingVariant, property.value(), property.isImportant(), property.shorthandID(), property.metadata().m_implicit);
+}
+
bool StylePropertySet::setProperty(CSSPropertyID propertyID, int identifier, bool important)
{
ASSERT(isMutable());
@@ -833,6 +871,12 @@
case CSSPropertyPaddingLeft:
shorthandPropertyID = CSSPropertyPadding;
break;
+ case CSSPropertyTransitionProperty:
+ case CSSPropertyTransitionDuration:
+ case CSSPropertyTransitionTimingFunction:
+ case CSSPropertyTransitionDelay:
+ shorthandPropertyID = CSSPropertyTransition;
+ break;
case CSSPropertyWebkitAnimationName:
case CSSPropertyWebkitAnimationDuration:
case CSSPropertyWebkitAnimationTimingFunction:
@@ -991,7 +1035,7 @@
if (old)
setProperty(toMerge.toCSSProperty(), old);
else
- mutablePropertyVector().append(toMerge.toCSSProperty());
+ appendPrefixingVariantProperty(toMerge.toCSSProperty());
}
}
« no previous file with comments | « Source/WebCore/css/StylePropertySet.h ('k') | Source/WebCore/css/StylePropertyShorthand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698