Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Issue 222023002: focus() behaviour differs depending on how value is set (Closed)

Created:
6 years, 8 months ago by harpreet.sk
Modified:
6 years, 8 months ago
Reviewers:
tkent, keishi
CC:
blink-reviews, sof, eae+blinkwatch, dglazkov+blink, adamk+blink_chromium.org, Inactive, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

input.focus() should not change selection. The api focus() shows different behaviour depending on how the value is set. If the value is set using the html "value" attribute and focus() is called then text get selected whereas if value is set using javascript value IDL attribute and then focus() is called caret appear at end of text in the field. All other browser shows same behaviour for both cases by displaying caret in input field. This patch removes this bug by initializing m_cachedSelection{Start,End} with 0. This way for HTML value attribute case the caret will be displayed at the start of input field. Since m_cachedSelection{Start,End} has been initialize with 0 so hasCachedSelection() api will always return true and hence is removed. BUG=133242 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171347

Patch Set 1 #

Patch Set 2 : Fixing selection handling of 'value' HTML attribute by initializing m_cachedSelection{Start,End} wi… #

Total comments: 8

Patch Set 3 : Addressing the changes mention in comments in Patch set 2 #

Total comments: 2

Patch Set 4 : Removing comment and rebasing #

Patch Set 5 : Adding fix for LayoutTest that are failing #

Total comments: 13

Patch Set 6 : Addressing changes from comments of patch set 5 #

