コード例 #1
0
ファイル: SVGAnimateElement.cpp プロジェクト: dzhshf/WebKit
static inline void applyCSSPropertyToTarget(SVGElement* targetElement, CSSPropertyID id, const String& value)
{
    ASSERT(!targetElement->m_deletionHasBegun);

    StylePropertySet* propertySet = targetElement->ensureAnimatedSMILStyleProperties();
    if (!propertySet->setProperty(id, value, false, 0))
        return;

    targetElement->setNeedsStyleRecalc(SyntheticStyleChange);
}
コード例 #2
0
ファイル: StyledElement.cpp プロジェクト: sohocoke/webkit
void StyledElement::removeCSSProperties(int id1, int id2, int id3, int id4, int id5, int id6, int id7, int id8)
{
    StylePropertySet* style = attributeStyle();
    if (!style)
        return;

    ASSERT(id1 != CSSPropertyInvalid);
    style->removeProperty(id1);

    if (id2 == CSSPropertyInvalid)
        return;
    style->removeProperty(id2);
    if (id3 == CSSPropertyInvalid)
        return;
    style->removeProperty(id3);
    if (id4 == CSSPropertyInvalid)
        return;
    style->removeProperty(id4);
    if (id5 == CSSPropertyInvalid)
        return;
    style->removeProperty(id5);
    if (id6 == CSSPropertyInvalid)
        return;
    style->removeProperty(id6);
    if (id7 == CSSPropertyInvalid)
        return;
    style->removeProperty(id7);
    if (id8 == CSSPropertyInvalid)
        return;
    style->removeProperty(id8);
}
コード例 #3
0
MutableStylePropertySet::MutableStylePropertySet(const StylePropertySet& other)
    : StylePropertySet(other.cssParserMode())
{
    if (other.isMutable())
        m_propertyVector = static_cast<const MutableStylePropertySet&>(other).mutablePropertyVector();
    else {
        m_propertyVector.reserveInitialCapacity(other.propertyCount());
        for (unsigned i = 0; i < other.propertyCount(); ++i)
            m_propertyVector.uncheckedAppend(other.propertyAt(i).toCSSProperty());
    }
}
コード例 #4
0
void RemoveCSSPropertyCommand::doApply()
{
    StylePropertySet* style = m_element->inlineStyleDecl();
    m_oldValue = style->getPropertyValue(m_property);
    m_important = style->propertyIsImportant(m_property);

    // Mutate using the CSSOM wrapper so we get the same event behavior as a script.
    ExceptionCode ec;
    // Setting to null string removes the property. We don't have internal version of removeProperty.
    m_element->style()->setPropertyInternal(m_property, String(), false, ec);
}
コード例 #5
0
void StylePropertySet::copyPropertiesFrom(const StylePropertySet& other)
{
    ASSERT(isMutable());

    if (other.isMutable()) {
        *m_mutablePropertyVector = *other.m_mutablePropertyVector;
        return;
    }

    ASSERT(m_mutablePropertyVector->isEmpty());
    m_mutablePropertyVector->reserveInitialCapacity(other.m_arraySize);
    for (unsigned i = 0; i < other.m_arraySize; ++i)
        m_mutablePropertyVector->uncheckedAppend(other.array()[i]);
}
コード例 #6
0
void ViewportStyleResolver::addViewportRule(StyleRuleViewport* viewportRule)
{
    StylePropertySet* propertySet = viewportRule->mutableProperties();

    unsigned propertyCount = propertySet->propertyCount();
    if (!propertyCount)
        return;

    if (!m_propertySet) {
        m_propertySet = propertySet->mutableCopy();
        return;
    }

    // We cannot use mergeAndOverrideOnConflict() here because it doesn't
    // respect the !important declaration (but addParsedProperty() does).
    for (unsigned i = 0; i < propertyCount; ++i)
        m_propertySet->addParsedProperty(propertySet->propertyAt(i).toCSSProperty());
}
コード例 #7
0
ファイル: StyledElement.cpp プロジェクト: sohocoke/webkit
void StyledElement::copyNonAttributeProperties(const Element* sourceElement)
{
    ASSERT(sourceElement);
    ASSERT(sourceElement->isStyledElement());

    const StyledElement* source = static_cast<const StyledElement*>(sourceElement);
    if (!source->inlineStyleDecl())
        return;

    StylePropertySet* inlineStyle = ensureInlineStyleDecl();
    inlineStyle->copyPropertiesFrom(*source->inlineStyleDecl());
    inlineStyle->setStrictParsing(source->inlineStyleDecl()->useStrictParsing());

    setIsStyleAttributeValid(source->isStyleAttributeValid());
    setIsSynchronizingStyleAttribute(source->isSynchronizingStyleAttribute());
    
    Element::copyNonAttributeProperties(sourceElement);
}
コード例 #8
0
bool FontFace::setPropertyFromStyle(const StylePropertySet& properties, CSSPropertyID propertyID)
{
    return setPropertyValue(properties.getPropertyCSSValue(propertyID), propertyID);
}
コード例 #9
0
ファイル: StyleResolver.cpp プロジェクト: ksimbili/sky_engine
CSSPropertyValue::CSSPropertyValue(CSSPropertyID id, const StylePropertySet& propertySet)
    : property(id), value(propertySet.getPropertyCSSValue(id).get())
{ }