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_CSSMozDocumentRule_h
8 #define mozilla_dom_CSSMozDocumentRule_h
10 #include "mozilla/css/GroupRule.h"
11 #include "mozilla/css/DocumentMatchingFunction.h"
12 #include "mozilla/ServoBindingTypes.h"
17 class CSSMozDocumentRule final
: public css::ConditionRule
{
19 CSSMozDocumentRule(RefPtr
<RawServoMozDocumentRule
> aRawRule
,
20 StyleSheet
* aSheet
, css::Rule
* aParentRule
, uint32_t aLine
,
23 NS_DECL_ISUPPORTS_INHERITED
25 static bool Match(const Document
*, nsIURI
* aDocURI
,
26 const nsACString
& aDocURISpec
, const nsACString
& aPattern
,
27 css::DocumentMatchingFunction
);
30 void List(FILE* out
= stdout
, int32_t aIndent
= 0) const final
;
33 RawServoMozDocumentRule
* Raw() const { return mRawRule
; }
34 void SetRawAfterClone(RefPtr
<RawServoMozDocumentRule
>);
37 StyleCssRuleType
Type() const final
;
38 void GetCssText(nsACString
& aCssText
) const final
;
39 void GetConditionText(nsACString
& aConditionText
) final
;
41 size_t SizeOfIncludingThis(MallocSizeOf
) const override
;
43 JSObject
* WrapObject(JSContext
* aCx
,
44 JS::Handle
<JSObject
*> aGivenProto
) override
;
47 ~CSSMozDocumentRule() = default;
49 RefPtr
<RawServoMozDocumentRule
> mRawRule
;
53 } // namespace mozilla
55 #endif // mozilla_dom_CSSMozDocumentRule_h