summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/TransformFunctions.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/css/TransformFunctions.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/css/TransformFunctions.cpp')
-rw-r--r--Source/WebCore/css/TransformFunctions.cpp324
1 files changed, 171 insertions, 153 deletions
diff --git a/Source/WebCore/css/TransformFunctions.cpp b/Source/WebCore/css/TransformFunctions.cpp
index b24e5f95c..71af13b1b 100644
--- a/Source/WebCore/css/TransformFunctions.cpp
+++ b/Source/WebCore/css/TransformFunctions.cpp
@@ -32,77 +32,95 @@
#include "config.h"
#include "TransformFunctions.h"
+#include "CSSFunctionValue.h"
#include "CSSPrimitiveValueMappings.h"
#include "CSSValueList.h"
#include "CSSValuePool.h"
#include "Matrix3DTransformOperation.h"
#include "MatrixTransformOperation.h"
#include "PerspectiveTransformOperation.h"
-#include "RenderStyle.h"
#include "RotateTransformOperation.h"
#include "ScaleTransformOperation.h"
#include "SkewTransformOperation.h"
#include "TranslateTransformOperation.h"
-#include "WebKitCSSTransformValue.h"
namespace WebCore {
-static TransformOperation::OperationType transformOperationType(WebKitCSSTransformValue::TransformOperationType type)
+static TransformOperation::OperationType transformOperationType(CSSValueID type)
{
switch (type) {
- case WebKitCSSTransformValue::ScaleTransformOperation: return TransformOperation::SCALE;
- case WebKitCSSTransformValue::ScaleXTransformOperation: return TransformOperation::SCALE_X;
- case WebKitCSSTransformValue::ScaleYTransformOperation: return TransformOperation::SCALE_Y;
- case WebKitCSSTransformValue::ScaleZTransformOperation: return TransformOperation::SCALE_Z;
- case WebKitCSSTransformValue::Scale3DTransformOperation: return TransformOperation::SCALE_3D;
- case WebKitCSSTransformValue::TranslateTransformOperation: return TransformOperation::TRANSLATE;
- case WebKitCSSTransformValue::TranslateXTransformOperation: return TransformOperation::TRANSLATE_X;
- case WebKitCSSTransformValue::TranslateYTransformOperation: return TransformOperation::TRANSLATE_Y;
- case WebKitCSSTransformValue::TranslateZTransformOperation: return TransformOperation::TRANSLATE_Z;
- case WebKitCSSTransformValue::Translate3DTransformOperation: return TransformOperation::TRANSLATE_3D;
- case WebKitCSSTransformValue::RotateTransformOperation: return TransformOperation::ROTATE;
- case WebKitCSSTransformValue::RotateXTransformOperation: return TransformOperation::ROTATE_X;
- case WebKitCSSTransformValue::RotateYTransformOperation: return TransformOperation::ROTATE_Y;
- case WebKitCSSTransformValue::RotateZTransformOperation: return TransformOperation::ROTATE_Z;
- case WebKitCSSTransformValue::Rotate3DTransformOperation: return TransformOperation::ROTATE_3D;
- case WebKitCSSTransformValue::SkewTransformOperation: return TransformOperation::SKEW;
- case WebKitCSSTransformValue::SkewXTransformOperation: return TransformOperation::SKEW_X;
- case WebKitCSSTransformValue::SkewYTransformOperation: return TransformOperation::SKEW_Y;
- case WebKitCSSTransformValue::MatrixTransformOperation: return TransformOperation::MATRIX;
- case WebKitCSSTransformValue::Matrix3DTransformOperation: return TransformOperation::MATRIX_3D;
- case WebKitCSSTransformValue::PerspectiveTransformOperation: return TransformOperation::PERSPECTIVE;
- case WebKitCSSTransformValue::UnknownTransformOperation: return TransformOperation::NONE;
+ case CSSValueScale:
+ return TransformOperation::SCALE;
+ case CSSValueScaleX:
+ return TransformOperation::SCALE_X;
+ case CSSValueScaleY:
+ return TransformOperation::SCALE_Y;
+ case CSSValueScaleZ:
+ return TransformOperation::SCALE_Z;
+ case CSSValueScale3d:
+ return TransformOperation::SCALE_3D;
+ case CSSValueTranslate:
+ return TransformOperation::TRANSLATE;
+ case CSSValueTranslateX:
+ return TransformOperation::TRANSLATE_X;
+ case CSSValueTranslateY:
+ return TransformOperation::TRANSLATE_Y;
+ case CSSValueTranslateZ:
+ return TransformOperation::TRANSLATE_Z;
+ case CSSValueTranslate3d:
+ return TransformOperation::TRANSLATE_3D;
+ case CSSValueRotate:
+ return TransformOperation::ROTATE;
+ case CSSValueRotateX:
+ return TransformOperation::ROTATE_X;
+ case CSSValueRotateY:
+ return TransformOperation::ROTATE_Y;
+ case CSSValueRotateZ:
+ return TransformOperation::ROTATE_Z;
+ case CSSValueRotate3d:
+ return TransformOperation::ROTATE_3D;
+ case CSSValueSkew:
+ return TransformOperation::SKEW;
+ case CSSValueSkewX:
+ return TransformOperation::SKEW_X;
+ case CSSValueSkewY:
+ return TransformOperation::SKEW_Y;
+ case CSSValueMatrix:
+ return TransformOperation::MATRIX;
+ case CSSValueMatrix3d:
+ return TransformOperation::MATRIX_3D;
+ case CSSValuePerspective:
+ return TransformOperation::PERSPECTIVE;
+ default:
+ break;
}
return TransformOperation::NONE;
}
-static Length convertToFloatLength(const CSSPrimitiveValue* primitiveValue, const RenderStyle* style, const RenderStyle* rootStyle, double multiplier)
+Length convertToFloatLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData& conversionData)
{
- return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | CalculatedConversion | FractionConversion | ViewportPercentageConversion>(style, rootStyle, multiplier) : Length(Undefined);
+ return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | CalculatedConversion>(conversionData) : Length(Undefined);
}
-bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle, CSSValue* value, TransformOperations& outOperations)
+bool transformsForValue(const CSSValue& value, const CSSToLengthConversionData& conversionData, TransformOperations& outOperations)
{
- if (!value || !value->isValueList()) {
+ if (!is<CSSValueList>(value)) {
outOperations.clear();
return false;
}
- float zoomFactor = style ? style->effectiveZoom() : 1;
TransformOperations operations;
- for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
- CSSValue* currValue = i.value();
-
- if (!currValue->isWebKitCSSTransformValue())
+ for (auto& currentValue : downcast<CSSValueList>(value)) {
+ if (!is<CSSFunctionValue>(currentValue.get()))
continue;
- WebKitCSSTransformValue* transformValue = toWebKitCSSTransformValue(i.value());
- if (!transformValue->length())
+ auto& transformValue = downcast<CSSFunctionValue>(currentValue.get());
+ if (!transformValue.length())
continue;
bool haveNonPrimitiveValue = false;
- for (unsigned j = 0; j < transformValue->length(); ++j) {
- if (!transformValue->itemWithoutBoundsCheck(j)->isPrimitiveValue()) {
+ for (unsigned j = 0; j < transformValue.length(); ++j) {
+ if (!is<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(j))) {
haveNonPrimitiveValue = true;
break;
}
@@ -110,68 +128,68 @@ bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle,
if (haveNonPrimitiveValue)
continue;
- CSSPrimitiveValue* firstValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(0));
+ auto& firstValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(0));
- switch (transformValue->operationType()) {
- case WebKitCSSTransformValue::ScaleTransformOperation:
- case WebKitCSSTransformValue::ScaleXTransformOperation:
- case WebKitCSSTransformValue::ScaleYTransformOperation: {
+ switch (transformValue.name()) {
+ case CSSValueScale:
+ case CSSValueScaleX:
+ case CSSValueScaleY: {
double sx = 1.0;
double sy = 1.0;
- if (transformValue->operationType() == WebKitCSSTransformValue::ScaleYTransformOperation)
- sy = firstValue->getDoubleValue();
+ if (transformValue.name() == CSSValueScaleY)
+ sy = firstValue.doubleValue();
else {
- sx = firstValue->getDoubleValue();
- if (transformValue->operationType() != WebKitCSSTransformValue::ScaleXTransformOperation) {
- if (transformValue->length() > 1) {
- CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
- sy = secondValue->getDoubleValue();
+ sx = firstValue.doubleValue();
+ if (transformValue.name() != CSSValueScaleX) {
+ if (transformValue.length() > 1) {
+ auto& secondValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(1));
+ sy = secondValue.doubleValue();
} else
sy = sx;
}
}
- operations.operations().append(ScaleTransformOperation::create(sx, sy, 1.0, transformOperationType(transformValue->operationType())));
+ operations.operations().append(ScaleTransformOperation::create(sx, sy, 1.0, transformOperationType(transformValue.name())));
break;
}
- case WebKitCSSTransformValue::ScaleZTransformOperation:
- case WebKitCSSTransformValue::Scale3DTransformOperation: {
+ case CSSValueScaleZ:
+ case CSSValueScale3d: {
double sx = 1.0;
double sy = 1.0;
double sz = 1.0;
- if (transformValue->operationType() == WebKitCSSTransformValue::ScaleZTransformOperation)
- sz = firstValue->getDoubleValue();
- else if (transformValue->operationType() == WebKitCSSTransformValue::ScaleYTransformOperation)
- sy = firstValue->getDoubleValue();
+ if (transformValue.name() == CSSValueScaleZ)
+ sz = firstValue.doubleValue();
+ else if (transformValue.name() == CSSValueScaleY)
+ sy = firstValue.doubleValue();
else {
- sx = firstValue->getDoubleValue();
- if (transformValue->operationType() != WebKitCSSTransformValue::ScaleXTransformOperation) {
- if (transformValue->length() > 2) {
- CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2));
- sz = thirdValue->getDoubleValue();
+ sx = firstValue.doubleValue();
+ if (transformValue.name() != CSSValueScaleX) {
+ if (transformValue.length() > 2) {
+ auto& thirdValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(2));
+ sz = thirdValue.doubleValue();
}
- if (transformValue->length() > 1) {
- CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
- sy = secondValue->getDoubleValue();
+ if (transformValue.length() > 1) {
+ auto& secondValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(1));
+ sy = secondValue.doubleValue();
} else
sy = sx;
}
}
- operations.operations().append(ScaleTransformOperation::create(sx, sy, sz, transformOperationType(transformValue->operationType())));
+ operations.operations().append(ScaleTransformOperation::create(sx, sy, sz, transformOperationType(transformValue.name())));
break;
}
- case WebKitCSSTransformValue::TranslateTransformOperation:
- case WebKitCSSTransformValue::TranslateXTransformOperation:
- case WebKitCSSTransformValue::TranslateYTransformOperation: {
+ case CSSValueTranslate:
+ case CSSValueTranslateX:
+ case CSSValueTranslateY: {
Length tx = Length(0, Fixed);
Length ty = Length(0, Fixed);
- if (transformValue->operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
- ty = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
+ if (transformValue.name() == CSSValueTranslateY)
+ ty = convertToFloatLength(&firstValue, conversionData);
else {
- tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
- if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
- if (transformValue->length() > 1) {
- CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
- ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor);
+ tx = convertToFloatLength(&firstValue, conversionData);
+ if (transformValue.name() != CSSValueTranslateX) {
+ if (transformValue.length() > 1) {
+ auto& secondValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(1));
+ ty = convertToFloatLength(&secondValue, conversionData);
}
}
}
@@ -179,28 +197,28 @@ bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle,
if (tx.isUndefined() || ty.isUndefined())
return false;
- operations.operations().append(TranslateTransformOperation::create(tx, ty, Length(0, Fixed), transformOperationType(transformValue->operationType())));
+ operations.operations().append(TranslateTransformOperation::create(tx, ty, Length(0, Fixed), transformOperationType(transformValue.name())));
break;
}
- case WebKitCSSTransformValue::TranslateZTransformOperation:
- case WebKitCSSTransformValue::Translate3DTransformOperation: {
+ case CSSValueTranslateZ:
+ case CSSValueTranslate3d: {
Length tx = Length(0, Fixed);
Length ty = Length(0, Fixed);
Length tz = Length(0, Fixed);
- if (transformValue->operationType() == WebKitCSSTransformValue::TranslateZTransformOperation)
- tz = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
- else if (transformValue->operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
- ty = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
+ if (transformValue.name() == CSSValueTranslateZ)
+ tz = convertToFloatLength(&firstValue, conversionData);
+ else if (transformValue.name() == CSSValueTranslateY)
+ ty = convertToFloatLength(&firstValue, conversionData);
else {
- tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
- if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
- if (transformValue->length() > 2) {
- CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2));
- tz = convertToFloatLength(thirdValue, style, rootStyle, zoomFactor);
+ tx = convertToFloatLength(&firstValue, conversionData);
+ if (transformValue.name() != CSSValueTranslateX) {
+ if (transformValue.length() > 2) {
+ auto& thirdValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(2));
+ tz = convertToFloatLength(&thirdValue, conversionData);
}
- if (transformValue->length() > 1) {
- CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
- ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor);
+ if (transformValue.length() > 1) {
+ auto& secondValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(1));
+ ty = convertToFloatLength(&secondValue, conversionData);
}
}
}
@@ -208,105 +226,105 @@ bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle,
if (tx.isUndefined() || ty.isUndefined() || tz.isUndefined())
return false;
- operations.operations().append(TranslateTransformOperation::create(tx, ty, tz, transformOperationType(transformValue->operationType())));
+ operations.operations().append(TranslateTransformOperation::create(tx, ty, tz, transformOperationType(transformValue.name())));
break;
}
- case WebKitCSSTransformValue::RotateTransformOperation: {
- double angle = firstValue->computeDegrees();
- operations.operations().append(RotateTransformOperation::create(0, 0, 1, angle, transformOperationType(transformValue->operationType())));
+ case CSSValueRotate: {
+ double angle = firstValue.computeDegrees();
+ operations.operations().append(RotateTransformOperation::create(0, 0, 1, angle, transformOperationType(transformValue.name())));
break;
}
- case WebKitCSSTransformValue::RotateXTransformOperation:
- case WebKitCSSTransformValue::RotateYTransformOperation:
- case WebKitCSSTransformValue::RotateZTransformOperation: {
+ case CSSValueRotateX:
+ case CSSValueRotateY:
+ case CSSValueRotateZ: {
double x = 0;
double y = 0;
double z = 0;
- double angle = firstValue->computeDegrees();
+ double angle = firstValue.computeDegrees();
- if (transformValue->operationType() == WebKitCSSTransformValue::RotateXTransformOperation)
+ if (transformValue.name() == CSSValueRotateX)
x = 1;
- else if (transformValue->operationType() == WebKitCSSTransformValue::RotateYTransformOperation)
+ else if (transformValue.name() == CSSValueRotateY)
y = 1;
else
z = 1;
- operations.operations().append(RotateTransformOperation::create(x, y, z, angle, transformOperationType(transformValue->operationType())));
+ operations.operations().append(RotateTransformOperation::create(x, y, z, angle, transformOperationType(transformValue.name())));
break;
}
- case WebKitCSSTransformValue::Rotate3DTransformOperation: {
- if (transformValue->length() < 4)
+ case CSSValueRotate3d: {
+ if (transformValue.length() < 4)
break;
- CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
- CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2));
- CSSPrimitiveValue* fourthValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(3));
- double x = firstValue->getDoubleValue();
- double y = secondValue->getDoubleValue();
- double z = thirdValue->getDoubleValue();
- double angle = fourthValue->computeDegrees();
- operations.operations().append(RotateTransformOperation::create(x, y, z, angle, transformOperationType(transformValue->operationType())));
+ auto& secondValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(1));
+ auto& thirdValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(2));
+ auto& fourthValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(3));
+ double x = firstValue.doubleValue();
+ double y = secondValue.doubleValue();
+ double z = thirdValue.doubleValue();
+ double angle = fourthValue.computeDegrees();
+ operations.operations().append(RotateTransformOperation::create(x, y, z, angle, transformOperationType(transformValue.name())));
break;
}
- case WebKitCSSTransformValue::SkewTransformOperation:
- case WebKitCSSTransformValue::SkewXTransformOperation:
- case WebKitCSSTransformValue::SkewYTransformOperation: {
+ case CSSValueSkew:
+ case CSSValueSkewX:
+ case CSSValueSkewY: {
double angleX = 0;
double angleY = 0;
- double angle = firstValue->computeDegrees();
- if (transformValue->operationType() == WebKitCSSTransformValue::SkewYTransformOperation)
+ double angle = firstValue.computeDegrees();
+ if (transformValue.name() == CSSValueSkewY)
angleY = angle;
else {
angleX = angle;
- if (transformValue->operationType() == WebKitCSSTransformValue::SkewTransformOperation) {
- if (transformValue->length() > 1) {
- CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
- angleY = secondValue->computeDegrees();
+ if (transformValue.name() == CSSValueSkew) {
+ if (transformValue.length() > 1) {
+ auto& secondValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(1));
+ angleY = secondValue.computeDegrees();
}
}
}
- operations.operations().append(SkewTransformOperation::create(angleX, angleY, transformOperationType(transformValue->operationType())));
+ operations.operations().append(SkewTransformOperation::create(angleX, angleY, transformOperationType(transformValue.name())));
break;
}
- case WebKitCSSTransformValue::MatrixTransformOperation: {
- if (transformValue->length() < 6)
+ case CSSValueMatrix: {
+ if (transformValue.length() < 6)
break;
- double a = firstValue->getDoubleValue();
- double b = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1))->getDoubleValue();
- double c = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2))->getDoubleValue();
- double d = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(3))->getDoubleValue();
- double e = zoomFactor * toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(4))->getDoubleValue();
- double f = zoomFactor * toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(5))->getDoubleValue();
+ double a = firstValue.doubleValue();
+ double b = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(1)).doubleValue();
+ double c = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(2)).doubleValue();
+ double d = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(3)).doubleValue();
+ double e = conversionData.zoom() * downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(4)).doubleValue();
+ double f = conversionData.zoom() * downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(5)).doubleValue();
operations.operations().append(MatrixTransformOperation::create(a, b, c, d, e, f));
break;
}
- case WebKitCSSTransformValue::Matrix3DTransformOperation: {
- if (transformValue->length() < 16)
+ case CSSValueMatrix3d: {
+ if (transformValue.length() < 16)
break;
- TransformationMatrix matrix(toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(0))->getDoubleValue(),
- toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1))->getDoubleValue(),
- toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2))->getDoubleValue(),
- toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(3))->getDoubleValue(),
- toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(4))->getDoubleValue(),
- toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(5))->getDoubleValue(),
- toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(6))->getDoubleValue(),
- toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(7))->getDoubleValue(),
- toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(8))->getDoubleValue(),
- toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(9))->getDoubleValue(),
- toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(10))->getDoubleValue(),
- toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(11))->getDoubleValue(),
- zoomFactor * toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(12))->getDoubleValue(),
- zoomFactor * toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(13))->getDoubleValue(),
- toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(14))->getDoubleValue(),
- toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(15))->getDoubleValue());
+ TransformationMatrix matrix(downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(0)).doubleValue(),
+ downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(1)).doubleValue(),
+ downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(2)).doubleValue(),
+ downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(3)).doubleValue(),
+ downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(4)).doubleValue(),
+ downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(5)).doubleValue(),
+ downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(6)).doubleValue(),
+ downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(7)).doubleValue(),
+ downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(8)).doubleValue(),
+ downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(9)).doubleValue(),
+ downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(10)).doubleValue(),
+ downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(11)).doubleValue(),
+ conversionData.zoom() * downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(12)).doubleValue(),
+ conversionData.zoom() * downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(13)).doubleValue(),
+ downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(14)).doubleValue(),
+ downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(15)).doubleValue());
operations.operations().append(Matrix3DTransformOperation::create(matrix));
break;
}
- case WebKitCSSTransformValue::PerspectiveTransformOperation: {
+ case CSSValuePerspective: {
Length p = Length(0, Fixed);
- if (firstValue->isLength())
- p = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
+ if (firstValue.isLength())
+ p = convertToFloatLength(&firstValue, conversionData);
else {
// This is a quirk that should go away when 3d transforms are finalized.
- double val = firstValue->getDoubleValue();
+ double val = firstValue.doubleValue();
p = val >= 0 ? Length(clampToPositiveInteger(val), Fixed) : Length(Undefined);
}
@@ -316,7 +334,7 @@ bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle,
operations.operations().append(PerspectiveTransformOperation::create(p));
break;
}
- case WebKitCSSTransformValue::UnknownTransformOperation:
+ default:
ASSERT_NOT_REACHED();
break;
}