OLD | NEW |
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 // FIXME: crbug.com/154772 - should this continue to use legacy style parsin
g? | 58 // FIXME: crbug.com/154772 - should this continue to use legacy style parsin
g? |
59 if (RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSProp
ertyWebkitTransform, string)) { | 59 if (RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSProp
ertyWebkitTransform, string)) { |
60 // Check for a "none" transform. In these cases we can use the default i
dentity matrix. | 60 // Check for a "none" transform. In these cases we can use the default i
dentity matrix. |
61 if (value->isPrimitiveValue() && (toCSSPrimitiveValue(value.get()))->get
ValueID() == CSSValueNone) | 61 if (value->isPrimitiveValue() && (toCSSPrimitiveValue(value.get()))->get
ValueID() == CSSValueNone) |
62 return; | 62 return; |
63 | 63 |
64 // FIXME: This has a null pointer crash if we use ex units (crbug.com/41
4145) | 64 // FIXME: This has a null pointer crash if we use ex units (crbug.com/41
4145) |
65 DEFINE_STATIC_REF(RenderStyle, defaultStyle, RenderStyle::createDefaultS
tyle()); | 65 DEFINE_STATIC_REF(RenderStyle, defaultStyle, RenderStyle::createDefaultS
tyle()); |
66 TransformOperations operations; | 66 TransformOperations operations; |
67 if (!TransformBuilder::createTransformOperations(value.get(), CSSToLengt
hConversionData(defaultStyle, defaultStyle, 0, 0, 1.0f), operations)) { | 67 if (!TransformBuilder::createTransformOperations(value.get(), CSSToLengt
hConversionData(defaultStyle, defaultStyle, nullptr, 1.0f), operations)) { |
68 exceptionState.throwDOMException(SyntaxError, "Failed to interpret '
" + string + "' as a transformation operation."); | 68 exceptionState.throwDOMException(SyntaxError, "Failed to interpret '
" + string + "' as a transformation operation."); |
69 return; | 69 return; |
70 } | 70 } |
71 | 71 |
72 // Convert transform operations to a TransformationMatrix. This can fail | 72 // Convert transform operations to a TransformationMatrix. This can fail |
73 // if a param has a percentage ('%') | 73 // if a param has a percentage ('%') |
74 if (operations.dependsOnBoxSize()) | 74 if (operations.dependsOnBoxSize()) |
75 exceptionState.throwDOMException(SyntaxError, "The transformation de
pends on the box size, which is not supported."); | 75 exceptionState.throwDOMException(SyntaxError, "The transformation de
pends on the box size, which is not supported."); |
76 TransformationMatrix t; | 76 TransformationMatrix t; |
77 operations.apply(FloatSize(0, 0), t); | 77 operations.apply(FloatSize(0, 0), t); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 if (m_matrix.isAffine()) | 177 if (m_matrix.isAffine()) |
178 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()); | 178 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()); |
179 return String::format("matrix3d(%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f,
%f, %f, %f, %f, %f)", | 179 return String::format("matrix3d(%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f,
%f, %f, %f, %f, %f)", |
180 m_matrix.m11(), m_matrix.m12(), m_matrix.m13(), m_matrix.m14(), | 180 m_matrix.m11(), m_matrix.m12(), m_matrix.m13(), m_matrix.m14(), |
181 m_matrix.m21(), m_matrix.m22(), m_matrix.m23(), m_matrix.m24(), | 181 m_matrix.m21(), m_matrix.m22(), m_matrix.m23(), m_matrix.m24(), |
182 m_matrix.m31(), m_matrix.m32(), m_matrix.m33(), m_matrix.m34(), | 182 m_matrix.m31(), m_matrix.m32(), m_matrix.m33(), m_matrix.m34(), |
183 m_matrix.m41(), m_matrix.m42(), m_matrix.m43(), m_matrix.m44()); | 183 m_matrix.m41(), m_matrix.m42(), m_matrix.m43(), m_matrix.m44()); |
184 } | 184 } |
185 | 185 |
186 } // namespace blink | 186 } // namespace blink |
OLD | NEW |