WebCore/ChangeLog

 12009-02-11 Chris Marrin <cmarrin@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 https://bugs.webkit.org/show_bug.cgi?id=23908
 6
 7 Added parsing of 3d transform functions and properties
 8 (perspective, perspective-origin, transform-style-3d,
 9 and backface-visibility).
 10
 11 Test: transforms/3d/cssmatrix-3d-interface.xhtml
 12
 13 * css/CSSComputedStyleDeclaration.cpp:
 14 (WebCore::):
 15 (WebCore::computedTransform):
 16 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
 17 * css/CSSMutableStyleDeclaration.cpp:
 18 (WebCore::CSSMutableStyleDeclaration::getPropertyValue):
 19 * css/CSSParser.cpp:
 20 (WebCore::CSSParser::parseValue):
 21 (WebCore::CSSParser::parseTransformOrigin):
 22 (WebCore::TransformOperationInfo::TransformOperationInfo):
 23 (WebCore::CSSParser::parseTransform):
 24 (WebCore::CSSParser::parsePerspectiveOrigin):
 25 * css/CSSParser.h:
 26 * css/CSSPropertyNames.in:
 27 * css/CSSStyleSelector.cpp:
 28 (WebCore::CSSStyleSelector::adjustRenderStyle):
 29 (WebCore::CSSStyleSelector::applyProperty):
 30 (WebCore::getTransformOperationType):
 31 (WebCore::CSSStyleSelector::createTransformOperations):
 32 * css/CSSValueKeywords.in:
 33 * css/WebKitCSSTransformValue.cpp:
 34 (WebCore::WebKitCSSTransformValue::cssText):
 35 * css/WebKitCSSTransformValue.h:
 36 (WebCore::WebKitCSSTransformValue::):
 37 * css/WebKitCSSTransformValue.idl:
 38 * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
 39 * platform/graphics/transforms/Matrix3DTransformOperation.h:
 40 * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
 41 * platform/graphics/transforms/PerspectiveTransformOperation.h:
 42 * platform/graphics/transforms/RotateTransformOperation.cpp:
 43 (WebCore::RotateTransformOperation::blend):
 44 * platform/graphics/transforms/RotateTransformOperation.h:
 45 (WebCore::RotateTransformOperation::RotateTransformOperation):
 46 * platform/graphics/transforms/ScaleTransformOperation.h:
 47 (WebCore::ScaleTransformOperation::ScaleTransformOperation):
 48 * platform/graphics/transforms/TransformOperation.h:
 49 (WebCore::TransformOperation::is3DOperation):
 50 * platform/graphics/transforms/TransformOperations.h:
 51 (WebCore::TransformOperations::has3DOperation):
 52 * platform/graphics/transforms/TranslateTransformOperation.h:
 53 (WebCore::TranslateTransformOperation::TranslateTransformOperation):
 54
1552009-02-11 David Hyatt <hyatt@apple.com>
256
357 Eliminate createInlineBox and dirtyLineBoxes from RenderObject. These functions have been devirtualized.
40880

WebCore/css/CSSComputedStyleDeclaration.cpp

@@static const int computedProperties[] =
142142 CSSPropertyWebkitAnimationName,
143143 CSSPropertyWebkitAnimationTimingFunction,
144144 CSSPropertyWebkitAppearance,
 145 CSSPropertyWebkitBackfaceVisibility,
145146 CSSPropertyWebkitBackgroundClip,
146147 CSSPropertyWebkitBackgroundComposite,
147148 CSSPropertyWebkitBackgroundOrigin,

@@static const int computedProperties[] =
189190 CSSPropertyWebkitMaskOrigin,
190191 CSSPropertyWebkitMaskSize,
191192 CSSPropertyWebkitNbspMode,
 193 CSSPropertyWebkitPerspective,
 194 CSSPropertyWebkitPerspectiveOrigin,
192195 CSSPropertyWebkitRtlOrdering,
193196 CSSPropertyWebkitTextDecorationsInEffect,
194197 CSSPropertyWebkitTextFillColor,

@@static const int computedProperties[] =
197200 CSSPropertyWebkitTextStrokeWidth,
198201 CSSPropertyWebkitTransform,
199202 CSSPropertyWebkitTransformOrigin,
 203 CSSPropertyWebkitTransformStyle,
200204 CSSPropertyWebkitTransitionDelay,
201205 CSSPropertyWebkitTransitionDuration,
202206 CSSPropertyWebkitTransitionProperty,

@@static PassRefPtr<CSSValue> computedTran
419423 TransformationMatrix transform;
420424 style->applyTransform(transform, box.size(), RenderStyle::ExcludeTransformOrigin);
421425
422  RefPtr<WebKitCSSTransformValue> transformVal = WebKitCSSTransformValue::create(WebKitCSSTransformValue::MatrixTransformOperation);
 426 RefPtr<WebKitCSSTransformValue> transformVal;
423427
424  transformVal->append(CSSPrimitiveValue::create(transform.a(), CSSPrimitiveValue::CSS_NUMBER));
425  transformVal->append(CSSPrimitiveValue::create(transform.b(), CSSPrimitiveValue::CSS_NUMBER));
426  transformVal->append(CSSPrimitiveValue::create(transform.c(), CSSPrimitiveValue::CSS_NUMBER));
427  transformVal->append(CSSPrimitiveValue::create(transform.d(), CSSPrimitiveValue::CSS_NUMBER));
428  transformVal->append(CSSPrimitiveValue::create(transform.e(), CSSPrimitiveValue::CSS_NUMBER));
429  transformVal->append(CSSPrimitiveValue::create(transform.f(), CSSPrimitiveValue::CSS_NUMBER));
 428 if (transform.isAffine()) {
 429 transformVal = WebKitCSSTransformValue::create(WebKitCSSTransformValue::MatrixTransformOperation);
 430
 431 transformVal->append(CSSPrimitiveValue::create(transform.a(), CSSPrimitiveValue::CSS_NUMBER));
 432 transformVal->append(CSSPrimitiveValue::create(transform.b(), CSSPrimitiveValue::CSS_NUMBER));
 433 transformVal->append(CSSPrimitiveValue::create(transform.c(), CSSPrimitiveValue::CSS_NUMBER));
 434 transformVal->append(CSSPrimitiveValue::create(transform.d(), CSSPrimitiveValue::CSS_NUMBER));
 435 transformVal->append(CSSPrimitiveValue::create(transform.e(), CSSPrimitiveValue::CSS_NUMBER));
 436 transformVal->append(CSSPrimitiveValue::create(transform.f(), CSSPrimitiveValue::CSS_NUMBER));
 437 } else {
 438 transformVal = WebKitCSSTransformValue::create(WebKitCSSTransformValue::Matrix3DTransformOperation);
 439
 440 transformVal->append(CSSPrimitiveValue::create(transform.m11(), CSSPrimitiveValue::CSS_NUMBER));
 441 transformVal->append(CSSPrimitiveValue::create(transform.m12(), CSSPrimitiveValue::CSS_NUMBER));
 442 transformVal->append(CSSPrimitiveValue::create(transform.m13(), CSSPrimitiveValue::CSS_NUMBER));
 443 transformVal->append(CSSPrimitiveValue::create(transform.m14(), CSSPrimitiveValue::CSS_NUMBER));
 444
 445 transformVal->append(CSSPrimitiveValue::create(transform.m21(), CSSPrimitiveValue::CSS_NUMBER));
 446 transformVal->append(CSSPrimitiveValue::create(transform.m22(), CSSPrimitiveValue::CSS_NUMBER));
 447 transformVal->append(CSSPrimitiveValue::create(transform.m23(), CSSPrimitiveValue::CSS_NUMBER));
 448 transformVal->append(CSSPrimitiveValue::create(transform.m24(), CSSPrimitiveValue::CSS_NUMBER));
 449
 450 transformVal->append(CSSPrimitiveValue::create(transform.m31(), CSSPrimitiveValue::CSS_NUMBER));
 451 transformVal->append(CSSPrimitiveValue::create(transform.m32(), CSSPrimitiveValue::CSS_NUMBER));
 452 transformVal->append(CSSPrimitiveValue::create(transform.m33(), CSSPrimitiveValue::CSS_NUMBER));
 453 transformVal->append(CSSPrimitiveValue::create(transform.m34(), CSSPrimitiveValue::CSS_NUMBER));
 454
 455 transformVal->append(CSSPrimitiveValue::create(transform.m41(), CSSPrimitiveValue::CSS_NUMBER));
 456 transformVal->append(CSSPrimitiveValue::create(transform.m42(), CSSPrimitiveValue::CSS_NUMBER));
 457 transformVal->append(CSSPrimitiveValue::create(transform.m43(), CSSPrimitiveValue::CSS_NUMBER));
 458 transformVal->append(CSSPrimitiveValue::create(transform.m44(), CSSPrimitiveValue::CSS_NUMBER));
 459 }
430460
431461 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
432462 list->append(transformVal);

@@PassRefPtr<CSSValue> CSSComputedStyleDec
11141144 return getTimingFunctionValue(style->animations());
11151145 case CSSPropertyWebkitAppearance:
11161146 return CSSPrimitiveValue::create(style->appearance());
 1147 case CSSPropertyWebkitBackfaceVisibility:
 1148 return CSSPrimitiveValue::createIdentifier(style->backfaceVisibility() ? CSSValueVisible : CSSValueHidden);
11171149 case CSSPropertyWebkitBorderImage:
11181150 return valueForNinePieceImage(style->borderImage());
11191151 case CSSPropertyWebkitMaskBoxImage:

@@PassRefPtr<CSSValue> CSSComputedStyleDec
11251157 return CSSPrimitiveValue::create(style->marginBottomCollapse());
11261158 case CSSPropertyWebkitMarginTopCollapse:
11271159 return CSSPrimitiveValue::create(style->marginTopCollapse());
 1160 case CSSPropertyWebkitPerspective:
 1161 if (style->perspective() == 0)
 1162 return CSSPrimitiveValue::createIdentifier(CSSValueNone);
 1163 return CSSPrimitiveValue::create(style->perspective(), CSSPrimitiveValue::CSS_NUMBER);
 1164 case CSSPropertyWebkitPerspectiveOrigin: {
 1165 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
 1166 if (renderer) {
 1167 IntRect box = sizingBox(renderer);
 1168 list->append(CSSPrimitiveValue::create(style->perspectiveOriginX().calcMinValue(box.width()), CSSPrimitiveValue::CSS_PX));
 1169 list->append(CSSPrimitiveValue::create(style->perspectiveOriginY().calcMinValue(box.height()), CSSPrimitiveValue::CSS_PX));
 1170 }
 1171 else {
 1172 list->append(CSSPrimitiveValue::create(style->perspectiveOriginX()));
 1173 list->append(CSSPrimitiveValue::create(style->perspectiveOriginY()));
 1174 }
 1175 return list.release();
 1176 }
