blob: 97eed2216784224d3b32cbaebc3a99b3cf9fb055 [file] [log] [blame]
<p>Focusing on the bottom input should not trigger duplicate focus events for both inputs.</p>
<input type="text" id="x"><br>
<input type="text" id="y">
<pre id="log">
Expected:
Bottom Input: Focus Event #1
Top Input: Focus Event #1
Actual:
</pre>
<script>
if (window.testRunner)
window.testRunner.dumpAsText();
function log(s) {
document.getElementById('log').appendChild(document.createTextNode(s+"\n"));
}
var topInput = document.getElementById('x');
var topCounter = 0;
var bottomInput = document.getElementById('y');
var bottomCounter = 0;
topInput.addEventListener('focus', function() {
++topCounter;
log("Top Input: Focus Event #" + topCounter);
}, false);
bottomInput.addEventListener('focus', function() {
++bottomCounter;
log("Bottom Input: Focus Event #" + bottomCounter);
topInput.focus();
}, false);
bottomInput.focus();
</script>