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_CSSMediaRule_h
8 #define mozilla_dom_CSSMediaRule_h
10 #include "mozilla/css/GroupRule.h"
11 #include "mozilla/ServoBindingTypes.h"
13 namespace mozilla::dom
{
15 class CSSMediaRule final
: public css::ConditionRule
{
17 CSSMediaRule(RefPtr
<StyleMediaRule
> aRawRule
, StyleSheet
* aSheet
,
18 css::Rule
* aParentRule
, uint32_t aLine
, uint32_t aColumn
);
20 NS_DECL_ISUPPORTS_INHERITED
21 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CSSMediaRule
, css::ConditionRule
)
23 void DropSheetReference() override
;
26 void List(FILE* out
= stdout
, int32_t aIndent
= 0) const final
;
29 StyleMediaRule
* Raw() const { return mRawRule
; }
30 void SetRawAfterClone(RefPtr
<StyleMediaRule
>);
31 already_AddRefed
<StyleLockedCssRules
> GetOrCreateRawRules() final
;
32 bool IsCCLeaf() const override
;
35 StyleCssRuleType
Type() const override
;
37 void GetCssText(nsACString
& aCssText
) const final
;
38 void GetConditionText(nsACString
& aConditionText
) final
;
39 dom::MediaList
* Media();
41 size_t SizeOfIncludingThis(MallocSizeOf
) const override
;
43 JSObject
* WrapObject(JSContext
* aCx
,
44 JS::Handle
<JSObject
*> aGivenProto
) override
;
47 virtual ~CSSMediaRule();
49 RefPtr
<StyleMediaRule
> mRawRule
;
50 RefPtr
<dom::MediaList
> mMediaList
;
53 } // namespace mozilla::dom
55 #endif // mozilla_dom_CSSMediaRule_h