void StylePropertySet::setProperty(int propertyID, PassRefPtr<CSSValue> prpValue, bool important) { CSSPropertyLonghand longhand = longhandForProperty(propertyID); if (!longhand.length()) { setProperty(CSSProperty(propertyID, prpValue, important)); return; } removePropertiesInSet(longhand.properties(), longhand.length()); RefPtr<CSSValue> value = prpValue; for (unsigned i = 0; i < longhand.length(); ++i) m_properties.append(CSSProperty(longhand.properties()[i], value, important)); }
bool StylePropertySet::removeShorthandProperty(int propertyID) { CSSPropertyLonghand longhand = longhandForProperty(propertyID); if (!longhand.length()) return false; return removePropertiesInSet(longhand.properties(), longhand.length()); }
bool CSSMutableStyleDeclaration::removeShorthandProperty(int propertyID, bool notifyChanged) { CSSPropertyLonghand longhand = longhandForProperty(propertyID); if (longhand.length()) { removePropertiesInSet(longhand.properties(), longhand.length(), notifyChanged); return true; } return false; }
bool StylePropertySet::propertyIsImportant(int propertyID) const { const CSSProperty* property = findPropertyWithId(propertyID); if (property) return property->isImportant(); CSSPropertyLonghand longhands = longhandForProperty(propertyID); if (!longhands.length()) return false; for (unsigned i = 0; i < longhands.length(); ++i) { if (!propertyIsImportant(longhands.properties()[i])) return false; } return true; }