iserttext command interop differences

Hi All,

I have created an issue<https://github.com/w3c/editing/issues/112> #112 on github to track this question. This email is for visibility.

I have a question about space canonicalization that happens in the browser when an user inserts or removes text or when it is done through execCommand('inserttext',...). Spec is here<https://w3c.github.io/editing/execCommand.html#canonical-space-sequences> - section 9.7.

I've been investigating what happens in Chrome when we have a situation with multiple spaces in the string: '  foo  bar  '.

It seems that there is a bug in Chrome. I was not able to investigate what happens in Firefox as I couldn't see insertion of &nbsp in Firefox console. Not sure if Firefox is inserting it but it is not displayed in the console or like Edge, they are not doing it.

Chrome folks: this looks like a bug

Here is the sample: https://jsfiddle.net/mwvywtze/ .

Expected output:

some text &nbsp;foo &nbsp;bar &nbsp;

Actual output:

some text &nbsp;foo  bar &nbsp;

P.S. There are currently minor differences between the spec and Chrome's implementation but we can have a separate discussion on whether the definition in the spec should stay or be updated.

Thanks,

--grisha

Received on Tuesday, 26 January 2016 19:21:40 UTC