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_CSSRuleList_h
8 #define mozilla_dom_CSSRuleList_h
10 #include "mozilla/StyleSheetInlines.h"
11 #include "mozilla/css/Rule.h"
12 #include "nsWrapperCache.h"
14 namespace mozilla::dom
{
16 class CSSRuleList
: public nsISupports
, public nsWrapperCache
{
18 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
19 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CSSRuleList
)
21 virtual StyleSheet
* GetParentObject() = 0;
22 JSObject
* WrapObject(JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
) final
;
25 css::Rule
* Item(uint32_t aIndex
) {
27 return IndexedGetter(aIndex
, unused
);
30 virtual css::Rule
* IndexedGetter(uint32_t aIndex
, bool& aFound
) = 0;
31 virtual uint32_t Length() = 0;
34 virtual ~CSSRuleList() = default;
37 } // namespace mozilla::dom
39 #endif /* mozilla_dom_CSSRuleList_h */