Changeset 27978 in webkit
- Timestamp:
- Nov 22, 2007 8:11:09 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r27970 r27978 1 2007-11-22 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 - pixel test for http://bugs.webkit.org/show_bug.cgi?id=15943 6 -webkit-transform matrix does not work 7 8 * fast/transforms/matrix-01.html: Added. 9 * platform/mac/fast/transforms/matrix-01-expected.checksum: Added. 10 * platform/mac/fast/transforms/matrix-01-expected.png: Added. 11 * platform/mac/fast/transforms/matrix-01-expected.txt: Added. 12 1 13 2007-11-22 Julien Chaffraix <julien.chaffraix@gmail.com> 2 14 -
trunk/WebCore/ChangeLog
r27973 r27978 1 2007-11-22 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=15943 6 -webkit-transform matrix does not work 7 8 Test: fast/transforms/matrix-01.html 9 10 Parse all six matrix entries as numbers. 11 12 * css/CSSParser.cpp: 13 (WebCore::TransformOperationInfo::TransformOperationInfo): 14 (WebCore::CSSParser::parseTransform): 15 * css/CSSStyleSelector.cpp: 16 (WebCore::CSSStyleSelector::applyProperty): 17 * rendering/RenderStyle.cpp: 18 (WebCore::MatrixTransformOperation::blend): 19 * rendering/RenderStyle.h: 20 (WebCore::MatrixTransformOperation::MatrixTransformOperation): 21 (WebCore::MatrixTransformOperation::apply): 22 1 23 2007-11-22 Laszlo Gombos <laszlo.gombos@gmail.com> 2 24 -
trunk/WebCore/css/CSSParser.cpp
r27650 r27978 3326 3326 m_type = CSSTransformValue::MatrixTransformOperation; 3327 3327 m_argCount = 11; 3328 m_unit = CSSParser::F Length;3328 m_unit = CSSParser::FNumber; 3329 3329 } 3330 3330 … … 3383 3383 unsigned argNumber = 0; 3384 3384 while (a) { 3385 bool strictParsing = true;3386 3385 CSSParser::Units unit = info.unit(); 3387 if (info.type() == CSSTransformValue::MatrixTransformOperation) { 3388 // We use lax parsing for matrix(), since we want to allow raw numbers to be converted to fixed lengths. 3389 strictParsing = false; 3390 3391 // Allow percents in the last two spots of matrix(). 3392 if (argNumber >= 4) 3393 unit = (unit | CSSParser::FPercent); 3394 } 3395 3396 if (!validUnit(a, unit, strictParsing)) 3386 3387 if (!validUnit(a, unit, true)) 3397 3388 return 0; 3398 3389 -
trunk/WebCore/css/CSSStyleSelector.cpp
r27951 r27978 3978 3978 CSSPrimitiveValue* fifthValue = static_cast<CSSPrimitiveValue*>(values->item(4)); 3979 3979 CSSPrimitiveValue* sixthValue = static_cast<CSSPrimitiveValue*>(values->item(5)); 3980 bool ok; 3981 MatrixTransformOperation* matrix = new MatrixTransformOperation(convertToLength(firstValue, style, &ok), 3982 convertToLength(secondValue, style, &ok), 3983 convertToLength(thirdValue, style, &ok), 3984 convertToLength(fourthValue, style, &ok), 3985 convertToLength(fifthValue, style, &ok), 3986 convertToLength(sixthValue, style, &ok)); 3980 MatrixTransformOperation* matrix = new MatrixTransformOperation(firstValue->getDoubleValue(), 3981 secondValue->getDoubleValue(), 3982 thirdValue->getDoubleValue(), 3983 fourthValue->getDoubleValue(), 3984 fifthValue->getDoubleValue(), 3985 sixthValue->getDoubleValue()); 3987 3986 operations.append(matrix); 3988 3987 break; -
trunk/WebCore/rendering/RenderStyle.cpp
r27951 r27978 514 514 515 515 if (blendToIdentity) 516 return new MatrixTransformOperation( Length(1, m_a.type()).blend(m_a, progress),517 Length(0, m_b.type()).blend(m_b,progress),518 Length(0, m_c.type()).blend(m_c,progress),519 Length(1, m_d.type()).blend(m_d, progress),520 Length(0, m_e.type()).blend(m_e,progress),521 Length(0, m_f.type()).blend(m_f,progress));516 return new MatrixTransformOperation(m_a * (1. - progress) + progress, 517 m_b * (1. - progress), 518 m_c * (1. - progress), 519 m_d * (1. - progress) + progress, 520 m_e * (1. - progress), 521 m_f * (1. - progress)); 522 522 523 523 const MatrixTransformOperation* fromOp = static_cast<const MatrixTransformOperation*>(from); 524 Length fromA = fromOp ? fromOp->m_a : Length(1, m_a.type());525 Length fromB = fromOp ? fromOp->m_b : Length(0, m_b.type());526 Length fromC = fromOp ? fromOp->m_c : Length(0, m_c.type());527 Length fromD = fromOp ? fromOp->m_d : Length(1, m_d.type());528 Length fromE = fromOp ? fromOp->m_e : Length(0, m_e.type());529 Length fromF = fromOp ? fromOp->m_f : Length(0, m_f.type());530 531 return new MatrixTransformOperation( m_a.blend(fromA, progress),532 m_b.blend(fromB, progress),533 m_c.blend(fromC, progress),534 m_d.blend(fromD, progress),535 m_e.blend(fromE, progress),536 m_f.blend(fromF, progress));524 double fromA = fromOp ? fromOp->m_a : 1.; 525 double fromB = fromOp ? fromOp->m_b : 0; 526 double fromC = fromOp ? fromOp->m_c : 0; 527 double fromD = fromOp ? fromOp->m_d : 1.; 528 double fromE = fromOp ? fromOp->m_e : 0; 529 double fromF = fromOp ? fromOp->m_f : 0; 530 531 return new MatrixTransformOperation(fromA + (m_a - fromA) * progress, 532 fromB + (m_b - fromB) * progress, 533 fromC + (m_c - fromC) * progress, 534 fromD + (m_d - fromD) * progress, 535 fromE + (m_e - fromE) * progress, 536 fromF + (m_f - fromF) * progress); 537 537 } 538 538 -
trunk/WebCore/rendering/RenderStyle.h
r27776 r27978 770 770 { 771 771 public: 772 MatrixTransformOperation( const Length& a, const Length& b, const Length& c, const Length& d, const Length& e, const Length&f)772 MatrixTransformOperation(double a, double b, double c, double d, double e, double f) 773 773 : m_a(a), m_b(b), m_c(c), m_d(d), m_e(e), m_f(f) 774 774 {} … … 787 787 virtual void apply(AffineTransform& transform, const IntSize& borderBoxSize) 788 788 { 789 AffineTransform matrix(m_a .value(), m_b.value(), m_c.value(), m_d.value(), m_e.calcValue(borderBoxSize.width()), m_f.calcValue(borderBoxSize.height()));789 AffineTransform matrix(m_a, m_b, m_c, m_d, m_e, m_f); 790 790 transform.multiply(matrix); 791 791 } … … 794 794 795 795 private: 796 Lengthm_a;797 Lengthm_b;798 Lengthm_c;799 Lengthm_d;800 Lengthm_e;801 Lengthm_f;796 double m_a; 797 double m_b; 798 double m_c; 799 double m_d; 800 double m_e; 801 double m_f; 802 802 }; 803 803
Note: See TracChangeset
for help on using the changeset viewer.