Bug 197686

Summary: iOS: Selection is dismissed even if click is preventDefault()'d
Product: WebKit Reporter: Tim Horton <thorton>
Component: New BugsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ews-watchlist, graouts, megan_gardner, simon.fraser, webkit-bot-watchers-bugzilla, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=249223
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews126 for ios-simulator-wk2
none
Patch
none
Archive of layout-test-results from ews215 for win-future
none
Archive of layout-test-results from ews122 for ios-simulator-wk2
none
Patch
none
Patch
none
Patch
none
Patch none

Description Tim Horton 2019-05-08 00:26:22 PDT
iOS: Selection is dismissed even if click is preventDefault()'d
Comment 1 Tim Horton 2019-05-08 00:26:54 PDT
Created attachment 369363 [details]
Patch
Comment 2 Tim Horton 2019-05-08 00:26:56 PDT
<rdar://problem/49398824>
Comment 3 EWS Watchlist 2019-05-08 02:25:25 PDT
Comment on attachment 369363 [details]
Patch

Attachment 369363 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/12131254

New failing tests:
editing/pasteboard/smart-paste-paragraph-003.html
editing/deleting/smart-delete-paragraph-003.html
Comment 4 EWS Watchlist 2019-05-08 02:25:27 PDT
Created attachment 369366 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.14.4
Comment 5 Tim Horton 2019-05-08 03:55:31 PDT
Created attachment 369371 [details]
Patch
Comment 6 EWS Watchlist 2019-05-08 04:49:55 PDT
Comment on attachment 369371 [details]
Patch

Attachment 369371 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/12132257

New failing tests:
svg/repaint/remove-border-property-on-root.html
Comment 7 EWS Watchlist 2019-05-08 04:49:57 PDT
Created attachment 369374 [details]
Archive of layout-test-results from ews215 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews215  Port: win-future  Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
Comment 8 EWS Watchlist 2019-05-08 05:54:23 PDT
Comment on attachment 369371 [details]
Patch

Attachment 369371 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/12132434

New failing tests:
editing/pasteboard/smart-paste-paragraph-003.html
editing/deleting/smart-delete-paragraph-003.html
Comment 9 EWS Watchlist 2019-05-08 05:54:24 PDT
Created attachment 369380 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.14.4
Comment 10 Tim Horton 2019-05-08 11:19:21 PDT
Created attachment 369397 [details]
Patch
Comment 11 Wenson Hsieh 2019-05-08 11:33:34 PDT
Comment on attachment 369397 [details]
Patch

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

> LayoutTests/editing/selection/ios/persist-selection-after-tapping-on-element-with-click-handler-expected.txt:3
> +This test verifies that the WebCore selection is not dismissed when tapping on an element that preventDefault()s the click event.

Nit - perhaps s/WebCore/DOM/?
Comment 12 Antoine Quint 2019-05-08 11:40:47 PDT
Comment on attachment 369397 [details]
Patch

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

> LayoutTests/editing/selection/ios/persist-selection-after-tapping-on-element-with-click-handler.html:38
> +        document.addEventListener("selectionchange", didChangeSelection);

Maybe use { once: true } here to avoid the cleanup?
Comment 13 Tim Horton 2019-05-08 11:43:41 PDT
Comment on attachment 369397 [details]
Patch

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

>> LayoutTests/editing/selection/ios/persist-selection-after-tapping-on-element-with-click-handler-expected.txt:3
>> +This test verifies that the WebCore selection is not dismissed when tapping on an element that preventDefault()s the click event.
> 
> Nit - perhaps s/WebCore/DOM/?

Sure

>> LayoutTests/editing/selection/ios/persist-selection-after-tapping-on-element-with-click-handler.html:38
>> +        document.addEventListener("selectionchange", didChangeSelection);
> 
> Maybe use { once: true } here to avoid the cleanup?

😲
Comment 14 Tim Horton 2019-05-08 11:48:06 PDT
(In reply to Tim Horton from comment #13)
> Comment on attachment 369397 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=369397&action=review
> 
> >> LayoutTests/editing/selection/ios/persist-selection-after-tapping-on-element-with-click-handler-expected.txt:3
> >> +This test verifies that the WebCore selection is not dismissed when tapping on an element that preventDefault()s the click event.
> > 
> > Nit - perhaps s/WebCore/DOM/?
> 
> Sure
> 
> >> LayoutTests/editing/selection/ios/persist-selection-after-tapping-on-element-with-click-handler.html:38
> >> +        document.addEventListener("selectionchange", didChangeSelection);
> > 
> > Maybe use { once: true } here to avoid the cleanup?
> 
> 😲

Wait, no.
Comment 15 Tim Horton 2019-05-08 11:49:55 PDT
Created attachment 369401 [details]
Patch
Comment 16 Tim Horton 2019-05-08 13:17:11 PDT
Created attachment 369412 [details]
Patch
Comment 17 Tim Horton 2019-05-08 13:29:52 PDT
Created attachment 369415 [details]
Patch
Comment 18 WebKit Commit Bot 2019-05-08 13:50:29 PDT
Comment on attachment 369415 [details]
Patch

Clearing flags on attachment: 369415

Committed r245067: <https://trac.webkit.org/changeset/245067>
Comment 19 WebKit Commit Bot 2019-05-08 13:50:30 PDT
All reviewed patches have been landed.  Closing bug.
Comment 20 Tim Horton 2019-05-08 16:09:29 PDT
My rebaselines might not quite have been right. Will try again
Comment 21 Ryan Haddad 2019-05-08 16:44:41 PDT
(In reply to Tim Horton from comment #20)
> My rebaselines might not quite have been right. Will try again
For posterity, this was the second attempt: https://trac.webkit.org/changeset/245077/webkit