blob: 21b190e97441a7b69eebc63aafaac1547e99e7bc [file] [log] [blame]
Tests for replacing exactly one Text node. The optimization to update its data should not be observable.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Keeping a reference
container = createElementWithText("old"); textNode = container.firstChild
PASS container.innerHTML = "new"; container.firstChild is not textNode
Mutation observer
container = createElementWithText("old"); mutationObserver.observe(container, {childList: true});
PASS container.innerHTML = "new"; records = mutationObserver.takeRecords(); records.length is 1
PASS records[0].type is "childList"
PASS records[0].removedNodes.length is 1
PASS records[0].removedNodes[0].data is "old"
PASS records[0].addedNodes.length is 1
PASS records[0].addedNodes[0].data is "new"
DOMSubtreeModified event
PASS container = createElementWithText("old"); countEvent(container, "DOMSubtreeModified"); eventCount is 0
PASS container.innerHTML = "new"; eventCount > 0 is true
DOMNodeInserted event
PASS container = createElementWithText("old"); countEvent(container, "DOMNodeInserted"); eventCount is 0
PASS container.innerHTML = "new"; eventCount is 1
DOMNodeRemoved event
PASS container = createElementWithText("old"); countEvent(container, "DOMNodeRemoved"); eventCount is 0
PASS container.innerHTML = "new"; eventCount is 1
DOMCharacterDataModified event
PASS container = createElementWithText("old"); countEvent(container, "DOMCharacterDataModified"); eventCount is 0
PASS container.innerHTML = "new"; eventCount is 0
PASS successfullyParsed is true
TEST COMPLETE