Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
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 nsICSSRuleList_h
7 #define nsICSSRuleList_h
9 #include "nsIDOMCSSRule.h"
10 #include "nsIDOMCSSRuleList.h"
12 // IID for the nsICSSRuleList interface
13 #define NS_ICSSRULELIST_IID \
14 { 0xccc0135a, 0xbcb6, 0x4654, \
15 { 0x8c, 0x78, 0x74, 0x35, 0x97, 0x9b, 0x88, 0x19 } }
17 class nsICSSRuleList : public nsIDOMCSSRuleList
18 {
19 public:
20 NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSRULELIST_IID)
22 NS_IMETHOD
23 GetLength(uint32_t* aLength) MOZ_OVERRIDE MOZ_FINAL
24 {
25 *aLength = Length();
26 return NS_OK;
27 }
28 NS_IMETHOD
29 Item(uint32_t aIndex, nsIDOMCSSRule** aReturn) MOZ_OVERRIDE MOZ_FINAL
30 {
31 NS_IF_ADDREF(*aReturn = Item(aIndex));
32 return NS_OK;
33 }
35 // WebIDL API
36 nsIDOMCSSRule* Item(uint32_t aIndex)
37 {
38 bool unused;
39 return IndexedGetter(aIndex, unused);
40 }
42 virtual nsIDOMCSSRule* IndexedGetter(uint32_t aIndex, bool& aFound) = 0;
43 virtual uint32_t Length() = 0;
44 };
46 NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSRuleList, NS_ICSSRULELIST_IID)
48 #endif /* nsICSSRuleList_h */