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

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

Issue 1320313002: Move makeRange() with VisiblePosition to EditingUtilities.cpp from VisiblePosition.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-31T14:11:43 Created 5 years, 3 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 | « Source/core/editing/VisiblePosition.h ('k') | 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) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
3 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. 3 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 m_deepPosition.formatForDebugger(buffer, length); 765 m_deepPosition.formatForDebugger(buffer, length);
766 } 766 }
767 767
768 void VisiblePosition::showTreeForThis() const 768 void VisiblePosition::showTreeForThis() const
769 { 769 {
770 m_deepPosition.showTreeForThis(); 770 m_deepPosition.showTreeForThis();
771 } 771 }
772 772
773 #endif 773 #endif
774 774
775 EphemeralRange makeRange(const VisiblePosition &start, const VisiblePosition &en d)
776 {
777 if (start.isNull() || end.isNull())
778 return EphemeralRange();
779
780 Position s = start.deepEquivalent().parentAnchoredEquivalent();
781 Position e = end.deepEquivalent().parentAnchoredEquivalent();
782 if (s.isNull() || e.isNull())
783 return EphemeralRange();
784
785 return EphemeralRange(s, e);
786 }
787
788 DEFINE_TRACE(VisiblePosition) 775 DEFINE_TRACE(VisiblePosition)
789 { 776 {
790 visitor->trace(m_deepPosition); 777 visitor->trace(m_deepPosition);
791 } 778 }
792 779
793 } // namespace blink 780 } // namespace blink
794 781
795 #ifndef NDEBUG 782 #ifndef NDEBUG
796 783
797 void showTree(const blink::VisiblePosition* vpos) 784 void showTree(const blink::VisiblePosition* vpos)
798 { 785 {
799 if (vpos) 786 if (vpos)
800 vpos->showTreeForThis(); 787 vpos->showTreeForThis();
801 else 788 else
802 fprintf(stderr, "Cannot showTree for (nil) VisiblePosition.\n"); 789 fprintf(stderr, "Cannot showTree for (nil) VisiblePosition.\n");
803 } 790 }
804 791
805 void showTree(const blink::VisiblePosition& vpos) 792 void showTree(const blink::VisiblePosition& vpos)
806 { 793 {
807 vpos.showTreeForThis(); 794 vpos.showTreeForThis();
808 } 795 }
809 796
810 #endif 797 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/VisiblePosition.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698