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

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

Issue 2747333002: Make makeSearchRange() in VisibleSelection to handle BeforeAnchor and AfterAnchor position type (Closed)
Patch Set: 2017-03-15T14:33:19 Update a comment in test Created 3 years, 9 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 | third_party/WebKit/Source/core/editing/VisibleSelectionTest.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 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // On a treasure map, <b>X</b> marks the spot. 175 // On a treasure map, <b>X</b> marks the spot.
176 // ^ selected 176 // ^ selected
177 // 177 //
178 DCHECK(isRange()); 178 DCHECK(isRange());
179 return normalizeRange(EphemeralRangeTemplate<Strategy>(m_start, m_end)); 179 return normalizeRange(EphemeralRangeTemplate<Strategy>(m_start, m_end));
180 } 180 }
181 181
182 template <typename Strategy> 182 template <typename Strategy>
183 static EphemeralRangeTemplate<Strategy> makeSearchRange( 183 static EphemeralRangeTemplate<Strategy> makeSearchRange(
184 const PositionTemplate<Strategy>& pos) { 184 const PositionTemplate<Strategy>& pos) {
185 Node* node = pos.anchorNode(); 185 Node* node = pos.computeContainerNode();
186 if (!node) 186 if (!node)
187 return EphemeralRangeTemplate<Strategy>(); 187 return EphemeralRangeTemplate<Strategy>();
188 Document& document = node->document(); 188 Document& document = node->document();
189 if (!document.documentElement()) 189 if (!document.documentElement())
190 return EphemeralRangeTemplate<Strategy>(); 190 return EphemeralRangeTemplate<Strategy>();
191 Element* boundary = enclosingBlockFlowElement(*node); 191 Element* boundary = enclosingBlockFlowElement(*node);
192 if (!boundary) 192 if (!boundary)
193 return EphemeralRangeTemplate<Strategy>(); 193 return EphemeralRangeTemplate<Strategy>();
194 194
195 return EphemeralRangeTemplate<Strategy>( 195 return EphemeralRangeTemplate<Strategy>(
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 800
801 void showTree(const blink::VisibleSelectionInFlatTree& sel) { 801 void showTree(const blink::VisibleSelectionInFlatTree& sel) {
802 sel.showTreeForThis(); 802 sel.showTreeForThis();
803 } 803 }
804 804
805 void showTree(const blink::VisibleSelectionInFlatTree* sel) { 805 void showTree(const blink::VisibleSelectionInFlatTree* sel) {
806 if (sel) 806 if (sel)
807 sel->showTreeForThis(); 807 sel->showTreeForThis();
808 } 808 }
809 #endif 809 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698