Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.h

Issue 2935413002: [Typed OM] Add comments and consistent structure to all the CSSTransformComponent subclasses (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.h
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.h b/third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.h
index f607337dc58b7d0058ace3c5a961f50242e701a0..ebc67eaf34e896ba93533a60800622de75ee3913 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSTransformComponent.h
@@ -14,6 +14,10 @@ namespace blink {
class DOMMatrix;
+// CSSTransformComponent is the base class used for the representations of
+// the individual CSS transforms. They are combined in a CSSTransformValue
+// before they can be used as a value for properties like "transform".
+// See CSSTransformComponent.idl for more information about this class.
class CORE_EXPORT CSSTransformComponent
: public GarbageCollectedFinalized<CSSTransformComponent>,
public ScriptWrappable {
@@ -34,22 +38,13 @@ class CORE_EXPORT CSSTransformComponent
kTranslation3DType
};
- static CSSTransformComponent* FromCSSValue(const CSSValue&);
-
- static bool Is2DComponentType(TransformComponentType transform_type) {
- return transform_type != kMatrix3DType &&
- transform_type != kPerspectiveType &&
- transform_type != kRotation3DType &&
- transform_type != kScale3DType &&
- transform_type != kTranslation3DType;
- }
-
virtual ~CSSTransformComponent() {}
- virtual TransformComponentType GetType() const = 0;
+ // Blink-internal ways of creating CSSTransformComponents.
+ static CSSTransformComponent* FromCSSValue(const CSSValue&);
+ // Getters and setters for attributes defined in the IDL.
bool is2D() const { return Is2DComponentType(GetType()); }
-
virtual String toString() const {
const CSSValue* result = ToCSSValue();
// TODO(meade): Remove this once all the number and length types are
@@ -57,12 +52,22 @@ class CORE_EXPORT CSSTransformComponent
return result ? result->CssText() : "";
}
+ // Internal methods.
+ virtual TransformComponentType GetType() const = 0;
virtual CSSFunctionValue* ToCSSValue() const = 0;
virtual DOMMatrix* AsMatrix() const = 0;
DEFINE_INLINE_VIRTUAL_TRACE() {}
protected:
+ static bool Is2DComponentType(TransformComponentType transform_type) {
+ return transform_type != kMatrix3DType &&
+ transform_type != kPerspectiveType &&
+ transform_type != kRotation3DType &&
+ transform_type != kScale3DType &&
+ transform_type != kTranslation3DType;
+ }
+
CSSTransformComponent() = default;
};
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSScale.h ('k') | third_party/WebKit/Source/core/css/cssom/CSSTranslation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698