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 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()); }