mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 968766 - Part e: Introduce HTMLAllCollection::Item; r=jst
This commit is contained in:
parent
b86cdb9379
commit
3986b6c5dd
@ -87,6 +87,12 @@ HTMLAllCollection::Length()
|
||||
return Collection()->Length(true);
|
||||
}
|
||||
|
||||
nsIContent*
|
||||
HTMLAllCollection::Item(uint32_t aIndex)
|
||||
{
|
||||
return Collection()->Item(aIndex);
|
||||
}
|
||||
|
||||
JSObject*
|
||||
HTMLAllCollection::GetObject(JSContext* aCx, ErrorResult& aRv)
|
||||
{
|
||||
@ -216,9 +222,7 @@ nsHTMLDocumentSH::DocumentAllGetProperty(JSContext *cx, JS::Handle<JSObject*> ob
|
||||
// Map document.all[n] (where n is a number) to the n:th item in
|
||||
// the document.all node list.
|
||||
|
||||
nsRefPtr<nsContentList> nodeList = doc->All()->Collection();
|
||||
|
||||
nsIContent *node = nodeList->Item(JSID_TO_INT(id));
|
||||
nsIContent* node = doc->All()->Item(SafeCast<uint32_t>(JSID_TO_INT(id)));
|
||||
|
||||
result = node;
|
||||
cache = node;
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
class nsContentList;
|
||||
class nsHTMLDocument;
|
||||
class nsIContent;
|
||||
|
||||
namespace mozilla {
|
||||
class ErrorResult;
|
||||
@ -32,12 +33,13 @@ public:
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(HTMLAllCollection)
|
||||
|
||||
uint32_t Length();
|
||||
nsIContent* Item(uint32_t aIndex);
|
||||
|
||||
JSObject* GetObject(JSContext* aCx, ErrorResult& aRv);
|
||||
|
||||
private:
|
||||
nsContentList* Collection();
|
||||
|
||||
private:
|
||||
JS::Heap<JSObject*> mObject;
|
||||
nsRefPtr<nsHTMLDocument> mDocument;
|
||||
nsRefPtr<nsContentList> mCollection;
|
||||
|
Loading…
Reference in New Issue
Block a user