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

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

Issue 1201423002: Use VisibleSelection::InDOMTree::equalSelections() instead of operator==() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-06-24T15:30:20 Rebase - exclude FrameSelection Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * Copyright (C) 2015 Google Inc. All rights reserved. 5 * Copyright (C) 2015 Google Inc. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 { 59 {
60 } 60 }
61 61
62 DEFINE_TRACE(SelectionController) 62 DEFINE_TRACE(SelectionController)
63 { 63 {
64 visitor->trace(m_frame); 64 visitor->trace(m_frame);
65 } 65 }
66 66
67 static void setSelectionIfNeeded(FrameSelection& selection, const VisibleSelecti on& newSelection) 67 static void setSelectionIfNeeded(FrameSelection& selection, const VisibleSelecti on& newSelection)
68 { 68 {
69 if (selection.selection() != newSelection) 69 if (!VisibleSelection::InDOMTree::equalSelections(selection.selection(), new Selection))
70 selection.setSelection(newSelection); 70 selection.setSelection(newSelection);
71 } 71 }
72 72
73 static inline bool dispatchSelectStart(Node* node) 73 static inline bool dispatchSelectStart(Node* node)
74 { 74 {
75 if (!node || !node->layoutObject()) 75 if (!node || !node->layoutObject())
76 return true; 76 return true;
77 77
78 return node->dispatchEvent(Event::createCancelableBubble(EventTypeNames::sel ectstart)); 78 return node->dispatchEvent(Event::createCancelableBubble(EventTypeNames::sel ectstart));
79 } 79 }
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 { 599 {
600 return m_mouseDownMayStartSelect; 600 return m_mouseDownMayStartSelect;
601 } 601 }
602 602
603 bool SelectionController::mouseDownWasSingleClickInSelection() const 603 bool SelectionController::mouseDownWasSingleClickInSelection() const
604 { 604 {
605 return m_mouseDownWasSingleClickInSelection; 605 return m_mouseDownWasSingleClickInSelection;
606 } 606 }
607 607
608 } // namespace blink 608 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698