11281177 case CSSPropertyWebkitRtlOrdering:
11291178 if (style->visuallyOrdered())
11301179 return CSSPrimitiveValue::createIdentifier(CSSValueVisual);

@@PassRefPtr<CSSValue> CSSComputedStyleDec
11611210 IntRect box = sizingBox(renderer);
11621211 list->append(CSSPrimitiveValue::create(style->transformOriginX().calcMinValue(box.width()), CSSPrimitiveValue::CSS_PX));
11631212 list->append(CSSPrimitiveValue::create(style->transformOriginY().calcMinValue(box.height()), CSSPrimitiveValue::CSS_PX));
 1213 if (style->transformOriginZ() != 0)
 1214 list->append(CSSPrimitiveValue::create(style->transformOriginZ(), CSSPrimitiveValue::CSS_PX));
11641215 } else {
11651216 list->append(CSSPrimitiveValue::create(style->transformOriginX()));
11661217 list->append(CSSPrimitiveValue::create(style->transformOriginY()));
 1218 if (style->transformOriginZ() != 0)
 1219 list->append(CSSPrimitiveValue::create(style->transformOriginZ(), CSSPrimitiveValue::CSS_PX));
11671220 }
11681221 return list.release();
11691222 }
 1223 case CSSPropertyWebkitTransformStyle:
 1224 return CSSPrimitiveValue::createIdentifier(style->transformStyle3D() ? CSSValuePreserve3d : CSSValueFlat);
11701225 case CSSPropertyWebkitTransitionDelay:
11711226 return getDelayValue(style->transitions());
11721227 case CSSPropertyWebkitTransitionDuration:
40876

WebCore/css/CSSMutableStyleDeclaration.cpp