Patch Set 7 : Rebasing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -17 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 1 chunk +11 lines, -0 lines 0 comments Download
M LayoutTests/editing/pasteboard/copy-in-password-field.html View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M LayoutTests/editing/pasteboard/copy-in-password-field-expected.txt View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M LayoutTests/editing/pasteboard/drop-inputtext-acquires-style.html View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/editing/pasteboard/input-with-display-none-div.html View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/editing/pasteboard/input-with-visibility-hidden.html View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/editing/pasteboard/paste-plaintext-user-select-none.html View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/forms/input-double-click-selection-gap-bug.html View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLInputElement.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLTextAreaElement.cpp View 1 2 3 1 chunk +2 lines, -5 lines 0 comments Download
M Source/core/html/HTMLTextFormControlElement.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLTextFormControlElement.cpp View 1 2 5 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 51 (0 generated)
harpreet.sk
Please take a look
6 years, 8 months ago (2014-04-02 11:03:09 UTC) #1
tkent
Are you sure other browsers set caret on focus, not on updating value?
6 years, 8 months ago (2014-04-03 05:00:40 UTC) #2
harpreet.sk
On 2014/04/03 05:00:40, tkent wrote: > Are you sure other browsers set caret on focus, ...
6 years, 8 months ago (2014-04-03 05:33:25 UTC) #3
tkent
> > Are you sure other browsers set caret on focus, not on updating value? ...
6 years, 8 months ago (2014-04-03 06:01:00 UTC) #4
harpreet.sk
On 2014/04/03 06:01:00, tkent wrote: > > > Are you sure other browsers set caret ...
6 years, 8 months ago (2014-04-03 06:21:11 UTC) #5
tkent
On 2014/04/03 06:21:11, harpreet.sk wrote: > Yes with my patch it's working fine. It will ...
6 years, 8 months ago (2014-04-03 06:27:25 UTC) #6
harpreet.sk
On 2014/04/03 06:27:25, tkent wrote: > On 2014/04/03 06:21:11, harpreet.sk wrote: > > Yes with ...
6 years, 8 months ago (2014-04-03 08:58:22 UTC) #7
harpreet.sk
The previous comment does not come correctly so putting it again. I have check the ...
6 years, 8 months ago (2014-04-03 09:07:02 UTC) #8
tkent
Your patch is not compatible with Firefox. IMO, we should not change selection at all ...
6 years, 8 months ago (2014-04-03 09:07:43 UTC) #9
harpreet.sk
On 2014/04/03 09:07:43, tkent wrote: > Your patch is not compatible with Firefox. IMO, we ...
6 years, 8 months ago (2014-04-03 09:59:23 UTC) #10
tkent
On 2014/04/03 09:59:23, harpreet.sk wrote: > Earlier i thought that since according to spec the ...
6 years, 8 months ago (2014-04-04 01:09:31 UTC) #11
harpreet.sk
On 2014/04/04 01:09:31, tkent wrote: > On 2014/04/03 09:59:23, harpreet.sk wrote: > > Earlier i ...
6 years, 8 months ago (2014-04-04 03:03:12 UTC) #12
tkent
On 2014/04/04 03:03:12, harpreet.sk wrote: > Actually i misread a little. Actually it was mention ...
6 years, 8 months ago (2014-04-04 03:17:22 UTC) #13
harpreet.sk
On 2014/04/04 03:17:22, tkent wrote: > Thanks. This part mentions setting 'value' IDL attribute. It ...
6 years, 8 months ago (2014-04-04 03:57:20 UTC) #14
tkent
On 2014/04/04 03:57:20, harpreet.sk wrote: > Although i agree with you but this will not ...
6 years, 8 months ago (2014-04-04 05:16:37 UTC) #15
harpreet.sk
On 2014/04/04 05:16:37, tkent wrote: > The resultant selection difference exists in IE and Firefox ...
6 years, 8 months ago (2014-04-04 05:34:40 UTC) #16
harpreet.sk
As per the bug 133242, IE and FireFox are showing the same behavior that is ...
6 years, 8 months ago (2014-04-07 07:26:10 UTC) #17
tkent
On 2014/04/07 07:26:10, harpreet.sk wrote: > As per the bug 133242, IE and FireFox are ...
6 years, 8 months ago (2014-04-08 05:57:46 UTC) #18
tkent
IMO, a codereview should discuss about the code change. We had better discuss the expected ...
6 years, 8 months ago (2014-04-08 05:59:46 UTC) #19
harpreet.sk
On 2014/04/08 05:57:46, tkent wrote: > In both cases, the behavior of IE and Firefox ...
6 years, 8 months ago (2014-04-08 15:33:58 UTC) #20
tkent
https://codereview.chromium.org/222023002/diff/20001/LayoutTests/TestExpectations File LayoutTests/TestExpectations (right): https://codereview.chromium.org/222023002/diff/20001/LayoutTests/TestExpectations#newcode964 LayoutTests/TestExpectations:964: crbug.com/133242 [ Android Lion Mac SnowLeopard Win ] fast/forms/input-double-click-selection-gap-bug.html ...
6 years, 8 months ago (2014-04-09 00:16:47 UTC) #21
tkent
Please update the CL description.
6 years, 8 months ago (2014-04-09 00:18:17 UTC) #22
harpreet.sk
Patch set 3 is uploaded with changes asked in comments in patch set 2 and ...
6 years, 8 months ago (2014-04-09 14:19:42 UTC) #23
tkent
lgtm. Please rebase. https://codereview.chromium.org/222023002/diff/40001/Source/core/html/HTMLTextAreaElement.cpp File Source/core/html/HTMLTextAreaElement.cpp (right): https://codereview.chromium.org/222023002/diff/40001/Source/core/html/HTMLTextAreaElement.cpp#newcode244 Source/core/html/HTMLTextAreaElement.cpp:244: // If this is the first ...
6 years, 8 months ago (2014-04-10 01:37:38 UTC) #24
harpreet.sk
Patch set 4 uploaded with comment removed and with rebase. https://codereview.chromium.org/222023002/diff/40001/Source/core/html/HTMLTextAreaElement.cpp File Source/core/html/HTMLTextAreaElement.cpp (right): https://codereview.chromium.org/222023002/diff/40001/Source/core/html/HTMLTextAreaElement.cpp#newcode244 ...
6 years, 8 months ago (2014-04-10 06:13:27 UTC) #25
harpreet.sk
The CQ bit was checked by harpreet.sk@samsung.com
6 years, 8 months ago (2014-04-10 06:20:58 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/harpreet.sk@samsung.com/222023002/60001
6 years, 8 months ago (2014-04-10 06:21:07 UTC) #27
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-10 06:51:40 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_rel
6 years, 8 months ago (2014-04-10 06:51:41 UTC) #29
tkent
not lgtm. Many tests are failing and we need to re-review.
6 years, 8 months ago (2014-04-10 09:07:05 UTC) #30
harpreet.sk
New patch is uploaded fixing LayoutTest that were getting failed. Please have a look.
6 years, 8 months ago (2014-04-10 13:01:02 UTC) #31
harpreet.sk
Try bots runs fine for patch set 5 and no more LayoutTests are failing. Please ...
6 years, 8 months ago (2014-04-11 05:02:25 UTC) #32
tkent
https://codereview.chromium.org/222023002/diff/80001/LayoutTests/TestExpectations File LayoutTests/TestExpectations (right): https://codereview.chromium.org/222023002/diff/80001/LayoutTests/TestExpectations#newcode1077 LayoutTests/TestExpectations:1077: I recommend to add new entries not to the ...
6 years, 8 months ago (2014-04-11 06:27:17 UTC) #33
harpreet.sk
Patch set 6 addresses the change asked in comments in patch set 5 https://codereview.chromium.org/222023002/diff/80001/LayoutTests/TestExpectations File ...
6 years, 8 months ago (2014-04-11 07:33:01 UTC) #34
tkent
https://codereview.chromium.org/222023002/diff/80001/LayoutTests/editing/pasteboard/input-with-display-none-div.html File LayoutTests/editing/pasteboard/input-with-display-none-div.html (right): https://codereview.chromium.org/222023002/diff/80001/LayoutTests/editing/pasteboard/input-with-display-none-div.html#newcode18 LayoutTests/editing/pasteboard/input-with-display-none-div.html:18: input.select(); On 2014/04/11 07:33:02, harpreet.sk wrote: > On 2014/04/11 ...
6 years, 8 months ago (2014-04-11 07:40:19 UTC) #35
tkent
6 years, 8 months ago (2014-04-11 07:40:22 UTC) #36
harpreet.sk
https://codereview.chromium.org/222023002/diff/80001/LayoutTests/editing/pasteboard/input-with-display-none-div.html File LayoutTests/editing/pasteboard/input-with-display-none-div.html (right): https://codereview.chromium.org/222023002/diff/80001/LayoutTests/editing/pasteboard/input-with-display-none-div.html#newcode18 LayoutTests/editing/pasteboard/input-with-display-none-div.html:18: input.select(); On 2014/04/11 07:40:20, tkent wrote: > On 2014/04/11 ...
6 years, 8 months ago (2014-04-11 08:09:13 UTC) #37
tkent
https://codereview.chromium.org/222023002/diff/80001/LayoutTests/editing/pasteboard/input-with-display-none-div.html File LayoutTests/editing/pasteboard/input-with-display-none-div.html (right): https://codereview.chromium.org/222023002/diff/80001/LayoutTests/editing/pasteboard/input-with-display-none-div.html#newcode18 LayoutTests/editing/pasteboard/input-with-display-none-div.html:18: input.select(); On 2014/04/11 08:09:14, harpreet.sk wrote: > On 2014/04/11 ...
6 years, 8 months ago (2014-04-11 08:19:40 UTC) #38
harpreet.sk
On 2014/04/11 08:19:40, tkent wrote: > https://codereview.chromium.org/222023002/diff/80001/LayoutTests/editing/pasteboard/input-with-display-none-div.html > File LayoutTests/editing/pasteboard/input-with-display-none-div.html (right): > > https://codereview.chromium.org/222023002/diff/80001/LayoutTests/editing/pasteboard/input-with-display-none-div.html#newcode18 > ...
6 years, 8 months ago (2014-04-11 08:26:22 UTC) #39
harpreet.sk
https://codereview.chromium.org/222023002/diff/80001/LayoutTests/editing/pasteboard/input-with-display-none-div.html File LayoutTests/editing/pasteboard/input-with-display-none-div.html (right): https://codereview.chromium.org/222023002/diff/80001/LayoutTests/editing/pasteboard/input-with-display-none-div.html#newcode18 LayoutTests/editing/pasteboard/input-with-display-none-div.html:18: input.select(); On 2014/04/11 08:19:41, tkent wrote: > > I'm ...
6 years, 8 months ago (2014-04-11 08:37:55 UTC) #40
tkent
lgtm https://codereview.chromium.org/222023002/diff/80001/LayoutTests/editing/pasteboard/input-with-display-none-div.html File LayoutTests/editing/pasteboard/input-with-display-none-div.html (right): https://codereview.chromium.org/222023002/diff/80001/LayoutTests/editing/pasteboard/input-with-display-none-div.html#newcode18 LayoutTests/editing/pasteboard/input-with-display-none-div.html:18: input.select(); On 2014/04/11 08:37:56, harpreet.sk wrote: > On ...
6 years, 8 months ago (2014-04-11 08:42:14 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/harpreet.sk@samsung.com/222023002/100001
6 years, 8 months ago (2014-04-11 08:42:20 UTC) #42
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-11 08:42:32 UTC) #43
commit-bot: I haz the power
Failed to apply patch for LayoutTests/TestExpectations: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 8 months ago (2014-04-11 08:42:33 UTC) #44
harpreet.sk
The CQ bit was checked by harpreet.sk@samsung.com
6 years, 8 months ago (2014-04-11 09:03:27 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/harpreet.sk@samsung.com/222023002/120001
6 years, 8 months ago (2014-04-11 09:03:34 UTC) #46
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-11 09:34:23 UTC) #47
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on mac_blink_rel
6 years, 8 months ago (2014-04-11 09:34:24 UTC) #48
harpreet.sk
The CQ bit was checked by harpreet.sk@samsung.com
6 years, 8 months ago (2014-04-11 13:11:35 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/harpreet.sk@samsung.com/222023002/120001
6 years, 8 months ago (2014-04-11 13:11:41 UTC) #50
commit-bot: I haz the power
6 years, 8 months ago (2014-04-11 14:15:32 UTC) #51
Message was sent while issue was closed.
Change committed as 171347

Powered by Google App Engine
This is Rietveld 408576698