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

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

Issue 1310913004: Introduce composed tree version of inSameLine() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-09-07T17:11:39 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/VisibleUnits.h ('k') | Source/core/editing/VisibleUnitsTest.cpp » ('j') | 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 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 bool inSameLine(const PositionInComposedTreeWithAffinity& position1, const Posit ionInComposedTreeWithAffinity& position2) 1114 bool inSameLine(const PositionInComposedTreeWithAffinity& position1, const Posit ionInComposedTreeWithAffinity& position2)
1115 { 1115 {
1116 return inSameLineAlgorithm<EditingInComposedTreeStrategy>(position1, positio n2); 1116 return inSameLineAlgorithm<EditingInComposedTreeStrategy>(position1, positio n2);
1117 } 1117 }
1118 1118
1119 bool inSameLine(const VisiblePosition& position1, const VisiblePosition& positio n2) 1119 bool inSameLine(const VisiblePosition& position1, const VisiblePosition& positio n2)
1120 { 1120 {
1121 return inSameLine(position1.toPositionWithAffinity(), position2.toPositionWi thAffinity()); 1121 return inSameLine(position1.toPositionWithAffinity(), position2.toPositionWi thAffinity());
1122 } 1122 }
1123 1123
1124 bool inSameLine(const VisiblePositionInComposedTree& position1, const VisiblePos itionInComposedTree& position2)
1125 {
1126 return inSameLine(position1.toPositionWithAffinity(), position2.toPositionWi thAffinity());
1127 }
1128
1124 bool isStartOfLine(const VisiblePosition& p) 1129 bool isStartOfLine(const VisiblePosition& p)
1125 { 1130 {
1126 return p.isNotNull() && p.deepEquivalent() == startOfLine(p).deepEquivalent( ); 1131 return p.isNotNull() && p.deepEquivalent() == startOfLine(p).deepEquivalent( );
1127 } 1132 }
1128 1133
1129 bool isEndOfLine(const VisiblePosition& p) 1134 bool isEndOfLine(const VisiblePosition& p)
1130 { 1135 {
1131 return p.isNotNull() && p.deepEquivalent() == endOfLine(p).deepEquivalent(); 1136 return p.isNotNull() && p.deepEquivalent() == endOfLine(p).deepEquivalent();
1132 } 1137 }
1133 1138
(...skipping 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after
2952 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivale nt()); 2957 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivale nt());
2953 case CanSkipOverEditingBoundary: 2958 case CanSkipOverEditingBoundary:
2954 return skipToStartOfEditingBoundary(prev, visiblePosition.deepEquivalent ()); 2959 return skipToStartOfEditingBoundary(prev, visiblePosition.deepEquivalent ());
2955 } 2960 }
2956 2961
2957 ASSERT_NOT_REACHED(); 2962 ASSERT_NOT_REACHED();
2958 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivalent() ); 2963 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivalent() );
2959 } 2964 }
2960 2965
2961 } // namespace blink 2966 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/VisibleUnits.h ('k') | Source/core/editing/VisibleUnitsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698