Chromium Code Reviews
DescriptionSelection 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
Created: 3 years, 10 months ago
(Patch set is too large to download)
Dependent Patchsets: Messages
Total messages: 21 (16 generated)
|