[Bug 23913] beforeinput should be fired only when the DOM change is caused by direct input by keypress or composition

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23913

--- Comment #9 from Ojan Vafai <ojan@chromium.org> ---
<div contentEditable id="foo">foo</div>
<div id="logger"></div>
<script>
var foo = document.getElementById('foo');
var logger = document.getElementById('logger');
foo.onfocus = function() {
  logger.innerHTML += 'focus started<br>';
  foo.blur();
  logger.innerHTML += 'focus done<br>';
};
foo.onblur = function() {
  logger.innerHTML += 'blur started<br>';
  foo.focus();
  logger.innerHTML += 'blur done<br>';
};
foo.focus();
</script>

Gecko prints out:
focus started
blur started
blur done
focus done

It doesn't hang, but the focus/blur events don't seem to be delayed either.

Incidentally, Blink prints out the same thing but 11 times, i.e:
focus started
blur started
focus started
blur started
...
blur done
focus done
blur done
focus done

I don't see why beforeinput can't get the same treatment.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 28 November 2013 00:21:43 UTC