Commit ea6426fc authored by rjwright's avatar rjwright Committed by Commit bot

Typed CSSOM: Rename Skew and SkewTransformComponent to CSSSkew

Changes in line with changes to the spec: https://drafts.css-houdini.org/css-typed-om-1/#cssskew

Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=610159

BUG=610171

Review-Url: https://codereview.chromium.org/2018313003
Cr-Commit-Position: refs/heads/master@{#396781}
parent 51e4f33e
......@@ -5,10 +5,10 @@
<script>
var EPSILON = 1e-6; // float epsilon
var values = [
{input: new Skew(0, 0), ax: 0, ay: 0, cssString: "skew(0, 0)"},
{input: new Skew(1, 2), ax: 1, ay: 2, cssString: "skew(1, 2)"},
{input: new Skew(-2, -4), ax: -2, ay: -4, cssString: "skew(-2, -4)"},
{input: new Skew(3.4, 2.7), ax: 3.4, ay: 2.7, cssString: "skew(3.4, 2.7)"}
{input: new CSSSkew(0, 0), ax: 0, ay: 0, cssString: "skew(0, 0)"},
{input: new CSSSkew(1, 2), ax: 1, ay: 2, cssString: "skew(1, 2)"},
{input: new CSSSkew(-2, -4), ax: -2, ay: -4, cssString: "skew(-2, -4)"},
{input: new CSSSkew(3.4, 2.7), ax: 3.4, ay: 2.7, cssString: "skew(3.4, 2.7)"}
];
test(function() {
......@@ -16,24 +16,24 @@ test(function() {
assert_equals(values[i].input.ax, values[i].ax);
assert_equals(values[i].input.ay, values[i].ay);
}
}, "Test that the (ax, ay) values for Skew are correct.");
}, "Test that the (ax, ay) values for CSSSkew are correct.");
test(function() {
for (var i = 0; i < values.length; ++i) {
assert_true(values[i].input.is2DComponent());
}
}, "Test that the is2DComponent values for Skew is correct.");
}, "Test that the is2DComponent values for CSSSkew is correct.");
test(function() {
for (var i = 0; i < values.length; ++i) {
assert_equals(values[i].input.cssString, values[i].cssString);
}
}, "Test that the cssString for Skew is correct.");
}, "Test that the cssString for CSSSkew is correct.");
test(function() {
assert_throws(null, function() { new Skew(); });
assert_throws(null, function() { new Skew(1); });
}, "Test that invalid number of arguments for Skew throws an exception.");
assert_throws(null, function() { new CSSSkew(); });
assert_throws(null, function() { new CSSSkew(1); });
}, "Test that invalid number of arguments for CSSSkew throws an exception.");
function tanDegrees(degrees) {
var radians = degrees * Math.PI / 180;
......@@ -56,6 +56,6 @@ test(function() {
}
}
}
}, "Test that asMatrix is constructed correctly for Skew.");
}, "Test that asMatrix is constructed correctly for CSSSkew.");
</script>
......@@ -534,6 +534,11 @@ interface CSSSimpleLength : CSSLengthValue
getter value
method constructor
setter value
interface CSSSkew : TransformComponent
attribute @@toStringTag
getter ax
getter ay
method constructor
interface CSSStyleDeclaration
attribute @@toStringTag
getter cssFloat
......@@ -5830,11 +5835,6 @@ interface SiteBoundCredential : Credential
getter iconURL
getter name
method constructor
interface Skew : TransformComponent
attribute @@toStringTag
getter ax
getter ay
method constructor
interface SourceBuffer : EventTarget
attribute @@toStringTag
getter appendWindowEnd
......
......@@ -48,10 +48,10 @@
'css/cssom/CSSRotation.idl',
'css/cssom/CSSScale.idl',
'css/cssom/CSSSimpleLength.idl',
'css/cssom/CSSSkew.idl',
'css/cssom/CSSTranslation.idl',
'css/cssom/Matrix.idl',
'css/cssom/Perspective.idl',
'css/cssom/Skew.idl',
'css/cssom/StylePropertyMap.idl',
'css/cssom/StyleValue.idl',
'css/cssom/TransformComponent.idl',
......@@ -1348,6 +1348,8 @@
'css/cssom/CSSScale.h',
'css/cssom/CSSSimpleLength.cpp',
'css/cssom/CSSSimpleLength.h',
'css/cssom/CSSSkew.cpp',
'css/cssom/CSSSkew.h',
'css/cssom/CSSTranslation.cpp',
'css/cssom/CSSTranslation.h',
'css/cssom/ImmutableStylePropertyMap.h',
......@@ -1358,8 +1360,6 @@
'css/cssom/MutableStylePropertyMap.h',
'css/cssom/PerspectiveTransformComponent.cpp',
'css/cssom/PerspectiveTransformComponent.h',
'css/cssom/SkewTransformComponent.cpp',
'css/cssom/SkewTransformComponent.h',
'css/cssom/StylePropertyMap.cpp',
'css/cssom/StylePropertyMap.h',
'css/cssom/StyleValue.cpp',
......
......@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/css/cssom/SkewTransformComponent.h"
#include "core/css/cssom/CSSSkew.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSValuePool.h"
namespace blink {
CSSFunctionValue* SkewTransformComponent::toCSSValue() const
CSSFunctionValue* CSSSkew::toCSSValue() const
{
CSSFunctionValue* result = CSSFunctionValue::create(CSSValueSkew);
result->append(cssValuePool().createValue(m_ax, CSSPrimitiveValue::UnitType::Number));
......
......@@ -2,21 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SkewTransformComponent_h
#define SkewTransformComponent_h
#ifndef CSSSkew_h
#define CSSSkew_h
#include "core/css/cssom/MatrixTransformComponent.h"
#include "core/css/cssom/TransformComponent.h"
namespace blink {
class CORE_EXPORT SkewTransformComponent final : public TransformComponent {
WTF_MAKE_NONCOPYABLE(SkewTransformComponent);
class CORE_EXPORT CSSSkew final : public TransformComponent {
WTF_MAKE_NONCOPYABLE(CSSSkew);
DEFINE_WRAPPERTYPEINFO();
public:
static SkewTransformComponent* create(double ax, double ay)
static CSSSkew* create(double ax, double ay)
{
return new SkewTransformComponent(ax, ay);
return new CSSSkew(ax, ay);
}
double ax() const { return m_ax; }
......@@ -32,7 +32,7 @@ public:
CSSFunctionValue* toCSSValue() const override;
private:
SkewTransformComponent(double ax, double ay) : TransformComponent(), m_ax(ax), m_ay(ay) { }
CSSSkew(double ax, double ay) : TransformComponent(), m_ax(ax), m_ay(ay) { }
double m_ax;
double m_ay;
......
......@@ -4,9 +4,8 @@
[
Constructor(double ax, double ay),
ImplementedAs=SkewTransformComponent,
RuntimeEnabled=CSSTypedOM
] interface Skew : TransformComponent {
] interface CSSSkew : TransformComponent {
readonly attribute double ax;
readonly attribute double ay;
};
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