@@String CSSMutableStyleDeclaration::getPr
217217 return getLayeredShorthandValue(properties, 6);
218218 }
219219 case CSSPropertyWebkitTransformOrigin: {
220  const int properties[2] = { CSSPropertyWebkitTransformOriginX,
221  CSSPropertyWebkitTransformOriginY };
222  return getShorthandValue(properties, 2);
 220 const int properties[3] = { CSSPropertyWebkitTransformOriginX,
 221 CSSPropertyWebkitTransformOriginY,
 222 CSSPropertyWebkitTransformOriginZ };
 223 return getShorthandValue(properties, 3);
223224 }
224225 case CSSPropertyWebkitTransition: {
225226 const int properties[4] = { CSSPropertyWebkitTransitionProperty, CSSPropertyWebkitTransitionDuration,
40876

WebCore/css/CSSParser.cpp

@@bool CSSParser::parseValue(int propId, b
12981298 break;
12991299 case CSSPropertyWebkitTransformOrigin:
13001300 case CSSPropertyWebkitTransformOriginX:
1301  case CSSPropertyWebkitTransformOriginY: {
 1301 case CSSPropertyWebkitTransformOriginY:
 1302 case CSSPropertyWebkitTransformOriginZ:
 1303 {
 1304 RefPtr<CSSValue> val1;
 1305 RefPtr<CSSValue> val2;
 1306 RefPtr<CSSValue> val3;
 1307 int propId1, propId2, propId3;
 1308 if (parseTransformOrigin(propId, propId1, propId2, propId3, val1, val2, val3)) {
 1309 addProperty(propId1, val1.release(), important);
 1310 if (val2)
 1311 addProperty(propId2, val2.release(), important);
 1312 if (val3)
 1313 addProperty(propId3, val3.release(), important);
 1314 return true;
 1315 }
 1316 return false;
 1317 }
 1318 case CSSPropertyWebkitTransformStyle:
 1319 if (value->id == CSSValueFlat || value->id == CSSValuePreserve3d)
 1320 valid_primitive = true;
 1321 break;
 1322 case CSSPropertyWebkitBackfaceVisibility:
 1323 if (value->id == CSSValueVisible || value->id == CSSValueHidden)
 1324 valid_primitive = true;
 1325 break;
 1326 case CSSPropertyWebkitPerspective:
 1327 if (id == CSSValueNone)
 1328 valid_primitive = true;
 1329 else {
 1330 if (validUnit(value, FNumber|FNonNeg, m_strict)) {
 1331 RefPtr<CSSValue> val = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit);
 1332 if (val) {
 1333 addProperty(propId, val.release(), important);
 1334 return true;
 1335 }
 1336 return false;
 1337 }
 1338 }
 1339 break;
 1340 case CSSPropertyWebkitPerspectiveOrigin:
 1341 case CSSPropertyWebkitPerspectiveOriginX:
 1342 case CSSPropertyWebkitPerspectiveOriginY: {
13021343 RefPtr<CSSValue> val1;
13031344 RefPtr<CSSValue> val2;
13041345 int propId1, propId2;
1305  if (parseTransformOrigin(propId, propId1, propId2, val1, val2)) {
 1346 if (parsePerspectiveOrigin(propId, propId1, propId2, val1, val2)) {
13061347 addProperty(propId1, val1.release(), important);
13071348 if (val2)
13081349 addProperty(propId2, val2.release(), important);

@@PassRefPtr<CSSValue> CSSParser::parseAni
23622403 return 0;
23632404}
23642405
 2406void CSSParser::parseTransformOrigin(RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2, RefPtr<CSSValue>& value3)
 2407{
 2408 parseFillPosition(value1, value2);
 2409
 2410 // now get z
 2411 if (m_valueList->current() && validUnit(m_valueList->current(), FLength, m_strict))
 2412 value3 = CSSPrimitiveValue::create(m_valueList->current()->fValue,
 2413 (CSSPrimitiveValue::UnitTypes)m_valueList->current()->unit);
 2414 if (value3)
 2415 m_valueList->next();
 2416}
 2417
23652418bool CSSParser::parseTimingFunctionValue(CSSParserValueList*& args, double& result)
23662419{
23672420 CSSParserValue* v = args->current();

@@public:
40244077 m_argCount = 11;
40254078 m_unit = CSSParser::FNumber;
40264079 }
4027 
 4080 else if (equalIgnoringCase(name, "scalez(")) {
 4081 m_unit = CSSParser::FNumber;
 4082 m_type = WebKitCSSTransformValue::ScaleZTransformOperation;
 4083 } else if (equalIgnoringCase(name, "scale3d(")) {
 4084 m_type = WebKitCSSTransformValue::Scale3DTransformOperation;
 4085 m_argCount = 5;
 4086 m_unit = CSSParser::FNumber;
 4087 } else if (equalIgnoringCase(name, "rotatex(") ||
 4088 equalIgnoringCase(name, "rotatey(") ||
 4089 equalIgnoringCase(name, "rotatez(")) {
 4090 m_unit = CSSParser::FAngle;
 4091 if (equalIgnoringCase(name, "rotatex("))
 4092 m_type = WebKitCSSTransformValue::RotateXTransformOperation;
 4093 else if (equalIgnoringCase(name, "rotatey("))
 4094 m_type = WebKitCSSTransformValue::RotateYTransformOperation;
 4095 else
 4096 m_type = WebKitCSSTransformValue::RotateZTransformOperation;
 4097 } else if (equalIgnoringCase(name, "rotate3d(")) {
 4098 m_type = WebKitCSSTransformValue::Rotate3DTransformOperation;
 4099 m_argCount = 7;
 4100 m_unit = CSSParser::FNumber;
 4101 } else if (equalIgnoringCase(name, "translatez(")) {
 4102 m_unit = CSSParser::FLength | CSSParser::FPercent;
 4103 m_type = WebKitCSSTransformValue::TranslateZTransformOperation;
 4104 } else if (equalIgnoringCase(name, "translate3d(")) {
 4105 m_type = WebKitCSSTransformValue::Translate3DTransformOperation;
 4106 m_argCount = 5;
 4107 m_unit = CSSParser::FLength | CSSParser::FPercent;
 4108 } else if (equalIgnoringCase(name, "matrix3d(")) {
 4109 m_type = WebKitCSSTransformValue::Matrix3DTransformOperation;
 4110 m_argCount = 31;
 4111 m_unit = CSSParser::FNumber;
 4112 } else if (equalIgnoringCase(name, "perspective(")) {
 4113 m_type = WebKitCSSTransformValue::PerspectiveTransformOperation;
 4114 m_unit = CSSParser::FNumber;
 4115 }
 4116
40284117 if (equalIgnoringCase(name, "scale(") || equalIgnoringCase(name, "skew(") || equalIgnoringCase(name, "translate(")) {
40294118 m_allowSingleArgument = true;
40304119 m_argCount = 3;

@@PassRefPtr<CSSValueList> CSSParser::pars
40804169 while (a) {
40814170 CSSParser::Units unit = info.unit();
40824171
4083  if (!validUnit(a, unit, true))
 4172 if (info.type() == WebKitCSSTransformValue::Rotate3DTransformOperation && argNumber == 3) {
 4173 if (!validUnit(a, FAngle, true))
 4174 return 0;
 4175 } else if (!validUnit(a, unit, true))
40844176 return 0;
40854177
40864178 // Add the value to the current transform operation.

@@PassRefPtr<CSSValueList> CSSParser::pars
41004192 return list.release();
41014193}
41024194
4103 bool CSSParser::parseTransformOrigin(int propId, int& propId1, int& propId2, RefPtr<CSSValue>& value, RefPtr<CSSValue>& value2)
 4195bool CSSParser::parseTransformOrigin(int propId, int& propId1, int& propId2, int& propId3, RefPtr<CSSValue>& value, RefPtr<CSSValue>& value2, RefPtr<CSSValue>& value3)
41044196{
41054197 propId1 = propId;
41064198 propId2 = propId;
 4199 propId3 = propId;
41074200 if (propId == CSSPropertyWebkitTransformOrigin) {
41084201 propId1 = CSSPropertyWebkitTransformOriginX;
41094202 propId2 = CSSPropertyWebkitTransformOriginY;
 4203 propId3 = CSSPropertyWebkitTransformOriginZ;
41104204 }
41114205
41124206 switch (propId) {
41134207 case CSSPropertyWebkitTransformOrigin:
4114  parseFillPosition(value, value2);
4115  // Unlike the other functions, parseFillPosition advances the m_valueList pointer
 4208 parseTransformOrigin(value, value2, value3);
 4209 // Unlike the other functions, parseTransformOrigin advances the m_valueList pointer
41164210 break;
41174211 case CSSPropertyWebkitTransformOriginX: {
41184212 bool xFound = false, yFound = true;

@@bool CSSParser::parseTransformOrigin(int
41284222 m_valueList->next();
41294223 break;
41304224 }
 4225 case CSSPropertyWebkitTransformOriginZ: {
 4226 if (validUnit(m_valueList->current(), FLength, m_strict))
 4227 value = CSSPrimitiveValue::create(m_valueList->current()->fValue,
 4228 (CSSPrimitiveValue::UnitTypes)m_valueList->current()->unit);
 4229 if (value)
 4230 m_valueList->next();
 4231 break;
 4232 }
41314233 }
41324234
4133  return value;
 4235 return (value != 0);
 4236}
 4237
 4238bool CSSParser::parsePerspectiveOrigin(int propId, int& propId1, int& propId2, RefPtr<CSSValue>& value, RefPtr<CSSValue>& value2)
 4239{
 4240 propId1 = propId;
 4241 propId2 = propId;
 4242 if (propId == CSSPropertyWebkitPerspectiveOrigin) {
 4243 propId1 = CSSPropertyWebkitPerspectiveOriginX;
 4244 propId2 = CSSPropertyWebkitPerspectiveOriginY;
 4245 }
 4246
 4247 switch (propId) {
 4248 case CSSPropertyWebkitPerspectiveOrigin:
 4249 parseFillPosition(value, value2);
 4250 break;
 4251 case CSSPropertyWebkitPerspectiveOriginX: {
 4252 bool xFound = false, yFound = true;
 4253 value = parseFillPositionXY(xFound, yFound);
 4254 if (value)
 4255 m_valueList->next();
 4256 break;
 4257 }
 4258 case CSSPropertyWebkitPerspectiveOriginY: {
 4259 bool xFound = true, yFound = false;
 4260 value = parseFillPositionXY(xFound, yFound);
 4261 if (value)
 4262 m_valueList->next();
 4263 break;
 4264 }
 4265 }
 4266
 4267 return (value != 0);
41344268}
41354269
41364270static inline int yyerror(const char*) { return 1; }
40876

WebCore/css/CSSParser.h

@@namespace WebCore {
9797 PassRefPtr<CSSValue> parseAnimationProperty();
9898 PassRefPtr<CSSValue> parseAnimationTimingFunction();
9999
 100 void parseTransformOrigin(RefPtr<CSSValue>&, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
100101 bool parseTimingFunctionValue(CSSParserValueList*& args, double& result);
101102 bool parseAnimationProperty(int propId, RefPtr<CSSValue>&);
102103 bool parseTransitionShorthand(bool important);

@@namespace WebCore {
144145 bool parseGradient(RefPtr<CSSValue>&);
145146
146147 PassRefPtr<CSSValueList> parseTransform();
147  bool parseTransformOrigin(int propId, int& propId1, int& propId2, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
148 
 148 bool parseTransformOrigin(int propId, int& propId1, int& propId2, int& propId3, RefPtr<CSSValue>&, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
 149 bool parsePerspectiveOrigin(int propId, int& propId1, int& propId, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
149150 bool parseVariable(CSSVariablesDeclaration*, const String& variableName, const String& variableValue);
150151 void parsePropertyWithResolvedVariables(int propId, bool important, CSSMutableStyleDeclaration*, CSSParserValueList*);
151152
40876

WebCore/css/CSSPropertyNames.in

@@zoom
151151-webkit-animation-name
152152-webkit-animation-timing-function
153153-webkit-appearance
 154-webkit-backface-visibility
154155-webkit-background-clip
155156-webkit-background-composite
156157-webkit-background-origin

@@zoom
216217-webkit-match-nearest-mail-blockquote-color
217218-webkit-nbsp-mode
218219-webkit-padding-start
 220-webkit-perspective
 221-webkit-perspective-origin
 222-webkit-perspective-origin-x
 223-webkit-perspective-origin-y
219224-webkit-rtl-ordering
220225-webkit-text-decorations-in-effect
221226-webkit-text-fill-color

@@zoom
228233-webkit-transform-origin
229234-webkit-transform-origin-x
230235-webkit-transform-origin-y
 236-webkit-transform-origin-z
 237-webkit-transform-style
231238-webkit-transition
232239-webkit-transition-delay
233240-webkit-transition-duration
40876

WebCore/css/CSSStyleSelector.cpp

6363#include "HTMLTextAreaElement.h"
6464#include "LinkHash.h"
6565#include "MatrixTransformOperation.h"
 66#include "Matrix3DTransformOperation.h"
6667#include "MediaList.h"
6768#include "MediaQueryEvaluator.h"
6869#include "NodeRenderStyle.h"
6970#include "Page.h"
7071#include "PageGroup.h"
7172#include "Pair.h"
 73#include "PerspectiveTransformOperation.h"
7274#include "Rect.h"
7375#include "RenderScrollbar.h"
7476#include "RenderScrollbarTheme.h"
 77#include "RenderStyleConstants.h"
7578#include "RenderTheme.h"
7679#include "RotateTransformOperation.h"
7780#include "ScaleTransformOperation.h"

8386#include "StyleGeneratedImage.h"
8487#include "StyleSheetList.h"
8588#include "Text.h"
 89#include "TransformationMatrix.h"
8690#include "TranslateTransformOperation.h"
8791#include "UserAgentStyleSheets.h"
8892#include "WebKitCSSKeyframeRule.h"

@@void CSSStyleSelector::adjustRenderStyle
14801484 // cases where objects that should be blended as a single unit end up with a non-transparent
14811485 // object wedged in between them. Auto z-index also becomes 0 for objects that specify transforms/masks/reflections.
14821486 if (style->hasAutoZIndex() && ((e && e->document()->documentElement() == e) || style->opacity() < 1.0f ||
1483  style->hasTransform() || style->hasMask() || style->boxReflect()))
 1487 style->hasTransformRelatedProperty() || style->hasMask() || style->boxReflect()))
14841488 style->setZIndex(0);
14851489
14861490 // Button, legend, input, select and textarea all consider width values of 'auto' to be 'intrinsic'.

@@void CSSStyleSelector::applyProperty(int
46084612 return;
46094613 case CSSPropertyUnicodeRange: // Only used in @font-face rules.
46104614 return;
 4615 case CSSPropertyWebkitBackfaceVisibility:
 4616 HANDLE_INHERIT_AND_INITIAL(backfaceVisibility, BackfaceVisibility)
 4617 m_style->setBackfaceVisibility((primitiveValue && primitiveValue->getIdent() == CSSValueVisible) ? BackfaceVisibilityVisible : BackfaceVisibilityHidden);
 4618 return;
46114619 case CSSPropertyWebkitBoxDirection:
46124620 HANDLE_INHERIT_AND_INITIAL(boxDirection, BoxDirection)
46134621 if (primitiveValue)

@@void CSSStyleSelector::applyProperty(int
49834991 case CSSPropertyWebkitTransformOrigin:
49844992 HANDLE_INHERIT_AND_INITIAL(transformOriginX, TransformOriginX)
49854993 HANDLE_INHERIT_AND_INITIAL(transformOriginY, TransformOriginY)
 4994 HANDLE_INHERIT_AND_INITIAL(transformOriginZ, TransformOriginZ)
49864995 return;
49874996 case CSSPropertyWebkitTransformOriginX: {
49884997 HANDLE_INHERIT_AND_INITIAL(transformOriginX, TransformOriginX)

@@void CSSStyleSelector::applyProperty(int
50125021 m_style->setTransformOriginY(l);
50135022 break;
50145023 }
 5024 case CSSPropertyWebkitTransformOriginZ: {
 5025 HANDLE_INHERIT_AND_INITIAL(transformOriginZ, TransformOriginZ)
 5026 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
 5027 float f;
 5028 int type = primitiveValue->primitiveType();
 5029 if (type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG)
 5030 f = (float) primitiveValue->computeLengthIntForLength(style());
 5031 else
 5032 return;
 5033 m_style->setTransformOriginZ(f);
 5034 break;
 5035 }
 5036 case CSSPropertyWebkitTransformStyle:
 5037 HANDLE_INHERIT_AND_INITIAL(transformStyle3D, TransformStyle3D)
 5038 m_style->setTransformStyle3D((primitiveValue && primitiveValue->getIdent() == CSSValuePreserve3d) ? TransformStyle3DPreserve3D : TransformStyle3DFlat);
 5039 return;
 5040 case CSSPropertyWebkitPerspective: {
 5041 HANDLE_INHERIT_AND_INITIAL(perspective, Perspective)
 5042 if (primitiveValue && primitiveValue->getIdent() == CSSValueNone) {
 5043 m_style->setPerspective(0);
 5044 return;
 5045 }
 5046
 5047 if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
 5048 return;
 5049 float perspectiveValue = (float) primitiveValue->getDoubleValue();
 5050 if (perspectiveValue >= 0.0f)
 5051 m_style->setPerspective(perspectiveValue);
 5052 return;
 5053 }
 5054 case CSSPropertyWebkitPerspectiveOrigin:
 5055 HANDLE_INHERIT_AND_INITIAL(perspectiveOriginX, PerspectiveOriginX)
 5056 HANDLE_INHERIT_AND_INITIAL(perspectiveOriginY, PerspectiveOriginY)
 5057 return;
 5058 case CSSPropertyWebkitPerspectiveOriginX: {
 5059 HANDLE_INHERIT_AND_INITIAL(perspectiveOriginX, PerspectiveOriginX)
 5060 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
 5061 Length l;
 5062 int type = primitiveValue->primitiveType();
 5063 if (type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG)
 5064 l = Length(primitiveValue->computeLengthIntForLength(style(), zoomFactor), Fixed);
 5065 else if (type == CSSPrimitiveValue::CSS_PERCENTAGE)
 5066 l = Length(primitiveValue->getDoubleValue(), Percent);
 5067 else
 5068 return;
 5069 m_style->setPerspectiveOriginX(l);
 5070 return;
 5071 }
 5072 case CSSPropertyWebkitPerspectiveOriginY: {
 5073 HANDLE_INHERIT_AND_INITIAL(perspectiveOriginY, PerspectiveOriginY)
 5074 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
 5075 Length l;
 5076 int type = primitiveValue->primitiveType();
 5077 if (type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG)
 5078 l = Length(primitiveValue->computeLengthIntForLength(style(), zoomFactor), Fixed);
 5079 else if(type == CSSPrimitiveValue::CSS_PERCENTAGE)
 5080 l = Length(primitiveValue->getDoubleValue(), Percent);
 5081 else
 5082 return;
 5083 m_style->setPerspectiveOriginY(l);
 5084 return;
 5085 }
50155086 case CSSPropertyWebkitAnimation:
50165087 if (isInitial)
50175088 m_style->clearAnimations();

@@static TransformOperation::OperationType
57935864 case WebKitCSSTransformValue::SkewXTransformOperation: return TransformOperation::SKEW_X;
57945865 case WebKitCSSTransformValue::SkewYTransformOperation: return TransformOperation::SKEW_Y;
57955866 case WebKitCSSTransformValue::MatrixTransformOperation: return TransformOperation::MATRIX;
 5867 case WebKitCSSTransformValue::TranslateZTransformOperation: return TransformOperation::TRANSLATE_Z;
 5868 case WebKitCSSTransformValue::Translate3DTransformOperation: return TransformOperation::TRANSLATE_3D;
 5869 case WebKitCSSTransformValue::RotateXTransformOperation: return TransformOperation::ROTATE_X;
 5870 case WebKitCSSTransformValue::RotateYTransformOperation: return TransformOperation::ROTATE_Y;
 5871 case WebKitCSSTransformValue::RotateZTransformOperation: return TransformOperation::ROTATE_Z;
 5872 case WebKitCSSTransformValue::Rotate3DTransformOperation: return TransformOperation::ROTATE_3D;
 5873 case WebKitCSSTransformValue::ScaleZTransformOperation: return TransformOperation::SCALE_Z;
 5874 case WebKitCSSTransformValue::Scale3DTransformOperation: return TransformOperation::SCALE_3D;
 5875 case WebKitCSSTransformValue::PerspectiveTransformOperation: return TransformOperation::PERSPECTIVE;
 5876 case WebKitCSSTransformValue::Matrix3DTransformOperation: return TransformOperation::MATRIX_3D;
57965877 case WebKitCSSTransformValue::UnknownTransformOperation: return TransformOperation::NONE;
57975878 }
57985879 return TransformOperation::NONE;

@@bool CSSStyleSelector::createTransformOp
58275908 sy = sx;
58285909 }
58295910 }
5830  operations.operations().append(ScaleTransformOperation::create(sx, sy, getTransformOperationType(val->operationType())));
 5911 operations.operations().append(ScaleTransformOperation::create(sx, sy, 1.0, getTransformOperationType(val->operationType())));
 5912 break;
 5913 }
 5914 case WebKitCSSTransformValue::ScaleZTransformOperation:
 5915 case WebKitCSSTransformValue::Scale3DTransformOperation: {
 5916 double sx = 1.0;
 5917 double sy = 1.0;
 5918 double sz = 1.0;
 5919 if (val->operationType() == WebKitCSSTransformValue::ScaleZTransformOperation)
 5920 sz = firstValue->getDoubleValue();
 5921 else if (val->operationType() == WebKitCSSTransformValue::ScaleYTransformOperation)
 5922 sy = firstValue->getDoubleValue();
 5923 else {
 5924 sx = firstValue->getDoubleValue();
 5925 if (val->operationType() != WebKitCSSTransformValue::ScaleXTransformOperation) {
 5926 if (val->length() > 2) {
 5927 CSSPrimitiveValue* thirdValue = static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(2));
 5928 sz = thirdValue->getDoubleValue();
 5929 }
 5930 if (val->length() > 1) {
 5931 CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(1));
 5932 sy = secondValue->getDoubleValue();
 5933 } else
 5934 sy = sx;
 5935 }
 5936 }
 5937 operations.operations().append(ScaleTransformOperation::create(sx, sy, sz, getTransformOperationType(val->operationType())));
58315938 break;
58325939 }
58335940 case WebKitCSSTransformValue::TranslateTransformOperation:

@@bool CSSStyleSelector::createTransformOp
58515958 if (!ok)
58525959 return false;
58535960
5854  operations.operations().append(TranslateTransformOperation::create(tx, ty, getTransformOperationType(val->operationType())));
 5961 operations.operations().append(TranslateTransformOperation::create(tx, ty, Length(0, Fixed), getTransformOperationType(val->operationType())));
 5962 break;
 5963 }
 5964 case WebKitCSSTransformValue::TranslateZTransformOperation:
 5965 case WebKitCSSTransformValue::Translate3DTransformOperation: {
 5966 bool ok = true;
 5967 Length tx = Length(0, Fixed);
 5968 Length ty = Length(0, Fixed);
 5969 Length tz = Length(0, Fixed);
 5970 if (val->operationType() == WebKitCSSTransformValue::TranslateZTransformOperation)
 5971 tz = convertToLength(firstValue, inStyle, &ok);
 5972 else if (val->operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
 5973 ty = convertToLength(firstValue, inStyle, &ok);
 5974 else {
 5975 tx = convertToLength(firstValue, inStyle, &ok);
 5976 if (val->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
 5977 if (val->length() > 2) {
 5978 CSSPrimitiveValue* thirdValue = static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(2));
 5979 tz = convertToLength(thirdValue, inStyle, &ok);
 5980 }
 5981 if (val->length() > 1) {
 5982 CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(1));
 5983 ty = convertToLength(secondValue, inStyle, &ok);
 5984 }
 5985 }
 5986 }
 5987
 5988 if (!ok)
 5989 return false;
 5990
 5991 operations.operations().append(TranslateTransformOperation::create(tx, ty, tz, getTransformOperationType(val->operationType())));
58555992 break;
58565993 }
58575994 case WebKitCSSTransformValue::RotateTransformOperation: {

@@bool CSSStyleSelector::createTransformOp
58636000 else if (firstValue->primitiveType() == CSSPrimitiveValue::CSS_TURN)
58646001 angle = turn2deg(angle);
58656002
5866  operations.operations().append(RotateTransformOperation::create(angle, getTransformOperationType(val->operationType())));
 6003 operations.operations().append(RotateTransformOperation::create(0, 0, 1, angle, getTransformOperationType(val->operationType())));
 6004 break;
 6005 }
 6006 case WebKitCSSTransformValue::RotateXTransformOperation:
 6007 case WebKitCSSTransformValue::RotateYTransformOperation:
 6008 case WebKitCSSTransformValue::RotateZTransformOperation: {
 6009 double x = 0;
 6010 double y = 0;
 6011 double z = 0;
 6012 double angle = firstValue->getDoubleValue();
 6013 if (firstValue->primitiveType() == CSSPrimitiveValue::CSS_RAD)
 6014 angle = rad2deg(angle);
 6015 else if (firstValue->primitiveType() == CSSPrimitiveValue::CSS_GRAD)
 6016 angle = grad2deg(angle);
 6017
 6018 if (val->operationType() == WebKitCSSTransformValue::RotateXTransformOperation)
 6019 x = 1;
 6020 else if (val->operationType() == WebKitCSSTransformValue::RotateYTransformOperation)
 6021 y = 1;
 6022 else
 6023 z = 1;
 6024 operations.operations().append(RotateTransformOperation::create(x, y, z, angle, getTransformOperationType(val->operationType())));
 6025 break;
 6026 }
 6027 case WebKitCSSTransformValue::Rotate3DTransformOperation: {
 6028 CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(1));
 6029 CSSPrimitiveValue* thirdValue = static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(2));
 6030 CSSPrimitiveValue* fourthValue = static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(3));
 6031 double x = firstValue->getDoubleValue();
 6032 double y = secondValue->getDoubleValue();
 6033 double z = thirdValue->getDoubleValue();
 6034 double angle = fourthValue->getDoubleValue();
 6035 if (fourthValue->primitiveType() == CSSPrimitiveValue::CSS_RAD)
 6036 angle = rad2deg(angle);
 6037 else if (fourthValue->primitiveType() == CSSPrimitiveValue::CSS_GRAD)
 6038 angle = grad2deg(angle);
 6039 operations.operations().append(RotateTransformOperation::create(x, y, z, angle, getTransformOperationType(val->operationType())));
58676040 break;
58686041 }
58696042 case WebKitCSSTransformValue::SkewTransformOperation:

@@bool CSSStyleSelector::createTransformOp
59086081 operations.operations().append(MatrixTransformOperation::create(a, b, c, d, e, f));
59096082 break;
59106083 }
 6084 case WebKitCSSTransformValue::Matrix3DTransformOperation: {
 6085 TransformationMatrix matrix(static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(0))->getFloatValue(),
 6086 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(1))->getFloatValue(),
 6087 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(2))->getFloatValue(),
 6088 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(3))->getFloatValue(),
 6089 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(4))->getFloatValue(),
 6090 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(5))->getFloatValue(),
 6091 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(6))->getFloatValue(),
 6092 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(7))->getFloatValue(),
 6093 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(8))->getFloatValue(),
 6094 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(9))->getFloatValue(),
 6095 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(10))->getFloatValue(),
 6096 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(11))->getFloatValue(),
 6097 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(12))->getFloatValue(),
 6098 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(13))->getFloatValue(),
 6099 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(14))->getFloatValue(),
 6100 static_cast<CSSPrimitiveValue*>(val->itemWithoutBoundsCheck(15))->getFloatValue());
 6101 operations.operations().append(Matrix3DTransformOperation::create(matrix));
 6102 break;
 6103 }
 6104 case WebKitCSSTransformValue::PerspectiveTransformOperation: {
 6105 double p = firstValue->getDoubleValue();
 6106 if (p < 0.0)
 6107 return false;
 6108 operations.operations().append(PerspectiveTransformOperation::create(p));
 6109 break;
 6110 }
