Bug 221942 - EventHandler::updateSelectionForMouseDownDispatchingSelectStart should not use an orphaned selection
Summary: EventHandler::updateSelectionForMouseDownDispatchingSelectStart should not us...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-15 17:53 PST by Ryosuke Niwa
Modified: 2021-02-19 20:21 PST (History)
8 users (show)

See Also:


Attachments
Patch (15.64 KB, patch)
2021-02-15 18:28 PST, Ryosuke Niwa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Fixed release builds (15.85 KB, patch)
2021-02-15 19:01 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Patch for landing (15.95 KB, patch)
2021-02-15 20:04 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2021-02-15 17:53:56 PST
Fix what appears to be the root/primary cause of the bug 221786 and add a test.
Comment 1 Ryosuke Niwa 2021-02-15 18:28:36 PST
Created attachment 420410 [details]
Patch
Comment 2 Ryosuke Niwa 2021-02-15 19:01:14 PST
Created attachment 420414 [details]
Fixed release builds
Comment 3 Wenson Hsieh 2021-02-15 19:07:29 PST
Comment on attachment 420414 [details]
Fixed release builds

View in context: https://bugs.webkit.org/attachment.cgi?id=420414&action=review

r=me (assuming EWS is green)

> LayoutTests/editing/selection/click-selection-with-selectstart-node-removal.html:32
> +    const boundingRect = editor.getBoundingClientRect();
> +    const x = boundingRect.x + 10;
> +    const y = boundingRect.y + 10;
> +    UIHelper.activateAndWaitForInputSessionAt(x, y);

Nit - can we just `UIHelper.activateElement(editor);` here?
Comment 4 Ryosuke Niwa 2021-02-15 19:14:44 PST
(In reply to Wenson Hsieh from comment #3)
> Comment on attachment 420414 [details]
> Fixed release builds
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=420414&action=review
> 
> r=me (assuming EWS is green)
> 
> > LayoutTests/editing/selection/click-selection-with-selectstart-node-removal.html:32
> > +    const boundingRect = editor.getBoundingClientRect();
> > +    const x = boundingRect.x + 10;
> > +    const y = boundingRect.y + 10;
> > +    UIHelper.activateAndWaitForInputSessionAt(x, y);
> 
> Nit - can we just `UIHelper.activateElement(editor);` here?

Hm... maybe? Does WebKitTestRunner knows to gracefully dismiss the keyword if it starts coming up?
Comment 5 Wenson Hsieh 2021-02-15 19:17:16 PST
(In reply to Ryosuke Niwa from comment #4)
> (In reply to Wenson Hsieh from comment #3)
> > Comment on attachment 420414 [details]
> > Fixed release builds
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=420414&action=review
> > 
> > r=me (assuming EWS is green)
> > 
> > > LayoutTests/editing/selection/click-selection-with-selectstart-node-removal.html:32
> > > +    const boundingRect = editor.getBoundingClientRect();
> > > +    const x = boundingRect.x + 10;
> > > +    const y = boundingRect.y + 10;
> > > +    UIHelper.activateAndWaitForInputSessionAt(x, y);
> > 
> > Nit - can we just `UIHelper.activateElement(editor);` here?
> 
> Hm... maybe? Does WebKitTestRunner knows to gracefully dismiss the keyword
> if it starts coming up?

It should, yes. Though to be totally safe, you can do something like:

    await UIHelper.activateElementAndWaitForInputSession(editor);

...instead.
Comment 6 Ryosuke Niwa 2021-02-15 20:04:07 PST
Created attachment 420420 [details]
Patch for landing
Comment 7 Ryosuke Niwa 2021-02-15 20:04:22 PST
Comment on attachment 420420 [details]
Patch for landing

Wait for EWS
Comment 8 Ryosuke Niwa 2021-02-16 14:05:11 PST
Comment on attachment 420420 [details]
Patch for landing

Clearing flags on attachment: 420420

Committed r272928: <https://commits.webkit.org/r272928>
Comment 9 Ryosuke Niwa 2021-02-16 14:05:13 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2021-02-16 14:07:29 PST
<rdar://problem/74405933>