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

Issue 2701413003: Range: node offsets should be unsigned. (Closed)

Created:
3 years, 10 months ago by tkent
Modified:
3 years, 10 months ago
Reviewers:
yoichio, yosin_UTC9, Sunny
CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Range: node offsets should be unsigned. BUG=658716 Review-Url: https://codereview.chromium.org/2701413003 Cr-Commit-Position: refs/heads/master@{#451739} Committed: https://chromium.googlesource.com/chromium/src/+/f5558c7534d4d34c0848d692432e7f0a919eb247

Patch Set 1 : . #

Patch Set 2 : Resolve std::numeric_limits<int>::max() leftover #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+187 lines, -181 lines) Patch
M third_party/WebKit/LayoutTests/editing/selection/extend-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/text/selection-exceptions.html View 1 chunk +5 lines, -5 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/text/selection-exceptions-expected.txt View 1 chunk +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/dom/NodeWithIndex.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Range.h View 6 chunks +13 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Range.cpp View 1 16 chunks +44 lines, -37 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Range.idl View 1 2 chunks +6 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h View 6 chunks +11 lines, -11 lines 2 comments Download
M third_party/WebKit/Source/core/dom/RangeTest.cpp View 5 chunks +26 lines, -26 lines 0 comments Download
M third_party/WebKit/Source/core/dom/StaticRangeTest.cpp View 2 chunks +20 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp View 8 chunks +16 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/core/editing/iterators/CharacterIteratorTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/tests/TextFinderTest.cpp View 14 chunks +32 lines, -32 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 27 (17 generated)
tkent
yosin@, yoichio@, would you review this please?
3 years, 10 months ago (2017-02-21 06:43:58 UTC) #8
yosin_UTC9
lgtm Thanks!
3 years, 10 months ago (2017-02-21 06:55:04 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2701413003/40001
3 years, 10 months ago (2017-02-21 07:52:57 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2701413003/60001
3 years, 10 months ago (2017-02-21 08:16:24 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/122965)
3 years, 10 months ago (2017-02-21 10:50:05 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2701413003/60001
3 years, 10 months ago (2017-02-21 11:48:59 UTC) #20
commit-bot: I haz the power
Committed patchset #2 (id:60001) as https://chromium.googlesource.com/chromium/src/+/f5558c7534d4d34c0848d692432e7f0a919eb247
3 years, 10 months ago (2017-02-21 12:20:23 UTC) #23
Sunny
https://codereview.chromium.org/2701413003/diff/60001/third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h File third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h (right): https://codereview.chromium.org/2701413003/diff/60001/third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h#newcode73 third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h:73: static const unsigned invalidOffset = static_cast<unsigned>(-1); Hi tkent@, I've ...
3 years, 10 months ago (2017-02-21 12:32:05 UTC) #25
tkent
https://codereview.chromium.org/2701413003/diff/60001/third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h File third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h (right): https://codereview.chromium.org/2701413003/diff/60001/third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h#newcode73 third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h:73: static const unsigned invalidOffset = static_cast<unsigned>(-1); On 2017/02/21 at ...
3 years, 10 months ago (2017-02-22 02:08:43 UTC) #26
Sunny
3 years, 10 months ago (2017-02-22 02:45:46 UTC) #27
Message was sent while issue was closed.
On 2017/02/22 02:08:43, tkent wrote:
>
https://codereview.chromium.org/2701413003/diff/60001/third_party/WebKit/Sour...
> File third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h (right):
> 
>
https://codereview.chromium.org/2701413003/diff/60001/third_party/WebKit/Sour...
> third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h:73: static const
> unsigned invalidOffset = static_cast<unsigned>(-1);
> On 2017/02/21 at 12:32:05, Sunny wrote:
> > Hi tkent@, I've tried working on this issue before and have a question.
> > 
> > In this file do you think it's acceptable to cast -1 to unsigned as a
> indicator of invalid offset?
> > 
> > My solution is use a boolean as indicator:
>
https://codereview.chromium.org/2673303002/diff/20001/third_party/WebKit/Sour...
> 
> Adding a boolean flag is a more graceful way.
> However, static_cast<unsigned>(-1) as an invalid value is more efficient than
> the boolean flag in terms of memory consumption.
> With the static_cast<unsigned>(-1), we can't handle offset=4294967295
correctly.
>  But it's not a practical problem because Blink can't handle such large nodes
> anyway.

Ah. Got it, thanks for your guiding ~

Powered by Google App Engine
This is Rietveld 408576698