Commit 2a5105ea authored by Hwanseung Lee's avatar Hwanseung Lee Committed by Commit Bot

[css-typed-om] rename CSSRotation to CSSRotate

reame CSSRotation to CSSRotate for consistency with others.

https://github.com/w3c/css-houdini-drafts/pull/598
https://drafts.css-houdini.org/css-typed-om-1/#cssrotate

Bug: 806736
Change-Id: Ibb62074598d1840b11be0b03cdeb253377038ccf
Reviewed-on: https://chromium-review.googlesource.com/890157
Commit-Queue: Hwanseung Lee <hs1217.lee@samsung.com>
Reviewed-by: default avatarnainar <nainar@chromium.org>
Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532837}
parent 5129bc4d
...@@ -40,7 +40,7 @@ function assert_style_value_equals(a, b) { ...@@ -40,7 +40,7 @@ function assert_style_value_equals(a, b) {
case 'CSSTransformValue': case 'CSSTransformValue':
assert_style_value_array_equals(a, b); assert_style_value_array_equals(a, b);
break; break;
case 'CSSRotation': case 'CSSRotate':
assert_style_value_equals(a.angle, b.angle); assert_style_value_equals(a.angle, b.angle);
// fallthrough // fallthrough
case 'CSSTranslate': case 'CSSTranslate':
......
...@@ -95,27 +95,27 @@ const gTestCases = [ ...@@ -95,27 +95,27 @@ const gTestCases = [
}, },
{ {
cssText: 'rotate(90deg)', cssText: 'rotate(90deg)',
expected: new CSSRotation(CSS.deg(90)), expected: new CSSRotate(CSS.deg(90)),
desc: 'rotate()' desc: 'rotate()'
}, },
{ {
cssText: 'rotate3d(1, 2, 3, 90deg)', cssText: 'rotate3d(1, 2, 3, 90deg)',
expected: new CSSRotation(CSS.number(1), CSS.number(2), CSS.number(3), CSS.deg(90)), expected: new CSSRotate(CSS.number(1), CSS.number(2), CSS.number(3), CSS.deg(90)),
desc: 'rotate3d()' desc: 'rotate3d()'
}, },
{ {
cssText: 'rotateX(90deg)', cssText: 'rotateX(90deg)',
expected: new CSSRotation(CSS.number(1), CSS.number(0), CSS.number(0), CSS.deg(90)), expected: new CSSRotate(CSS.number(1), CSS.number(0), CSS.number(0), CSS.deg(90)),
desc: 'rotateX()' desc: 'rotateX()'
}, },
{ {
cssText: 'rotateY(90deg)', cssText: 'rotateY(90deg)',
expected: new CSSRotation(CSS.number(0), CSS.number(1), CSS.number(0), CSS.deg(90)), expected: new CSSRotate(CSS.number(0), CSS.number(1), CSS.number(0), CSS.deg(90)),
desc: 'rotateY()' desc: 'rotateY()'
}, },
{ {
cssText: 'rotateZ(90deg)', cssText: 'rotateZ(90deg)',
expected: new CSSRotation(CSS.number(0), CSS.number(0), CSS.number(1), CSS.deg(90)), expected: new CSSRotate(CSS.number(0), CSS.number(0), CSS.number(1), CSS.deg(90)),
desc: 'rotateZ()' desc: 'rotateZ()'
}, },
{ {
...@@ -156,7 +156,7 @@ test(t => { ...@@ -156,7 +156,7 @@ test(t => {
'translate(1px) rotateX(90deg) perspective(1px) skew(90deg) scale3d(1, 2, 3)', 'translate(1px) rotateX(90deg) perspective(1px) skew(90deg) scale3d(1, 2, 3)',
new CSSTransformValue([ new CSSTransformValue([
new CSSTranslate(CSS.px(1), CSS.px(0)), new CSSTranslate(CSS.px(1), CSS.px(0)),
new CSSRotation(CSS.number(1), CSS.number(0), CSS.number(0), CSS.deg(90)), new CSSRotate(CSS.number(1), CSS.number(0), CSS.number(0), CSS.deg(90)),
new CSSPerspective(CSS.px(1)), new CSSPerspective(CSS.px(1)),
new CSSSkew(CSS.deg(90), CSS.deg(0)), new CSSSkew(CSS.deg(90), CSS.deg(0)),
new CSSScale(CSS.number(1), CSS.number(2), CSS.number(3)), new CSSScale(CSS.number(1), CSS.number(2), CSS.number(3)),
......
...@@ -30,14 +30,14 @@ const gTestCases = [ ...@@ -30,14 +30,14 @@ const gTestCases = [
desc: 'CSSScale with 3 arguments' desc: 'CSSScale with 3 arguments'
}, },
{ {
value: new CSSRotation(CSS.deg(90)), value: new CSSRotate(CSS.deg(90)),
cssText: 'rotate(90deg)', cssText: 'rotate(90deg)',
desc: 'CSSRotation with 1 argument' desc: 'CSSRotate with 1 argument'
}, },
{ {
value: new CSSRotation(CSS.number(1), CSS.number(2), CSS.number(3), CSS.deg(90)), value: new CSSRotate(CSS.number(1), CSS.number(2), CSS.number(3), CSS.deg(90)),
cssText: 'rotate3d(1, 2, 3, 90deg)', cssText: 'rotate3d(1, 2, 3, 90deg)',
desc: 'CSSRotation with 4 arguments' desc: 'CSSRotate with 4 arguments'
}, },
{ {
value: new CSSSkew(CSS.deg(90), CSS.deg(45)), value: new CSSSkew(CSS.deg(90), CSS.deg(45)),
...@@ -57,7 +57,7 @@ const gTestCases = [ ...@@ -57,7 +57,7 @@ const gTestCases = [
{ {
value: new CSSTransformValue([ value: new CSSTransformValue([
new CSSTranslate(CSS.px(1), CSS.px(0)), new CSSTranslate(CSS.px(1), CSS.px(0)),
new CSSRotation(CSS.deg(90)), new CSSRotate(CSS.deg(90)),
new CSSPerspective(CSS.px(1)), new CSSPerspective(CSS.px(1)),
new CSSSkew(CSS.deg(90), CSS.deg(45)), new CSSSkew(CSS.deg(90), CSS.deg(45)),
new CSSScale(CSS.number(1), CSS.number(2), CSS.number(3)), new CSSScale(CSS.number(1), CSS.number(2), CSS.number(3)),
...@@ -68,7 +68,7 @@ const gTestCases = [ ...@@ -68,7 +68,7 @@ const gTestCases = [
{ {
value: new CSSTransformValue([ value: new CSSTransformValue([
new CSSTranslate(new CSSMathSum(CSS.px(1), CSS.em(1)), CSS.px(0)), new CSSTranslate(new CSSMathSum(CSS.px(1), CSS.em(1)), CSS.px(0)),
new CSSRotation(new CSSMathSum(CSS.deg(90), CSS.turn(1))), new CSSRotate(new CSSMathSum(CSS.deg(90), CSS.turn(1))),
new CSSPerspective(new CSSMathSum(CSS.px(1), CSS.em(1))), new CSSPerspective(new CSSMathSum(CSS.px(1), CSS.em(1))),
new CSSSkew(new CSSMathProduct(CSS.deg(90), 2), new CSSMathProduct(CSS.turn(1), 2)), new CSSSkew(new CSSMathProduct(CSS.deg(90), 2), new CSSMathProduct(CSS.turn(1), 2)),
new CSSScale( new CSSScale(
...@@ -101,7 +101,7 @@ for (const {value, cssText, desc} of gTestCases) { ...@@ -101,7 +101,7 @@ for (const {value, cssText, desc} of gTestCases) {
test(() => { test(() => {
let result = new CSSTransformValue([ let result = new CSSTransformValue([
new CSSTranslate(CSS.px(1), CSS.px(2), CSS.px(3)), new CSSTranslate(CSS.px(1), CSS.px(2), CSS.px(3)),
new CSSRotation(1, 2, 3, CSS.deg(90)), new CSSRotate(1, 2, 3, CSS.deg(90)),
new CSSScale(1, 2, 3), new CSSScale(1, 2, 3),
]); ]);
......
<!doctype html> <!doctype html>
<meta charset="utf-8"> <meta charset="utf-8">
<title>CSSRotation tests</title> <title>CSSRotate tests</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssrotation"> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssrotate">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script> <script src="../resources/testhelper.js"></script>
...@@ -20,57 +20,57 @@ const gInvalidCoordTestCases = [ ...@@ -20,57 +20,57 @@ const gInvalidCoordTestCases = [
for (const {angle, desc} of gInvalidAngleTestCases) { for (const {angle, desc} of gInvalidAngleTestCases) {
test(() => { test(() => {
assert_throws(new TypeError(), () => new CSSRotation(angle)); assert_throws(new TypeError(), () => new CSSRotate(angle));
assert_throws(new TypeError(), () => new CSSRotation(0, 0, 0, angle)); assert_throws(new TypeError(), () => new CSSRotate(0, 0, 0, angle));
}, 'Constructing a CSSRotation with ' + desc + ' for the angle throws a TypeError'); }, 'Constructing a CSSRotate with ' + desc + ' for the angle throws a TypeError');
} }
for (const {coord, desc} of gInvalidCoordTestCases) { for (const {coord, desc} of gInvalidCoordTestCases) {
test(() => { test(() => {
assert_throws(new TypeError(), () => new CSSRotation(coord, 0, 0, CSS.deg(0))); assert_throws(new TypeError(), () => new CSSRotate(coord, 0, 0, CSS.deg(0)));
assert_throws(new TypeError(), () => new CSSRotation(0, coord, 0, CSS.deg(0))); assert_throws(new TypeError(), () => new CSSRotate(0, coord, 0, CSS.deg(0)));
assert_throws(new TypeError(), () => new CSSRotation(0, 0, coord, CSS.deg(0))); assert_throws(new TypeError(), () => new CSSRotate(0, 0, coord, CSS.deg(0)));
}, 'Constructing a CSSRotation with ' + desc + ' for the coordinates throws a TypeError'); }, 'Constructing a CSSRotate with ' + desc + ' for the coordinates throws a TypeError');
} }
for (const attr of ['x', 'y', 'z']) { for (const attr of ['x', 'y', 'z']) {
for (const {value, desc} of gInvalidCoordTestCases) { for (const {value, desc} of gInvalidCoordTestCases) {
test(() => { test(() => {
let result = new CSSRotation(0, 0, 0, CSS.deg(0)); let result = new CSSRotate(0, 0, 0, CSS.deg(0));
assert_throws(new TypeError(), () => result[attr] = value); assert_throws(new TypeError(), () => result[attr] = value);
assert_style_value_equals(result[attr], CSS.number(0)); assert_style_value_equals(result[attr], CSS.number(0));
}, 'Updating CSSRotation.' + attr + ' to ' + desc + ' throws a TypeError'); }, 'Updating CSSRotate.' + attr + ' to ' + desc + ' throws a TypeError');
} }
} }
for (const {angle, desc} of gInvalidAngleTestCases) { for (const {angle, desc} of gInvalidAngleTestCases) {
test(() => { test(() => {
let result = new CSSRotation(CSS.deg(0)); let result = new CSSRotate(CSS.deg(0));
assert_throws(new TypeError(), () => result.angle = angle); assert_throws(new TypeError(), () => result.angle = angle);
assert_style_value_equals(result.angle, CSS.deg(0)); assert_style_value_equals(result.angle, CSS.deg(0));
}, 'Updating CSSRotation.angle to ' + desc + ' throws a TypeError'); }, 'Updating CSSRotate.angle to ' + desc + ' throws a TypeError');
} }
test(() => { test(() => {
const result = new CSSRotation(CSS.deg(3.14)); const result = new CSSRotate(CSS.deg(3.14));
assert_style_value_equals(result.x, CSS.number(0)); assert_style_value_equals(result.x, CSS.number(0));
assert_style_value_equals(result.y, CSS.number(0)); assert_style_value_equals(result.y, CSS.number(0));
assert_style_value_equals(result.z, CSS.number(1)); assert_style_value_equals(result.z, CSS.number(1));
assert_style_value_equals(result.angle, CSS.deg(3.14)); assert_style_value_equals(result.angle, CSS.deg(3.14));
assert_true(result.is2D); assert_true(result.is2D);
}, 'CSSRotation can be constructed from a single angle'); }, 'CSSRotate can be constructed from a single angle');
test(() => { test(() => {
const result = new CSSRotation(-3.14, CSS.number(3.14), 3.14, CSS.deg(3.14)); const result = new CSSRotate(-3.14, CSS.number(3.14), 3.14, CSS.deg(3.14));
assert_style_value_equals(result.x, CSS.number(-3.14)); assert_style_value_equals(result.x, CSS.number(-3.14));
assert_style_value_equals(result.y, CSS.number(3.14)); assert_style_value_equals(result.y, CSS.number(3.14));
assert_style_value_equals(result.z, CSS.number(3.14)); assert_style_value_equals(result.z, CSS.number(3.14));
assert_style_value_equals(result.angle, CSS.deg(3.14)); assert_style_value_equals(result.angle, CSS.deg(3.14));
assert_false(result.is2D); assert_false(result.is2D);
}, 'CSSRotation can be constructed from numberish coordinates'); }, 'CSSRotate can be constructed from numberish coordinates');
test(() => { test(() => {
const result = new CSSRotation( const result = new CSSRotate(
new CSSMathSum(-3.14), new CSSMathSum(-3.14),
new CSSMathProduct(3.14), new CSSMathProduct(3.14),
new CSSMathNegate(-3.14), new CSSMathNegate(-3.14),
...@@ -81,46 +81,46 @@ test(() => { ...@@ -81,46 +81,46 @@ test(() => {
assert_style_value_equals(result.z, new CSSMathNegate(-3.14)); assert_style_value_equals(result.z, new CSSMathNegate(-3.14));
assert_style_value_equals(result.angle, new CSSMathMax(CSS.deg(3.14))); assert_style_value_equals(result.angle, new CSSMathMax(CSS.deg(3.14)));
assert_false(result.is2D); assert_false(result.is2D);
}, 'CSSRotation can be constructed from CSSMathValues'); }, 'CSSRotate can be constructed from CSSMathValues');
for (const attr of ['x', 'y', 'z']) { for (const attr of ['x', 'y', 'z']) {
test(() => { test(() => {
let result = new CSSRotation(0, 0, 0, CSS.deg(0)); let result = new CSSRotate(0, 0, 0, CSS.deg(0));
result[attr] = 3.14; result[attr] = 3.14;
assert_style_value_equals(result[attr], CSS.number(3.14)); assert_style_value_equals(result[attr], CSS.number(3.14));
}, 'CSSRotation.' + attr + ' can be updated to a double'); }, 'CSSRotate.' + attr + ' can be updated to a double');
test(() => { test(() => {
let result = new CSSRotation(0, 0, 0, CSS.deg(0)); let result = new CSSRotate(0, 0, 0, CSS.deg(0));
result[attr] = CSS.number(3.14); result[attr] = CSS.number(3.14);
assert_style_value_equals(result[attr], CSS.number(3.14)); assert_style_value_equals(result[attr], CSS.number(3.14));
}, 'CSSRotation.' + attr + ' can be updated to a number CSSUnitValue'); }, 'CSSRotate.' + attr + ' can be updated to a number CSSUnitValue');
test(() => { test(() => {
let result = new CSSRotation(0, 0, 0, CSS.deg(0)); let result = new CSSRotate(0, 0, 0, CSS.deg(0));
result[attr] = new CSSMathSum(3.14); result[attr] = new CSSMathSum(3.14);
assert_style_value_equals(result[attr], new CSSMathSum(3.14)); assert_style_value_equals(result[attr], new CSSMathSum(3.14));
}, 'CSSRotation.' + attr + ' can be updated to a CSSMathValue matching <number>'); }, 'CSSRotate.' + attr + ' can be updated to a CSSMathValue matching <number>');
} }
test(() => { test(() => {
let rotation = new CSSRotation(CSS.deg(0)); let rotation = new CSSRotate(CSS.deg(0));
rotation.angle = CSS.deg(6); rotation.angle = CSS.deg(6);
assert_style_value_equals(rotation.angle, CSS.deg(6)); assert_style_value_equals(rotation.angle, CSS.deg(6));
}, 'CSSRotation.angle can be updated to a degree CSSUnitValue'); }, 'CSSRotate.angle can be updated to a degree CSSUnitValue');
test(() => { test(() => {
let rotation = new CSSRotation(CSS.deg(0)); let rotation = new CSSRotate(CSS.deg(0));
rotation.angle = new CSSMathSum(CSS.deg(3.14)); rotation.angle = new CSSMathSum(CSS.deg(3.14));
assert_style_value_equals(rotation.angle, new CSSMathSum(CSS.deg(3.14))); assert_style_value_equals(rotation.angle, new CSSMathSum(CSS.deg(3.14)));
}, 'CSSRotation.angle can be updated to a CSSMathValue matching <angle>'); }, 'CSSRotate.angle can be updated to a CSSMathValue matching <angle>');
test(() => { test(() => {
let rotation = new CSSRotation(CSS.deg(0)); let rotation = new CSSRotate(CSS.deg(0));
rotation.is2D = true; rotation.is2D = true;
assert_true(rotation.is2D); assert_true(rotation.is2D);
rotation.is2D = false; rotation.is2D = false;
assert_false(rotation.is2D); assert_false(rotation.is2D);
}, 'Modifying CSSRotation.is2D can be updated to true or false'); }, 'Modifying CSSRotate.is2D can be updated to true or false');
</script> </script>
...@@ -20,7 +20,7 @@ test(() => { ...@@ -20,7 +20,7 @@ test(() => {
const values = [ const values = [
new CSSScale(1, 1), new CSSScale(1, 1),
new CSSTranslate(CSS.px(1), CSS.px(1)), new CSSTranslate(CSS.px(1), CSS.px(1)),
new CSSRotation(CSS.deg(90)) new CSSRotate(CSS.deg(90))
]; ];
const transform = new CSSTransformValue(values); const transform = new CSSTransformValue(values);
...@@ -66,11 +66,11 @@ test(() => { ...@@ -66,11 +66,11 @@ test(() => {
test(() => { test(() => {
const transform = new CSSTransformValue([ const transform = new CSSTransformValue([
new CSSRotation(CSS.number(1), CSS.number(2), CSS.number(3), CSS.deg(90)) new CSSRotate(CSS.number(1), CSS.number(2), CSS.number(3), CSS.deg(90))
]); ]);
const expectedMatrix = (new DOMMatrixReadOnly()).rotateAxisAngle(1, 2, 3, 90); const expectedMatrix = (new DOMMatrixReadOnly()).rotateAxisAngle(1, 2, 3, 90);
assert_matrix_approx_equals(transform.toMatrix(), expectedMatrix, EPSILON); assert_matrix_approx_equals(transform.toMatrix(), expectedMatrix, EPSILON);
}, 'CSSTransformValue.toMatrix returns correct matrix for CSSRotation'); }, 'CSSTransformValue.toMatrix returns correct matrix for CSSRotate');
test(() => { test(() => {
const transform = new CSSTransformValue([ const transform = new CSSTransformValue([
...@@ -134,7 +134,7 @@ test(() => { ...@@ -134,7 +134,7 @@ test(() => {
const transformMatrix = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); const transformMatrix = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
let transformArray = [ let transformArray = [
new CSSTranslate(CSS.px(1), CSS.px(1), CSS.px(1)), new CSSTranslate(CSS.px(1), CSS.px(1), CSS.px(1)),
new CSSRotation(1, 2, 3, CSS.deg(90)), new CSSRotate(1, 2, 3, CSS.deg(90)),
new CSSScale(2, 3, 2), new CSSScale(2, 3, 2),
new CSSMatrixComponent(transformMatrix), new CSSMatrixComponent(transformMatrix),
]; ];
......
...@@ -64,7 +64,7 @@ CONSOLE MESSAGE: line 147: setter y ...@@ -64,7 +64,7 @@ CONSOLE MESSAGE: line 147: setter y
CONSOLE MESSAGE: line 147: interface CSSResourceValue : CSSStyleValue CONSOLE MESSAGE: line 147: interface CSSResourceValue : CSSStyleValue
CONSOLE MESSAGE: line 147: getter state CONSOLE MESSAGE: line 147: getter state
CONSOLE MESSAGE: line 147: method constructor CONSOLE MESSAGE: line 147: method constructor
CONSOLE MESSAGE: line 147: interface CSSRotation : CSSTransformComponent CONSOLE MESSAGE: line 147: interface CSSRotate : CSSTransformComponent
CONSOLE MESSAGE: line 147: getter angle CONSOLE MESSAGE: line 147: getter angle
CONSOLE MESSAGE: line 147: getter x CONSOLE MESSAGE: line 147: getter x
CONSOLE MESSAGE: line 147: getter y CONSOLE MESSAGE: line 147: getter y
...@@ -348,7 +348,7 @@ CONSOLE MESSAGE: line 147: setter y ...@@ -348,7 +348,7 @@ CONSOLE MESSAGE: line 147: setter y
CONSOLE MESSAGE: line 147: interface CSSResourceValue : CSSStyleValue CONSOLE MESSAGE: line 147: interface CSSResourceValue : CSSStyleValue
CONSOLE MESSAGE: line 147: getter state CONSOLE MESSAGE: line 147: getter state
CONSOLE MESSAGE: line 147: method constructor CONSOLE MESSAGE: line 147: method constructor
CONSOLE MESSAGE: line 147: interface CSSRotation : CSSTransformComponent CONSOLE MESSAGE: line 147: interface CSSRotate : CSSTransformComponent
CONSOLE MESSAGE: line 147: getter angle CONSOLE MESSAGE: line 147: getter angle
CONSOLE MESSAGE: line 147: getter x CONSOLE MESSAGE: line 147: getter x
CONSOLE MESSAGE: line 147: getter y CONSOLE MESSAGE: line 147: getter y
......
...@@ -8,7 +8,7 @@ var EPSILON = 1e-6; // float epsilon ...@@ -8,7 +8,7 @@ var EPSILON = 1e-6; // float epsilon
var testParams = [ var testParams = [
{ {
input: new CSSRotation(new CSSUnitValue(0, 'deg')), input: new CSSRotate(new CSSUnitValue(0, 'deg')),
angle: 0, angle: 0,
x: 0, x: 0,
y: 0, y: 0,
...@@ -18,7 +18,7 @@ var testParams = [ ...@@ -18,7 +18,7 @@ var testParams = [
asMatrix: new DOMMatrixReadOnly([1, 0, 0, 1, 0, 0]) asMatrix: new DOMMatrixReadOnly([1, 0, 0, 1, 0, 0])
}, },
{ {
input: new CSSRotation(new CSSUnitValue(10, 'deg')), input: new CSSRotate(new CSSUnitValue(10, 'deg')),
angle: 10, angle: 10,
x: 0, x: 0,
y: 0, y: 0,
...@@ -28,7 +28,7 @@ var testParams = [ ...@@ -28,7 +28,7 @@ var testParams = [
asMatrix: new DOMMatrixReadOnly([0.9848077, 0.1736481, -0.1736481, 0.9848077, 0, 0]) asMatrix: new DOMMatrixReadOnly([0.9848077, 0.1736481, -0.1736481, 0.9848077, 0, 0])
}, },
{ {
input: new CSSRotation(new CSSUnitValue(-21, 'deg')), input: new CSSRotate(new CSSUnitValue(-21, 'deg')),
angle: -21, angle: -21,
x: 0, x: 0,
y: 0, y: 0,
...@@ -38,7 +38,7 @@ var testParams = [ ...@@ -38,7 +38,7 @@ var testParams = [
asMatrix: new DOMMatrixReadOnly([0.9335804, -0.3583679, 0.3583679, 0.9335804, 0, 0]) asMatrix: new DOMMatrixReadOnly([0.9335804, -0.3583679, 0.3583679, 0.9335804, 0, 0])
}, },
{ {
input: new CSSRotation(new CSSUnitValue(3.2, 'deg')), input: new CSSRotate(new CSSUnitValue(3.2, 'deg')),
angle: 3.2, angle: 3.2,
x: 0, x: 0,
y: 0, y: 0,
...@@ -48,7 +48,7 @@ var testParams = [ ...@@ -48,7 +48,7 @@ var testParams = [
asMatrix: new DOMMatrixReadOnly([0.9984407, 0.0558215, -0.0558215, 0.9984407, 0, 0]) asMatrix: new DOMMatrixReadOnly([0.9984407, 0.0558215, -0.0558215, 0.9984407, 0, 0])
}, },
{ {
input: new CSSRotation(0, 0, 1, new CSSUnitValue(90, 'deg')), input: new CSSRotate(0, 0, 1, new CSSUnitValue(90, 'deg')),
angle: 90, angle: 90,
x: 0, x: 0,
y: 0, y: 0,
...@@ -58,7 +58,7 @@ var testParams = [ ...@@ -58,7 +58,7 @@ var testParams = [
asMatrix: new DOMMatrixReadOnly([0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]) asMatrix: new DOMMatrixReadOnly([0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])
}, },
{ {
input: new CSSRotation(2.7, -3, 4.4, new CSSUnitValue(0, 'deg')), input: new CSSRotate(2.7, -3, 4.4, new CSSUnitValue(0, 'deg')),
angle: 0, angle: 0,
x: 2.7, x: 2.7,
y: -3, y: -3,
...@@ -68,7 +68,7 @@ var testParams = [ ...@@ -68,7 +68,7 @@ var testParams = [
asMatrix: new DOMMatrixReadOnly([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]) asMatrix: new DOMMatrixReadOnly([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])
}, },
{ {
input: new CSSRotation(2, 3, 4, new CSSUnitValue(10, 'deg')), input: new CSSRotate(2, 3, 4, new CSSUnitValue(10, 'deg')),
angle: 10, angle: 10,
x: 2, x: 2,
y: 3, y: 3,
...@@ -79,7 +79,7 @@ var testParams = [ ...@@ -79,7 +79,7 @@ var testParams = [
0.9895225, 0.0707777, 0, 0.1009279, -0.0582048, 0.9931896, 0, 0, 0, 0, 1]) 0.9895225, 0.0707777, 0, 0.1009279, -0.0582048, 0.9931896, 0, 0, 0, 0, 1])
}, },
{ {
input: new CSSRotation(2, 3.7, -4, new CSSUnitValue(-1.2, 'deg')), input: new CSSRotate(2, 3.7, -4, new CSSUnitValue(-1.2, 'deg')),
angle: -1.2, angle: -1.2,
x: 2, x: 2,
y: 3.7, y: 3.7,
...@@ -90,7 +90,7 @@ var testParams = [ ...@@ -90,7 +90,7 @@ var testParams = [
0.9998698, -0.0073125, 0, -0.0134019, 0.0071198, 0.9998848, 0, 0, 0, 0, 1]) 0.9998698, -0.0073125, 0, -0.0134019, 0.0071198, 0.9998848, 0, 0, 0, 0, 1])
}, },
{ {
input: new CSSRotation(1, 0, 0, new CSSUnitValue(0.5, 'turn')), input: new CSSRotate(1, 0, 0, new CSSUnitValue(0.5, 'turn')),
angle: 0.5, angle: 0.5,
x: 1, x: 1,
y: 0, y: 0,
...@@ -104,10 +104,10 @@ var testParams = [ ...@@ -104,10 +104,10 @@ var testParams = [
test(() => { test(() => {
// Wrong number of arguments. // Wrong number of arguments.
assert_throws(new TypeError(), () => { new CSSRotation(); }); assert_throws(new TypeError(), () => { new CSSRotate(); });
assert_throws(new TypeError(), () => { new CSSRotation(null); }); assert_throws(new TypeError(), () => { new CSSRotate(null); });
assert_throws(new TypeError(), () => { assert_throws(new TypeError(), () => {
new CSSRotation(1, 2, new CSSUnitValue(10, 'deg')); new CSSRotate(1, 2, new CSSUnitValue(10, 'deg'));
}); });
}, "Invalid arguments to constructor should throw"); }, "Invalid arguments to constructor should throw");
......
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
function cssTransformWithRotate(angleValue) { function cssTransformWithRotate(angleValue) {
return new CSSTransformValue([ return new CSSTransformValue([
new CSSRotation(angleValue)]); new CSSRotate(angleValue)]);
} }
function cssTransformWithRotate3D(x, y, z, angleValue) { function cssTransformWithRotate3D(x, y, z, angleValue) {
return new CSSTransformValue([ return new CSSTransformValue([
new CSSRotation(x, y, z, angleValue)]); new CSSRotate(x, y, z, angleValue)]);
} }
runInlineStylePropertyMapTests( { runInlineStylePropertyMapTests( {
......
...@@ -40,7 +40,7 @@ function assert_style_value_equals(a, b) { ...@@ -40,7 +40,7 @@ function assert_style_value_equals(a, b) {
case 'CSSTransformValue': case 'CSSTransformValue':
assert_style_value_array_equals(a, b); assert_style_value_array_equals(a, b);
break; break;
case 'CSSRotation': case 'CSSRotate':
assert_style_value_equals(a.angle, b.angle); assert_style_value_equals(a.angle, b.angle);
// fallthrough // fallthrough
case 'CSSTranslate': case 'CSSTranslate':
......
...@@ -724,7 +724,7 @@ interface CSSResourceValue : CSSStyleValue ...@@ -724,7 +724,7 @@ interface CSSResourceValue : CSSStyleValue
attribute @@toStringTag attribute @@toStringTag
getter state getter state
method constructor method constructor
interface CSSRotation : CSSTransformComponent interface CSSRotate : CSSTransformComponent
attribute @@toStringTag attribute @@toStringTag
getter angle getter angle
getter x getter x
......
...@@ -87,7 +87,7 @@ core_idl_files = ...@@ -87,7 +87,7 @@ core_idl_files =
"css/cssom/CSSPerspective.idl", "css/cssom/CSSPerspective.idl",
"css/cssom/CSSPositionValue.idl", "css/cssom/CSSPositionValue.idl",
"css/cssom/CSSResourceValue.idl", "css/cssom/CSSResourceValue.idl",
"css/cssom/CSSRotation.idl", "css/cssom/CSSRotate.idl",
"css/cssom/CSSScale.idl", "css/cssom/CSSScale.idl",
"css/cssom/CSSSkew.idl", "css/cssom/CSSSkew.idl",
"css/cssom/CSSStyleValue.idl", "css/cssom/CSSStyleValue.idl",
......
...@@ -340,8 +340,8 @@ blink_core_sources("css") { ...@@ -340,8 +340,8 @@ blink_core_sources("css") {
"cssom/CSSPositionValue.cpp", "cssom/CSSPositionValue.cpp",
"cssom/CSSPositionValue.h", "cssom/CSSPositionValue.h",
"cssom/CSSResourceValue.h", "cssom/CSSResourceValue.h",
"cssom/CSSRotation.cpp", "cssom/CSSRotate.cpp",
"cssom/CSSRotation.h", "cssom/CSSRotate.h",
"cssom/CSSScale.cpp", "cssom/CSSScale.cpp",
"cssom/CSSScale.h", "cssom/CSSScale.h",
"cssom/CSSSkew.cpp", "cssom/CSSSkew.cpp",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "core/css/cssom/CSSRotation.h" #include "core/css/cssom/CSSRotate.h"
#include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/ExceptionState.h"
#include "core/css/CSSFunctionValue.h" #include "core/css/CSSFunctionValue.h"
...@@ -23,14 +23,14 @@ bool IsValidRotateAngle(const CSSNumericValue* value) { ...@@ -23,14 +23,14 @@ bool IsValidRotateAngle(const CSSNumericValue* value) {
value->Type().MatchesBaseType(CSSNumericValueType::BaseType::kAngle); value->Type().MatchesBaseType(CSSNumericValueType::BaseType::kAngle);
} }
CSSRotation* FromCSSRotate(const CSSFunctionValue& value) { CSSRotate* FromCSSRotate(const CSSFunctionValue& value) {
DCHECK_EQ(value.length(), 1UL); DCHECK_EQ(value.length(), 1UL);
CSSNumericValue* angle = CSSNumericValue* angle =
CSSNumericValue::FromCSSValue(ToCSSPrimitiveValue(value.Item(0))); CSSNumericValue::FromCSSValue(ToCSSPrimitiveValue(value.Item(0)));
return CSSRotation::Create(angle); return CSSRotate::Create(angle);
} }
CSSRotation* FromCSSRotate3d(const CSSFunctionValue& value) { CSSRotate* FromCSSRotate3d(const CSSFunctionValue& value) {
DCHECK_EQ(value.length(), 4UL); DCHECK_EQ(value.length(), 4UL);
CSSNumericValue* x = CSSNumericValue* x =
...@@ -42,10 +42,10 @@ CSSRotation* FromCSSRotate3d(const CSSFunctionValue& value) { ...@@ -42,10 +42,10 @@ CSSRotation* FromCSSRotate3d(const CSSFunctionValue& value) {
CSSNumericValue* angle = CSSNumericValue* angle =
CSSNumericValue::FromCSSValue(ToCSSPrimitiveValue(value.Item(3))); CSSNumericValue::FromCSSValue(ToCSSPrimitiveValue(value.Item(3)));
return CSSRotation::Create(x, y, z, angle); return CSSRotate::Create(x, y, z, angle);
} }
CSSRotation* FromCSSRotateXYZ(const CSSFunctionValue& value) { CSSRotate* FromCSSRotateXYZ(const CSSFunctionValue& value) {
DCHECK_EQ(value.length(), 1UL); DCHECK_EQ(value.length(), 1UL);
CSSNumericValue* angle = CSSNumericValue* angle =
...@@ -53,17 +53,14 @@ CSSRotation* FromCSSRotateXYZ(const CSSFunctionValue& value) { ...@@ -53,17 +53,14 @@ CSSRotation* FromCSSRotateXYZ(const CSSFunctionValue& value) {
switch (value.FunctionType()) { switch (value.FunctionType()) {
case CSSValueRotateX: case CSSValueRotateX:
return CSSRotation::Create(CSSUnitValue::Create(1), return CSSRotate::Create(CSSUnitValue::Create(1), CSSUnitValue::Create(0),
CSSUnitValue::Create(0), CSSUnitValue::Create(0), angle);
CSSUnitValue::Create(0), angle);
case CSSValueRotateY: case CSSValueRotateY:
return CSSRotation::Create(CSSUnitValue::Create(0), return CSSRotate::Create(CSSUnitValue::Create(0), CSSUnitValue::Create(1),
CSSUnitValue::Create(1), CSSUnitValue::Create(0), angle);
CSSUnitValue::Create(0), angle);
case CSSValueRotateZ: case CSSValueRotateZ:
return CSSRotation::Create(CSSUnitValue::Create(0), return CSSRotate::Create(CSSUnitValue::Create(0), CSSUnitValue::Create(0),
CSSUnitValue::Create(0), CSSUnitValue::Create(1), angle);
CSSUnitValue::Create(1), angle);
default: default:
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
...@@ -72,21 +69,21 @@ CSSRotation* FromCSSRotateXYZ(const CSSFunctionValue& value) { ...@@ -72,21 +69,21 @@ CSSRotation* FromCSSRotateXYZ(const CSSFunctionValue& value) {
} // namespace } // namespace
CSSRotation* CSSRotation::Create(CSSNumericValue* angle, CSSRotate* CSSRotate::Create(CSSNumericValue* angle,
ExceptionState& exception_state) { ExceptionState& exception_state) {
if (!IsValidRotateAngle(angle)) { if (!IsValidRotateAngle(angle)) {
exception_state.ThrowTypeError("Must pass an angle to CSSRotation"); exception_state.ThrowTypeError("Must pass an angle to CSSRotate");
return nullptr; return nullptr;
} }
return new CSSRotation(CSSUnitValue::Create(0), CSSUnitValue::Create(0), return new CSSRotate(CSSUnitValue::Create(0), CSSUnitValue::Create(0),
CSSUnitValue::Create(1), angle, true /* is2D */); CSSUnitValue::Create(1), angle, true /* is2D */);
} }
CSSRotation* CSSRotation::Create(const CSSNumberish& x, CSSRotate* CSSRotate::Create(const CSSNumberish& x,
const CSSNumberish& y, const CSSNumberish& y,
const CSSNumberish& z, const CSSNumberish& z,
CSSNumericValue* angle, CSSNumericValue* angle,
ExceptionState& exception_state) { ExceptionState& exception_state) {
CSSNumericValue* x_value = CSSNumericValue::FromNumberish(x); CSSNumericValue* x_value = CSSNumericValue::FromNumberish(x);
CSSNumericValue* y_value = CSSNumericValue::FromNumberish(y); CSSNumericValue* y_value = CSSNumericValue::FromNumberish(y);
CSSNumericValue* z_value = CSSNumericValue::FromNumberish(z); CSSNumericValue* z_value = CSSNumericValue::FromNumberish(z);
...@@ -97,25 +94,25 @@ CSSRotation* CSSRotation::Create(const CSSNumberish& x, ...@@ -97,25 +94,25 @@ CSSRotation* CSSRotation::Create(const CSSNumberish& x,
return nullptr; return nullptr;
} }
if (!IsValidRotateAngle(angle)) { if (!IsValidRotateAngle(angle)) {
exception_state.ThrowTypeError("Must pass an angle to CSSRotation"); exception_state.ThrowTypeError("Must pass an angle to CSSRotate");
return nullptr; return nullptr;
} }
return new CSSRotation(x_value, y_value, z_value, angle, false /* is2D */); return new CSSRotate(x_value, y_value, z_value, angle, false /* is2D */);
} }
CSSRotation* CSSRotation::Create(CSSNumericValue* angle) { CSSRotate* CSSRotate::Create(CSSNumericValue* angle) {
return new CSSRotation(CSSUnitValue::Create(0), CSSUnitValue::Create(0), return new CSSRotate(CSSUnitValue::Create(0), CSSUnitValue::Create(0),
CSSUnitValue::Create(1), angle, true /* is2D */); CSSUnitValue::Create(1), angle, true /* is2D */);
} }
CSSRotation* CSSRotation::Create(CSSNumericValue* x, CSSRotate* CSSRotate::Create(CSSNumericValue* x,
CSSNumericValue* y, CSSNumericValue* y,
CSSNumericValue* z, CSSNumericValue* z,
CSSNumericValue* angle) { CSSNumericValue* angle) {
return new CSSRotation(x, y, z, angle, false /* is2D */); return new CSSRotate(x, y, z, angle, false /* is2D */);
} }
CSSRotation* CSSRotation::FromCSSValue(const CSSFunctionValue& value) { CSSRotate* CSSRotate::FromCSSValue(const CSSFunctionValue& value) {
switch (value.FunctionType()) { switch (value.FunctionType()) {
case CSSValueRotate: case CSSValueRotate:
return FromCSSRotate(value); return FromCSSRotate(value);
...@@ -131,16 +128,16 @@ CSSRotation* CSSRotation::FromCSSValue(const CSSFunctionValue& value) { ...@@ -131,16 +128,16 @@ CSSRotation* CSSRotation::FromCSSValue(const CSSFunctionValue& value) {
} }
} }
void CSSRotation::setAngle(CSSNumericValue* angle, void CSSRotate::setAngle(CSSNumericValue* angle,
ExceptionState& exception_state) { ExceptionState& exception_state) {
if (!IsValidRotateAngle(angle)) { if (!IsValidRotateAngle(angle)) {
exception_state.ThrowTypeError("Must pass an angle to CSSRotation"); exception_state.ThrowTypeError("Must pass an angle to CSSRotate");
return; return;
} }
angle_ = angle; angle_ = angle;
} }
const DOMMatrix* CSSRotation::AsMatrix(ExceptionState& exception_state) const { const DOMMatrix* CSSRotate::AsMatrix(ExceptionState& exception_state) const {
CSSUnitValue* x = x_->to(CSSPrimitiveValue::UnitType::kNumber); CSSUnitValue* x = x_->to(CSSPrimitiveValue::UnitType::kNumber);
CSSUnitValue* y = y_->to(CSSPrimitiveValue::UnitType::kNumber); CSSUnitValue* y = y_->to(CSSPrimitiveValue::UnitType::kNumber);
CSSUnitValue* z = z_->to(CSSPrimitiveValue::UnitType::kNumber); CSSUnitValue* z = z_->to(CSSPrimitiveValue::UnitType::kNumber);
...@@ -161,7 +158,7 @@ const DOMMatrix* CSSRotation::AsMatrix(ExceptionState& exception_state) const { ...@@ -161,7 +158,7 @@ const DOMMatrix* CSSRotation::AsMatrix(ExceptionState& exception_state) const {
return matrix; return matrix;
} }
const CSSFunctionValue* CSSRotation::ToCSSValue() const { const CSSFunctionValue* CSSRotate::ToCSSValue() const {
DCHECK(x_->to(CSSPrimitiveValue::UnitType::kNumber)); DCHECK(x_->to(CSSPrimitiveValue::UnitType::kNumber));
DCHECK(y_->to(CSSPrimitiveValue::UnitType::kNumber)); DCHECK(y_->to(CSSPrimitiveValue::UnitType::kNumber));
DCHECK(z_->to(CSSPrimitiveValue::UnitType::kNumber)); DCHECK(z_->to(CSSPrimitiveValue::UnitType::kNumber));
...@@ -189,7 +186,7 @@ const CSSFunctionValue* CSSRotation::ToCSSValue() const { ...@@ -189,7 +186,7 @@ const CSSFunctionValue* CSSRotation::ToCSSValue() const {
return result; return result;
} }
void CSSRotation::setX(const CSSNumberish& x, ExceptionState& exception_state) { void CSSRotate::setX(const CSSNumberish& x, ExceptionState& exception_state) {
CSSNumericValue* value = CSSNumericValue::FromNumberish(x); CSSNumericValue* value = CSSNumericValue::FromNumberish(x);
if (!IsValidRotateCoord(value)) { if (!IsValidRotateCoord(value)) {
exception_state.ThrowTypeError("Must specify a number unit"); exception_state.ThrowTypeError("Must specify a number unit");
...@@ -198,7 +195,7 @@ void CSSRotation::setX(const CSSNumberish& x, ExceptionState& exception_state) { ...@@ -198,7 +195,7 @@ void CSSRotation::setX(const CSSNumberish& x, ExceptionState& exception_state) {
x_ = value; x_ = value;
} }
void CSSRotation::setY(const CSSNumberish& y, ExceptionState& exception_state) { void CSSRotate::setY(const CSSNumberish& y, ExceptionState& exception_state) {
CSSNumericValue* value = CSSNumericValue::FromNumberish(y); CSSNumericValue* value = CSSNumericValue::FromNumberish(y);
if (!IsValidRotateCoord(value)) { if (!IsValidRotateCoord(value)) {
exception_state.ThrowTypeError("Must specify a number unit"); exception_state.ThrowTypeError("Must specify a number unit");
...@@ -207,7 +204,7 @@ void CSSRotation::setY(const CSSNumberish& y, ExceptionState& exception_state) { ...@@ -207,7 +204,7 @@ void CSSRotation::setY(const CSSNumberish& y, ExceptionState& exception_state) {
y_ = value; y_ = value;
} }
void CSSRotation::setZ(const CSSNumberish& z, ExceptionState& exception_state) { void CSSRotate::setZ(const CSSNumberish& z, ExceptionState& exception_state) {
CSSNumericValue* value = CSSNumericValue::FromNumberish(z); CSSNumericValue* value = CSSNumericValue::FromNumberish(z);
if (!IsValidRotateCoord(value)) { if (!IsValidRotateCoord(value)) {
exception_state.ThrowTypeError("Must specify a number unit"); exception_state.ThrowTypeError("Must specify a number unit");
...@@ -216,11 +213,11 @@ void CSSRotation::setZ(const CSSNumberish& z, ExceptionState& exception_state) { ...@@ -216,11 +213,11 @@ void CSSRotation::setZ(const CSSNumberish& z, ExceptionState& exception_state) {
z_ = value; z_ = value;
} }
CSSRotation::CSSRotation(CSSNumericValue* x, CSSRotate::CSSRotate(CSSNumericValue* x,
CSSNumericValue* y, CSSNumericValue* y,
CSSNumericValue* z, CSSNumericValue* z,
CSSNumericValue* angle, CSSNumericValue* angle,
bool is2D) bool is2D)
: CSSTransformComponent(is2D), angle_(angle), x_(x), y_(y), z_(z) { : CSSTransformComponent(is2D), angle_(angle), x_(x), y_(y), z_(z) {
DCHECK(IsValidRotateCoord(x)); DCHECK(IsValidRotateCoord(x));
DCHECK(IsValidRotateCoord(y)); DCHECK(IsValidRotateCoord(y));
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CSSRotation_h #ifndef CSSRotate_h
#define CSSRotation_h #define CSSRotate_h
#include "base/macros.h" #include "base/macros.h"
#include "core/css/cssom/CSSNumericValue.h" #include "core/css/cssom/CSSNumericValue.h"
...@@ -17,26 +17,26 @@ class CSSNumericValue; ...@@ -17,26 +17,26 @@ class CSSNumericValue;
// Represents a rotation value in a CSSTransformValue used for properties like // Represents a rotation value in a CSSTransformValue used for properties like
// "transform". // "transform".
// See CSSRotation.idl for more information about this class. // See CSSRotate.idl for more information about this class.
class CORE_EXPORT CSSRotation final : public CSSTransformComponent { class CORE_EXPORT CSSRotate final : public CSSTransformComponent {
DEFINE_WRAPPERTYPEINFO(); DEFINE_WRAPPERTYPEINFO();
public: public:
// Constructors defined in the IDL. // Constructors defined in the IDL.
static CSSRotation* Create(CSSNumericValue* angle, ExceptionState&); static CSSRotate* Create(CSSNumericValue* angle, ExceptionState&);
static CSSRotation* Create(const CSSNumberish& x, static CSSRotate* Create(const CSSNumberish& x,
const CSSNumberish& y, const CSSNumberish& y,
const CSSNumberish& z, const CSSNumberish& z,
CSSNumericValue* angle, CSSNumericValue* angle,
ExceptionState&); ExceptionState&);
// Blink-internal ways of creating CSSRotations. // Blink-internal ways of creating CSSRotates.
static CSSRotation* Create(CSSNumericValue* angle); static CSSRotate* Create(CSSNumericValue* angle);
static CSSRotation* Create(CSSNumericValue* x, static CSSRotate* Create(CSSNumericValue* x,
CSSNumericValue* y, CSSNumericValue* y,
CSSNumericValue* z, CSSNumericValue* z,
CSSNumericValue* angle); CSSNumericValue* angle);
static CSSRotation* FromCSSValue(const CSSFunctionValue&); static CSSRotate* FromCSSValue(const CSSFunctionValue&);
// Getters and setters for attributes defined in the IDL. // Getters and setters for attributes defined in the IDL.
CSSNumericValue* angle() { return angle_.Get(); } CSSNumericValue* angle() { return angle_.Get(); }
...@@ -62,17 +62,17 @@ class CORE_EXPORT CSSRotation final : public CSSTransformComponent { ...@@ -62,17 +62,17 @@ class CORE_EXPORT CSSRotation final : public CSSTransformComponent {
} }
private: private:
CSSRotation(CSSNumericValue* x, CSSRotate(CSSNumericValue* x,
CSSNumericValue* y, CSSNumericValue* y,
CSSNumericValue* z, CSSNumericValue* z,
CSSNumericValue* angle, CSSNumericValue* angle,
bool is2D); bool is2D);
Member<CSSNumericValue> angle_; Member<CSSNumericValue> angle_;
Member<CSSNumericValue> x_; Member<CSSNumericValue> x_;
Member<CSSNumericValue> y_; Member<CSSNumericValue> y_;
Member<CSSNumericValue> z_; Member<CSSNumericValue> z_;
DISALLOW_COPY_AND_ASSIGN(CSSRotation); DISALLOW_COPY_AND_ASSIGN(CSSRotate);
}; };
} // namespace blink } // namespace blink
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
// Represents a rotation value in a CSSTransformValue used for properties like // Represents a rotation value in a CSSTransformValue used for properties like
// "transform". // "transform".
// Spec: https://drafts.css-houdini.org/css-typed-om/#cssrotation // Spec: https://drafts.css-houdini.org/css-typed-om/#cssrotate
[ [
Constructor(CSSNumericValue angleValue), Constructor(CSSNumericValue angleValue),
Constructor(CSSNumberish x, CSSNumberish y, CSSNumberish z, CSSNumericValue angle), Constructor(CSSNumberish x, CSSNumberish y, CSSNumberish z, CSSNumericValue angle),
Exposed=(Window,PaintWorklet), Exposed=(Window,PaintWorklet),
RuntimeEnabled=CSSTypedOM, RuntimeEnabled=CSSTypedOM,
RaisesException=Constructor RaisesException=Constructor
] interface CSSRotation : CSSTransformComponent { ] interface CSSRotate : CSSTransformComponent {
[RaisesException=Setter] attribute CSSNumericValue angle; [RaisesException=Setter] attribute CSSNumericValue angle;
[RaisesException=Setter] attribute CSSNumberish x; [RaisesException=Setter] attribute CSSNumberish x;
[RaisesException=Setter] attribute CSSNumberish y; [RaisesException=Setter] attribute CSSNumberish y;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "core/css/cssom/CSSMatrixComponent.h" #include "core/css/cssom/CSSMatrixComponent.h"
#include "core/css/cssom/CSSPerspective.h" #include "core/css/cssom/CSSPerspective.h"
#include "core/css/cssom/CSSRotation.h" #include "core/css/cssom/CSSRotate.h"
#include "core/css/cssom/CSSScale.h" #include "core/css/cssom/CSSScale.h"
#include "core/css/cssom/CSSSkew.h" #include "core/css/cssom/CSSSkew.h"
#include "core/css/cssom/CSSTranslate.h" #include "core/css/cssom/CSSTranslate.h"
...@@ -30,7 +30,7 @@ CSSTransformComponent* CSSTransformComponent::FromCSSValue( ...@@ -30,7 +30,7 @@ CSSTransformComponent* CSSTransformComponent::FromCSSValue(
case CSSValueRotateY: case CSSValueRotateY:
case CSSValueRotateZ: case CSSValueRotateZ:
case CSSValueRotate3d: case CSSValueRotate3d:
return CSSRotation::FromCSSValue(function_value); return CSSRotate::FromCSSValue(function_value);
case CSSValueScale: case CSSValueScale:
case CSSValueScaleX: case CSSValueScaleX:
case CSSValueScaleY: case CSSValueScaleY:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment