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

Side by Side Diff: third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Issue 2932293002: Early return if SelectionInDOMTree is None at LayoutSelection::CalcSelectionPaintRange. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 continue; 311 continue;
312 layout_object->SetShouldInvalidateSelection(); 312 layout_object->SetShouldInvalidateSelection();
313 } 313 }
314 314
315 // Reset selection. 315 // Reset selection.
316 paint_range_ = SelectionPaintRange(); 316 paint_range_ = SelectionPaintRange();
317 } 317 }
318 318
319 static SelectionPaintRange CalcSelectionPaintRange( 319 static SelectionPaintRange CalcSelectionPaintRange(
320 const FrameSelection& frame_selection) { 320 const FrameSelection& frame_selection) {
321 const SelectionInDOMTree& selection_in_dom =
322 frame_selection.GetSelectionInDOMTree();
323 if (selection_in_dom.IsNone())
324 return SelectionPaintRange();
325
321 const VisibleSelectionInFlatTree& original_selection = 326 const VisibleSelectionInFlatTree& original_selection =
322 frame_selection.ComputeVisibleSelectionInFlatTree(); 327 frame_selection.ComputeVisibleSelectionInFlatTree();
323 // Construct a new VisibleSolution, since visibleSelection() is not 328 // Construct a new VisibleSolution, since visibleSelection() is not
324 // necessarily valid, and the following steps assume a valid selection. See 329 // necessarily valid, and the following steps assume a valid selection. See
325 // <https://bugs.webkit.org/show_bug.cgi?id=69563> and 330 // <https://bugs.webkit.org/show_bug.cgi?id=69563> and
326 // <rdar://problem/10232866>. 331 // <rdar://problem/10232866>.
327 const SelectionInFlatTree& new_selection = CalcSelection( 332 const SelectionInFlatTree& new_selection = CalcSelection(
328 original_selection, frame_selection.ShouldShowBlockCursor()); 333 original_selection, frame_selection.ShouldShowBlockCursor());
329 const VisibleSelectionInFlatTree& selection = 334 const VisibleSelectionInFlatTree& selection =
330 CreateVisibleSelection(new_selection); 335 CreateVisibleSelection(new_selection);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 458
454 o->SetShouldInvalidateSelection(); 459 o->SetShouldInvalidateSelection();
455 } 460 }
456 } 461 }
457 462
458 DEFINE_TRACE(LayoutSelection) { 463 DEFINE_TRACE(LayoutSelection) {
459 visitor->Trace(frame_selection_); 464 visitor->Trace(frame_selection_);
460 } 465 }
461 466
462 } // namespace blink 467 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698