summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/css/css_counter_style_rule.h
blob: 7581cb9ccded656ebad9e83df065b08149b7b418 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_CSS_COUNTER_STYLE_RULE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_CSS_COUNTER_STYLE_RULE_H_

#include "third_party/blink/renderer/core/css/css_rule.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"

namespace blink {

class StyleRuleCounterStyle;

class CSSCounterStyleRule final : public CSSRule {
  DEFINE_WRAPPERTYPEINFO();

 public:
  CSSCounterStyleRule(StyleRuleCounterStyle*, CSSStyleSheet*);
  ~CSSCounterStyleRule() override;

  String cssText() const override;
  void Reattach(StyleRuleBase*) override;

  String name() const;
  String system() const;
  String symbols() const;
  String additiveSymbols() const;
  String negative() const;
  String prefix() const;
  String suffix() const;
  String range() const;
  String pad() const;
  String speakAs() const;
  String fallback() const;

  void setName(const String&);
  void setSystem(const String&);
  void setSymbols(const String&);
  void setAdditiveSymbols(const String&);
  void setNegative(const String&);
  void setPrefix(const String&);
  void setSuffix(const String&);
  void setRange(const String&);
  void setPad(const String&);
  void setSpeakAs(const String&);
  void setFallback(const String&);

  void Trace(Visitor*) const override;

 private:
  CSSRule::Type GetType() const override { return kCounterStyleRule; }

  Member<StyleRuleCounterStyle> counter_style_rule_;
};

template <>
struct DowncastTraits<CSSCounterStyleRule> {
  static bool AllowFrom(const CSSRule& rule) {
    return rule.GetType() == CSSRule::kCounterStyleRule;
  }
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_CSS_CSS_COUNTER_STYLE_RULE_H_