Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/LayoutSelection.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp |
| index d94c6482ea6e6c022c2e2be0955179e909e4b311..01e40852d22f095c542bb2e1c1f4206527ae28f8 100644 |
| --- a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp |
| +++ b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp |
| @@ -339,22 +339,9 @@ static SelectionPaintRange CalcSelectionPaintRange( |
| return SelectionPaintRange(); |
| DCHECK(!selection.IsNone()); |
| - // Use the rightmost candidate for the start of the selection, and the |
| - // leftmost candidate for the end of the selection. Example: foo <a>bar</a>. |
| - // Imagine that a line wrap occurs after 'foo', and that 'bar' is selected. |
| - // If we pass [foo, 3] as the start of the selection, the selection painting |
| - // code will think that content on the line containing 'foo' is selected |
| - // and will fill the gap before 'bar'. |
| - PositionInFlatTree start_pos = selection.Start(); |
| - const PositionInFlatTree most_forward_start = |
| - MostForwardCaretPosition(start_pos); |
| - if (IsVisuallyEquivalentCandidate(most_forward_start)) |
| - start_pos = most_forward_start; |
| - PositionInFlatTree end_pos = selection.End(); |
| - const PositionInFlatTree most_backward = MostBackwardCaretPosition(end_pos); |
| - if (IsVisuallyEquivalentCandidate(most_backward)) |
| - end_pos = most_backward; |
|
yosin_UTC9
2017/06/22 02:08:40
nit: we don't need to have an extra blank line bet
yoichio
2017/06/22 03:49:14
Done.
|
| + const PositionInFlatTree start_pos = selection.Start(); |
| + const PositionInFlatTree end_pos = selection.End(); |
| DCHECK(start_pos.IsNotNull()); |
|
yosin_UTC9
2017/06/22 02:08:40
nit: Could you remove this? DCHECK_LE() can crash
yoichio
2017/06/22 03:49:14
Done.
|
| DCHECK(end_pos.IsNotNull()); |
|
yosin_UTC9
2017/06/22 02:08:40
nit: Could you remove this? DCHECK_LE() can crash
yoichio
2017/06/22 03:49:14
Done.
|
| DCHECK_LE(start_pos, end_pos); |