Bug 1700051: part 48) Slightly simplify `mozInlineSpellWordUtil::FindRealWordContaini...
[gecko.git] / layout / style / CSSNamespaceRule.h
blobff28de8e7ea13fbdc3f4eb28a6ede6cd265e0a8b
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_CSSNamespaceRule_h
8 #define mozilla_dom_CSSNamespaceRule_h
10 #include "mozilla/css/Rule.h"
11 #include "mozilla/dom/CSSNamespaceRuleBinding.h"
12 #include "mozilla/ServoBindingTypes.h"
14 class nsAtom;
16 namespace mozilla {
17 namespace dom {
19 class CSSNamespaceRule final : public css::Rule {
20 public:
21 CSSNamespaceRule(already_AddRefed<RawServoNamespaceRule> aRule,
22 StyleSheet* aSheet, css::Rule* aParentRule, uint32_t aLine,
23 uint32_t aColumn)
24 : css::Rule(aSheet, aParentRule, aLine, aColumn),
25 mRawRule(std::move(aRule)) {}
27 bool IsCCLeaf() const final { return Rule::IsCCLeaf(); }
29 #ifdef DEBUG
30 void List(FILE* out = stdout, int32_t aIndent = 0) const final;
31 #endif
33 nsAtom* GetPrefix() const;
34 void GetURLSpec(nsString& aURLSpec) const;
36 // WebIDL interface
37 void GetCssText(nsACString& aCssText) const final;
39 // WebIDL interfaces
40 uint16_t Type() const final { return CSSRule_Binding::NAMESPACE_RULE; }
42 const RawServoNamespaceRule* Raw() const { return mRawRule.get(); }
44 void GetNamespaceURI(nsString& aNamespaceURI) { GetURLSpec(aNamespaceURI); }
46 void GetPrefix(DOMString& aPrefix) {
47 aPrefix.SetKnownLiveAtom(GetPrefix(), DOMString::eTreatNullAsEmpty);
50 size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const final;
52 JSObject* WrapObject(JSContext* aCx,
53 JS::Handle<JSObject*> aGivenProto) final {
54 return CSSNamespaceRule_Binding::Wrap(aCx, this, aGivenProto);
57 private:
58 ~CSSNamespaceRule();
59 RefPtr<RawServoNamespaceRule> mRawRule;
62 } // namespace dom
63 } // namespace mozilla
65 #endif // mozilla_dom_CSSNamespaceRule_h