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

Issue 2710593002: Selection API: collapse(), setBaseAndExtent(), and extend() don't need to have code to check negati… (Closed)

Created:
3 years, 10 months ago by tkent
Modified:
3 years, 10 months ago
Reviewers:
yoichio, yosin_UTC9
CC:
blink-reviews, blink-reviews-w3ctests_chromium.org, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Selection API: collapse(), setBaseAndExtent(), and extend() don't need to have code to check negative offsets. Range::checkNodeWOffset() produces IndexSizeError for negative offsets. Code to check negative offsets in these functions were redundant. This CL changes behavior for DOCTYPE. If a DOCTYPE node and a negative offset are specified, the functions throw InvalidNodeTypeError instead of IndexSizeError. This fixes 111 tests in external/wpt/selection/. Also, setBaseAndExtent(null, -1, ...) doesn't throw an IndexSizeError. This is consistent with a behavior that setBaseAndExtent(null, 10000, ...) doesn't throw. The offset argument should be unsigned actually, and we can't check offset validity for null node. BUG=683066 Review-Url: https://codereview.chromium.org/2710593002 Cr-Commit-Position: refs/heads/master@{#451700} Committed: https://chromium.googlesource.com/chromium/src/+/78f6af0ff4c8891082f4b6b366ec70d85d528cf8

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -10900 lines) Patch
M third_party/WebKit/LayoutTests/editing/selection/extend-expected.txt View 1 chunk +1 line, -1 line 1 comment Download
D third_party/WebKit/LayoutTests/external/wpt/selection/collapse-00-expected.txt View 1 chunk +0 lines, -3174 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/selection/collapse-30-expected.txt View 1 chunk +0 lines, -2995 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/selection/extend-00-expected.txt View 1 chunk +0 lines, -2074 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/selection/extend-20-expected.txt View 1 chunk +0 lines, -2434 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/selection/extend-40-expected.txt View 1 chunk +0 lines, -184 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Selection/use-counters.html View 1 chunk +0 lines, -4 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/editing/DOMSelection.cpp View 3 chunks +0 lines, -24 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 21 (16 generated)
tkent
yoichio@, yosin@, would you review this please?
3 years, 10 months ago (2017-02-21 03:25:35 UTC) #13
tkent
https://codereview.chromium.org/2710593002/diff/10001/third_party/WebKit/LayoutTests/editing/selection/extend-expected.txt File third_party/WebKit/LayoutTests/editing/selection/extend-expected.txt (right): https://codereview.chromium.org/2710593002/diff/10001/third_party/WebKit/LayoutTests/editing/selection/extend-expected.txt#newcode4 third_party/WebKit/LayoutTests/editing/selection/extend-expected.txt:4: Success: s.extend(span2.firstChild, -1) raised IndexSizeError: Failed to execute 'extend' ...
3 years, 10 months ago (2017-02-21 03:26:44 UTC) #14
yosin_UTC9
lgtm Good catch!
3 years, 10 months ago (2017-02-21 03:34:55 UTC) #15
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/2710593002/10001
3 years, 10 months ago (2017-02-21 03:35:18 UTC) #18
commit-bot: I haz the power
3 years, 10 months ago (2017-02-21 04:37:13 UTC) #21
Message was sent while issue was closed.
Committed patchset #1 (id:10001) as
https://chromium.googlesource.com/chromium/src/+/78f6af0ff4c8891082f4b6b366ec...

Powered by Google App Engine
This is Rietveld 408576698