[webkit-dev] Unapplying execCommand

Ryosuke Niwa rniwa at webkit.org
Fri Oct 8 15:47:58 PDT 2010


Greetings all,

I realized that the behavior of undo is different on WebKit and Chromium.
 Namely on Safari, execCommand("undo") undoes all previous execCommands
while it undoes exactly one execCommand in Chromium.

For example, we if have
<div id="test" contenteditable>hello</div>
<script>
window.getSelection().selectAllChildren(test);
document.execCommand('bold', false, null);
document.execCommand('italic', false, null);
document.execCommand('undo', false, null);
</script>

WebKit will have the plain "hello" after the script is ran.  i.e. hello is
neither boldened nor italicized.  On Chromium, "hello" is boldened after the
script is ran, which is also consistent with Firefox, Internet Explorer, and
Opera (I have to add artificial delay for MSIE and Opera to execute undo
properly).  I feel like this should be a bug and possibly a regression.

Does anyone know if this was a UI / functionality decision or it is a bug?

Best regards,
Ryosuke Niwa
Software Engineer
Google Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20101008/27ca021f/attachment.html>


More information about the webkit-dev mailing list