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

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/cssScale.html

Issue 2888403004: [css-typed-om] replace all attribute with DOMMatrix in cssMatrixComponent (Closed)
Patch Set: fix the typo Created 3 years, 7 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/LayoutTests/typedcssom/cssScale.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssScale.html b/third_party/WebKit/LayoutTests/typedcssom/cssScale.html
index 9af0b07288d95b9da0ab4745dc0543e408ae3f7b..d67fd22086271e61d1242721b0b60be59d301460 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/cssScale.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/cssScale.html
@@ -79,11 +79,11 @@ test(function() {
var inputAsMatrix = input.asMatrix();
assert_equals(inputAsMatrix.is2D(), input.is2D());
- var expectedMatrix = input.is2D() ? new CSSMatrixComponent(input.x, 0, 0, input.y, 0, 0) :
- new CSSMatrixComponent(input.x, 0, 0, 0, 0, input.y, 0, 0, 0, 0, input.z, 0, 0, 0, 0, 1);
+ var expectedMatrix = input.is2D() ? new CSSMatrixComponent(new DOMMatrixReadOnly([input.x, 0, 0, input.y, 0, 0])) :
+ new CSSMatrixComponent(new DOMMatrixReadOnly([input.x, 0, 0, 0, 0, input.y, 0, 0, 0, 0, input.z, 0, 0, 0, 0, 1]));
for (var attribute in expectedMatrix) {
- if (typeof expectedMatrix[attribute] === "number") {
- assert_approx_equals(inputAsMatrix[attribute], expectedMatrix[attribute], EPSILON);
+ if (attribute == "matrix") {
+ assert_matrix_approx_equals(inputAsMatrix[attribute], expectedMatrix[attribute]);
} else {
assert_equals(inputAsMatrix[attribute], expectedMatrix[attribute]);
}
@@ -100,4 +100,14 @@ test(function() {
assert_equals(actual.y, 2);
assert_equals(actual.z, 3);
}, "Test that x, y, z are mutable attributes.");
+
+function assert_array_approx_equals(actual, expected) {
+ for (var i = 0; i < actual.length; i++) {
+ assert_approx_equals(actual[i], expected[i], EPSILON);
+ }
+}
+
+function assert_matrix_approx_equals(actual, expected) {
+ assert_array_approx_equals(actual.toFloat64Array(), expected.toFloat64Array());
+}
</script>
« no previous file with comments | « third_party/WebKit/LayoutTests/typedcssom/cssRotation.html ('k') | third_party/WebKit/LayoutTests/typedcssom/cssSkew.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698