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

Side by Side Diff: Source/web/WebLocalFrameImpl.cpp

Issue 766753002: Scroll text field when selecting text (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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/web/tests/WebFrameTest.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 1205
1206 VisiblePosition basePosition = currentSelection.isBaseFirst() ? 1206 VisiblePosition basePosition = currentSelection.isBaseFirst() ?
1207 currentSelection.visibleStart() : currentSelection.visibleEnd(); 1207 currentSelection.visibleStart() : currentSelection.visibleEnd();
1208 VisiblePosition extentPosition = visiblePositionForWindowPoint(point); 1208 VisiblePosition extentPosition = visiblePositionForWindowPoint(point);
1209 1209
1210 // Prevent the selection from collapsing. 1210 // Prevent the selection from collapsing.
1211 if (comparePositions(basePosition, extentPosition) == 0) 1211 if (comparePositions(basePosition, extentPosition) == 0)
1212 return; 1212 return;
1213 1213
1214 VisibleSelection newSelection = VisibleSelection(basePosition, extentPositio n); 1214 VisibleSelection newSelection = VisibleSelection(basePosition, extentPositio n);
1215 frame()->selection().setSelection(newSelection, CharacterGranularity); 1215 frame()->selection().setSelection(newSelection, FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle | UserTriggered, FrameSelection::AlignCursorO nScrollIfNeeded, CharacterGranularity);
1216 } 1216 }
1217 1217
1218 void WebLocalFrameImpl::moveRangeSelection(const WebPoint& base, const WebPoint& extent) 1218 void WebLocalFrameImpl::moveRangeSelection(const WebPoint& base, const WebPoint& extent)
1219 { 1219 {
1220 VisiblePosition basePosition = visiblePositionForWindowPoint(base); 1220 VisiblePosition basePosition = visiblePositionForWindowPoint(base);
1221 VisiblePosition extentPosition = visiblePositionForWindowPoint(extent); 1221 VisiblePosition extentPosition = visiblePositionForWindowPoint(extent);
1222 VisibleSelection newSelection = VisibleSelection(basePosition, extentPositio n); 1222 VisibleSelection newSelection = VisibleSelection(basePosition, extentPositio n);
1223 frame()->selection().setSelection(newSelection, CharacterGranularity); 1223 frame()->selection().setSelection(newSelection, CharacterGranularity);
1224 } 1224 }
1225 1225
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
2013 { 2013 {
2014 m_frameWidget = frameWidget; 2014 m_frameWidget = frameWidget;
2015 } 2015 }
2016 2016
2017 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const 2017 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const
2018 { 2018 {
2019 return m_frameWidget; 2019 return m_frameWidget;
2020 } 2020 }
2021 2021
2022 } // namespace blink 2022 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698