Bug 1883861 - Part 1: Move visitMemoryBarrier into the common CodeGenerator file...
[gecko.git] / layout / style / CSSMozDocumentRule.h
blob0c1b0ab0227cef1620350ffa079c6f67f84053b8
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"
14 namespace mozilla::dom {
16 class CSSMozDocumentRule final : public css::ConditionRule {
17 public:
18 CSSMozDocumentRule(RefPtr<StyleDocumentRule> aRawRule, StyleSheet* aSheet,
19 css::Rule* aParentRule, uint32_t aLine, uint32_t aColumn);
21 NS_DECL_ISUPPORTS_INHERITED
23 static bool Match(const Document*, nsIURI* aDocURI,
24 const nsACString& aDocURISpec, const nsACString& aPattern,
25 css::DocumentMatchingFunction);
27 #ifdef DEBUG
28 void List(FILE* out = stdout, int32_t aIndent = 0) const final;
29 #endif
31 StyleDocumentRule* Raw() const { return mRawRule; }
32 void SetRawAfterClone(RefPtr<StyleDocumentRule>);
33 already_AddRefed<StyleLockedCssRules> GetOrCreateRawRules() final;
35 // WebIDL interface
36 StyleCssRuleType Type() const final;
37 void GetCssText(nsACString& aCssText) const final;
38 void GetConditionText(nsACString& aConditionText) final;
40 size_t SizeOfIncludingThis(MallocSizeOf) const override;
42 JSObject* WrapObject(JSContext* aCx,
43 JS::Handle<JSObject*> aGivenProto) override;
45 private:
46 ~CSSMozDocumentRule() = default;
48 RefPtr<StyleDocumentRule> mRawRule;
51 } // namespace mozilla::dom
53 #endif // mozilla_dom_CSSMozDocumentRule_h