59116111 case WebKitCSSTransformValue::UnknownTransformOperation:
59126112 ASSERT_NOT_REACHED();
59136113 break;
40876

WebCore/css/CSSValueKeywords.in

@@running
575575paused
576576
577577#
 578# CSS_PROP__WEBKIT_TRANSFORM_STYLE
 579#
 580flat
 581preserve-3d
 582
 583#
578584# CSS_PROP__WEBKIT_TRANSITION_TIMING_FUNCTION
579585# CSS_PROP__WEBKIT_ANIMATION_TIMING_FUNCTION
580586#

@@painted
601607fill
602608stroke
603609#all
604 #none
605610\ No newline at end of file
 611#none
40876

WebCore/css/WebKitCSSTransformValue.cpp

@@String WebKitCSSTransformValue::cssText(
7979 case MatrixTransformOperation:
8080 result += "matrix(";
8181 break;
 82 case TranslateZTransformOperation:
 83 result += "translateZ(";
 84 break;
 85 case Translate3DTransformOperation:
 86 result += "translate3d(";
 87 break;
 88 case RotateXTransformOperation:
 89 result += "rotateX(";
 90 break;
 91 case RotateYTransformOperation:
 92 result += "rotateY(";
 93 break;
 94 case RotateZTransformOperation:
 95 result += "rotateZ(";
 96 break;
 97 case Rotate3DTransformOperation:
 98 result += "rotate3d(";
 99 break;
 100 case ScaleZTransformOperation:
 101 result += "scaleZ(";
 102 break;
 103 case Scale3DTransformOperation:
 104 result += "scale3d(";
 105 break;
 106 case PerspectiveTransformOperation:
 107 result += "perspective(";
 108 break;
 109 case Matrix3DTransformOperation:
 110 result += "matrix3d(";
 111 break;
82112 default:
83113 break;
84114 }
40876

