DescriptionStop 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 #
Dependent Patchsets: Messages
Total messages: 16 (11 generated)
|