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 2957833004: Make VisiblePosition::LastPositionInNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-27T15:28:02 Created 3 years, 5 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
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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 const String& str = PlainText( 514 const String& str = PlainText(
515 range, 515 range,
516 TextIteratorBehavior::Builder() 516 TextIteratorBehavior::Builder()
517 .SetEmitsObjectReplacementCharacter(HasEditableStyle(*inner_node)) 517 .SetEmitsObjectReplacementCharacter(HasEditableStyle(*inner_node))
518 .Build()); 518 .Build());
519 if (str.IsEmpty() || str.SimplifyWhiteSpace().ContainsOnlyWhitespace()) 519 if (str.IsEmpty() || str.SimplifyWhiteSpace().ContainsOnlyWhitespace())
520 return false; 520 return false;
521 521
522 if (new_selection.RootEditableElement() && 522 if (new_selection.RootEditableElement() &&
523 pos.DeepEquivalent() == VisiblePositionInFlatTree::LastPositionInNode( 523 pos.DeepEquivalent() == VisiblePositionInFlatTree::LastPositionInNode(
524 new_selection.RootEditableElement()) 524 *new_selection.RootEditableElement())
525 .DeepEquivalent()) 525 .DeepEquivalent())
526 return false; 526 return false;
527 527
528 visibility = HandleVisibility::kVisible; 528 visibility = HandleVisibility::kVisible;
529 } 529 }
530 530
531 if (append_trailing_whitespace == AppendTrailingWhitespace::kShouldAppend) 531 if (append_trailing_whitespace == AppendTrailingWhitespace::kShouldAppend)
532 new_selection.AppendTrailingWhitespace(); 532 new_selection.AppendTrailingWhitespace();
533 533
534 return UpdateSelectionForMouseDownDispatchingSelectStart( 534 return UpdateSelectionForMouseDownDispatchingSelectStart(
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 1211
1212 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) { 1212 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) {
1213 bool is_mouse_down_on_link_or_image = 1213 bool is_mouse_down_on_link_or_image =
1214 event.IsOverLink() || event.GetHitTestResult().GetImage(); 1214 event.IsOverLink() || event.GetHitTestResult().GetImage();
1215 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) != 1215 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) !=
1216 0 && 1216 0 &&
1217 !is_mouse_down_on_link_or_image; 1217 !is_mouse_down_on_link_or_image;
1218 } 1218 }
1219 1219
1220 } // namespace blink 1220 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698