MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / DomMutation

Class DomMutation

py/selenium/webdriver/remote/script.py:125–156  ·  view source on GitHub ↗

Represents a DOM mutation event from add_dom_mutation_handler. Attributes: element_id: The ``data-__webdriver_id`` attribute value set on the mutated element by the MutationObserver. Use this to locate the element from the main thread if needed. For ``characterD

Source from the content-addressed store, hash-verified

123
124@dataclass
125class DomMutation:
126 """Represents a DOM mutation event from add_dom_mutation_handler.
127
128 Attributes:
129 element_id: The ``data-__webdriver_id`` attribute value set on the
130 mutated element by the MutationObserver. Use this to locate the
131 element from the main thread if needed. For ``characterData``
132 mutations this identifies the parent element of the text node.
133 attribute_name: The name of the changed attribute (``attributes``
134 mutations only).
135 current_value: The value after the mutation (attribute value or
136 character data; ``None`` if the attribute was removed).
137 old_value: The value before the mutation.
138 type: The mutation type: ``attributes``, ``childList`` or
139 ``characterData``.
140 target: Same identifier as ``element_id``; named per the
141 cross-binding API design.
142 added_nodes: Node descriptors added by a ``childList`` mutation.
143 Element descriptors carry ``nodeType``/``nodeName``/``id``
144 (a ``data-__webdriver_id`` value); other nodes carry
145 ``nodeType``/``nodeName``/``value``.
146 removed_nodes: Node descriptors removed by a ``childList`` mutation.
147 """
148
149 element_id: str | None = None
150 attribute_name: str | None = None
151 current_value: str | None = None
152 old_value: str | None = None
153 type: str | None = None
154 target: str | None = None
155 added_nodes: list[Any] = field(default_factory=list)
156 removed_nodes: list[Any] = field(default_factory=list)
157
158
159class PinnedScript(str):

Callers 1

Calls 1

fieldFunction · 0.50

Tested by

no test coverage detected