38 lines
879 B
HTML
38 lines
879 B
HTML
<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>
|