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); }
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); }
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()); } }
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); }
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]); }
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()); }
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); }
bool FontFace::setPropertyFromStyle(const StylePropertySet& properties, CSSPropertyID propertyID) { return setPropertyValue(properties.getPropertyCSSValue(propertyID), propertyID); }
CSSPropertyValue::CSSPropertyValue(CSSPropertyID id, const StylePropertySet& propertySet) : property(id), value(propertySet.getPropertyCSSValue(id).get()) { }