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

Issue 1269263003: The start and end arguments should be unsigned long in setSelectionRange() function

Created:
5 years, 4 months ago by tanay.c
Modified:
5 years, 4 months ago
Reviewers:
philipj_slow
CC:
Habib Virji
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

The start and end arguments should be unsigned long in setSelectionRange() function as per specs @ https://html.spec.whatwg.org/#the-textarea-element BUG=460722

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 #

Patch Set 4 : Rebase #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : Fixing tests #

Total comments: 4

Patch Set 8 : #

Patch Set 9 : #

Total comments: 7

Patch Set 10 : #

Patch Set 11 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -85 lines) Patch
M LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/forms/input-appearance-selection.html View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/forms/selection-functions-expected.txt View 1 2 3 4 5 6 7 1 chunk +8 lines, -8 lines 0 comments Download
M LayoutTests/fast/forms/selection-start-end-readonly.html View 1 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/forms/selection-start-end-readonly-expected.txt View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLInputElement.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLInputElement.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLInputElement.idl View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLTextAreaElement.idl View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -7 lines 0 comments Download
M Source/core/html/HTMLTextFormControlElement.h View 1 2 3 4 5 6 7 5 chunks +9 lines, -10 lines 0 comments Download
M Source/core/html/HTMLTextFormControlElement.cpp View 1 2 3 4 5 6 7 8 9 15 chunks +24 lines, -25 lines 0 comments Download
M Source/core/html/HTMLTextFormControlElementTest.cpp View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -7 lines 0 comments Download
M Source/modules/accessibility/AXLayoutObject.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M Source/modules/accessibility/AXObject.h View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -9 lines 0 comments Download
M Source/web/WebAXObject.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +0 lines, -4 lines 0 comments Download

Messages

Total messages: 13 (1 generated)
tanay.c
PTAL
5 years, 4 months ago (2015-08-05 13:00:55 UTC) #2
philipj_slow
The implementation still uses int, can you investigate the impact of making the change throughout? ...
5 years, 4 months ago (2015-08-05 14:04:46 UTC) #3
tanay.c
On 2015/08/05 14:04:46, philipj wrote: > The implementation still uses int, can you investigate the ...
5 years, 4 months ago (2015-08-07 05:56:53 UTC) #4
philipj_slow
On 2015/08/07 05:56:53, tanay.c wrote: > On 2015/08/05 14:04:46, philipj wrote: > > The implementation ...
5 years, 4 months ago (2015-08-10 12:22:31 UTC) #5
philipj_slow
More generally, just make sure that the behavior is exactly what the spec says and ...
5 years, 4 months ago (2015-08-10 12:23:17 UTC) #6
tanay.c
On 2015/08/10 12:23:17, philipj wrote: > More generally, just make sure that the behavior is ...
5 years, 4 months ago (2015-08-12 12:50:05 UTC) #7
philipj_slow
https://codereview.chromium.org/1269263003/diff/120001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (left): https://codereview.chromium.org/1269263003/diff/120001/Source/core/html/HTMLTextFormControlElement.cpp#oldcode354 Source/core/html/HTMLTextFormControlElement.cpp:354: const int editorValueLength = static_cast<int>(innerEditorValue().length()); Making this unsigned now ...
5 years, 4 months ago (2015-08-12 13:20:04 UTC) #8
tanay.c
Thanks for the comments. PTAL. https://codereview.chromium.org/1269263003/diff/120001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (left): https://codereview.chromium.org/1269263003/diff/120001/Source/core/html/HTMLTextFormControlElement.cpp#oldcode354 Source/core/html/HTMLTextFormControlElement.cpp:354: const int editorValueLength = ...
5 years, 4 months ago (2015-08-14 05:39:12 UTC) #9
philipj_slow
As this goes deeper, it becomes harder to see where there may be signed<->unsigned conversions. ...
5 years, 4 months ago (2015-08-14 07:45:53 UTC) #10
tanay.c
Thanks for the comments. However, on further analysis it looks like there will be some ...
5 years, 4 months ago (2015-08-17 12:06:32 UTC) #11
philipj_slow
On 2015/08/17 12:06:32, tanay.c wrote: > Thanks for the comments. However, on further analysis it ...
5 years, 4 months ago (2015-08-18 07:47:33 UTC) #12
tanay.c
5 years, 4 months ago (2015-08-20 05:58:27 UTC) #13
On 2015/08/18 07:47:33, philipj wrote:
> On 2015/08/17 12:06:32, tanay.c wrote:
> > Thanks for the comments. However, on further analysis it looks like there
will
> > be some changes which will effect both the chromium side and the blink side.
> > This is due to signature changes in the following functions:
> >
>
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit...
> > &
> >
>
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit...
> > 
> > Hence, we might need to do this change in 5 steps:
> > 1) Blink side with 2 functions 
> >           int afunc()
> >           unsigned afunc(bool unused_param)
> > 2) Chromium side changes with afunc(unused_param)
> > 3) Blink side changes 
> >           remove int afunc()
> >           add    unsigned afunc()
> > 4) Chromium side changes 
> >           use unsigned afunc()
> > 5) Blink side remove afunc(bool unsued_param)
> > 
> > Please let me know your comments.
> 
> Hmm, carrying this over to the Chromium side as well does not sound great.
> http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Integer_Types
> says to not use unsigned, so the more it can be limited the better I think.
> 
> Did you try the compiler warning trick to see how much else code is affected?
If
> there is no clean cut to be made, it's probably best to just leave it as
signed
> everywhere.

I have tried with another patch which seems to crash test cases related to
Position offset in the bots. 
Even if compiler warnings are eliminated, it does not guarantee that all
implicit conversions
are handled. 
Issue is under discussion @ https://github.com/w3c/selection-api/issues/33
Awaiting further inputs.

Powered by Google App Engine
This is Rietveld 408576698