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

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

Issue 225303002: Let Selection.collapse remember a raw Position instead of a canonicalized one. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix setSelectedRange arguments Created 6 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
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 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 } 1231 }
1232 1232
1233 void WebLocalFrameImpl::selectRange(const WebPoint& base, const WebPoint& extent ) 1233 void WebLocalFrameImpl::selectRange(const WebPoint& base, const WebPoint& extent )
1234 { 1234 {
1235 moveRangeSelection(base, extent); 1235 moveRangeSelection(base, extent);
1236 } 1236 }
1237 1237
1238 void WebLocalFrameImpl::selectRange(const WebRange& webRange) 1238 void WebLocalFrameImpl::selectRange(const WebRange& webRange)
1239 { 1239 {
1240 if (RefPtrWillBeRawPtr<Range> range = static_cast<PassRefPtrWillBeRawPtr<Ran ge> >(webRange)) 1240 if (RefPtrWillBeRawPtr<Range> range = static_cast<PassRefPtrWillBeRawPtr<Ran ge> >(webRange))
1241 frame()->selection().setSelectedRange(range.get(), WebCore::VP_DEFAULT_A FFINITY, false); 1241 frame()->selection().setSelectedRange(range.get(), WebCore::VP_DEFAULT_A FFINITY, false, NotUserTriggered);
1242 } 1242 }
1243 1243
1244 void WebLocalFrameImpl::moveRangeSelection(const WebPoint& base, const WebPoint& extent) 1244 void WebLocalFrameImpl::moveRangeSelection(const WebPoint& base, const WebPoint& extent)
1245 { 1245 {
1246 VisiblePosition basePosition = visiblePositionForWindowPoint(base); 1246 VisiblePosition basePosition = visiblePositionForWindowPoint(base);
1247 VisiblePosition extentPosition = visiblePositionForWindowPoint(extent); 1247 VisiblePosition extentPosition = visiblePositionForWindowPoint(extent);
1248 VisibleSelection newSelection = VisibleSelection(basePosition, extentPositio n); 1248 VisibleSelection newSelection = VisibleSelection(basePosition, extentPositio n);
1249 frame()->selection().setSelection(newSelection, CharacterGranularity); 1249 frame()->selection().setSelection(newSelection, CharacterGranularity);
1250 } 1250 }
1251 1251
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1920 1920
1921 void WebLocalFrameImpl::invalidateAll() const 1921 void WebLocalFrameImpl::invalidateAll() const
1922 { 1922 {
1923 ASSERT(frame() && frame()->view()); 1923 ASSERT(frame() && frame()->view());
1924 FrameView* view = frame()->view(); 1924 FrameView* view = frame()->view();
1925 view->invalidateRect(view->frameRect()); 1925 view->invalidateRect(view->frameRect());
1926 invalidateScrollbar(); 1926 invalidateScrollbar();
1927 } 1927 }
1928 1928
1929 } // namespace blink 1929 } // namespace blink
OLDNEW
« Source/core/editing/FrameSelection.h ('K') | « Source/core/page/DOMSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698