summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/css/css_font_feature_values_rule.h
blob: a70caec1ee7a19e9aa9e1bcd91dde0c866d60454 (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
// Copyright 2018 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_FONT_FEATURE_VALUES_RULE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_CSS_FONT_FEATURE_VALUES_RULE_H_

#include "third_party/blink/renderer/core/css/css_rule.h"
#include "third_party/blink/renderer/platform/heap/handle.h"

namespace blink {

class StyleRuleFontFeatureValues;

class CSSFontFeatureValuesRule final : public CSSRule {
  DEFINE_WRAPPERTYPEINFO();

 public:
  static CSSFontFeatureValuesRule* Create(StyleRuleFontFeatureValues* rule,
                                          CSSStyleSheet* sheet) {
    return new CSSFontFeatureValuesRule(rule, sheet);
  }

  ~CSSFontFeatureValuesRule() override;

  void setFontFamily(const String& font_family);
  String fontFamily();
  void setFontDisplay(const String& font_display);
  String fontDisplay();

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

  StyleRuleFontFeatureValues* StyleRule() const {
    return font_feature_values_rule_.Get();
  }

  void Trace(blink::Visitor*) override;

 private:
  CSSFontFeatureValuesRule(StyleRuleFontFeatureValues*, CSSStyleSheet* parent);

  CSSRule::Type type() const override { return kFontFeatureValuesRule; }

  Member<StyleRuleFontFeatureValues> font_feature_values_rule_;
};

DEFINE_CSS_RULE_TYPE_CASTS(CSSFontFeatureValuesRule, kFontFeatureValuesRule);

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_CSS_CSS_FONT_FEATURE_VALUES_RULE_H_