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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2442673002: Get rid of createVisibleSelection() taking one Position (Closed)
Patch Set: 2016-10-24T17:42:38 Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 498d9def3d446f2420a90b97897bc2da4ea7cb8b..2cf591068903f77225f1d05a4e9d09585d151b15 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -2635,15 +2635,15 @@ void Element::updateFocusAppearance(
document().updateStyleAndLayoutIgnorePendingStylesheets();
// FIXME: We should restore the previous selection if there is one.
- VisibleSelection newSelection = createVisibleSelection(
- firstPositionInOrBeforeNode(this), TextAffinity::Downstream);
// Passing DoNotSetFocus as this function is called after
// FocusController::setFocusedElement() and we don't want to change the
// focus to a new Element.
- frame->selection().setSelection(newSelection,
- FrameSelection::CloseTyping |
- FrameSelection::ClearTypingStyle |
- FrameSelection::DoNotSetFocus);
+ frame->selection().setSelection(
+ SelectionInDOMTree::Builder()
+ .collapse(firstPositionInOrBeforeNode(this))
+ .build(),
+ FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle |
+ FrameSelection::DoNotSetFocus);
frame->selection().revealSelection();
} else if (layoutObject() && !layoutObject()->isLayoutPart()) {
layoutObject()->scrollRectToVisible(boundingBox());
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698