blob: 792bed5be85651aab304076e7820aa5175472fa4 [file] [log] [blame]
This page tests whether custom properties on DOM objects persist after garbage collection.
If the test passes, you'll see a series of 'PASS' messages below.
Because neither WinIE nor FF has reasonable or predictable behavior in this scenario, this test just documents our behavior to ensure that we don't change it accidentally. It is not a prescription for how things should behave.
DOM OBJECTS BEFORE GARBAGE COLLECTION:
PASS: document.implementation.myCustomProperty should be 1 and is.
PASS: document.fonts.myCustomProperty should be 1 and is.
PASS: document.myCustomProperty should be 1 and is.
PASS: document.body.myCustomProperty should be 1 and is.
PASS: document.body.attributes.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('body').myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('canvas')[0].getContext('2d').myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('canvas')[0].getContext('2d').createLinearGradient(0, 0, 0, 0).myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('canvas')[0].getContext('2d').createPattern(document.getElementsByTagName('canvas')[0], 'no-repeat').myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('select')[0].options.myCustomProperty should be 1 and is.
PASS: document.body.childNodes.myCustomProperty should be 1 and is.
PASS: document.body.dataset.myCustomProperty should be 1 and is.
PASS: document.body.classList.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('link')[0].relList.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('link')[0].sizes.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('output')[0].htmlFor.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('output')[0].labels.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('iframe')[0].sandbox.myCustomProperty should be 1 and is.
PASS: document.all.myCustomProperty should be 1 and is.
PASS: document.images.myCustomProperty should be 1 and is.
PASS: document.embeds.myCustomProperty should be 1 and is.
PASS: document.applets.myCustomProperty should be 1 and is.
PASS: document.links.myCustomProperty should be 1 and is.
PASS: document.forms.myCustomProperty should be 1 and is.
PASS: document.anchors.myCustomProperty should be 1 and is.
PASS: document.scripts.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('form')[0].elements.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('table')[0].rows.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('table')[0].rows[0].cells.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('table')[0].tBodies.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('table')[0].tBodies[0].rows.myCustomProperty should be 1 and is.
PASS: document.body.children.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('map')[0].areas.myCustomProperty should be 1 and is.
PASS: document.body.style.myCustomProperty should be 1 and is.
PASS: document.styleSheets.myCustomProperty should be 1 and is.
PASS: document.styleSheets[0].myCustomProperty should be 1 and is.
PASS: document.styleSheets[0].cssRules.myCustomProperty should be 1 and is.
PASS: document.styleSheets[0].cssRules[0].myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('style')[0].sheet.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('svg')[0].firstChild.sheet.myCustomProperty should be 1 and is.
PASS: new XPathEvaluator().myCustomProperty should be undefined and is.
PASS: new XPathEvaluator().evaluate('/', document, null, 0, null).myCustomProperty should be undefined and is.
PASS: document.createNSResolver(document).myCustomProperty should be undefined and is.
PASS: document.createExpression('/', document.createNSResolver(document)).myCustomProperty should be undefined and is.
DOM OBJECTS AFTER GARBAGE COLLECTION:
PASS: document.implementation.myCustomProperty should be 1 and is.
PASS: document.fonts.myCustomProperty should be 1 and is.
PASS: document.myCustomProperty should be 1 and is.
PASS: document.body.myCustomProperty should be 1 and is.
PASS: document.body.attributes.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('body').myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('canvas')[0].getContext('2d').myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('canvas')[0].getContext('2d').createLinearGradient(0, 0, 0, 0).myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('canvas')[0].getContext('2d').createPattern(document.getElementsByTagName('canvas')[0], 'no-repeat').myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('select')[0].options.myCustomProperty should be 1 and is.
PASS: document.body.childNodes.myCustomProperty should be 1 and is.
PASS: document.body.dataset.myCustomProperty should be 1 and is.
PASS: document.body.classList.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('link')[0].relList.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('link')[0].sizes.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('output')[0].htmlFor.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('output')[0].labels.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('iframe')[0].sandbox.myCustomProperty should be 1 and is.
PASS: document.all.myCustomProperty should be 1 and is.
PASS: document.images.myCustomProperty should be 1 and is.
PASS: document.embeds.myCustomProperty should be 1 and is.
PASS: document.applets.myCustomProperty should be 1 and is.
PASS: document.links.myCustomProperty should be 1 and is.
PASS: document.forms.myCustomProperty should be 1 and is.
PASS: document.anchors.myCustomProperty should be 1 and is.
PASS: document.scripts.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('form')[0].elements.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('table')[0].rows.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('table')[0].rows[0].cells.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('table')[0].tBodies.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('table')[0].tBodies[0].rows.myCustomProperty should be 1 and is.
PASS: document.body.children.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('map')[0].areas.myCustomProperty should be 1 and is.
PASS: document.body.style.myCustomProperty should be 1 and is.
PASS: document.styleSheets.myCustomProperty should be 1 and is.
PASS: document.styleSheets[0].myCustomProperty should be 1 and is.
PASS: document.styleSheets[0].cssRules.myCustomProperty should be 1 and is.
PASS: document.styleSheets[0].cssRules[0].myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('style')[0].sheet.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('svg')[0].firstChild.sheet.myCustomProperty should be 1 and is.
PASS: new XPathEvaluator().myCustomProperty should be undefined and is.
PASS: new XPathEvaluator().evaluate('/', document, null, 0, null).myCustomProperty should be undefined and is.
PASS: document.createNSResolver(document).myCustomProperty should be undefined and is.
PASS: document.createExpression('/', document.createNSResolver(document)).myCustomProperty should be undefined and is.
DOM EVENT BEFORE GARBAGE COLLECTION
PASS: event.myCustomProperty should be 1 and is.
DOM EVENT AFTER GARBAGE COLLECTION
PASS: event.myCustomProperty should be 1 and is.