mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 968766 - Part f: Introduce HTMLAllCollection::GetNamedItem; r=jst
This commit is contained in:
parent
d368c17b35
commit
6e16dac6e8
@ -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);
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user