WebCore/css/WebKitCSSTransformValue.h

@@public:
4747 SkewTransformOperation,
4848 SkewXTransformOperation,
4949 SkewYTransformOperation,
50  MatrixTransformOperation
 50 MatrixTransformOperation,
 51 TranslateZTransformOperation,
 52 Translate3DTransformOperation,
 53 RotateXTransformOperation,
 54 RotateYTransformOperation,
 55 RotateZTransformOperation,
 56 Rotate3DTransformOperation,
 57 ScaleZTransformOperation,
 58 Scale3DTransformOperation,
 59 PerspectiveTransformOperation,
 60 Matrix3DTransformOperation
5161 };
5262
5363 static PassRefPtr<WebKitCSSTransformValue> create(TransformOperationType type)
40876

WebCore/css/WebKitCSSTransformValue.idl

@@module css {
4848 const unsigned short CSS_SKEWX = 9;
4949 const unsigned short CSS_SKEWY = 10;
5050 const unsigned short CSS_MATRIX = 11;
 51 const unsigned short CSS_TRANSLATEZ = 12;
 52 const unsigned short CSS_TRANSLATE3D = 13;
 53 const unsigned short CSS_ROTATEX = 14;
 54 const unsigned short CSS_ROTATEY = 15;
 55 const unsigned short CSS_ROTATEZ = 16;
 56 const unsigned short CSS_ROTATE3D = 17;
 57 const unsigned short CSS_SCALEZ = 18;
 58 const unsigned short CSS_SCALE3D = 19;
 59 const unsigned short CSS_PERSPECTIVE = 20;
 60 const unsigned short CSS_MATRIX3D = 21;
5161
5262 readonly attribute unsigned short operationType;
5363 };
40876

WebCore/platform/graphics/transforms/Matrix3DTransformOperation.cpp

2626#include "config.h"
2727#include "Matrix3DTransformOperation.h"
2828
29 #if ENABLE(3D_TRANSFORMS)
30 
3129#include <algorithm>
3230
3331using namespace std;

@@PassRefPtr<TransformOperation> Matrix3DT
5654}
5755
5856} // namespace WebCore
59 
60 #endif // ENABLE(3D_TRANSFORMS)
40876

WebCore/platform/graphics/transforms/Matrix3DTransformOperation.h

2828
2929#include "TransformOperation.h"
3030
31 #if ENABLE(3D_TRANSFORMS)
32 
3331namespace WebCore {
3432
3533class Matrix3DTransformOperation : public TransformOperation {

@@private:
7169
7270} // namespace WebCore
7371
74 #endif // ENABLE(3D_TRANSFORMS)
75 
7672#endif // Matrix3DTransformOperation_h
40876

WebCore/platform/graphics/transforms/PerspectiveTransformOperation.cpp

2626#include "config.h"
2727#include "PerspectiveTransformOperation.h"
2828
29 #if ENABLE(3D_TRANSFORMS)
30 
3129#include <algorithm>
3230
3331using namespace std;

@@PassRefPtr<TransformOperation> Perspecti
6159}
6260
6361} // namespace WebCore
64 
65 #endif // ENABLE(3D_TRANSFORMS)
40876

WebCore/platform/graphics/transforms/PerspectiveTransformOperation.h

2828
2929#include "TransformOperation.h"
3030
31 #if ENABLE(3D_TRANSFORMS)
32 
3331namespace WebCore {
3432
3533class PerspectiveTransformOperation : public TransformOperation {

@@private:
7068
7169} // namespace WebCore
7270
73 #endif // ENABLE(3D_TRANSFORMS)
74 
7571#endif // PerspectiveTransformOperation_h
40876

WebCore/platform/graphics/transforms/RotateTransformOperation.cpp

@@PassRefPtr<TransformOperation> RotateTra
9292 y = 0.0f;
9393 z = 1.0f;
9494 }
95 #if ENABLE(3D_TRANSFORMS)
9695 return RotateTransformOperation::create(x, y, z, angle, ROTATE_3D);
97 #else
98  return RotateTransformOperation::create(0, 0, z, angle, ROTATE_Z);
99 #endif
10096}
10197
10298} // namespace WebCore
40876

WebCore/platform/graphics/transforms/RotateTransformOperation.h

@@private:
7272 , m_angle(angle)
7373 , m_type(type)
7474 {
75 #if ENABLE(3D_TRANSFORMS)
7675 ASSERT(type == ROTATE_X || type == ROTATE_Y || type == ROTATE_Z || type == ROTATE_3D);
77 #else
78  ASSERT(type == ROTATE_Z);
79  ASSERT(x == 0 && y == 0);
80 #endif
8176 }
8277
8378 double m_x;
40876

WebCore/platform/graphics/transforms/ScaleTransformOperation.h

@@private:
7373 , m_z(sz)
7474 , m_type(type)
7575 {
76 #if ENABLE(3D_TRANSFORMS)
7776 ASSERT(type == SCALE_X || type == SCALE_Y || type == SCALE_Z || type == SCALE || type == SCALE_3D);
78 #else
79  ASSERT(type == SCALE_X || type == SCALE_Y || type == SCALE);
80  ASSERT(sz == 1);
81 #endif
8277 }
8378
8479 double m_x;
40876

WebCore/platform/graphics/transforms/TransformOperation.h

@@public:
6666 virtual OperationType getOperationType() const = 0;
6767 virtual bool isSameType(const TransformOperation&) const { return false; }
6868
69 #if ENABLE(3D_TRANSFORMS)
7069 bool is3DOperation() const
7170 {
7271 OperationType opType = getOperationType();

@@public:
8079 opType == MATRIX_3D ||
8180 opType == PERSPECTIVE;
8281 }
83 #endif
8482};
8583
8684} // namespace WebCore
40877

WebCore/platform/graphics/transforms/TransformOperations.h

@@public:
4747 m_operations[i]->apply(t, sz);
4848 }
4949
50 #if ENABLE(3D_TRANSFORMS)
5150 // Return true if any of the operation types are 3D operation types (even if the
5251 // values describe affine transforms)
5352 bool has3DOperation() const

@@public:
5756 return true;
5857 return false;
5958 }
60 #endif
6159
6260 Vector<RefPtr<TransformOperation> >& operations() { return m_operations; }
6361 const Vector<RefPtr<TransformOperation> >& operations() const { return m_operations; }
40876

WebCore/platform/graphics/transforms/TranslateTransformOperation.h

@@private:
7474 , m_z(tz)
7575 , m_type(type)
7676 {
77 #if ENABLE(3D_TRANSFORMS)
7877 ASSERT(type == TRANSLATE_X || type == TRANSLATE_Y || type == TRANSLATE_Z || type == TRANSLATE || type == TRANSLATE_3D);
79 #else
80  ASSERT(type == TRANSLATE_X || type == TRANSLATE_Y || type == TRANSLATE);
81 #endif
8278 }
8379
8480 Length m_x;
40876

LayoutTests/ChangeLog

 12009-02-11 Chris Marrin <cmarrin@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 https://bugs.webkit.org/show_bug.cgi?id=23908
 6
 7 Added test for parsing 3d functions in webkit-transform
 8
 9 * transforms/3d: Added.
 10 * transforms/3d/cssmatrix-3d-interface-expected.txt: Added.
 11 * transforms/3d/cssmatrix-3d-interface.xhtml: Added.
 12
1132009-02-11 Scott Violet <sky@google.com>
214
315 Reviewed by Simon Fraser.
40880

