mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Address review comments
This commit is contained in:
parent
298a20f9ec
commit
b97d812e6d
1 changed files with 8 additions and 6 deletions
|
|
@ -32,7 +32,9 @@
|
||||||
|
|
||||||
|
|
||||||
class Node(xml.dom.Node):
|
class Node(xml.dom.Node):
|
||||||
"""Define properties accessible on a DOM node."""
|
"""Base class representing a node in the DOM tree.
|
||||||
|
Provides core properties and methods that all DOM nodes must implement.
|
||||||
|
"""
|
||||||
namespaceURI = None # this is non-null only for elements and attributes
|
namespaceURI = None # this is non-null only for elements and attributes
|
||||||
parentNode = None
|
parentNode = None
|
||||||
ownerDocument = None
|
ownerDocument = None
|
||||||
|
|
@ -84,11 +86,11 @@ def _get_lastChild(self):
|
||||||
def insertBefore(self, newChild, refChild):
|
def insertBefore(self, newChild, refChild):
|
||||||
"""Insert a new DOM Node before an existing Node.
|
"""Insert a new DOM Node before an existing Node.
|
||||||
|
|
||||||
https://dom.spec.whatwg.org/#dom-node-insertbefore
|
newChild
|
||||||
The insertBefore(node, child) method, when invoked,
|
The new node to insert
|
||||||
must return the result of pre-inserting node into
|
refChild
|
||||||
this before child.
|
The existing node that will be the next sibling of newChild.
|
||||||
See also https://dom.spec.whatwg.org/#concept-node-pre-insert
|
If None, newChild is appended to the end.
|
||||||
"""
|
"""
|
||||||
if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
|
if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
|
||||||
for c in tuple(newChild.childNodes):
|
for c in tuple(newChild.childNodes):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue