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

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

Issue 2022723002: Move VisibleSelection::positionRespectingEditingBoundary() to EditingUtilities.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-05-30T17:10:26 Created 4 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleSelection.cpp ('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 * 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 2160 matching lines...) Expand 10 before | Expand all | Expand 10 after
2171 return false; 2171 return false;
2172 } 2172 }
2173 2173
2174 VisiblePosition visiblePositionForContentsPoint(const IntPoint& contentsPoint, L ocalFrame* frame) 2174 VisiblePosition visiblePositionForContentsPoint(const IntPoint& contentsPoint, L ocalFrame* frame)
2175 { 2175 {
2176 HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | H itTestRequest::Active | HitTestRequest::IgnoreClipping; 2176 HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | H itTestRequest::Active | HitTestRequest::IgnoreClipping;
2177 HitTestResult result(request, contentsPoint); 2177 HitTestResult result(request, contentsPoint);
2178 frame->document()->layoutViewItem().hitTest(result); 2178 frame->document()->layoutViewItem().hitTest(result);
2179 2179
2180 if (Node* node = result.innerNode()) 2180 if (Node* node = result.innerNode())
2181 return frame->selection().selection().visiblePositionRespectingEditingBo undary(result.localPoint(), node); 2181 return createVisiblePosition(positionRespectingEditingBoundary(frame->se lection().selection().start(), result.localPoint(), node));
2182 return VisiblePosition(); 2182 return VisiblePosition();
2183 } 2183 }
2184 2184
2185 // TODO(yosin): We should use |associatedLayoutObjectOf()| in "VisibleUnits.cpp" 2185 // TODO(yosin): We should use |associatedLayoutObjectOf()| in "VisibleUnits.cpp"
2186 // where it takes |LayoutObject| from |Position|. 2186 // where it takes |LayoutObject| from |Position|.
2187 // Note about ::first-letter pseudo-element: 2187 // Note about ::first-letter pseudo-element:
2188 // When an element has ::first-letter pseudo-element, first letter characters 2188 // When an element has ::first-letter pseudo-element, first letter characters
2189 // are taken from |Text| node and first letter characters are considered 2189 // are taken from |Text| node and first letter characters are considered
2190 // as content of <pseudo:first-letter>. 2190 // as content of <pseudo:first-letter>.
2191 // For following HTML, 2191 // For following HTML,
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
3251 { 3251 {
3252 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); 3252 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule);
3253 } 3253 }
3254 3254
3255 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule) 3255 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule)
3256 { 3256 {
3257 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule); 3257 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule);
3258 } 3258 }
3259 3259
3260 } // namespace blink 3260 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698