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

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/CSSRotation.h

Issue 2938353002: [CSS Typed OM] Add missing error handling for CSSRotation constructor (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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CSSRotation_h 5 #ifndef CSSRotation_h
6 #define CSSRotation_h 6 #define CSSRotation_h
7 7
8 #include "core/css/cssom/CSSNumericValue.h" 8 #include "core/css/cssom/CSSNumericValue.h"
9 #include "core/css/cssom/CSSTransformComponent.h" 9 #include "core/css/cssom/CSSTransformComponent.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 class DOMMatrix; 13 class DOMMatrix;
14 14
15 // Represents a rotation value in a CSSTransformValue used for properties like 15 // Represents a rotation value in a CSSTransformValue used for properties like
16 // "transform". 16 // "transform".
17 // See CSSRotation.idl for more information about this class. 17 // See CSSRotation.idl for more information about this class.
18 class CORE_EXPORT CSSRotation final : public CSSTransformComponent { 18 class CORE_EXPORT CSSRotation final : public CSSTransformComponent {
19 WTF_MAKE_NONCOPYABLE(CSSRotation); 19 WTF_MAKE_NONCOPYABLE(CSSRotation);
20 DEFINE_WRAPPERTYPEINFO(); 20 DEFINE_WRAPPERTYPEINFO();
21 21
22 public: 22 public:
23 // Constructors defined in the IDL. 23 // Constructors defined in the IDL.
24 static CSSRotation* Create(const CSSNumericValue* angle_value) { 24 static CSSRotation* Create(CSSNumericValue* angle,
25 return new CSSRotation(angle_value); 25 ExceptionState& exception_state) {
26 return Create(0, 0, 1, angle, exception_state);
26 } 27 }
27 static CSSRotation* Create(double x, 28 static CSSRotation* Create(double x,
28 double y, 29 double y,
29 double z, 30 double z,
30 const CSSNumericValue* angle_value) { 31 CSSNumericValue* angle,
31 return new CSSRotation(x, y, z, angle_value); 32 ExceptionState&);
32 }
33 33
34 // Blink-internal ways of creating CSSRotations. 34 // Blink-internal ways of creating CSSRotations.
35 static CSSRotation* Create(CSSNumericValue* angle) {
36 return Create(0, 0, 1, angle);
37 }
38 static CSSRotation* Create(double x,
39 double y,
40 double z,
41 CSSNumericValue* angle);
alancutter (OOO until 2018) 2017/06/19 10:51:27 I don't think we should add these if we never use
meade_UTC10 2017/06/21 07:11:30 This existed before (I actually added the exceptio
alancutter (OOO until 2018) 2017/06/22 03:12:12 My mistake, didn't realise they were used.
35 static CSSRotation* FromCSSValue(const CSSFunctionValue&); 42 static CSSRotation* FromCSSValue(const CSSFunctionValue&);
36 43
37 // Getters and setters for attributes defined in the IDL. 44 // Getters and setters for attributes defined in the IDL.
38 // Bindings requires returning non-const pointers. This is safe because 45 // Bindings requires returning non-const pointers. This is safe because
39 // CSSNumericValues are immutable. 46 // CSSNumericValues are immutable.
40 CSSNumericValue* angle() const { 47 CSSNumericValue* angle() const {
41 return const_cast<CSSNumericValue*>(angle_.Get()); 48 return const_cast<CSSNumericValue*>(angle_.Get());
42 } 49 }
43 double x() const { return x_; } 50 double x() const { return x_; }
44 double y() const { return y_; } 51 double y() const { return y_; }
(...skipping 30 matching lines...) Expand all
75 Member<const CSSNumericValue> angle_; 82 Member<const CSSNumericValue> angle_;
76 double x_; 83 double x_;
77 double y_; 84 double y_;
78 double z_; 85 double z_;
79 bool is2d_; 86 bool is2d_;
80 }; 87 };
81 88
82 } // namespace blink 89 } // namespace blink
83 90
84 #endif 91 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698