Bumping manifests a=b2g-bump
[gecko.git] / layout / style / CSSRuleList.h
blobe87b05b74255c9bfff4f7aba0466065ee4727129
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 #ifndef mozilla_dom_CSSRuleList_h
7 #define mozilla_dom_CSSRuleList_h
9 #include "nsIDOMCSSRule.h"
10 #include "nsIDOMCSSRuleList.h"
11 #include "nsWrapperCache.h"
13 namespace mozilla {
14 class CSSStyleSheet;
16 namespace dom {
18 // IID for the CSSRuleList interface
19 #define NS_ICSSRULELIST_IID \
20 { 0x56ac8d1c, 0xc1ed, 0x45fe, \
21 { 0x9a, 0x4d, 0x3a, 0xdc, 0xf9, 0xd1, 0xb9, 0x3f } }
23 class CSSRuleList : public nsIDOMCSSRuleList
24 , public nsWrapperCache
26 public:
27 CSSRuleList()
29 SetIsDOMBinding();
32 NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSRULELIST_IID)
34 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
35 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CSSRuleList)
37 virtual CSSStyleSheet* GetParentObject() = 0;
38 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE MOZ_FINAL;
40 NS_IMETHOD
41 GetLength(uint32_t* aLength) MOZ_OVERRIDE MOZ_FINAL
43 *aLength = Length();
44 return NS_OK;
46 NS_IMETHOD
47 Item(uint32_t aIndex, nsIDOMCSSRule** aReturn) MOZ_OVERRIDE MOZ_FINAL
49 NS_IF_ADDREF(*aReturn = Item(aIndex));
50 return NS_OK;
53 // WebIDL API
54 nsIDOMCSSRule* Item(uint32_t aIndex)
56 bool unused;
57 return IndexedGetter(aIndex, unused);
60 virtual nsIDOMCSSRule* IndexedGetter(uint32_t aIndex, bool& aFound) = 0;
61 virtual uint32_t Length() = 0;
63 protected:
64 virtual ~CSSRuleList() {}
67 NS_DEFINE_STATIC_IID_ACCESSOR(CSSRuleList, NS_ICSSRULELIST_IID)
69 } // namespace dom
70 } // namespace mozilla
72 #endif /* mozilla_dom_CSSRuleList_h */