Bug 116437 - Double clicking to select text range incorrectly selects across markup boundaries
Summary: Double clicking to select text range incorrectly selects across markup bounda...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.8
: P2 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-20 05:26 PDT by Matt Bradley
Modified: 2022-09-29 15:13 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Bradley 2013-05-20 05:26:53 PDT
I have observed this in definition lists. It may exhibit elsewhere:

Given the following markup:

<dl>
  <dt>Definition Label</dt>
  <dd>Text Content</dd>
</dl>

Double clicking the word "text" above, creates a selection range across the words "Label" and "Text", ignoring the </dt><dd> word boundary and the whitespace. Copying the selection into the paste buffer results in the "LabelText" being stored.

Triple clicking the word "text" results in the correct selection of the content between <dd> and </dd>, giving us a selection of "Text Content"

Putting a non-breaking space in to the markup forces the missing word boundary, eg:

<dl>
  <dt>Definition Label&nbsp;</dt>
  <dd>Text Content</dd>
</dl>

Double clicking "Text" now selects the word "Text" only, and this is all that will be copied into the paste buffer, but the selection range displayed on screen appears to take in everything from the &nbsp; to the end of the word "Text"
Comment 1 Hovis 2015-09-21 10:57:00 PDT
I have seen this behavior with dt, dd elements in Firefox 40.0.3 on Windows 7.

I suspect this is standards-compliant behavior.
Comment 2 Ahmad Saleem 2022-09-29 15:13:11 PDT
I am unable to reproduce this issue by converting the test case from Comment 0 into JSFiddle below and then double clicking on "Text" and it does not select "Label" word as mentioned in Comment 0 and this behavior is consistent with all browsers (Safari 16, Chrome Canary 108 and Firefox Nightly 107).

Link - https://jsfiddle.net/o8x6wvh4/show

If it is reproducible, please reopen and share updated details of how to reproduce step. Meanwhile I am marking this as "RESOLVED CONFIGURATION CHANGED". Thanks!