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

Side by Side Diff: Source/core/css/CSSTimingFunctionValue.h

Issue 1164573002: CSSValue Immediates: Change CSSValue to an object instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 4 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
« no previous file with comments | « Source/core/css/CSSStyleDeclaration.h ('k') | Source/core/css/CSSUnicodeRangeValue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 14 matching lines...) Expand all
25 25
26 #ifndef CSSTimingFunctionValue_h 26 #ifndef CSSTimingFunctionValue_h
27 #define CSSTimingFunctionValue_h 27 #define CSSTimingFunctionValue_h
28 28
29 #include "core/css/CSSValue.h" 29 #include "core/css/CSSValue.h"
30 #include "platform/animation/TimingFunction.h" 30 #include "platform/animation/TimingFunction.h"
31 #include "wtf/PassRefPtr.h" 31 #include "wtf/PassRefPtr.h"
32 32
33 namespace blink { 33 namespace blink {
34 34
35 class CSSCubicBezierTimingFunctionValue : public CSSValue { 35 class CSSCubicBezierTimingFunctionValue : public CSSValueObject {
36 public: 36 public:
37 static PassRefPtrWillBeRawPtr<CSSCubicBezierTimingFunctionValue> create(doub le x1, double y1, double x2, double y2) 37 static PassRefPtrWillBeRawPtr<CSSCubicBezierTimingFunctionValue> create(doub le x1, double y1, double x2, double y2)
38 { 38 {
39 return adoptRefWillBeNoop(new CSSCubicBezierTimingFunctionValue(x1, y1, x2, y2)); 39 return adoptRefWillBeNoop(new CSSCubicBezierTimingFunctionValue(x1, y1, x2, y2));
40 } 40 }
41 41
42 String customCSSText() const; 42 String customCSSText() const;
43 43
44 double x1() const { return m_x1; } 44 double x1() const { return m_x1; }
45 double y1() const { return m_y1; } 45 double y1() const { return m_y1; }
46 double x2() const { return m_x2; } 46 double x2() const { return m_x2; }
47 double y2() const { return m_y2; } 47 double y2() const { return m_y2; }
48 48
49 bool equals(const CSSCubicBezierTimingFunctionValue&) const; 49 bool equals(const CSSCubicBezierTimingFunctionValue&) const;
50 50
51 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { CSSValue::traceAfterDispatch(visitor) ; } 51 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { CSSValueObject::traceAfterDispatch(vi sitor); }
52 52
53 private: 53 private:
54 CSSCubicBezierTimingFunctionValue(double x1, double y1, double x2, double y2 ) 54 CSSCubicBezierTimingFunctionValue(double x1, double y1, double x2, double y2 )
55 : CSSValue(CubicBezierTimingFunctionClass) 55 : CSSValueObject(CubicBezierTimingFunctionClass)
56 , m_x1(x1) 56 , m_x1(x1)
57 , m_y1(y1) 57 , m_y1(y1)
58 , m_x2(x2) 58 , m_x2(x2)
59 , m_y2(y2) 59 , m_y2(y2)
60 { 60 {
61 } 61 }
62 62
63 double m_x1; 63 double m_x1;
64 double m_y1; 64 double m_y1;
65 double m_x2; 65 double m_x2;
66 double m_y2; 66 double m_y2;
67 }; 67 };
68 68
69 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCubicBezierTimingFunctionValue, isCubicBezierTimi ngFunctionValue()); 69 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCubicBezierTimingFunctionValue, isCubicBezierTimi ngFunctionValue());
70 70
71 class CSSStepsTimingFunctionValue : public CSSValue { 71 class CSSStepsTimingFunctionValue : public CSSValueObject {
72 public: 72 public:
73 static PassRefPtrWillBeRawPtr<CSSStepsTimingFunctionValue> create(int steps, StepsTimingFunction::StepAtPosition stepAtPosition) 73 static PassRefPtrWillBeRawPtr<CSSStepsTimingFunctionValue> create(int steps, StepsTimingFunction::StepAtPosition stepAtPosition)
74 { 74 {
75 return adoptRefWillBeNoop(new CSSStepsTimingFunctionValue(steps, stepAtP osition)); 75 return adoptRefWillBeNoop(new CSSStepsTimingFunctionValue(steps, stepAtP osition));
76 } 76 }
77 77
78 int numberOfSteps() const { return m_steps; } 78 int numberOfSteps() const { return m_steps; }
79 StepsTimingFunction::StepAtPosition stepAtPosition() const { return m_stepAt Position; } 79 StepsTimingFunction::StepAtPosition stepAtPosition() const { return m_stepAt Position; }
80 80
81 String customCSSText() const; 81 String customCSSText() const;
82 82
83 bool equals(const CSSStepsTimingFunctionValue&) const; 83 bool equals(const CSSStepsTimingFunctionValue&) const;
84 84
85 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { CSSValue::traceAfterDispatch(visitor) ; } 85 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { CSSValueObject::traceAfterDispatch(vi sitor); }
86 86
87 private: 87 private:
88 CSSStepsTimingFunctionValue(int steps, StepsTimingFunction::StepAtPosition s tepAtPosition) 88 CSSStepsTimingFunctionValue(int steps, StepsTimingFunction::StepAtPosition s tepAtPosition)
89 : CSSValue(StepsTimingFunctionClass) 89 : CSSValueObject(StepsTimingFunctionClass)
90 , m_steps(steps) 90 , m_steps(steps)
91 , m_stepAtPosition(stepAtPosition) 91 , m_stepAtPosition(stepAtPosition)
92 { 92 {
93 } 93 }
94 94
95 int m_steps; 95 int m_steps;
96 StepsTimingFunction::StepAtPosition m_stepAtPosition; 96 StepsTimingFunction::StepAtPosition m_stepAtPosition;
97 }; 97 };
98 98
99 DEFINE_CSS_VALUE_TYPE_CASTS(CSSStepsTimingFunctionValue, isStepsTimingFunctionVa lue()); 99 DEFINE_CSS_VALUE_TYPE_CASTS(CSSStepsTimingFunctionValue, isStepsTimingFunctionVa lue());
100 100
101 } // namespace 101 } // namespace
102 102
103 #endif 103 #endif
OLDNEW
« no previous file with comments | « Source/core/css/CSSStyleDeclaration.h ('k') | Source/core/css/CSSUnicodeRangeValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698