summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/callback-arguments.html
blob: 0246abf53e9003c35d8bd0be9d56f1f5b0924958 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<body>
<script src="../../../resources/js-test.js"></script>
<script>
window.jsTestIsAsync = true;
description('Verifies that MutationObserver is passed to the callback as expected.');

function mutationCallback(mutations, observer) {
    window.thisArgument = this;
    window.argument2 = observer;
    shouldBe('thisArgument', 'mutationObserver');
    shouldBe('argument2', 'mutationObserver');
    finishJSTest();
}
var mutationObserver = new MutationObserver(mutationCallback);
var div = document.createElement('div');
mutationObserver.observe(div, {attributes: true});
div.setAttribute('foo', 'bar');
</script>
</body>