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 CSSImportRule for stylo */
8 :
9 : #ifndef mozilla_ServoImportRule_h
10 : #define mozilla_ServoImportRule_h
11 :
12 : #include "mozilla/dom/CSSImportRule.h"
13 : #include "mozilla/ServoBindingTypes.h"
14 :
15 : namespace mozilla {
16 :
17 : class ServoStyleSheet;
18 : class ServoMediaList;
19 :
20 : class ServoImportRule final : public dom::CSSImportRule
21 : {
22 : public:
23 : ServoImportRule(RefPtr<RawServoImportRule> aRawRule,
24 : uint32_t aLine, uint32_t aColumn);
25 :
26 : NS_DECL_ISUPPORTS_INHERITED
27 0 : NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServoImportRule, dom::CSSImportRule)
28 :
29 : // unhide since nsIDOMCSSImportRule has its own GetStyleSheet and GetMedia
30 : using dom::CSSImportRule::GetStyleSheet;
31 : using dom::CSSImportRule::GetMedia;
32 :
33 : #ifdef DEBUG
34 : void List(FILE* out = stdout, int32_t aIndent = 0) const final;
35 : #endif
36 : already_AddRefed<css::Rule> Clone() const final;
37 : size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const final;
38 :
39 : // nsIDOMCSSImportRule interface
40 : NS_IMETHOD GetHref(nsAString& aHref) final;
41 :
42 : // WebIDL interface
43 : void GetCssTextImpl(nsAString& aCssText) const override;
44 : dom::MediaList* GetMedia() const final;
45 : StyleSheet* GetStyleSheet() const final;
46 :
47 : private:
48 : ~ServoImportRule();
49 :
50 : RefPtr<RawServoImportRule> mRawRule;
51 : RefPtr<ServoStyleSheet> mChildSheet;
52 : };
53 :
54 : } // namespace mozilla
55 :
56 : #endif // mozilla_ServoImportRule_h
|