blob: a1f09cdd2f56d56ac45abc5a62b79a066786cc83 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../../resources/js-test.js"></script>
<script>
description('This tests mutating the attribute value by the setters of textContent and nodeValue. WebKit should insert exactly one record');
let element = document.createElement('div');
element.setAttribute('title', 'hello');
let observer = new MutationObserver(function (records) { });
observer.observe(element, {attributes: true});
var records;
evalAndLog('element.attributes.title.textContent = "new"; records = observer.takeRecords()');
shouldBe('records[0].attributeName', '"title"');
shouldBe('records.length', '1');
debug('');
evalAndLog('element.attributes.title.nodeValue = "world"; records = observer.takeRecords()');
shouldBe('records[0].attributeName', '"title"');
shouldBe('records.length', '1');
</script>
</body>
</html>