Bug 128804 - setSelectionRange shouldn't trigger a synchronous layout to check focusability when text field is already focused
Summary: setSelectionRange shouldn't trigger a synchronous layout to check focusabilit...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 127832
  Show dependency treegraph
 
Reported: 2014-02-14 01:02 PST by Ryosuke Niwa
Modified: 2014-02-14 20:48 PST (History)
7 users (show)

See Also:


Attachments
Fixes the bug (5.55 KB, patch)
2014-02-14 02:37 PST, Ryosuke Niwa
enrica: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2014-02-14 01:02:31 PST
HTMLTextFormControl::setSelectionRange doesn't need to trigger a synchronous layout
if the text field is already focused since we don't need to call hasVisibleTextArea in that case,
which depends on the dimension of RenderBox.
Comment 1 Ryosuke Niwa 2014-02-14 01:04:03 PST
We can get rid of synchronous layout completely once we fix webkit.org/b/38696 as I've outlined in
https://lists.webkit.org/pipermail/webkit-dev/2014-February/026235.html

but we can fix this one first in order to resolve the bug 128797 since we don't call setSelectionRange in setValue when the text field is not focused.
Comment 2 Ryosuke Niwa 2014-02-14 02:37:05 PST
Created attachment 224186 [details]
Fixes the bug
Comment 3 WebKit Commit Bot 2014-02-14 02:38:14 PST
Attachment 224186 [details] did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:19:  Line contains tab character.  [whitespace/tab] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Ryosuke Niwa 2014-02-14 12:55:05 PST
Comment on attachment 224186 [details]
Fixes the bug

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

> Source/WebCore/ChangeLog:19
> +	already. Also pass in DoNotSetFocus option to setSelection since we already have the focus in that case.

Odd. I thought I removed this tab character before uploading it :/
Comment 5 Enrica Casucci 2014-02-14 14:29:48 PST
Comment on attachment 224186 [details]
Fixes the bug

Looks good.
Comment 6 Ryosuke Niwa 2014-02-14 20:48:12 PST
Committed r164156: <http://trac.webkit.org/changeset/164156>