You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: w3/python/core/fundamental_interface/DOMImplementation.py
-1Lines changed: 0 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,6 @@ class DOMImplementation:
7
7
"""Interface DOMImplementation
8
8
9
9
The `DOMImplementation` interface provides a number of methods for performing operations that are independent of any particular instance of the document object model.
10
-
11
10
The DOM Level 1 does not specify a way of creating a document instance, and hence document creation is an operation specific to an implementation. Future Levels of the DOM specification are expected to provide methods for creating documents directly.
"""Indirect accessor to set the 'node_type' property.
148
-
"""
144
+
"""Indirect accessor to set the 'node_type' property."""
149
145
ifnode_typenotinNodeType:
150
146
raiseValueError(f'{node_type} is not a valid code '
151
147
'for a node type.')
152
148
self._node_type=node_type
153
149
154
150
@property
155
151
defparent_node(self) ->Optional[_AnyNode]:
156
-
"""The parent of this node. All nodes, except `Document`, `DocumentFragment`, and `Attr` may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is `None`.
152
+
"""The parent of this node.
153
+
154
+
All nodes, except `Document`, `DocumentFragment`, and `Attr` may have a parent.
155
+
However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is `None`.
157
156
"""
158
157
returnself._parent_node
159
158
160
159
def_set_parent_node(self,
161
160
parent_node: Optional[_AnyNode]) ->None:
162
-
"""Indirect accessor to set the 'node_type' property.
163
-
"""
161
+
"""Indirect accessor to set the 'node_type' property."""
164
162
ifnotparent_node:
165
163
self._parent_node=None
166
164
else:
167
165
self._parent_node=parent_node
168
166
169
167
@property
170
168
defchild_nodes(self) ->NodeList:
171
-
"""A `NodeList` that contains all children of this node. If there are no children, this is a `NodeList` containing no nodes. The content of the returned `NodeList` is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the `NodeList` accessors; it is not a static snapshot of the content of the node. This is true for every `NodeList`, including the ones returned by the `getElementsByTagName` method.
169
+
"""A `NodeList` that contains all children of this node.
170
+
171
+
If there are no children, this is a `NodeList` containing no nodes.
172
+
The content of the returned `NodeList` is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the `NodeList` accessors; it is not a static snapshot of the content of the node.
173
+
This is true for every `NodeList`, including the ones returned by the `getElementsByTagName` method.
"""Accessor that indicates how many siblings are there preceding this node. if there is no such parent node, this returns `None`.
232
+
"""Accessor that indicates how many siblings are there preceding this node.
233
+
234
+
If there is no such parent node, this returns `None`.
224
235
"""
225
236
ifself.parent_nodeisNone:
226
237
returnNone
227
238
returnself.parent_node.child_nodes.index(self)
228
239
229
240
@property
230
241
defattributes(self) ->_NamedNodeMap:
231
-
"""A `NamedNodeMap` containing the attributes of this node (if it is an `Element`) or `None` otherwise.
232
-
"""
242
+
"""A `NamedNodeMap` containing the attributes of this node (if it is an `Element`) or `None` otherwise."""
233
243
returnself._attributes
234
244
235
245
def_init_attributes(self,
@@ -242,16 +252,18 @@ def _init_attributes(self,
242
252
243
253
@property
244
254
defowner_document(self) ->Optional[_Document]:
245
-
"""The `Document` object associated with this node. This is also the `Document` object used to create new nodes. When this node is a `Document` this is `None`.
255
+
"""The `Document` object associated with this node.
256
+
257
+
This is also the `Document` object used to create new nodes.
0 commit comments