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

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

Issue 2380713004: [GeometryInterface] Add setMatrixValue(transfromList) function. (Closed)
Patch Set: rebase & check relative length unit. 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 dcbe627cf82f7e51a6a49fbc5e601c35b4fb6574..e816dc6af4ad1cf29af83e946fb34e54d623df62 100644
--- a/third_party/WebKit/Source/core/css/resolver/TransformBuilder.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/TransformBuilder.cpp
@@ -102,6 +102,28 @@ static TransformOperation::OperationType getTransformOperationType(
}
}
+bool TransformBuilder::checkHavingRelativeLengthUnit(const CSSValue& inValue) {
meade_UTC10 2016/10/17 03:22:28 Perhaps this should take a CSSValueList? Then you
meade_UTC10 2016/10/17 03:22:28 In other places we've used "hasRelativeLengths". P
Hwanseung Lee 2016/10/18 16:37:52 Done.
Hwanseung Lee 2016/10/18 16:37:52 Done.
+ if (!inValue.isValueList()) {
+ DCHECK_EQ(toCSSIdentifierValue(inValue).getValueID(), CSSValueNone);
meade_UTC10 2016/10/17 03:22:28 I don't understand what this DCHECK is for... Do y
Hwanseung Lee 2016/10/18 16:37:52 i did remove this it when change to CSSVauleList.
Hwanseung Lee 2016/10/18 16:37:52 i did remove this code because parameter was chang
+ return false;
+ }
+
+ for (auto& value : toCSSValueList(inValue)) {
+ const CSSFunctionValue* transformValue = toCSSFunctionValue(value.get());
+
+ for (size_t i = 0; i < transformValue->length(); i++) {
+ const CSSPrimitiveValue& primitiveValue =
+ toCSSPrimitiveValue(transformValue->item(i));
+
+ if (CSSPrimitiveValue::isRelativeUnit(
+ primitiveValue.typeWithCalcResolved())) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
void TransformBuilder::createTransformOperations(
const CSSValue& inValue,
const CSSToLengthConversionData& conversionData,

Powered by Google App Engine
This is Rietveld 408576698