diff options
author | Ben Murdoch <benm@google.com> | 2011-05-13 16:23:25 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-16 11:35:02 +0100 |
commit | 65f03d4f644ce73618e5f4f50dd694b26f55ae12 (patch) | |
tree | f478babb801e720de7bfaee23443ffe029f58731 /Source/WebCore/css/WebKitCSSMatrix.cpp | |
parent | 47de4a2fb7262c7ebdb9cd133ad2c54c187454d0 (diff) | |
download | external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.zip external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.gz external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.bz2 |
Merge WebKit at r75993: Initial merge by git.
Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3
Diffstat (limited to 'Source/WebCore/css/WebKitCSSMatrix.cpp')
-rw-r--r-- | Source/WebCore/css/WebKitCSSMatrix.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/WebCore/css/WebKitCSSMatrix.cpp b/Source/WebCore/css/WebKitCSSMatrix.cpp index a4af7f8..7d60f8c 100644 --- a/Source/WebCore/css/WebKitCSSMatrix.cpp +++ b/Source/WebCore/css/WebKitCSSMatrix.cpp @@ -30,6 +30,7 @@ #include "CSSStyleSelector.h" #include "CSSMutableStyleDeclaration.h" #include "CSSPropertyNames.h" +#include "CSSValueKeywords.h" #include "ExceptionCode.h" #include "RenderStyle.h" #include <wtf/MathExtras.h> @@ -57,9 +58,14 @@ void WebKitCSSMatrix::setMatrixValue(const String& string, ExceptionCode& ec) if (p.parseValue(styleDeclaration.get(), CSSPropertyWebkitTransform, string, true)) { // Convert to TransformOperations. This can fail if a property // requires style (i.e., param uses 'ems' or 'exs') - PassRefPtr<CSSValue> val = styleDeclaration->getPropertyCSSValue(CSSPropertyWebkitTransform); + RefPtr<CSSValue> value = styleDeclaration->getPropertyCSSValue(CSSPropertyWebkitTransform); + + // Check for a "none" or empty transform. In these cases we can use the default identity matrix. + if (!value || (value->isPrimitiveValue() && (static_cast<CSSPrimitiveValue*>(value.get()))->getIdent() == CSSValueNone)) + return; + TransformOperations operations; - if (!CSSStyleSelector::createTransformOperations(val.get(), 0, 0, operations)) { + if (!CSSStyleSelector::createTransformOperations(value.get(), 0, 0, operations)) { ec = SYNTAX_ERR; return; } |