Bug 181715 - input and textarea elements should reveal selection in setSelection when focused
Summary: input and textarea elements should reveal selection in setSelection when focused
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-01-16 21:04 PST by Ryosuke Niwa
Modified: 2018-01-23 23:24 PST (History)
9 users (show)

See Also:


Attachments
Cleanup (15.22 KB, patch)
2018-01-16 21:40 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 2018-01-16 21:04:09 PST
Right now, input and textarea elements manually invokes FrameSelection::revealSelection.
Use FrameSelection::setSelection to reveal selection instead.
Comment 1 Radar WebKit Bug Importer 2018-01-16 21:04:58 PST
<rdar://problem/36570546>
Comment 2 Ryosuke Niwa 2018-01-16 21:40:30 PST
Created attachment 331465 [details]
Cleanup
Comment 3 Ryosuke Niwa 2018-01-16 22:13:53 PST
Thanks for the review. Waiting for EWS first.
Comment 4 Simon Fraser (smfr) 2018-01-17 09:32:49 PST
Comment on attachment 331465 [details]
Cleanup

Is there any behavior change here?
Comment 5 Ryosuke Niwa 2018-01-17 14:55:13 PST
(In reply to Simon Fraser (smfr) from comment #4)
> Comment on attachment 331465 [details]
> Cleanup
> 
> Is there any behavior change here?

I don't think there is any.
Comment 6 WebKit Commit Bot 2018-01-17 15:19:50 PST
Comment on attachment 331465 [details]
Cleanup

Clearing flags on attachment: 331465

Committed r227092: <https://trac.webkit.org/changeset/227092>
Comment 7 WebKit Commit Bot 2018-01-17 15:19:51 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Claudio Saavedra 2018-01-19 08:06:21 PST
(In reply to Ryosuke Niwa from comment #5)
> (In reply to Simon Fraser (smfr) from comment #4)
> > Comment on attachment 331465 [details]
> > Cleanup
> > 
> > Is there any behavior change here?
> 
> I don't think there is any.

This broke two tests in wkgtk, but I haven't had time to investigate yet.

http://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=fast%2Fforms%2Ftextarea-scrolled-type.html%20fast%2Fforms%2Ffocus-selection-textarea.html
Comment 9 Claudio Saavedra 2018-01-19 08:17:04 PST
Also this one:

editing/input/reveal-edit-on-paste-vertically.html
Comment 10 Claudio Saavedra 2018-01-19 08:47:24 PST
https://build.webkit.org/results/GTK%20Linux%2064-bit%20Release%20(Tests)/r227193%20(5131)/editing/input/reveal-edit-on-paste-vertically-pretty-diff.html

-ScrollVertically: PASS
+ScrollVertically: FAIL
+viewportMiddle: 300, offsetOfInput: 9


https://build.webkit.org/results/GTK%20Linux%2064-bit%20Release%20(Tests)/r227193%20(5131)/fast/forms/focus-selection-textarea-pretty-diff.html

Diff a bit long, but this should give a clue:

-PASS fourth.selectionStart is 0
-PASS fourth.selectionEnd is 0
+FAIL fourth.selectionStart should be 0. Was 11.
+FAIL fourth.selectionEnd should be 0. Was 18.

The third one might be related, but it could as well just be that an updated expectation for gtk+ is needed. Hope the above is useful!
Comment 11 Ryosuke Niwa 2018-01-19 14:11:53 PST
You might need to wait until the scrolling happens because the scrolling is now happens after the layout asynchronously.
Comment 12 Claudio Saavedra 2018-01-22 05:00:59 PST
(In reply to Ryosuke Niwa from comment #11)
> You might need to wait until the scrolling happens because the scrolling is
> now happens after the layout asynchronously.

Where do you mean? In the EventSenderProxy?
Comment 13 Ryosuke Niwa 2018-01-22 12:04:07 PST
(In reply to Claudio Saavedra from comment #12)
> (In reply to Ryosuke Niwa from comment #11)
> > You might need to wait until the scrolling happens because the scrolling is
> > now happens after the layout asynchronously.
> 
> Where do you mean? In the EventSenderProxy?

In those tests.