blob: 8668e5ff0bdfb8c3973cc0211c7e3f65e810a8a8 [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.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 undefined 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(new Image(), 'no-repeat').myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('select')[0].options.myCustomProperty should be undefined and is.
PASS: document.all.myCustomProperty should be undefined and is.
PASS: document.body.childNodes.myCustomProperty should be undefined and is.
PASS: document.images.myCustomProperty should be undefined and is.
PASS: document.embeds.myCustomProperty should be undefined and is.
PASS: document.applets.myCustomProperty should be undefined and is.
PASS: document.links.myCustomProperty should be undefined and is.
PASS: document.forms.myCustomProperty should be undefined and is.
PASS: document.anchors.myCustomProperty should be undefined and is.
PASS: document.scripts.myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('form')[0].elements.myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('table')[0].rows.myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('table')[0].rows[0].cells.myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('table')[0].tBodies.myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('table')[0].tBodies[0].rows.myCustomProperty should be undefined and is.
PASS: document.body.children.myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('map')[0].areas.myCustomProperty should be undefined and is.
PASS: document.body.style.myCustomProperty should be 1 and is.
PASS: document.body.style.getPropertyCSSValue('color').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 undefined and is.
PASS: document.styleSheets[0].cssRules[0].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 undefined 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 undefined and is.
PASS: document.getElementsByTagName('body').myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('canvas')[0].getContext('2d').myCustomProperty should be undefined 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(new Image(), 'no-repeat').myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('select')[0].options.myCustomProperty should be undefined and is.
PASS: document.all.myCustomProperty should be undefined and is.
PASS: document.body.childNodes.myCustomProperty should be undefined and is.
PASS: document.images.myCustomProperty should be undefined and is.
PASS: document.embeds.myCustomProperty should be undefined and is.
PASS: document.applets.myCustomProperty should be undefined and is.
PASS: document.links.myCustomProperty should be undefined and is.
PASS: document.forms.myCustomProperty should be undefined and is.
PASS: document.anchors.myCustomProperty should be undefined and is.
PASS: document.scripts.myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('form')[0].elements.myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('table')[0].rows.myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('table')[0].rows[0].cells.myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('table')[0].tBodies.myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('table')[0].tBodies[0].rows.myCustomProperty should be undefined and is.
PASS: document.body.children.myCustomProperty should be undefined and is.
PASS: document.getElementsByTagName('map')[0].areas.myCustomProperty should be undefined and is.
PASS: document.body.style.myCustomProperty should be undefined and is.
PASS: document.body.style.getPropertyCSSValue('color').myCustomProperty should be undefined and is.
PASS: document.styleSheets.myCustomProperty should be undefined and is.
PASS: document.styleSheets[0].myCustomProperty should be undefined and is.
PASS: document.styleSheets[0].cssRules.myCustomProperty should be undefined and is.
PASS: document.styleSheets[0].cssRules[0].myCustomProperty should be undefined 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.