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

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

Issue 675413003: WebLocalFrameImpl::selectWordAroundPosition should select a word before space. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use VisibleUnit functions and add test cases Created 6 years, 1 month 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
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 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 1160
1161 TextGranularity granularity = selection.isRange() ? WordGranularity : Charac terGranularity; 1161 TextGranularity granularity = selection.isRange() ? WordGranularity : Charac terGranularity;
1162 frame->selection().setSelection(selection, granularity); 1162 frame->selection().setSelection(selection, granularity);
1163 } 1163 }
1164 1164
1165 bool WebLocalFrameImpl::selectWordAroundCaret() 1165 bool WebLocalFrameImpl::selectWordAroundCaret()
1166 { 1166 {
1167 FrameSelection& selection = frame()->selection(); 1167 FrameSelection& selection = frame()->selection();
1168 if (selection.isNone() || selection.isRange()) 1168 if (selection.isNone() || selection.isRange())
1169 return false; 1169 return false;
1170 selectWordAroundPosition(frame(), selection.selection().visibleStart()); 1170 return frame()->selection().selectWordAroundPosition(selection.selection().v isibleStart());
1171 return true;
1172 } 1171 }
1173 1172
1174 void WebLocalFrameImpl::selectRange(const WebPoint& base, const WebPoint& extent ) 1173 void WebLocalFrameImpl::selectRange(const WebPoint& base, const WebPoint& extent )
1175 { 1174 {
1176 moveRangeSelection(base, extent); 1175 moveRangeSelection(base, extent);
1177 } 1176 }
1178 1177
1179 void WebLocalFrameImpl::selectRange(const WebRange& webRange) 1178 void WebLocalFrameImpl::selectRange(const WebRange& webRange)
1180 { 1179 {
1181 if (RefPtrWillBeRawPtr<Range> range = static_cast<PassRefPtrWillBeRawPtr<Ran ge> >(webRange)) 1180 if (RefPtrWillBeRawPtr<Range> range = static_cast<PassRefPtrWillBeRawPtr<Ran ge> >(webRange))
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 1971
1973 void WebLocalFrameImpl::invalidateAll() const 1972 void WebLocalFrameImpl::invalidateAll() const
1974 { 1973 {
1975 ASSERT(frame() && frame()->view()); 1974 ASSERT(frame() && frame()->view());
1976 FrameView* view = frame()->view(); 1975 FrameView* view = frame()->view();
1977 view->invalidateRect(view->frameRect()); 1976 view->invalidateRect(view->frameRect());
1978 invalidateScrollbar(); 1977 invalidateScrollbar();
1979 } 1978 }
1980 1979
1981 } // namespace blink 1980 } // namespace blink
OLDNEW
« Source/core/editing/FrameSelection.cpp ('K') | « Source/core/editing/FrameSelectionTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698