Bug 1698786: part 2) Change some compile-time dependent `printf`s to `MOZ_LOG` in...
[gecko.git] / layout / style / CSSMediaRule.h
blob4b21239ac1dd1086f76e757d63c922587f9b8e36
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 {
14 namespace dom {
16 class CSSMediaRule final : public css::ConditionRule {
17 public:
18 CSSMediaRule(RefPtr<RawServoMediaRule> aRawRule, StyleSheet* aSheet,
19 css::Rule* aParentRule, uint32_t aLine, uint32_t aColumn);
21 NS_DECL_ISUPPORTS_INHERITED
22 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CSSMediaRule, css::ConditionRule)
24 void DropSheetReference() override;
26 #ifdef DEBUG
27 void List(FILE* out = stdout, int32_t aIndent = 0) const final;
28 #endif
30 RawServoMediaRule* Raw() const { return mRawRule; }
32 // WebIDL interface
33 uint16_t Type() const override { return CSSRule_Binding::MEDIA_RULE; }
34 // WebIDL interface
35 void GetCssText(nsACString& aCssText) const final;
36 void GetConditionText(nsACString& aConditionText) final;
37 void SetConditionText(const nsACString& aConditionText,
38 ErrorResult& aRv) final;
39 dom::MediaList* Media();
41 size_t SizeOfIncludingThis(MallocSizeOf) const override;
43 JSObject* WrapObject(JSContext* aCx,
44 JS::Handle<JSObject*> aGivenProto) override;
46 private:
47 virtual ~CSSMediaRule();
49 RefPtr<RawServoMediaRule> mRawRule;
50 RefPtr<dom::MediaList> mMediaList;
53 } // namespace dom
54 } // namespace mozilla
56 #endif // mozilla_dom_CSSMediaRule_h