From 6e16dac6e8a4b2e1a9a5c2693b3506c61b1d43b3 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sun, 9 Feb 2014 09:04:36 +0100 Subject: [PATCH] Bug 968766 - Part f: Introduce HTMLAllCollection::GetNamedItem; r=jst --- content/html/document/src/HTMLAllCollection.cpp | 10 +++++++++- content/html/document/src/HTMLAllCollection.h | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/content/html/document/src/HTMLAllCollection.cpp b/content/html/document/src/HTMLAllCollection.cpp index 4478388a53c4..794a62fc306a 100644 --- a/content/html/document/src/HTMLAllCollection.cpp +++ b/content/html/document/src/HTMLAllCollection.cpp @@ -130,6 +130,14 @@ HTMLAllCollection::Collection() return mCollection; } +nsISupports* +HTMLAllCollection::GetNamedItem(const nsAString& aID, + nsWrapperCache** aCache, + nsresult* aResult) +{ + return mDocument->GetDocumentAllResult(aID, aCache, aResult); +} + } // namespace dom } // namespace mozilla @@ -212,7 +220,7 @@ nsHTMLDocumentSH::DocumentAllGetProperty(JSContext *cx, JS::Handle ob // For all other strings, look for an element by id or name. nsDependentJSString str(id); - result = doc->GetDocumentAllResult(str, &cache, &rv); + result = doc->All()->GetNamedItem(str, &cache, &rv); if (NS_FAILED(rv)) { xpc::Throw(cx, rv); diff --git a/content/html/document/src/HTMLAllCollection.h b/content/html/document/src/HTMLAllCollection.h index a153b7e1f12b..fc6cb27c3cca 100644 --- a/content/html/document/src/HTMLAllCollection.h +++ b/content/html/document/src/HTMLAllCollection.h @@ -17,6 +17,7 @@ class nsContentList; class nsHTMLDocument; class nsIContent; +class nsWrapperCache; namespace mozilla { class ErrorResult; @@ -37,6 +38,9 @@ public: JSObject* GetObject(JSContext* aCx, ErrorResult& aRv); + nsISupports* GetNamedItem(const nsAString& aID, nsWrapperCache** aCache, + nsresult* aResult); + private: nsContentList* Collection();