Skip to content

Commit 7c25505

Browse files
committed
Fix #299 - Add previousSibling and nextSibling to MutationObserver Record
1 parent 63c22fb commit 7c25505

File tree

5 files changed

+1841
-1168
lines changed

5 files changed

+1841
-1168
lines changed

cjs/interface/mutation-observer.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ const {MUTATION_OBSERVER} = require('../shared/symbols.js');
33

44
const createRecord =
55
(type, target, addedNodes, removedNodes, attributeName, oldValue) =>
6-
({type, target, addedNodes, removedNodes, attributeName, oldValue});
6+
({
7+
type,
8+
target,
9+
addedNodes,
10+
removedNodes,
11+
attributeName,
12+
oldValue,
13+
previousSibling: target.previousSibling,
14+
nextSibling: target.nextSibling,
15+
});
716

817
const queueAttribute = (
918
observer, target, attributeName, attributeFilter, attributeOldValue, oldValue

esm/interface/mutation-observer.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@ import {MUTATION_OBSERVER} from '../shared/symbols.js';
22

33
const createRecord =
44
(type, target, addedNodes, removedNodes, attributeName, oldValue) =>
5-
({type, target, addedNodes, removedNodes, attributeName, oldValue});
5+
({
6+
type,
7+
target,
8+
addedNodes,
9+
removedNodes,
10+
attributeName,
11+
oldValue,
12+
previousSibling: target.previousSibling,
13+
nextSibling: target.nextSibling,
14+
});
615

716
const queueAttribute = (
817
observer, target, attributeName, attributeFilter, attributeOldValue, oldValue

0 commit comments

Comments
 (0)