CSSValueList::CSSValueList(CSSParserValueList* list) : m_isSpaceSeparated(true) { if (list) { unsigned s = list->size(); for (unsigned i = 0; i < s; ++i) { CSSParserValue* v = list->valueAt(i); append(v->createCSSValue()); } } }
bool parseValue(CSSParserValueList* tokens, unsigned* index, Value* result) { CSSParserValue* parserValue = tokens->valueAt(*index); if (parserValue->unit == CSSParserValue::Operator || parserValue->unit == CSSParserValue::Function) return false; RefPtr<CSSValue> value = parserValue->createCSSValue(); if (!value || !value->isPrimitiveValue()) return false; CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value.get()); result->value = CSSCalcPrimitiveValue::create(primitiveValue, parserValue->isInt); ++*index; return true; }