implement NodeList and consolidate common scope and context retrieval

This commit is contained in:
Tim Taubert 2013-10-05 19:17:52 -07:00
parent bc3eeb6f1c
commit 9fe9145be4
13 changed files with 180 additions and 72 deletions

View file

@ -300,14 +300,15 @@ DOMInterfaces = {
'nodeValue',
'removeChild',
'textContent',
'childNodes'
]
},
'NodeList': [
{
'nativeType': 'nsINodeList',
'prefable': True,
'resultNotAddRefed': [ 'item' ]
'nativeType': 'NodeList',
'pointerType': '@mut ',
'resultNotAddRefed': ['item']
}],
'PaintRequestList': [

View file

@ -42,8 +42,8 @@ interface Node /*: EventTarget*/ {
[Pure]
readonly attribute Element? parentElement;
boolean hasChildNodes();
/*[Constant]
readonly attribute NodeList childNodes;*/
[Constant]
readonly attribute NodeList childNodes;
[Pure]
readonly attribute Node? firstChild;
[Pure]

View file

@ -0,0 +1,16 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* http://www.w3.org/TR/2012/WD-dom-20120105/
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
interface NodeList {
readonly attribute unsigned long length;
getter Node? item(unsigned long index);
};