1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /* class for CSS @namespace rules */
8 #ifndef mozilla_css_NameSpaceRule_h__
9 #define mozilla_css_NameSpaceRule_h__
11 #include "mozilla/Attributes.h"
12 #include "mozilla/MemoryReporting.h"
13 #include "mozilla/css/Rule.h"
15 #include "nsIDOMCSSRule.h"
19 // IID for the NameSpaceRule class {f0b0dbe1-5031-4a21-b06a-dc141ef2af98}
20 #define NS_CSS_NAMESPACE_RULE_IMPL_CID \
21 {0xf0b0dbe1, 0x5031, 0x4a21, {0xb0, 0x6a, 0xdc, 0x14, 0x1e, 0xf2, 0xaf, 0x98}}
27 class NameSpaceRule MOZ_FINAL
: public Rule
,
31 NameSpaceRule(nsIAtom
* aPrefix
, const nsString
& aURLSpec
,
32 uint32_t aLineNumber
, uint32_t aColumnNumber
);
35 NameSpaceRule(const NameSpaceRule
& aCopy
);
38 NS_DECLARE_STATIC_IID_ACCESSOR(NS_CSS_NAMESPACE_RULE_IMPL_CID
)
42 DECL_STYLE_RULE_INHERIT
44 // nsIStyleRule methods
46 virtual void List(FILE* out
= stdout
, int32_t aIndent
= 0) const MOZ_OVERRIDE
;
50 virtual int32_t GetType() const;
51 virtual already_AddRefed
<Rule
> Clone() const;
53 nsIAtom
* GetPrefix() const { return mPrefix
; }
55 void GetURLSpec(nsString
& aURLSpec
) const { aURLSpec
= mURLSpec
; }
57 virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf
) const
60 // nsIDOMCSSRule interface
64 nsCOMPtr
<nsIAtom
> mPrefix
;
68 NS_DEFINE_STATIC_IID_ACCESSOR(NameSpaceRule
, NS_CSS_NAMESPACE_RULE_IMPL_CID
)
71 } // namespace mozilla
73 #endif /* mozilla_css_NameSpaceRule_h__ */