Line data Source code
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 : /* representation of CSSMediaRule for stylo */
8 :
9 : #ifndef mozilla_ServoMediaRule_h
10 : #define mozilla_ServoMediaRule_h
11 :
12 : #include "mozilla/dom/CSSMediaRule.h"
13 : #include "mozilla/ServoBindingTypes.h"
14 :
15 : namespace mozilla {
16 :
17 : class ServoMediaList;
18 :
19 : class ServoMediaRule final : public dom::CSSMediaRule
20 : {
21 : public:
22 : ServoMediaRule(RefPtr<RawServoMediaRule> aRawRule,
23 : uint32_t aLine, uint32_t aColumn);
24 :
25 : NS_DECL_ISUPPORTS_INHERITED
26 0 : NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServoMediaRule, dom::CSSMediaRule)
27 :
28 : already_AddRefed<css::Rule> Clone() const override;
29 : bool UseForPresentation(nsPresContext* aPresContext,
30 : nsMediaQueryResultCacheKey& aKey) final;
31 : void SetStyleSheet(StyleSheet* aSheet) override;
32 : #ifdef DEBUG
33 : void List(FILE* out = stdout, int32_t aIndent = 0) const final;
34 : #endif
35 :
36 : RawServoMediaRule* Raw() const { return mRawRule; }
37 :
38 : // nsIDOMCSSConditionRule interface
39 : NS_DECL_NSIDOMCSSCONDITIONRULE
40 :
41 : // WebIDL interface
42 : void GetCssTextImpl(nsAString& aCssText) const override;
43 : using CSSMediaRule::SetConditionText;
44 : dom::MediaList* Media() override;
45 :
46 : size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
47 : const override;
48 :
49 : private:
50 : virtual ~ServoMediaRule();
51 :
52 : RefPtr<RawServoMediaRule> mRawRule;
53 : RefPtr<ServoMediaList> mMediaList;
54 : };
55 :
56 : } // namespace mozilla
57 :
58 : #endif // mozilla_ServoMediaRule_h
|