LayoutTests/transforms/3d/cssmatrix-3d-interface-expected.txt

 1This test exercises the CSSMatrix 3D interface
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6CSSMatrix constructors
 7PASS default constructor
 8PASS object constructor
 9PASS string constructor
 10
 11Test toString
 12PASS a[0] is "matrix3d"
 13PASS parseFloat(a2[0]) is 1
 14PASS parseFloat(a2[1]) is 0
 15PASS parseFloat(a2[2]) is 0
 16PASS parseFloat(a2[3]) is 1
 17PASS parseFloat(a2[4]) is 0
 18PASS parseFloat(a2[5]) is 1
 19PASS parseFloat(a2[6]) is 0
 20PASS parseFloat(a2[7]) is 0
 21PASS parseFloat(a2[8]) is 0
 22PASS parseFloat(a2[9]) is 0
 23PASS parseFloat(a2[10]) is 1
 24PASS parseFloat(a2[11]) is 0
 25PASS parseFloat(a2[12]) is 0
 26PASS parseFloat(a2[13]) is 0
 27PASS parseFloat(a2[14]) is 0
 28PASS parseFloat(a3[0]) is 1
 29PASS a3[1] is ""
 30
 31Test bad input to string constructor
 32PASS new WebKitCSSMatrix("banana") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 33
 34Test attributes on default matrix
 35PASS m.m11 is 1
 36PASS m.m12 is 0
 37PASS m.m13 is 0
 38PASS m.m14 is 0
 39PASS m.m21 is 0
 40PASS m.m22 is 1
 41PASS m.m23 is 0
 42PASS m.m24 is 0
 43PASS m.m31 is 0
 44PASS m.m32 is 0
 45PASS m.m33 is 1
 46PASS m.m34 is 0
 47PASS m.m41 is 0
 48PASS m.m42 is 0
 49PASS m.m43 is 0
 50PASS m.m44 is 1
 51
 52Test attributes on custom matrix
 53PASS m.m11 is 11
 54PASS m.m12 is 12
 55PASS m.m13 is 13
 56PASS m.m14 is 14
 57PASS m.m21 is 21
 58PASS m.m22 is 22
 59PASS m.m23 is 23
 60PASS m.m24 is 24
 61PASS m.m31 is 31
 62PASS m.m32 is 32
 63PASS m.m33 is 33
 64PASS m.m34 is 34
 65PASS m.m41 is 41
 66PASS m.m42 is 42
 67PASS m.m43 is 43
 68PASS m.m44 is 44
 69
 70Test setMatrixValue - set to matrix()
 71PASS m.m11 is 11
 72PASS m.m12 is 12
 73PASS m.m13 is 13
 74PASS m.m14 is 14
 75PASS m.m21 is 21
 76PASS m.m22 is 22
 77PASS m.m23 is 23
 78PASS m.m24 is 24
 79PASS m.m31 is 31
 80PASS m.m32 is 32
 81PASS m.m33 is 33
 82PASS m.m34 is 34
 83PASS m.m41 is 41
 84PASS m.m42 is 42
 85PASS m.m43 is 43
 86PASS m.m44 is 44
 87
 88Test setMatrixValue - set to translate(10px, 20px, 30px) scale(2, 3, 4)
 89PASS m.m11 is 2
 90PASS m.m12 is 0
 91PASS m.m13 is 0
 92PASS m.m14 is 0
 93PASS m.m21 is 0
 94PASS m.m22 is 3
 95PASS m.m23 is 0
 96PASS m.m24 is 0
 97PASS m.m31 is 0
 98PASS m.m32 is 0
 99PASS m.m33 is 4
 100PASS m.m34 is 0
 101PASS m.m41 is 10
 102PASS m.m42 is 20
 103PASS m.m43 is 30
 104PASS m.m44 is 1
 105
 106Test throwing exception from setMatrixValue
 107PASS m.setMatrixValue("banana") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 108PASS m.setMatrixValue("translate3d(10em, 20%, 40)") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 109PASS m.setMatrixValue("translate3d(10px, 20px, 30px) scale3d()") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 110
 111Test multiply
 112PASS parseFloat(m3.m11) is 250
 113PASS parseFloat(m3.m12) is 260
 114PASS parseFloat(m3.m13) is 270
 115PASS parseFloat(m3.m14) is 280
 116PASS parseFloat(m3.m21) is 618
 117PASS parseFloat(m3.m22) is 644
 118PASS parseFloat(m3.m23) is 670
 119PASS parseFloat(m3.m24) is 696
 120PASS parseFloat(m3.m31) is 986
 121PASS parseFloat(m3.m32) is 1028
 122PASS parseFloat(m3.m33) is 1070
 123PASS parseFloat(m3.m34) is 1112
 124PASS parseFloat(m3.m41) is 1354
 125PASS parseFloat(m3.m42) is 1412
 126PASS parseFloat(m3.m43) is 1470
 127PASS parseFloat(m3.m44) is 1528
 128
 129Test immutability of multiply
 130PASS parseFloat(m.m11) is 1
 131PASS parseFloat(m.m12) is 2
 132PASS parseFloat(m.m13) is 3
 133PASS parseFloat(m.m14) is 4
 134PASS parseFloat(m.m21) is 5
 135PASS parseFloat(m.m22) is 6
 136PASS parseFloat(m.m23) is 7
 137PASS parseFloat(m.m24) is 8
 138PASS parseFloat(m.m31) is 9
 139PASS parseFloat(m.m32) is 10
 140PASS parseFloat(m.m33) is 11
 141PASS parseFloat(m.m34) is 12
 142PASS parseFloat(m.m41) is 13
 143PASS parseFloat(m.m42) is 14
 144PASS parseFloat(m.m43) is 15
 145PASS parseFloat(m.m44) is 16
 146
 147Test inverse
 148PASS parseFloat(m2.m11) is 0.5
 149PASS parseFloat(m2.m12) is 0
 150PASS parseFloat(m2.m13) is 0
 151PASS parseFloat(m2.m14) is 0
 152PASS parseFloat(m2.m21) is 0
 153PASS parseFloat(m2.m22) is 0.5
 154PASS parseFloat(m2.m23) is 0
 155PASS parseFloat(m2.m24) is 0
 156PASS parseFloat(m2.m31) is 0
 157PASS parseFloat(m2.m32) is 0
 158PASS parseFloat(m2.m33) is 0.5
 159PASS parseFloat(m2.m34) is 0
 160PASS parseFloat(m2.m41) is -5
 161PASS parseFloat(m2.m42) is -10
 162PASS parseFloat(m2.m43) is -15
 163PASS parseFloat(m2.m44) is 1
 164
 165Test immutability of inverse
 166PASS parseFloat(m.m11) is 2
 167PASS parseFloat(m.m12) is 0
 168PASS parseFloat(m.m13) is 0
 169PASS parseFloat(m.m14) is 0
 170PASS parseFloat(m.m21) is 0
 171PASS parseFloat(m.m22) is 2
 172PASS parseFloat(m.m23) is 0
 173PASS parseFloat(m.m24) is 0
 174PASS parseFloat(m.m31) is 0
 175PASS parseFloat(m.m32) is 0
 176PASS parseFloat(m.m33) is 2
 177PASS parseFloat(m.m34) is 0
 178PASS parseFloat(m.m41) is 10
 179PASS parseFloat(m.m42) is 20
 180PASS parseFloat(m.m43) is 30
 181PASS parseFloat(m.m44) is 1
 182
 183Test throwing exception from inverse
 184PASS m.inverse() threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
 185
 186Test translate
 187PASS m2.m11 is 1
 188PASS m2.m12 is 0
 189PASS m2.m13 is 0
 190PASS m2.m14 is 0
 191PASS m2.m21 is 0
 192PASS m2.m22 is 1
 193PASS m2.m23 is 0
 194PASS m2.m24 is 0
 195PASS m2.m31 is 0
 196PASS m2.m32 is 0
 197PASS m2.m33 is 1
 198PASS m2.m34 is 0
 199PASS m2.m41 is 10
 200PASS m2.m42 is 20
 201PASS m2.m43 is 30
 202PASS m2.m44 is 1
 203
 204Test immutability of translate
 205PASS m.m11 is 1
 206PASS m.m12 is 0
 207PASS m.m13 is 0
 208PASS m.m14 is 0
 209PASS m.m21 is 0
 210PASS m.m22 is 1
 211PASS m.m23 is 0
 212PASS m.m24 is 0
 213PASS m.m31 is 0
 214PASS m.m32 is 0
 215PASS m.m33 is 1
 216PASS m.m34 is 0
 217PASS m.m41 is 0
 218PASS m.m42 is 0
 219PASS m.m43 is 0
 220PASS m.m44 is 1
 221
 222Test scale
 223PASS m2.m11 is 10
 224PASS m2.m12 is 0
 225PASS m2.m13 is 0
 226PASS m2.m14 is 0
 227PASS m2.m21 is 0
 228PASS m2.m22 is 20
 229PASS m2.m23 is 0
 230PASS m2.m24 is 0
 231PASS m2.m31 is 0
 232PASS m2.m32 is 0
 233PASS m2.m33 is 30
 234PASS m2.m34 is 0
 235PASS m2.m41 is 0
 236PASS m2.m42 is 0
 237PASS m2.m43 is 0
 238PASS m2.m44 is 1
 239
 240Test immutability of scale
 241PASS m.m11 is 1
 242PASS m.m12 is 0
 243PASS m.m13 is 0
 244PASS m.m14 is 0
 245PASS m.m21 is 0
 246PASS m.m22 is 1
 247PASS m.m23 is 0
 248PASS m.m24 is 0
 249PASS m.m31 is 0
 250PASS m.m32 is 0
 251PASS m.m33 is 1
 252PASS m.m34 is 0
 253PASS m.m41 is 0
 254PASS m.m42 is 0
 255PASS m.m43 is 0
 256PASS m.m44 is 1
 257
 258Test rotate
 259PASS parseFloat(m2.m11.toPrecision(6)) is 0.813798
 260PASS parseFloat(m2.m12.toPrecision(6)) is 0.469846
 261PASS parseFloat(m2.m13.toPrecision(6)) is -0.34202
 262PASS parseFloat(m2.m14.toPrecision(6)) is 0
 263PASS parseFloat(m2.m21.toPrecision(6)) is -0.44097
 264PASS parseFloat(m2.m22.toPrecision(6)) is 0.882564
 265PASS parseFloat(m2.m23.toPrecision(6)) is 0.163176
 266PASS parseFloat(m2.m24.toPrecision(6)) is 0
 267PASS parseFloat(m2.m31.toPrecision(6)) is 0.378522
 268PASS parseFloat(m2.m32.toPrecision(6)) is 0.0180283
 269PASS parseFloat(m2.m33.toPrecision(6)) is 0.925417
 270PASS parseFloat(m2.m34.toPrecision(6)) is 0
 271PASS parseFloat(m2.m41.toPrecision(6)) is 0
 272PASS parseFloat(m2.m42.toPrecision(6)) is 0
 273PASS parseFloat(m2.m43.toPrecision(6)) is 0
 274PASS parseFloat(m2.m44.toPrecision(6)) is 1
 275
 276Test immutability of rotate
 277PASS m.m11 is 1
 278PASS m.m12 is 0
 279PASS m.m13 is 0
 280PASS m.m14 is 0
 281PASS m.m21 is 0
 282PASS m.m22 is 1
 283PASS m.m23 is 0
 284PASS m.m24 is 0
 285PASS m.m31 is 0
 286PASS m.m32 is 0
 287PASS m.m33 is 1
 288PASS m.m34 is 0
 289PASS m.m41 is 0
 290PASS m.m42 is 0
 291PASS m.m43 is 0
 292PASS m.m44 is 1
 293
 294Test rotateAxisAngle
 295PASS parseFloat(m2.m11.toPrecision(6)) is 0.804738
 296PASS parseFloat(m2.m12.toPrecision(6)) is 0.505879
 297PASS parseFloat(m2.m13.toPrecision(6)) is -0.310617
 298PASS parseFloat(m2.m14.toPrecision(6)) is 0
 299PASS parseFloat(m2.m21.toPrecision(6)) is -0.310617
 300PASS parseFloat(m2.m22.toPrecision(6)) is 0.804738
 301PASS parseFloat(m2.m23.toPrecision(6)) is 0.505879
 302PASS parseFloat(m2.m24.toPrecision(6)) is 0
 303PASS parseFloat(m2.m31.toPrecision(6)) is 0.505879
 304PASS parseFloat(m2.m32.toPrecision(6)) is -0.310617
 305PASS parseFloat(m2.m33.toPrecision(6)) is 0.804738
 306PASS parseFloat(m2.m34.toPrecision(6)) is 0
 307PASS parseFloat(m2.m41.toPrecision(6)) is 0
 308PASS parseFloat(m2.m42.toPrecision(6)) is 0
 309PASS parseFloat(m2.m43.toPrecision(6)) is 0
 310PASS parseFloat(m2.m44.toPrecision(6)) is 1
 311
 312Test immutability of rotateAxisAngle
 313PASS m.m11 is 1
 314PASS m.m12 is 0
 315PASS m.m13 is 0
 316PASS m.m14 is 0
 317PASS m.m21 is 0
 318PASS m.m22 is 1
 319PASS m.m23 is 0
 320PASS m.m24 is 0
 321PASS m.m31 is 0
 322PASS m.m32 is 0
 323PASS m.m33 is 1
 324PASS m.m34 is 0
 325PASS m.m41 is 0
 326PASS m.m42 is 0
 327PASS m.m43 is 0
 328PASS m.m44 is 1
 329
 330PASS successfullyParsed is true
 331
 332TEST COMPLETE
 333
