W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > September 2010

[Bug 10583] toString does not represent what WebKit and Mozilla do, which is to return only the text within the selection that is visible to the user.

From: <bugzilla@jessica.w3.org>
Date: Thu, 09 Sep 2010 09:05:38 +0000
To: public-html-bugzilla@w3.org
Message-Id: <E1Otd4c-0004Wh-ST@jessica.w3.org>

Tim Down <timdown@gmail.com> changed:

           What    |Removed                     |Added
                 CC|                            |timdown@gmail.com

--- Comment #2 from Tim Down <timdown@gmail.com>  2010-09-09 09:05:38 ---
I submitted this bug. Consider the following example HTML with selection
delimited by pipes:

<div>|One<script>var x = 1;</script>two|</div>

Calling toString() on a Range representing that selection would produce
"Onevarx = 1;two", while calling toString() on the Selection object in both
Mozilla and WebKit will produce "Onetwo". The latter behaviour is contrary to
HTML5's specified behaviour, according to which it should return the same
string as the Range:

"Objects implementing this interface must stringify to a concatenation of the
results of invoking the toString()  method of the Range object on each of the
ranges of the selection, in the order they appear in the list (first to last)."

This section of the spec is too simplistic, since major browsers have
historically done something more subtle (i.e. returning a concatenation of only
the text that is visible to the user within each selection range).

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Thursday, 9 September 2010 09:05:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:01:24 UTC