Index: third_party/WebKit/Source/core/css/resolver/TransformBuilder.cpp |
diff --git a/third_party/WebKit/Source/core/css/resolver/TransformBuilder.cpp b/third_party/WebKit/Source/core/css/resolver/TransformBuilder.cpp |
index dcbe627cf82f7e51a6a49fbc5e601c35b4fb6574..6cccee12ead48a1a3c0cb21107541d9b095ff1f2 100644 |
--- a/third_party/WebKit/Source/core/css/resolver/TransformBuilder.cpp |
+++ b/third_party/WebKit/Source/core/css/resolver/TransformBuilder.cpp |
@@ -102,6 +102,30 @@ static TransformOperation::OperationType getTransformOperationType( |
} |
} |
+bool TransformBuilder::hasRelativeLengths(const CSSValueList& valueList) { |
+ for (auto& value : valueList) { |
+ const CSSFunctionValue* transformValue = toCSSFunctionValue(value.get()); |
+ |
+ for (Member<const blink::CSSValue> item : *transformValue) { |
Timothy Loh
2016/10/24 04:18:30
I think you can write
for (const CSSValue* item :
Hwanseung Lee
2016/10/24 13:23:37
Done.
Timothy Loh
2016/10/25 04:48:01
You don't need to write blink::, this is already i
Hwanseung Lee
2016/10/27 16:24:47
Done.
|
+ const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(*item); |
+ |
+ // TODO(hs1217.lee) : to prevent relative unit like calc(10px + 1em). |
+ // but when calc() not take parameter of ralative unit like calc(1px +1 |
+ // px), |
+ // shoud be return false; |
+ if (primitiveValue.isCalculated()) { |
+ return true; |
+ } |
+ |
+ if (CSSPrimitiveValue::isRelativeUnit( |
+ primitiveValue.typeWithCalcResolved())) { |
+ return true; |
+ } |
+ } |
+ } |
+ return false; |
+} |
+ |
void TransformBuilder::createTransformOperations( |
const CSSValue& inValue, |
const CSSToLengthConversionData& conversionData, |