blob: 23b9cf8b97ef79759e8404f9776c4b7958e678e5 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../js/resources/js-test-pre.js"></script>
</head>
<body>
Please run this test within DumpRenderTree.
<script>
function keyDown(key, modifiers)
{
if (!window.eventSender)
return;
eventSender.keyDown(key, modifiers);
}
description('Check focus style for multiple fields time input UI');
var testInput = document.createElement("input");
testInput.setAttribute("type", "time");
testInput.setAttribute("step", "0.001");
document.body.appendChild(testInput);
var sample = document.createElement("span");
sample.style.backgroundColor = "highlight";
sample.style.color = "highlighttext";
document.body.appendChild(sample);
var sampleStyle = getComputedStyle(sample);
var highlighttext = sampleStyle.color;
var highlight = sampleStyle.backgroundColor;
testInput.focus();
var shadowRoot = internals.oldestShadowRoot(testInput);
var fields = shadowRoot.firstChild.childNodes;
for (var index = 0; index < fields.length; ++index) {
var field = fields[index];
if (field.nodeType != 1)
continue;
var id = internals.shadowPseudoId(field);
if (id.indexOf('-field') < 0)
continue;
var style = getComputedStyle(field);
shouldBe('"' + id + '"; style.backgroundColor', 'highlight');
shouldBe('"' + id + '"; style.color', 'highlighttext');
keyDown('rightArrow');
}
debug('');
testInput.parentElement.removeChild(testInput);
sample.parentElement.removeChild(sample);
</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>