NEW 199211
Selection highlight not shown on programmatic focus after initial load
https://bugs.webkit.org/show_bug.cgi?id=199211
Summary Selection highlight not shown on programmatic focus after initial load
Daniel Bates
Reported 2019-06-25 16:38:34 PDT
Steps to reproduce: Visit <data:text/html,<p>Hello World</p><script>let p = document.querySelector("p"); window.getSelection().setBaseAndExtent(p.firstChild, 0, p.firstChild, 2)</script>>
Attachments
First stab (3.68 KB, patch)
2019-06-25 16:39 PDT, Daniel Bates
ews-watchlist: commit-queue-
Archive of layout-test-results from ews121 for ios-simulator-wk2 (3.80 MB, application/zip)
2019-06-25 18:39 PDT, EWS Watchlist
no flags
Simpler fix, let's see what happens (3.65 KB, patch)
2019-06-26 11:51 PDT, Daniel Bates
ews-watchlist: commit-queue-
Archive of layout-test-results from ews126 for ios-simulator-wk2 (4.25 MB, application/zip)
2019-06-26 13:36 PDT, EWS Watchlist
no flags
Daniel Bates
Comment 1 2019-06-25 16:39:24 PDT
Created attachment 372874 [details] First stab
EWS Watchlist
Comment 2 2019-06-25 18:39:46 PDT
Comment on attachment 372874 [details] First stab Attachment 372874 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/12575966 New failing tests: editing/selection/selection-across-shadow-boundaries-readonly-2.html imported/mozilla/svg/text/selectSubString-3.svg fast/flexbox/flexbox-fail-to-select-same-line.html editing/selection/update-selection-by-style-change.html fast/text/international/hebrew-selection.html fast/dynamic/selection-gets-cleared-when-part-of-it-gets-removed.html svg/masking/mask-should-not-paint-selection.html imported/blink/editing/selection/deleteFromDocument-crash.html imported/mozilla/svg/text/multiple-chunks-selection.svg fast/dynamic/remove-invisible-node-inside-selection.html imported/mozilla/svg/text/selectSubString.svg fast/dynamic/remove-node-inside-selection.html
EWS Watchlist
Comment 3 2019-06-25 18:39:48 PDT
Created attachment 372890 [details] Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.14.5
Daniel Bates
Comment 4 2019-06-26 10:49:07 PDT
(In reply to Build Bot from comment #2) > Comment on attachment 372874 [details] > First stab > > Attachment 372874 [details] did not pass ios-sim-ews (ios-simulator-wk2): > Output: https://webkit-queues.webkit.org/results/12575966 > > New failing tests: > editing/selection/selection-across-shadow-boundaries-readonly-2.html > imported/mozilla/svg/text/selectSubString-3.svg > fast/flexbox/flexbox-fail-to-select-same-line.html > editing/selection/update-selection-by-style-change.html > fast/text/international/hebrew-selection.html > fast/dynamic/selection-gets-cleared-when-part-of-it-gets-removed.html > svg/masking/mask-should-not-paint-selection.html > imported/blink/editing/selection/deleteFromDocument-crash.html > imported/mozilla/svg/text/multiple-chunks-selection.svg > fast/dynamic/remove-invisible-node-inside-selection.html > imported/mozilla/svg/text/selectSubString.svg > fast/dynamic/remove-node-inside-selection.html These "failures" reveal various bugs in our code! Only one of the failures may indicate the patch is not quite right: svg/masking/mask-should-not-paint-selection.html, but quick glance at this test makes me think the mechanism to prevent selection is not enabled on iOS and the only reason we've been passing this test is because we do not paint selection on first load. ^^^ that last part is the reason for other failures in this list like fast/text/international/hebrew-selection.html. That is, we've been passing this test because both sides of the comparison have been broken. I fixed the -expected.html side, which uses programmatic selection API. The non-expected side used window.eventSender, which is known to be broken in WebKit2 on iOS. Haha
Daniel Bates
Comment 5 2019-06-26 10:49:30 PDT
Forgot to mention, other failure indicate a timing difference when we snapshot.
Daniel Bates
Comment 6 2019-06-26 11:51:41 PDT
Created attachment 372939 [details] Simpler fix, let's see what happens
EWS Watchlist
Comment 7 2019-06-26 13:36:49 PDT
Comment on attachment 372939 [details] Simpler fix, let's see what happens Attachment 372939 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/12582947 New failing tests: editing/selection/selection-across-shadow-boundaries-readonly-2.html editing/selection/selection-across-shadow-boundaries-readonly-3.html imported/mozilla/svg/text/selectSubString-3.svg fast/flexbox/flexbox-fail-to-select-same-line.html fast/text/international/hebrew-selection.html editing/selection/update-selection-by-style-change.html editing/selection/selection-across-shadow-boundaries-readonly-1.html fast/dynamic/selection-gets-cleared-when-part-of-it-gets-removed.html imported/blink/fast/text/international/repaint-glyph-bounds.html svg/masking/mask-should-not-paint-selection.html imported/mozilla/svg/text/multiple-chunks-selection.svg imported/blink/editing/style/justify-left-crash.html fast/dynamic/remove-invisible-node-inside-selection.html imported/mozilla/svg/text/selectSubString.svg svg/foreignObject/viewport-foreignobject-crash.html fast/dynamic/remove-node-inside-selection.html
EWS Watchlist
Comment 8 2019-06-26 13:36:51 PDT
Created attachment 372945 [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.5
Radar WebKit Bug Importer
Comment 9 2019-06-26 16:29:23 PDT
Ahmad Saleem
Comment 10 2023-05-11 14:29:52 PDT
Using Comment 0: Chrome Canary 115: 'He'llo World <--- He is selected. Safari 16.4: 'He'llo World <--- He is selected. WebKit ToT (Mini-Browser): 'He'llo World <--- He is selected. Firefox Nightly 115: 'He'llo World <--- He is selected. __________ All browsers are matching.. The platform mention is iOS / iPadOS. Is it for it or due to Selection API, it now works? CCing - Ryosuke.
Ryosuke Niwa
Comment 11 2023-05-12 15:27:27 PDT
The issue still reproduces on iOS 16.4.1 (a)
Note You need to log in before you can comment on or make changes to this bug.