1 // Copyright 2020 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_CSS_INITIAL_COLOR_VALUE_H_
6 #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_CSS_INITIAL_COLOR_VALUE_H_
7 
8 #include "base/util/type_safety/pass_key.h"
9 #include "third_party/blink/renderer/core/core_export.h"
10 #include "third_party/blink/renderer/core/css/css_value.h"
11 #include "third_party/blink/renderer/platform/wtf/casting.h"
12 
13 namespace blink {
14 
15 class CSSValuePool;
16 
17 // TODO(crbug.com/1046753): Remove this class when canvastext is supported.
18 class CORE_EXPORT CSSInitialColorValue : public CSSValue {
19  public:
20   static CSSInitialColorValue* Create();
21 
CSSInitialColorValue(util::PassKey<CSSValuePool>)22   explicit CSSInitialColorValue(util::PassKey<CSSValuePool>)
23       : CSSValue(kInitialColorValueClass) {}
24 
25   String CustomCSSText() const;
26 
Equals(const CSSInitialColorValue &)27   bool Equals(const CSSInitialColorValue&) const { return true; }
28 
TraceAfterDispatch(blink::Visitor * visitor)29   void TraceAfterDispatch(blink::Visitor* visitor) const {
30     CSSValue::TraceAfterDispatch(visitor);
31   }
32 
33  private:
34   friend class CSSValuePool;
35 };
36 
37 template <>
38 struct DowncastTraits<CSSInitialColorValue> {
39   static bool AllowFrom(const CSSValue& value) {
40     return value.IsInitialColorValue();
41   }
42 };
43 
44 }  // namespace blink
45 
46 #endif  // THIRD_PARTY_BLINK_RENDERER_CORE_CSS_CSS_INITIAL_COLOR_VALUE_H_
47