/src/mozilla-central/layout/style/CSSSupportsRule.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/CSSSupportsRule.h" |
8 | | |
9 | | #include "mozilla/css/GroupRule.h" |
10 | | #include "mozilla/dom/CSSSupportsRuleBinding.h" |
11 | | #include "mozilla/ServoBindings.h" |
12 | | |
13 | | using namespace mozilla::css; |
14 | | |
15 | | namespace mozilla { |
16 | | namespace dom { |
17 | | |
18 | | CSSSupportsRule::CSSSupportsRule(RefPtr<RawServoSupportsRule> aRawRule, |
19 | | StyleSheet* aSheet, |
20 | | css::Rule* aParentRule, |
21 | | uint32_t aLine, |
22 | | uint32_t aColumn) |
23 | | : css::ConditionRule(Servo_SupportsRule_GetRules(aRawRule).Consume(), |
24 | | aSheet, aParentRule, aLine, aColumn) |
25 | | , mRawRule(std::move(aRawRule)) |
26 | 0 | { |
27 | 0 | } |
28 | | |
29 | | NS_IMPL_ADDREF_INHERITED(CSSSupportsRule, ConditionRule) |
30 | | NS_IMPL_RELEASE_INHERITED(CSSSupportsRule, ConditionRule) |
31 | | |
32 | | // QueryInterface implementation for SupportsRule |
33 | 0 | NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CSSSupportsRule) |
34 | 0 | NS_INTERFACE_MAP_END_INHERITING(ConditionRule) |
35 | | |
36 | | #ifdef DEBUG |
37 | | /* virtual */ void |
38 | | CSSSupportsRule::List(FILE* out, int32_t aIndent) const |
39 | | { |
40 | | nsAutoCString str; |
41 | | for (int32_t i = 0; i < aIndent; i++) { |
42 | | str.AppendLiteral(" "); |
43 | | } |
44 | | Servo_SupportsRule_Debug(mRawRule, &str); |
45 | | fprintf_stderr(out, "%s\n", str.get()); |
46 | | } |
47 | | #endif |
48 | | |
49 | | void |
50 | | CSSSupportsRule::GetConditionText(nsAString& aConditionText) |
51 | 0 | { |
52 | 0 | Servo_SupportsRule_GetConditionText(mRawRule, &aConditionText); |
53 | 0 | } |
54 | | |
55 | | void |
56 | | CSSSupportsRule::SetConditionText(const nsAString& aConditionText, |
57 | | ErrorResult& aRv) |
58 | 0 | { |
59 | 0 | aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); |
60 | 0 | } |
61 | | |
62 | | /* virtual */ void |
63 | | CSSSupportsRule::GetCssText(nsAString& aCssText) const |
64 | 0 | { |
65 | 0 | Servo_SupportsRule_GetCssText(mRawRule, &aCssText); |
66 | 0 | } |
67 | | |
68 | | /* virtual */ size_t |
69 | | CSSSupportsRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const |
70 | 0 | { |
71 | 0 | // TODO Implement this! |
72 | 0 | return aMallocSizeOf(this); |
73 | 0 | } |
74 | | |
75 | | /* virtual */ JSObject* |
76 | | CSSSupportsRule::WrapObject(JSContext* aCx, |
77 | | JS::Handle<JSObject*> aGivenProto) |
78 | 0 | { |
79 | 0 | return CSSSupportsRule_Binding::Wrap(aCx, this, aGivenProto); |
80 | 0 | } |
81 | | |
82 | | } // namespace dom |
83 | | } // namespace mozilla |