Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: third_party/WebKit/Source/core/css/resolver/TransformBuilder.cpp

Issue 2380713004: [GeometryInterface] Add setMatrixValue(transfromList) function. (Closed)
Patch Set: [GeometryInterface] Add setMatrixValue(transfromList) function. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 b5b220ffdfbc2adafe200ddd16c7a2374391e30c..0c00516edf56a13f409d28cad8b80c05c6cab350 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 (const CSSValue* item : *transformValue) {
+ 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;
+}
+
TransformOperations TransformBuilder::createTransformOperations(
const CSSValue& inValue,
const CSSToLengthConversionData& conversionData) {
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/TransformBuilder.h ('k') | third_party/WebKit/Source/core/dom/DOMMatrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698