This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 18337 - setRangeText() issues: Step 6, s/selection start/start/ s/selection end/end/. Step 8, "select" selectMode, s/selection end be end/selection end be start + the length of the value of the first argument/, similar issue in selectMode "end".
Summary: setRangeText() issues: Step 6, s/selection start/start/ s/selection end/end/....
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-19 22:36 UTC by contributor
Modified: 2012-09-26 18:11 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2012-07-19 22:36:02 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html
Multipage: http://www.whatwg.org/C#textFieldSelection
Complete: http://www.whatwg.org/c#textFieldSelection

Comment:
setRangeText() issues: Step 6, s/selection start/start/ s/selection end/end/.
Step 8, "select" selectMode, s/selection end be end/selection end be the
length of the value of the first argument/, similar issue in selectMode "end".

Posted from: 144.189.101.1
User agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; en) Presto/2.10.289 Version/12.00
Comment 1 Pablo Flouret 2012-07-19 23:39:09 UTC
Also, on step 5 of selectMode "preserve":

[[
Otherwise: if selection end is greater than start, then set it to end.
]]

Seems the final "end" should be "start + replacement.length()".

(Basically, it looks like "end" is generally confused to mean the end of the replacement string, instead of the end index of what's meant to be replaced.)
Comment 2 contributor 2012-09-26 18:08:16 UTC
Checked in as WHATWG revision r7409.
Check-in comment: Fix some errors in the algorithm.
http://html5.org/tools/web-apps-tracker?from=7408&to=7409
Comment 3 contributor 2012-09-26 18:11:06 UTC
Checked in as WHATWG revision r7410.
Check-in comment: Cleanup area of last checkin; ack for last checkin
http://html5.org/tools/web-apps-tracker?from=7409&to=7410