W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2011

[whatwg] More HTML Editing Commands questions

From: Tim Down <timdown@gmail.com>
Date: Mon, 16 May 2011 11:59:23 +0100
Message-ID: <BANLkTimT7wz1zkNszA2=PTK6RSB5MdZQnA@mail.gmail.com>
I have a couple of general questions about the HTML Editing Commands spec:

1) Will there be any provision for special handling of whitespace text
nodes? I notice that WebKit leaves them alone. For example, running
document.execCommand("bold", false, null) for the following HTML with
selection boundaries denoted by pipes:

<p>|One</p>
<p>Two|</p>

... in Chrome 10 you get

<p>|<b>One</b></p>
<p><b>Two|<b></p>

The whitespace between the <p> elements has been ignored. This also
leads to a bug, since it seems the check for whether the selection
content is already completely bold does take into account the
whitespace node and rerunning the command now has no effect. Opera
surrounds the whitespace node within a styling element, while Firefox
seems to have some voodoo magic to decide whether or not to surround a
whitespace node. In the simple case above, it leaves it alone so long
as I haven't previously manipulated the DOM manually with my own
script.

2) Will the spec specify what happens when executing commands on an
insertion point/caret?

Tim
Received on Monday, 16 May 2011 03:59:23 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:33 UTC