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

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

Issue 424973003: Don't clear selection on focus change except for text form control element (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-08-13T13:21:11 Created 6 years, 4 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 | « LayoutTests/fast/forms/focus-selection-textarea-expected.txt ('k') | Source/core/page/FocusController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 82015687ef949f185db4a99c480715b1d6f2ed9f..b037ec21b33439a53a803a462ab39233fe597f6c 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -2094,7 +2094,7 @@ void Element::updateFocusAppearance(bool /*restorePreviousSelection*/)
VisibleSelection newSelection = VisibleSelection(firstPositionInOrBeforeNode(this), 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::DoNotSetFocus);
+ frame->selection().setSelection(newSelection, FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle | FrameSelection::DoNotSetFocus);
frame->selection().revealSelection();
} else if (renderer() && !renderer()->isWidget())
renderer()->scrollRectToVisible(boundingBox());
« no previous file with comments | « LayoutTests/fast/forms/focus-selection-textarea-expected.txt ('k') | Source/core/page/FocusController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698