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

Issue 2850443002: Stop flat tree selection canonicalization from using invalid positions (Closed)

Created:
3 years, 7 months ago by Xiaocheng
Modified:
3 years, 7 months ago
Reviewers:
yosin_UTC9
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Stop flat tree selection canonicalization from using invalid positions There are some valid DOM positions (*) that do not have corresponding valid flat tree positions. This patch adds special handling of such DOM positions, so that when computing VisibleSelectionInFlatTree from SelectionInDOMTree, such positions are converted to NULL instead of invalid flat tree positions, so that the renderer does not crash. (*) If NODE is a direct child of a shadow host but is not distributed into the flat tree, NODE@BeforeAnchor and NODE@AfterAnchor are valid Position but invalid PositionInFlatTree. This patch handles these two kind of positions. BUG=702756, 709872, 712984 TEST=FrameSelectionTest.SelectInvalidPositionInFlatTreeDoesntCrash Review-Url: https://codereview.chromium.org/2850443002 Cr-Commit-Position: refs/heads/master@{#467676} Committed: https://chromium.googlesource.com/chromium/src/+/0cbb9fc2999813a837b8ee0483f77e3879cc25e0

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add expectation check #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -9 lines) Patch
M third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp View 1 1 chunk +21 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/Position.cpp View 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/SelectionEditor.cpp View 1 chunk +15 lines, -9 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 16 (11 generated)
Xiaocheng
PTAL.
3 years, 7 months ago (2017-04-27 06:55:12 UTC) #6
yosin_UTC9
lgtm w/ a comment to improve test case. BTW, I feel this is the first ...
3 years, 7 months ago (2017-04-27 07:02:28 UTC) #7
Xiaocheng
https://codereview.chromium.org/2850443002/diff/1/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp File third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp (right): https://codereview.chromium.org/2850443002/diff/1/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp#newcode343 third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp:343: Selection().ComputeVisibleSelectionInFlatTree(); On 2017/04/27 at 07:02:28, yosin_UTC9 wrote: > nit: ...
3 years, 7 months ago (2017-04-27 07:20:46 UTC) #8
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/2850443002/20001
3 years, 7 months ago (2017-04-27 13:28:53 UTC) #13
commit-bot: I haz the power
3 years, 7 months ago (2017-04-27 15:04:28 UTC) #16
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/0cbb9fc2999813a837b8ee0483f7...

Powered by Google App Engine
This is Rietveld 408576698