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"
18 class CSSImportRule final
: public css::Rule
{
20 CSSImportRule(RefPtr
<RawServoImportRule
> 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
;
29 void List(FILE* out
= stdout
, int32_t aIndent
= 0) const final
;
32 size_t SizeOfIncludingThis(MallocSizeOf
) const override
;
35 uint16_t Type() const final
{ return CSSRule_Binding::IMPORT_RULE
; }
36 void GetCssText(nsACString
& aCssText
) const override
;
37 void GetHref(nsAString
& aHref
) const;
38 dom::MediaList
* GetMedia() const;
39 StyleSheet
* GetStyleSheet() const { return mChildSheet
; }
41 // Clear the mSheet pointer on this rule and descendants.
42 void DropSheetReference() final
;
44 JSObject
* WrapObject(JSContext
* aCx
,
45 JS::Handle
<JSObject
*> aGivenProto
) override
;
47 const RawServoImportRule
* Raw() const { return mRawRule
.get(); }
52 RefPtr
<RawServoImportRule
> mRawRule
;
53 RefPtr
<StyleSheet
> mChildSheet
;
57 } // namespace mozilla
59 #endif // mozilla_dom_CSSImportRule_h