blob: 60714bfdbe9c08e48d6eb3bf36b97cc21a71dd33 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test.js"></script>
<script src="../../resources/gc.js"></script>
</head>
<body>
<script>
description("This tests that custom properties on element.dataset persist GC.");
var d = document.createElement("div");
var dataset = d.dataset;
// Add a property to our prototype. It will be hidden by the corresponding data- attribute.
dataset.__proto__.customProperty = 1;
dataset.customProperty = 1; // Now set a property on ourselves.
shouldBe("d.getAttribute('data-custom-property')", "'1'");
shouldBe("d.dataset.customProperty", "'1'");
dataset = null;
gc();
// Test that the custom property persisted the GC.
shouldBe("d.dataset.customProperty", "'1'");
</script>
</body>
</html>