0

LayoutTests/transforms/3d/cssmatrix-3d-interface.xhtml

 1<html xmlns="http://www.w3.org/1999/xhtml">
 2<head>
 3<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css"/>
 4<script src="../../fast/js/resources/js-test-pre.js"></script>
 5</head>
 6<body>
 7<div id="description"></div>
 8<div id="console"></div>
 9
 10<script>
 11
 12description("This test exercises the CSSMatrix 3D interface");
 13
 14debug("");
 15debug("CSSMatrix constructors");
 16
 17var m = null;
 18m = new WebKitCSSMatrix();
 19if (m)
 20 testPassed("default constructor");
 21else
 22 testFailed("default constructor");
 23
 24var m2 = new WebKitCSSMatrix(m);
 25if (m2)
 26 testPassed("object constructor");
 27else
 28 testFailed("object constructor");
 29
 30m = new WebKitCSSMatrix("matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)");
 31if (m)
 32 testPassed("string constructor");
 33else
 34 testFailed("string constructor");
 35
 36debug("");
 37debug("Test toString");
 38var m = new WebKitCSSMatrix("matrix3d(1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)");
 39var s = m.toString();
 40var a = s.split('(');
 41shouldBe('a[0]', '"matrix3d"');
 42var a2 = a[1].split(',');
 43shouldBe('parseFloat(a2[0])', '1');
 44shouldBe('parseFloat(a2[1])', '0');
 45shouldBe('parseFloat(a2[2])', '0');
 46shouldBe('parseFloat(a2[3])', '1');
 47shouldBe('parseFloat(a2[4])', '0');
 48shouldBe('parseFloat(a2[5])', '1');
 49shouldBe('parseFloat(a2[6])', '0');
 50shouldBe('parseFloat(a2[7])', '0');
 51shouldBe('parseFloat(a2[8])', '0');
 52shouldBe('parseFloat(a2[9])', '0');
 53shouldBe('parseFloat(a2[10])', '1');
 54shouldBe('parseFloat(a2[11])', '0');
 55shouldBe('parseFloat(a2[12])', '0');
 56shouldBe('parseFloat(a2[13])', '0');
 57shouldBe('parseFloat(a2[14])', '0');
 58var a3 = a2[15].split(")");
 59shouldBe('parseFloat(a3[0])', '1');
 60shouldBe('a3[1]', '""');
 61
 62debug("");
 63debug("Test bad input to string constructor");
 64shouldThrow('new WebKitCSSMatrix("banana")');
 65
 66debug("");
 67debug("Test attributes on default matrix");
 68m = new WebKitCSSMatrix();
 69shouldBe('m.m11', '1');
 70shouldBe('m.m12', '0');
 71shouldBe('m.m13', '0');
 72shouldBe('m.m14', '0');
 73shouldBe('m.m21', '0');
 74shouldBe('m.m22', '1');
 75shouldBe('m.m23', '0');
 76shouldBe('m.m24', '0');
 77shouldBe('m.m31', '0');
 78shouldBe('m.m32', '0');
 79shouldBe('m.m33', '1');
 80shouldBe('m.m34', '0');
 81shouldBe('m.m41', '0');
 82shouldBe('m.m42', '0');
 83shouldBe('m.m43', '0');
 84shouldBe('m.m44', '1');
 85
 86debug("");
 87debug("Test attributes on custom matrix");
 88m = new WebKitCSSMatrix("matrix3d(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44)");
 89shouldBe('m.m11', '11');
 90shouldBe('m.m12', '12');
 91shouldBe('m.m13', '13');
 92shouldBe('m.m14', '14');
 93shouldBe('m.m21', '21');
 94shouldBe('m.m22', '22');
 95shouldBe('m.m23', '23');
 96shouldBe('m.m24', '24');
 97shouldBe('m.m31', '31');
 98shouldBe('m.m32', '32');
 99shouldBe('m.m33', '33');
 100shouldBe('m.m34', '34');
 101shouldBe('m.m41', '41');
 102shouldBe('m.m42', '42');
 103shouldBe('m.m43', '43');
 104shouldBe('m.m44', '44');
 105
 106debug("");
 107debug("Test setMatrixValue - set to matrix()");
 108m = new WebKitCSSMatrix();
 109m.setMatrixValue("matrix3d(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44)");
 110shouldBe('m.m11', '11');
 111shouldBe('m.m12', '12');
 112shouldBe('m.m13', '13');
 113shouldBe('m.m14', '14');
 114shouldBe('m.m21', '21');
 115shouldBe('m.m22', '22');
 116shouldBe('m.m23', '23');
 117shouldBe('m.m24', '24');
 118shouldBe('m.m31', '31');
 119shouldBe('m.m32', '32');
 120shouldBe('m.m33', '33');
 121shouldBe('m.m34', '34');
 122shouldBe('m.m41', '41');
 123shouldBe('m.m42', '42');
 124shouldBe('m.m43', '43');
 125shouldBe('m.m44', '44');
 126
 127debug("");
 128debug("Test setMatrixValue - set to translate(10px, 20px, 30px) scale(2, 3, 4)");
 129m = new WebKitCSSMatrix();
 130m.setMatrixValue("translate3d(10px, 20px, 30px) scale3d(2, 3, 4)");
 131shouldBe('m.m11', '2');
 132shouldBe('m.m12', '0');
 133shouldBe('m.m13', '0');
 134shouldBe('m.m14', '0');
 135shouldBe('m.m21', '0');
 136shouldBe('m.m22', '3');
 137shouldBe('m.m23', '0');
 138shouldBe('m.m24', '0');
 139shouldBe('m.m31', '0');
 140shouldBe('m.m32', '0');
 141shouldBe('m.m33', '4');
 142shouldBe('m.m34', '0');
 143shouldBe('m.m41', '10');
 144shouldBe('m.m42', '20');
 145shouldBe('m.m43', '30');
 146shouldBe('m.m44', '1');
 147
 148debug("");
 149debug("Test throwing exception from setMatrixValue");
 150shouldThrow('m.setMatrixValue("banana")');
 151shouldThrow('m.setMatrixValue("translate3d(10em, 20%, 40)")');
 152shouldThrow('m.setMatrixValue("translate3d(10px, 20px, 30px) scale3d()")');
 153
 154debug("");
 155debug("Test multiply");
 156m = new WebKitCSSMatrix("matrix3d( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)");
 157m2 = new WebKitCSSMatrix("matrix3d(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)");
 158var m3 = m.multiply(m2);
 159shouldBe('parseFloat(m3.m11)', '250');
 160shouldBe('parseFloat(m3.m12)', '260');
 161shouldBe('parseFloat(m3.m13)', '270');
 162shouldBe('parseFloat(m3.m14)', '280');
 163shouldBe('parseFloat(m3.m21)', '618');
 164shouldBe('parseFloat(m3.m22)', '644');
 165shouldBe('parseFloat(m3.m23)', '670');
 166shouldBe('parseFloat(m3.m24)', '696');
 167shouldBe('parseFloat(m3.m31)', '986');
 168shouldBe('parseFloat(m3.m32)', '1028');
 169shouldBe('parseFloat(m3.m33)', '1070');
 170shouldBe('parseFloat(m3.m34)', '1112');
 171shouldBe('parseFloat(m3.m41)', '1354');
 172shouldBe('parseFloat(m3.m42)', '1412');
 173shouldBe('parseFloat(m3.m43)', '1470');
 174shouldBe('parseFloat(m3.m44)', '1528');
 175
 176debug("");
 177debug("Test immutability of multiply");
 178shouldBe('parseFloat(m.m11)', '1');
 179shouldBe('parseFloat(m.m12)', '2');
 180shouldBe('parseFloat(m.m13)', '3');
 181shouldBe('parseFloat(m.m14)', '4');
 182shouldBe('parseFloat(m.m21)', '5');
 183shouldBe('parseFloat(m.m22)', '6');
 184shouldBe('parseFloat(m.m23)', '7');
 185shouldBe('parseFloat(m.m24)', '8');
 186shouldBe('parseFloat(m.m31)', '9');
 187shouldBe('parseFloat(m.m32)', '10');
 188shouldBe('parseFloat(m.m33)', '11');
 189shouldBe('parseFloat(m.m34)', '12');
 190shouldBe('parseFloat(m.m41)', '13');
 191shouldBe('parseFloat(m.m42)', '14');
 192shouldBe('parseFloat(m.m43)', '15');
 193shouldBe('parseFloat(m.m44)', '16');
 194
 195debug("");
 196debug("Test inverse");
 197m = new WebKitCSSMatrix("matrix3d(2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 10, 20, 30, 1)");
 198m2 = m.inverse();
 199
 200shouldBe('parseFloat(m2.m11)', '0.5');
 201shouldBe('parseFloat(m2.m12)', '0');
 202shouldBe('parseFloat(m2.m13)', '0');
 203shouldBe('parseFloat(m2.m14)', '0');
 204shouldBe('parseFloat(m2.m21)', '0');
 205shouldBe('parseFloat(m2.m22)', '0.5');
 206shouldBe('parseFloat(m2.m23)', '0');
 207shouldBe('parseFloat(m2.m24)', '0');
 208shouldBe('parseFloat(m2.m31)', '0');
 209shouldBe('parseFloat(m2.m32)', '0');
 210shouldBe('parseFloat(m2.m33)', '0.5');
 211shouldBe('parseFloat(m2.m34)', '0');
 212shouldBe('parseFloat(m2.m41)', '-5');
 213shouldBe('parseFloat(m2.m42)', '-10');
 214shouldBe('parseFloat(m2.m43)', '-15');
 215shouldBe('parseFloat(m2.m44)', '1');
 216
 217debug("");
 218debug("Test immutability of inverse");
 219shouldBe('parseFloat(m.m11)', '2');
 220shouldBe('parseFloat(m.m12)', '0');
 221shouldBe('parseFloat(m.m13)', '0');
 222shouldBe('parseFloat(m.m14)', '0');
 223shouldBe('parseFloat(m.m21)', '0');
 224shouldBe('parseFloat(m.m22)', '2');
 225shouldBe('parseFloat(m.m23)', '0');
 226shouldBe('parseFloat(m.m24)', '0');
 227shouldBe('parseFloat(m.m31)', '0');
 228shouldBe('parseFloat(m.m32)', '0');
 229shouldBe('parseFloat(m.m33)', '2');
 230shouldBe('parseFloat(m.m34)', '0');
 231shouldBe('parseFloat(m.m41)', '10');
 232shouldBe('parseFloat(m.m42)', '20');
 233shouldBe('parseFloat(m.m43)', '30');
 234shouldBe('parseFloat(m.m44)', '1');
 235
 236debug("");
 237debug("Test throwing exception from inverse");
 238m = new WebKitCSSMatrix("matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"); // not invertible
 239shouldThrow('m.inverse()');
 240
 241debug("");
 242debug("Test translate");
 243m = new WebKitCSSMatrix();
 244var m2 = m.translate(10, 20, 30);
 245shouldBe('m2.m11', '1');
 246shouldBe('m2.m12', '0');
 247shouldBe('m2.m13', '0');
 248shouldBe('m2.m14', '0');
 249shouldBe('m2.m21', '0');
 250shouldBe('m2.m22', '1');
 251shouldBe('m2.m23', '0');
 252shouldBe('m2.m24', '0');
 253shouldBe('m2.m31', '0');
 254shouldBe('m2.m32', '0');
 255shouldBe('m2.m33', '1');
 256shouldBe('m2.m34', '0');
 257shouldBe('m2.m41', '10');
 258shouldBe('m2.m42', '20');
 259shouldBe('m2.m43', '30');
 260shouldBe('m2.m44', '1');
 261
 262debug("");
 263debug("Test immutability of translate");
 264shouldBe('m.m11', '1');
 265shouldBe('m.m12', '0');
 266shouldBe('m.m13', '0');
 267shouldBe('m.m14', '0');
 268shouldBe('m.m21', '0');
 269shouldBe('m.m22', '1');
 270shouldBe('m.m23', '0');
 271shouldBe('m.m24', '0');
 272shouldBe('m.m31', '0');
 273shouldBe('m.m32', '0');
 274shouldBe('m.m33', '1');
 275shouldBe('m.m34', '0');
 276shouldBe('m.m41', '0');
 277shouldBe('m.m42', '0');
 278shouldBe('m.m43', '0');
 279shouldBe('m.m44', '1');
 280
 281debug("");
 282debug("Test scale");
 283m = new WebKitCSSMatrix();
 284m2 = m.scale(10, 20, 30);
 285shouldBe('m2.m11', '10');
 286shouldBe('m2.m12', '0');
 287shouldBe('m2.m13', '0');
 288shouldBe('m2.m14', '0');
 289shouldBe('m2.m21', '0');
 290shouldBe('m2.m22', '20');
 291shouldBe('m2.m23', '0');
 292shouldBe('m2.m24', '0');
 293shouldBe('m2.m31', '0');
 294shouldBe('m2.m32', '0');
 295shouldBe('m2.m33', '30');
 296shouldBe('m2.m34', '0');
 297shouldBe('m2.m41', '0');
 298shouldBe('m2.m42', '0');
 299shouldBe('m2.m43', '0');
 300shouldBe('m2.m44', '1');
 301
 302debug("");
 303debug("Test immutability of scale");
 304shouldBe('m.m11', '1');
 305shouldBe('m.m12', '0');
 306shouldBe('m.m13', '0');
 307shouldBe('m.m14', '0');
 308shouldBe('m.m21', '0');
 309shouldBe('m.m22', '1');
 310shouldBe('m.m23', '0');
 311shouldBe('m.m24', '0');
 312shouldBe('m.m31', '0');
 313shouldBe('m.m32', '0');
 314shouldBe('m.m33', '1');
 315shouldBe('m.m34', '0');
 316shouldBe('m.m41', '0');
 317shouldBe('m.m42', '0');
 318shouldBe('m.m43', '0');
 319shouldBe('m.m44', '1');
 320
 321debug("");
 322debug("Test rotate");
 323m = new WebKitCSSMatrix();
 324m2 = m.rotate(10, 20, 30);
 325shouldBe('parseFloat(m2.m11.toPrecision(6))', '0.813798');
 326shouldBe('parseFloat(m2.m12.toPrecision(6))', '0.469846');
 327shouldBe('parseFloat(m2.m13.toPrecision(6))', '-0.34202');
 328shouldBe('parseFloat(m2.m14.toPrecision(6))', '0');
 329shouldBe('parseFloat(m2.m21.toPrecision(6))', '-0.44097');
 330shouldBe('parseFloat(m2.m22.toPrecision(6))', '0.882564');
 331shouldBe('parseFloat(m2.m23.toPrecision(6))', '0.163176');
 332shouldBe('parseFloat(m2.m24.toPrecision(6))', '0');
 333shouldBe('parseFloat(m2.m31.toPrecision(6))', '0.378522');
 334shouldBe('parseFloat(m2.m32.toPrecision(6))', '0.0180283');
 335shouldBe('parseFloat(m2.m33.toPrecision(6))', '0.925417');
 336shouldBe('parseFloat(m2.m34.toPrecision(6))', '0');
 337shouldBe('parseFloat(m2.m41.toPrecision(6))', '0');
 338shouldBe('parseFloat(m2.m42.toPrecision(6))', '0');
 339shouldBe('parseFloat(m2.m43.toPrecision(6))', '0');
 340shouldBe('parseFloat(m2.m44.toPrecision(6))', '1');
 341
 342debug("");
 343debug("Test immutability of rotate");
 344shouldBe('m.m11', '1');
 345shouldBe('m.m12', '0');
 346shouldBe('m.m13', '0');
 347shouldBe('m.m14', '0');
 348shouldBe('m.m21', '0');
 349shouldBe('m.m22', '1');
 350shouldBe('m.m23', '0');
 351shouldBe('m.m24', '0');
 352shouldBe('m.m31', '0');
 353shouldBe('m.m32', '0');
 354shouldBe('m.m33', '1');
 355shouldBe('m.m34', '0');
 356shouldBe('m.m41', '0');
 357shouldBe('m.m42', '0');
 358shouldBe('m.m43', '0');
 359shouldBe('m.m44', '1');
 360
 361debug("");
 362debug("Test rotateAxisAngle");
 363m = new WebKitCSSMatrix();
 364m2 = m.rotateAxisAngle(0.707, 0.707, 0.707, 45);
 365shouldBe('parseFloat(m2.m11.toPrecision(6))', '0.804738');
 366shouldBe('parseFloat(m2.m12.toPrecision(6))', '0.505879');
 367shouldBe('parseFloat(m2.m13.toPrecision(6))', '-0.310617');
 368shouldBe('parseFloat(m2.m14.toPrecision(6))', '0');
 369shouldBe('parseFloat(m2.m21.toPrecision(6))', '-0.310617');
 370shouldBe('parseFloat(m2.m22.toPrecision(6))', '0.804738');
 371shouldBe('parseFloat(m2.m23.toPrecision(6))', '0.505879');
 372shouldBe('parseFloat(m2.m24.toPrecision(6))', '0');
 373shouldBe('parseFloat(m2.m31.toPrecision(6))', '0.505879');
 374shouldBe('parseFloat(m2.m32.toPrecision(6))', '-0.310617');
 375shouldBe('parseFloat(m2.m33.toPrecision(6))', '0.804738');
 376shouldBe('parseFloat(m2.m34.toPrecision(6))', '0');
 377shouldBe('parseFloat(m2.m41.toPrecision(6))', '0');
 378shouldBe('parseFloat(m2.m42.toPrecision(6))', '0');
 379shouldBe('parseFloat(m2.m43.toPrecision(6))', '0');
 380shouldBe('parseFloat(m2.m44.toPrecision(6))', '1');
 381
 382debug("");
 383debug("Test immutability of rotateAxisAngle");
 384shouldBe('m.m11', '1');
 385shouldBe('m.m12', '0');
 386shouldBe('m.m13', '0');
 387shouldBe('m.m14', '0');
 388shouldBe('m.m21', '0');
 389shouldBe('m.m22', '1');
 390shouldBe('m.m23', '0');
 391shouldBe('m.m24', '0');
 392shouldBe('m.m31', '0');
 393shouldBe('m.m32', '0');
 394shouldBe('m.m33', '1');
 395shouldBe('m.m34', '0');
 396shouldBe('m.m41', '0');
 397shouldBe('m.m42', '0');
 398shouldBe('m.m43', '0');
 399shouldBe('m.m44', '1');
 400
 401debug("");
 402successfullyParsed = true;
 403
 404</script>
 405<script src="../../fast/js/resources/js-test-post.js"></script>
 406
 407<script>
 408</script>
 409
 410</body>
 411</html>
0