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

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

Issue 1324463002: Introduce lineDirectionPointForBlockDirectionNavigationOf() for VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-28T17:32:46 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 | « no previous file | Source/core/editing/VisiblePosition.h » ('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, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple 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 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 } 1204 }
1205 1205
1206 LocalFrame* frame = pos.document()->frame(); 1206 LocalFrame* frame = pos.document()->frame();
1207 if (!frame) 1207 if (!frame)
1208 return x; 1208 return x;
1209 1209
1210 if (m_xPosForVerticalArrowNavigation == NoXPosForVerticalArrowNavigation()) { 1210 if (m_xPosForVerticalArrowNavigation == NoXPosForVerticalArrowNavigation()) {
1211 VisiblePosition visiblePosition(pos, m_selection.affinity()); 1211 VisiblePosition visiblePosition(pos, m_selection.affinity());
1212 // VisiblePosition creation can fail here if a node containing the selec tion becomes visibility:hidden 1212 // VisiblePosition creation can fail here if a node containing the selec tion becomes visibility:hidden
1213 // after the selection is created and before this function is called. 1213 // after the selection is created and before this function is called.
1214 x = visiblePosition.lineDirectionPointForBlockDirectionNavigation(); 1214 x = lineDirectionPointForBlockDirectionNavigationOf(visiblePosition);
1215 m_xPosForVerticalArrowNavigation = x; 1215 m_xPosForVerticalArrowNavigation = x;
1216 } else { 1216 } else {
1217 x = m_xPosForVerticalArrowNavigation; 1217 x = m_xPosForVerticalArrowNavigation;
1218 } 1218 }
1219 1219
1220 return x; 1220 return x;
1221 } 1221 }
1222 1222
1223 void FrameSelection::clear() 1223 void FrameSelection::clear()
1224 { 1224 {
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 2069
2070 void showTree(const blink::FrameSelection* sel) 2070 void showTree(const blink::FrameSelection* sel)
2071 { 2071 {
2072 if (sel) 2072 if (sel)
2073 sel->showTreeForThis(); 2073 sel->showTreeForThis();
2074 else 2074 else
2075 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); 2075 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n");
2076 } 2076 }
2077 2077
2078 #endif 2078 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/VisiblePosition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698