mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
implement NodeList and consolidate common scope and context retrieval
This commit is contained in:
parent
bc3eeb6f1c
commit
9fe9145be4
13 changed files with 180 additions and 72 deletions
|
@ -300,14 +300,15 @@ DOMInterfaces = {
|
|||
'nodeValue',
|
||||
'removeChild',
|
||||
'textContent',
|
||||
'childNodes'
|
||||
]
|
||||
},
|
||||
|
||||
'NodeList': [
|
||||
{
|
||||
'nativeType': 'nsINodeList',
|
||||
'prefable': True,
|
||||
'resultNotAddRefed': [ 'item' ]
|
||||
'nativeType': 'NodeList',
|
||||
'pointerType': '@mut ',
|
||||
'resultNotAddRefed': ['item']
|
||||
}],
|
||||
|
||||
'PaintRequestList': [
|
||||
|
|
|
@ -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]
|
||||
|
|
16
src/components/script/dom/bindings/codegen/NodeList.webidl
Normal file
16
src/components/script/dom/bindings/codegen/NodeList.webidl
Normal 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);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue