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

Side by Side Diff: Source/core/css/CSSMatrix.cpp

Issue 22900008: Make vw/vh units to work in css transforms. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 TransformOperations operations; 71 TransformOperations operations;
72 if (!TransformBuilder::createTransformOperations(value.get(), 0, 0, oper ations)) { 72 if (!TransformBuilder::createTransformOperations(value.get(), 0, 0, oper ations)) {
73 es.throwDOMException(SyntaxError); 73 es.throwDOMException(SyntaxError);
74 return; 74 return;
75 } 75 }
76 76
77 // Convert transform operations to a TransformationMatrix. This can fail 77 // Convert transform operations to a TransformationMatrix. This can fail
78 // if a param has a percentage ('%') 78 // if a param has a percentage ('%')
79 TransformationMatrix t; 79 TransformationMatrix t;
80 for (unsigned i = 0; i < operations.operations().size(); ++i) { 80 for (unsigned i = 0; i < operations.operations().size(); ++i) {
81 if (operations.operations()[i].get()->apply(t, IntSize(0, 0))) { 81 if (operations.operations()[i].get()->apply(t, IntSize(0, 0), 0)) {
82 es.throwDOMException(SyntaxError); 82 es.throwDOMException(SyntaxError);
83 return; 83 return;
84 } 84 }
85 } 85 }
86 86
87 // set the matrix 87 // set the matrix
88 m_matrix = t; 88 m_matrix = t;
89 } else { // There is something there but parsing failed. 89 } else { // There is something there but parsing failed.
90 es.throwDOMException(SyntaxError); 90 es.throwDOMException(SyntaxError);
91 } 91 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 if (m_matrix.isAffine()) 185 if (m_matrix.isAffine())
186 return String::format("matrix(%f, %f, %f, %f, %f, %f)", m_matrix.a(), m_ matrix.b(), m_matrix.c(), m_matrix.d(), m_matrix.e(), m_matrix.f()); 186 return String::format("matrix(%f, %f, %f, %f, %f, %f)", m_matrix.a(), m_ matrix.b(), m_matrix.c(), m_matrix.d(), m_matrix.e(), m_matrix.f());
187 return String::format("matrix3d(%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f)", 187 return String::format("matrix3d(%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f)",
188 m_matrix.m11(), m_matrix.m12(), m_matrix.m13(), m_matrix.m14(), 188 m_matrix.m11(), m_matrix.m12(), m_matrix.m13(), m_matrix.m14(),
189 m_matrix.m21(), m_matrix.m22(), m_matrix.m23(), m_matrix.m24(), 189 m_matrix.m21(), m_matrix.m22(), m_matrix.m23(), m_matrix.m24(),
190 m_matrix.m31(), m_matrix.m32(), m_matrix.m33(), m_matrix.m34(), 190 m_matrix.m31(), m_matrix.m32(), m_matrix.m33(), m_matrix.m34(),
191 m_matrix.m41(), m_matrix.m42(), m_matrix.m43(), m_matrix.m44()); 191 m_matrix.m41(), m_matrix.m42(), m_matrix.m43(), m_matrix.m44());
192 } 192 }
193 193
194 } // namespace WebCore 194 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698