Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / layout / style / CSSImportRule.h
blobfbe21a576a1aa9ded8a3a0b935288246f8c5d77d
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/. */
7 #ifndef mozilla_dom_CSSImportRule_h
8 #define mozilla_dom_CSSImportRule_h
10 #include "mozilla/css/Rule.h"
12 namespace mozilla {
14 class StyleSheet;
16 namespace dom {
18 class CSSImportRule final : public css::Rule {
19 public:
20 CSSImportRule(RefPtr<StyleLockedImportRule> aRawRule, StyleSheet* aSheet,
21 css::Rule* aParentRule, uint32_t aLine, uint32_t aColumn);
23 NS_DECL_ISUPPORTS_INHERITED
24 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CSSImportRule, css::Rule)
26 bool IsCCLeaf() const final;
28 #ifdef DEBUG
29 void List(FILE* out = stdout, int32_t aIndent = 0) const final;
30 #endif
32 size_t SizeOfIncludingThis(MallocSizeOf) const override;
34 // WebIDL interface
35 StyleCssRuleType Type() const final;
36 void GetCssText(nsACString& aCssText) const override;
37 void GetHref(nsAString& aHref) const;
38 dom::MediaList* GetMedia();
39 StyleSheet* GetStyleSheet() const { return mChildSheet; }
40 StyleSheet* GetStyleSheetForBindings();
41 void GetLayerName(nsACString&) const;
42 void GetSupportsText(nsACString&) const;
44 // Clear the mSheet pointer on this rule and descendants.
45 void DropSheetReference() final;
47 JSObject* WrapObject(JSContext* aCx,
48 JS::Handle<JSObject*> aGivenProto) override;
50 const StyleLockedImportRule* Raw() const { return mRawRule.get(); }
51 void SetRawAfterClone(RefPtr<StyleLockedImportRule>);
53 private:
54 ~CSSImportRule();
56 RefPtr<StyleLockedImportRule> mRawRule;
57 RefPtr<StyleSheet> mChildSheet;
60 } // namespace dom
61 } // namespace mozilla
63 #endif // mozilla_dom_CSSImportRule_h