/src/mozilla-central/layout/style/CSSCounterStyleRule.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #include "mozilla/dom/CSSCounterStyleRule.h" |
8 | | |
9 | | #include "mozAutoDocUpdate.h" |
10 | | #include "mozilla/dom/CSSCounterStyleRuleBinding.h" |
11 | | #include "mozilla/ServoBindings.h" |
12 | | #include "nsStyleUtil.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace dom { |
16 | | |
17 | | bool |
18 | | CSSCounterStyleRule::IsCCLeaf() const |
19 | 0 | { |
20 | 0 | return Rule::IsCCLeaf(); |
21 | 0 | } |
22 | | |
23 | | #ifdef DEBUG |
24 | | void |
25 | | CSSCounterStyleRule::List(FILE* out, int32_t aIndent) const |
26 | | { |
27 | | nsAutoCString str; |
28 | | for (int32_t i = 0; i < aIndent; i++) { |
29 | | str.AppendLiteral(" "); |
30 | | } |
31 | | Servo_CounterStyleRule_Debug(mRawRule, &str); |
32 | | fprintf_stderr(out, "%s\n", str.get()); |
33 | | } |
34 | | #endif |
35 | | |
36 | | uint16_t |
37 | | CSSCounterStyleRule::Type() const |
38 | 0 | { |
39 | 0 | return CSSRule_Binding::COUNTER_STYLE_RULE; |
40 | 0 | } |
41 | | |
42 | | void |
43 | | CSSCounterStyleRule::GetCssText(nsAString& aCssText) const |
44 | 0 | { |
45 | 0 | Servo_CounterStyleRule_GetCssText(mRawRule, &aCssText); |
46 | 0 | } |
47 | | |
48 | | void |
49 | | CSSCounterStyleRule::GetName(nsAString& aName) |
50 | 0 | { |
51 | 0 | aName.Truncate(); |
52 | 0 | nsAtom* name = Servo_CounterStyleRule_GetName(mRawRule); |
53 | 0 | nsDependentAtomString nameStr(name); |
54 | 0 | nsStyleUtil::AppendEscapedCSSIdent(nameStr, aName); |
55 | 0 | } |
56 | | |
57 | | void |
58 | | CSSCounterStyleRule::SetName(const nsAString& aName) |
59 | 0 | { |
60 | 0 | NS_ConvertUTF16toUTF8 name(aName); |
61 | 0 | if (Servo_CounterStyleRule_SetName(mRawRule, &name)) { |
62 | 0 | if (StyleSheet* sheet = GetStyleSheet()) { |
63 | 0 | sheet->RuleChanged(this); |
64 | 0 | } |
65 | 0 | } |
66 | 0 | } |
67 | | |
68 | | #define CSS_COUNTER_DESC(name_, method_) \ |
69 | | void \ |
70 | | CSSCounterStyleRule::Get##method_(nsAString& aValue) \ |
71 | 0 | { \ |
72 | 0 | aValue.Truncate(); \ |
73 | 0 | Servo_CounterStyleRule_GetDescriptorCssText( \ |
74 | 0 | mRawRule, eCSSCounterDesc_##method_, &aValue); \ |
75 | 0 | } \ Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::GetSystem(nsTSubstring<char16_t>&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::GetSymbols(nsTSubstring<char16_t>&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::GetAdditiveSymbols(nsTSubstring<char16_t>&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::GetNegative(nsTSubstring<char16_t>&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::GetPrefix(nsTSubstring<char16_t>&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::GetSuffix(nsTSubstring<char16_t>&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::GetRange(nsTSubstring<char16_t>&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::GetPad(nsTSubstring<char16_t>&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::GetFallback(nsTSubstring<char16_t>&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::GetSpeakAs(nsTSubstring<char16_t>&) |
76 | | void \ |
77 | | CSSCounterStyleRule::Set##method_(const nsAString& aValue) \ |
78 | 0 | { \ |
79 | 0 | NS_ConvertUTF16toUTF8 value(aValue); \ |
80 | 0 | if (Servo_CounterStyleRule_SetDescriptor( \ |
81 | 0 | mRawRule, eCSSCounterDesc_##method_, &value)) { \ |
82 | 0 | if (StyleSheet* sheet = GetStyleSheet()) { \ |
83 | 0 | sheet->RuleChanged(this); \ |
84 | 0 | } \ |
85 | 0 | } \ |
86 | 0 | } Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::SetSystem(nsTSubstring<char16_t> const&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::SetSymbols(nsTSubstring<char16_t> const&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::SetAdditiveSymbols(nsTSubstring<char16_t> const&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::SetNegative(nsTSubstring<char16_t> const&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::SetPrefix(nsTSubstring<char16_t> const&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::SetSuffix(nsTSubstring<char16_t> const&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::SetRange(nsTSubstring<char16_t> const&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::SetPad(nsTSubstring<char16_t> const&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::SetFallback(nsTSubstring<char16_t> const&) Unexecuted instantiation: mozilla::dom::CSSCounterStyleRule::SetSpeakAs(nsTSubstring<char16_t> const&) |
87 | | #include "nsCSSCounterDescList.h" |
88 | | #undef CSS_COUNTER_DESC |
89 | | |
90 | | /* virtual */ size_t |
91 | | CSSCounterStyleRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const |
92 | 0 | { |
93 | 0 | return aMallocSizeOf(this); |
94 | 0 | } |
95 | | |
96 | | /* virtual */ JSObject* |
97 | | CSSCounterStyleRule::WrapObject(JSContext* aCx, |
98 | | JS::Handle<JSObject*> aGivenProto) |
99 | 0 | { |
100 | 0 | return CSSCounterStyleRule_Binding::Wrap(aCx, this, aGivenProto); |
101 | 0 | } |
102 | | |
103 | | } // namespace dom |
104 | | } // namespace mozilla |