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

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

Issue 2875453003: Prune ComputeVisibleSelectionInDOMTreeDeprecated from SelectionController::UpdateSelectionForMouseD… (Closed)
Patch Set: Created 3 years, 7 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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
6 * Copyright (C) 2015 Google Inc. All rights reserved. 6 * Copyright (C) 2015 Google Inc. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 Node* target = hit_test_result.InnerNode(); 347 Node* target = hit_test_result.InnerNode();
348 if (!target) 348 if (!target)
349 return; 349 return;
350 350
351 // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets 351 // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets
352 // needs to be audited. See http://crbug.com/590369 for more details. 352 // needs to be audited. See http://crbug.com/590369 for more details.
353 frame_->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); 353 frame_->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
354 354
355 const PositionWithAffinity& raw_target_position = 355 const PositionWithAffinity& raw_target_position =
356 PositionRespectingEditingBoundary( 356 PositionRespectingEditingBoundary(
357 Selection().ComputeVisibleSelectionInDOMTreeDeprecated().Start(), 357 Selection().ComputeVisibleSelectionInDOMTree().Start(),
358 hit_test_result.LocalPoint(), target); 358 hit_test_result.LocalPoint(), target);
359 VisiblePositionInFlatTree target_position = CreateVisiblePosition( 359 VisiblePositionInFlatTree target_position = CreateVisiblePosition(
360 FromPositionInDOMTree<EditingInFlatTreeStrategy>(raw_target_position)); 360 FromPositionInDOMTree<EditingInFlatTreeStrategy>(raw_target_position));
361 // Don't modify the selection if we're not on a node. 361 // Don't modify the selection if we're not on a node.
362 if (target_position.IsNull()) 362 if (target_position.IsNull())
363 return; 363 return;
364 364
365 // Restart the selection if this is the first mouse move. This work is usually 365 // Restart the selection if this is the first mouse move. This work is usually
366 // done in handleMousePressEvent, but not if the mouse press was on an 366 // done in handleMousePressEvent, but not if the mouse press was on an
367 // existing selection. 367 // existing selection.
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 1134
1135 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) { 1135 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) {
1136 bool is_mouse_down_on_link_or_image = 1136 bool is_mouse_down_on_link_or_image =
1137 event.IsOverLink() || event.GetHitTestResult().GetImage(); 1137 event.IsOverLink() || event.GetHitTestResult().GetImage();
1138 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) != 1138 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) !=
1139 0 && 1139 0 &&
1140 !is_mouse_down_on_link_or_image; 1140 !is_mouse_down_on_link_or_image;
1141 } 1141 }
1142 1142
1143 } // namespace blink 1143 } // 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