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

Side by Side Diff: Source/core/editing/Editor.cpp

Issue 1126263004: Input element is not scrolled into center during composition Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 | no next file » | 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) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 : m_editor(editor) 95 : m_editor(editor)
96 { 96 {
97 ++m_editor->m_preventRevealSelection; 97 ++m_editor->m_preventRevealSelection;
98 } 98 }
99 99
100 Editor::RevealSelectionScope::~RevealSelectionScope() 100 Editor::RevealSelectionScope::~RevealSelectionScope()
101 { 101 {
102 ASSERT(m_editor->m_preventRevealSelection); 102 ASSERT(m_editor->m_preventRevealSelection);
103 --m_editor->m_preventRevealSelection; 103 --m_editor->m_preventRevealSelection;
104 if (!m_editor->m_preventRevealSelection) 104 if (!m_editor->m_preventRevealSelection)
105 m_editor->frame().selection().revealSelection(ScrollAlignment::alignToEd geIfNeeded, RevealExtent); 105 m_editor->frame().selection().revealSelection(ScrollAlignment::alignCent erIfNeeded, RevealExtent);
106 } 106 }
107 107
108 // When an event handler has moved the selection outside of a text control 108 // When an event handler has moved the selection outside of a text control
109 // we should use the target control's selection for this editing operation. 109 // we should use the target control's selection for this editing operation.
110 VisibleSelection Editor::selectionForCommand(Event* event) 110 VisibleSelection Editor::selectionForCommand(Event* event)
111 { 111 {
112 VisibleSelection selection = frame().selection().selection(); 112 VisibleSelection selection = frame().selection().selection();
113 if (!event) 113 if (!event)
114 return selection; 114 return selection;
115 // If the target is a text control, and the current selection is outside of its shadow tree, 115 // If the target is a text control, and the current selection is outside of its shadow tree,
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 } 1267 }
1268 1268
1269 DEFINE_TRACE(Editor) 1269 DEFINE_TRACE(Editor)
1270 { 1270 {
1271 visitor->trace(m_frame); 1271 visitor->trace(m_frame);
1272 visitor->trace(m_lastEditCommand); 1272 visitor->trace(m_lastEditCommand);
1273 visitor->trace(m_mark); 1273 visitor->trace(m_mark);
1274 } 1274 }
1275 1275
1276 } // namespace blink 1276 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698