Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / layout / style / CSSRuleList.h
blob3a8d60ac16f8c9a164ed1f19627bd9928dcb8e0d
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 NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSRULELIST_IID)
29 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
30 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CSSRuleList)
32 virtual CSSStyleSheet* GetParentObject() = 0;
33 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE MOZ_FINAL;
35 NS_IMETHOD
36 GetLength(uint32_t* aLength) MOZ_OVERRIDE MOZ_FINAL
38 *aLength = Length();
39 return NS_OK;
41 NS_IMETHOD
42 Item(uint32_t aIndex, nsIDOMCSSRule** aReturn) MOZ_OVERRIDE MOZ_FINAL
44 NS_IF_ADDREF(*aReturn = Item(aIndex));
45 return NS_OK;
48 // WebIDL API
49 nsIDOMCSSRule* Item(uint32_t aIndex)
51 bool unused;
52 return IndexedGetter(aIndex, unused);
55 virtual nsIDOMCSSRule* IndexedGetter(uint32_t aIndex, bool& aFound) = 0;
56 virtual uint32_t Length() = 0;
58 protected:
59 virtual ~CSSRuleList() {}
62 NS_DEFINE_STATIC_IID_ACCESSOR(CSSRuleList, NS_ICSSRULELIST_IID)
64 } // namespace dom
65 } // namespace mozilla
67 #endif /* mozilla_dom_CSSRuleList_h */