Example #1
0
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));
}
Example #2
0
bool StylePropertySet::removeShorthandProperty(int propertyID)
{
    CSSPropertyLonghand longhand = longhandForProperty(propertyID);
    if (!longhand.length())
        return false;
    return removePropertiesInSet(longhand.properties(), longhand.length());
}
Example #3
0
bool CSSMutableStyleDeclaration::removeShorthandProperty(int propertyID, bool notifyChanged) 
{
    CSSPropertyLonghand longhand = longhandForProperty(propertyID);
    if (longhand.length()) {
        removePropertiesInSet(longhand.properties(), longhand.length(), notifyChanged);
        return true;
    }
    return false;
}
Example #4
0
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;
}