Bug 968766 - Part f: Introduce HTMLAllCollection::GetNamedItem; r=jst

This commit is contained in:
Ms2ger 2014-02-09 09:04:36 +01:00
parent d368c17b35
commit 6e16dac6e8
2 changed files with 13 additions and 1 deletions

View File

@ -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<JSObject*> 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);

View File

@ -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();