blob: 7391629bd3022c8540ffbf9783a362c657f00f34 [file] [log] [blame] [edit]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p>
Tests that a range input's slider is cloned along with its host. There
should be a second range input in the document and it should have a
slider positioned at zero.
</p>
<input type="range" id="sheep" style="display: block; width: 100px;">
<div id="console"></div>
<script>
var sheep = document.querySelector('#sheep');
var dolly = sheep.cloneNode();
sheep.insertAdjacentElement('afterEnd', dolly);
// Cloned element should be the same size. Having zero height is one
// symptom of a broken clone.
shouldBe('dolly.clientHeight', 'sheep.clientHeight');
if (window.internals) {
var sheepShadow = internals.shadowRoot(sheep);
var dollyShadow = internals.shadowRoot(dolly);
shouldBe('internals.userAgentPart(dollyShadow.firstChild)',
'internals.userAgentPart(sheepShadow.firstChild)');
}
dolly.value = 0;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>