Bug 50609 - Selection ending in a non-editable span inside a editable div is rendered incorrectly
Summary: Selection ending in a non-editable span inside a editable div is rendered inc...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction, InRadar
Depends on:
Blocks:
 
Reported: 2010-12-06 18:35 PST by Mark Tsui
Modified: 2022-08-30 09:49 PDT (History)
9 users (show)

See Also:


Attachments
Test case (284 bytes, text/html)
2010-12-06 19:29 PST, Mark Tsui
no flags Details
reduction (504 bytes, text/html)
2011-09-19 13:39 PDT, Ryosuke Niwa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Tsui 2010-12-06 18:35:13 PST
What steps will reproduce the problem?
1. Open up the attached file.
2. Place cursor in the text "start selection here"
3. Press shift+right to expand selection to the right until it reaches 
"glitch"
4. Notice that as the selection expands, before selecting the "g" the 
entire contenteditable region becomes visibly selected.

What is the expected result?
The selection should expand and include the previous selection + "g" 
character 

What happens instead?
The entire contenteditable appears selected.

Please provide any additional information below. Attach a screenshot if
possible.

In other browsers, it takes two shift+right to move across the nested 
spans.

Additional notes- the selection is rendered over the entire region, but if the selection is programmatically queries in JS returns the correct result.
Comment 1 Mark Tsui 2010-12-06 19:29:35 PST
Created attachment 75773 [details]
Test case
Comment 2 Ryosuke Niwa 2011-09-19 13:39:17 PDT
Created attachment 107912 [details]
reduction
Comment 3 Ryosuke Niwa 2011-09-19 13:40:20 PDT
Confirmed on ToT WebKit.
Comment 4 Ahmad Saleem 2022-08-30 05:00:44 PDT
All browser differ:

If I place my cursor after "here"(|) [before space] and do Shift+Right Arrow:

> STP 152 takes two Shift+Right before selecting "G" from glitch
> Chrome Canary 107 takes five Shift+Right before selecting "G" from glitch
> Firefox Nightly 106 takes four Shift+Right before selecting "G" from glitch

______

I am not sure on web-spec and which behavior is ideal but just want to share updated testing results. Thanks!
Comment 5 Radar WebKit Bug Importer 2022-08-30 09:49:35 PDT
<rdar://problem/99335798>