content/html/document/src/HTMLAllCollection.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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_HTMLAllCollection_h
     8 #define mozilla_dom_HTMLAllCollection_h
    10 #include "js/RootingAPI.h"
    11 #include "nsAutoPtr.h"
    12 #include "nsCycleCollectionParticipant.h"
    13 #include "nsISupportsImpl.h"
    14 #include "nsRefPtrHashtable.h"
    16 #include <stdint.h>
    18 class nsContentList;
    19 class nsHTMLDocument;
    20 class nsIContent;
    21 class nsWrapperCache;
    23 namespace mozilla {
    24 class ErrorResult;
    26 namespace dom {
    28 class HTMLAllCollection
    29 {
    30 public:
    31   HTMLAllCollection(nsHTMLDocument* aDocument);
    32   ~HTMLAllCollection();
    34   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(HTMLAllCollection)
    35   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(HTMLAllCollection)
    37   uint32_t Length();
    38   nsIContent* Item(uint32_t aIndex);
    40   JSObject* GetObject(JSContext* aCx, ErrorResult& aRv);
    42   nsISupports* GetNamedItem(const nsAString& aID, nsWrapperCache** aCache);
    44 private:
    45   nsContentList* Collection();
    47   /**
    48    * Returns the NodeList for document.all[aID], or null if there isn't one.
    49    */
    50   nsContentList* GetDocumentAllList(const nsAString& aID);
    52   JS::Heap<JSObject*> mObject;
    53   nsRefPtr<nsHTMLDocument> mDocument;
    54   nsRefPtr<nsContentList> mCollection;
    55   nsRefPtrHashtable<nsStringHashKey, nsContentList> mNamedMap;
    56 };
    58 } // namespace dom
    59 } // namespace mozilla
    61 #endif // mozilla_dom_HTMLAllCollection_h

mercurial