Reviewed by Oliver.
Fix for <rdar://problem/
5586370> CSS Transform - incorrect matrix
math leads to crazy problems
Transform matrices accept the first four parameters as CSS lengths.
CSS lengths get mapped into WebCore::Lengths as percents by
WebCore::convertToLength(). Percent lengths cannot call value(). It
does not yield a correct result and it asserts on Debug builds.
* rendering/RenderStyle.h:
(WebCore::MatrixTransformOperation::apply): Instead of calling
value() on the lengths, call calcValue. This fixes the assert and
the bad rendering.
LayoutTests:
Reviewed by Oliver.
Test for <rdar://problem/
5586370> CSS Transform - incorrect matrix
math leads to crazy problems
* fast/transforms/identity-matrix.html: Added.
* platform/mac/fast/transforms/identity-matrix-expected.checksum: Added.
* platform/mac/fast/transforms/identity-matrix-expected.png: Added.
* platform/mac/fast/transforms/identity-matrix-expected.txt: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27649
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-11-09 Beth Dakin <bdakin@apple.com>
+
+ Reviewed by Oliver.
+
+ Test for <rdar://problem/5586370> CSS Transform - incorrect matrix
+ math leads to crazy problems
+
+ * fast/transforms/identity-matrix.html: Added.
+ * platform/mac/fast/transforms/identity-matrix-expected.checksum: Added.
+ * platform/mac/fast/transforms/identity-matrix-expected.png: Added.
+ * platform/mac/fast/transforms/identity-matrix-expected.txt: Added.
+
2007-11-08 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
--- /dev/null
+ <head>
+<style>
+ div {
+ float:left;
+ width:100px;
+ height:100px;
+ background-color:skyblue;
+ border: 5px solid black;
+ margin:5px;
+ }
+ .matrix{ -webkit-transform: matrix(1, 0, 0, 1, 0, 0); }
+</style>
+</head>
+<body>
+The following divs should be idential:
+ <br>
+
+ <div></div>
+ <div class="matrix"></div>
+</body>
--- /dev/null
+90f9ead95952ec5a4e0d209c890c94c0
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderText {#text} at (0,0) size 243x18
+ text run at (0,0) width 243: "The following divs should be idential: "
+ RenderBR {BR} at (0,0) size 0x0
+ RenderBlock (floating) {DIV} at (5,23) size 110x110 [bgcolor=#87CEEB] [border: (5px solid #000000)]
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+layer at (133,31) size 110x110
+ RenderBlock (floating) {DIV} at (125,23) size 110x110 [bgcolor=#87CEEB] [border: (5px solid #000000)]
+2007-11-09 Beth Dakin <bdakin@apple.com>
+
+ Reviewed by Oliver.
+
+ Fix for <rdar://problem/5586370> CSS Transform - incorrect matrix
+ math leads to crazy problems
+
+ Transform matrices accept the first four parameters as CSS lengths.
+ CSS lengths get mapped into WebCore::Lengths as percents by
+ WebCore::convertToLength(). Percent lengths cannot call value(). It
+ does not yield a correct result and it asserts on Debug builds.
+
+ * rendering/RenderStyle.h:
+ (WebCore::MatrixTransformOperation::apply): Instead of calling
+ value() on the lengths, call calcValue. This fixes the assert and
+ the bad rendering.
+
2007-11-09 Simon Hausmann <hausmann@kde.org>
Reviewed by nobody, build/link fix for Qt/Windows.
virtual void apply(AffineTransform& transform, const IntSize& borderBoxSize)
{
- AffineTransform matrix(m_a.value(), m_b.value(), m_c.value(), m_d.value(), m_e.calcValue(borderBoxSize.width()), m_f.calcValue(borderBoxSize.height()));
+ AffineTransform matrix(m_a.calcValue(1), m_b.calcValue(1), m_c.calcValue(1), m_d.calcValue(1), m_e.calcValue(borderBoxSize.width()), m_f.calcValue(borderBoxSize.height()));
transform.multiply(matrix);
}