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
; }
36 uint16_t Type() const final
{ return CSSRule_Binding::DOCUMENT_RULE
; }
37 void GetCssText(nsACString
& aCssText
) const final
;
38 void GetConditionText(nsACString
& aConditionText
) final
;
39 void SetConditionText(const nsACString
& aConditionText
,
40 ErrorResult
& aRv
) final
;
42 size_t SizeOfIncludingThis(MallocSizeOf
) const override
;
44 JSObject
* WrapObject(JSContext
* aCx
,
45 JS::Handle
<JSObject
*> aGivenProto
) override
;
48 ~CSSMozDocumentRule() = default;
50 RefPtr
<RawServoMozDocumentRule
> mRawRule
;
54 } // namespace mozilla
56 #endif // mozilla_dom_CSSMozDocumentRule_h