Skip to content

Commit 62a2386

Browse files
committed
missing properties addedNodes, removedNodes, previousSibling, and nextSibling added to MutationRecord
1 parent 253280b commit 62a2386

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

src/changes/changes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
<body>
1010
<release version="2.70.0" date="xx, 2023" description="Chrome/Edge 109, Firefox 108, Bugfixes">
11+
<action type="add" dev="rbri">
12+
Missing properties addedNodes, removedNodes, previousSibling, and nextSibling added to MutationRecord.
13+
</action>
1114
<action type="add" dev="rbri" issue="546">"
1215
Anchors are now taking care of the rel="noreferrer" attribute.
1316
</action>

src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/MutationRecord.java

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public class MutationRecord extends HtmlUnitScriptable {
4040
private String oldValue_;
4141
private String attributeName_;
4242

43+
private NodeList addedNodes_;
44+
private NodeList removedNodes_;
45+
private Node previousSibling_;
46+
private Node nextSibling_;
4347
/**
4448
* Creates an instance.
4549
*/
@@ -115,4 +119,67 @@ public String getAttributeName() {
115119
return attributeName_;
116120
}
117121

122+
/**
123+
* Sets the {@code addedNodes} property.
124+
* @param addedNodes the {@code addedNodes} property
125+
*/
126+
void setAddedNodes(final NodeList addedNodes) {
127+
addedNodes_ = addedNodes;
128+
}
129+
130+
/**
131+
* @return the {@code addedNodes} property
132+
*/
133+
@JsxGetter
134+
public NodeList getAddedNodes() {
135+
return addedNodes_;
136+
}
137+
138+
/**
139+
* Sets the {@code removedNodes} property.
140+
* @param removedNodes the {@code removedNodes} property
141+
*/
142+
void setRemovedNodes(final NodeList removedNodes) {
143+
removedNodes_ = removedNodes;
144+
}
145+
146+
/**
147+
* @return the {@code removedNodes} property
148+
*/
149+
@JsxGetter
150+
public NodeList getRemovedNodes() {
151+
return removedNodes_;
152+
}
153+
154+
/**
155+
* Sets the {@code previousSibling} property.
156+
* @param removedNodes the {@code previousSibling} property
157+
*/
158+
void setPreviousSibling(final Node previousSibling) {
159+
previousSibling_ = previousSibling;
160+
}
161+
162+
/**
163+
* @return the {@code previousSibling} property
164+
*/
165+
@JsxGetter
166+
public Node getPreviousSibling() {
167+
return previousSibling_;
168+
}
169+
170+
/**
171+
* Sets the {@code nextSibling} property.
172+
* @param removedNodes the {@code nextSibling} property
173+
*/
174+
void setNextSibling(final Node nextSibling) {
175+
nextSibling_ = nextSibling;
176+
}
177+
178+
/**
179+
* @return the {@code nextSibling} property
180+
*/
181+
@JsxGetter
182+
public Node getNextSibling() {
183+
return nextSibling_;
184+
}
118185
}

0 commit comments

Comments
 (0)