tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

CSSRuleList.h (1160B)


      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/. */
      6 
      7 #ifndef mozilla_dom_CSSRuleList_h
      8 #define mozilla_dom_CSSRuleList_h
      9 
     10 #include "mozilla/StyleSheetInlines.h"
     11 #include "mozilla/css/Rule.h"
     12 #include "nsWrapperCache.h"
     13 
     14 namespace mozilla::dom {
     15 
     16 class CSSRuleList : public nsISupports, public nsWrapperCache {
     17 public:
     18  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     19  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CSSRuleList)
     20 
     21  virtual StyleSheet* GetParentObject() = 0;
     22  JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
     23 
     24  // WebIDL API
     25  css::Rule* Item(uint32_t aIndex) {
     26    bool unused;
     27    return IndexedGetter(aIndex, unused);
     28  }
     29 
     30  virtual css::Rule* IndexedGetter(uint32_t aIndex, bool& aFound) = 0;
     31  virtual uint32_t Length() = 0;
     32 
     33 protected:
     34  virtual ~CSSRuleList() = default;
     35 };
     36 
     37 }  // namespace mozilla::dom
     38 
     39 #endif /* mozilla_dom_CSSRuleList_h */