diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2016-08-25 19:20:41 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-02-02 12:30:55 +0000 |
commit | 6882a04fb36642862b11efe514251d32070c3d65 (patch) | |
tree | b7959826000b061fd5ccc7512035c7478742f7b0 /Source/WebCore/css/CSSFunctionValue.cpp | |
parent | ab6df191029eeeb0b0f16f127d553265659f739e (diff) | |
download | qtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz |
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebCore/css/CSSFunctionValue.cpp')
-rw-r--r-- | Source/WebCore/css/CSSFunctionValue.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Source/WebCore/css/CSSFunctionValue.cpp b/Source/WebCore/css/CSSFunctionValue.cpp index d363cf10d..31861b336 100644 --- a/Source/WebCore/css/CSSFunctionValue.cpp +++ b/Source/WebCore/css/CSSFunctionValue.cpp @@ -28,7 +28,6 @@ #include "CSSParserValues.h" #include "CSSValueList.h" -#include <wtf/PassOwnPtr.h> #include <wtf/text/StringBuilder.h> namespace WebCore { @@ -38,17 +37,17 @@ CSSFunctionValue::CSSFunctionValue(CSSParserFunction* function) , m_name(function->name) { if (function->args) - m_args = CSSValueList::createFromParserValueList(function->args.get()); + m_args = CSSValueList::createFromParserValueList(*function->args); } -CSSFunctionValue::CSSFunctionValue(String name, PassRefPtr<CSSValueList> args) +CSSFunctionValue::CSSFunctionValue(const String& name, PassRefPtr<CSSValueList> args) : CSSValue(FunctionClass) , m_name(name) , m_args(args) { } -String CSSFunctionValue::customCssText() const +String CSSFunctionValue::customCSSText() const { StringBuilder result; result.append(m_name); // Includes the '(' @@ -63,4 +62,19 @@ bool CSSFunctionValue::equals(const CSSFunctionValue& other) const return m_name == other.m_name && compareCSSValuePtr(m_args, other.m_args); } +bool CSSFunctionValue::buildParserValueSubstitutingVariables(CSSParserValue* result, const CustomPropertyValueMap& customProperties) const +{ + result->id = CSSValueInvalid; + result->unit = CSSParserValue::Function; + result->function = new CSSParserFunction; + result->function->name.init(m_name); + bool success = true; + if (m_args) { + CSSParserValueList* argList = new CSSParserValueList; + success = m_args->buildParserValueListSubstitutingVariables(argList, customProperties); + result->function->args.reset(argList); + } + return success; +} + } |