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

Side by Side Diff: Source/core/html/HTMLTextFormControlElementTest.cpp

Issue 1299873002: ALL-IN-ONE Introduce enum class TextAffinity (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T18:08:52 Created 5 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 unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLTextFormControlElement.cpp ('k') | Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/html/HTMLTextFormControlElement.h" 6 #include "core/html/HTMLTextFormControlElement.h"
7 7
8 #include "core/dom/Text.h" 8 #include "core/dom/Text.h"
9 #include "core/editing/FrameSelection.h" 9 #include "core/editing/FrameSelection.h"
10 #include "core/editing/Position.h" 10 #include "core/editing/Position.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 205 }
206 206
207 TEST_F(HTMLTextFormControlElementTest, SpellCheckDoesNotCauseUpdateLayout) 207 TEST_F(HTMLTextFormControlElementTest, SpellCheckDoesNotCauseUpdateLayout)
208 { 208 {
209 HTMLInputElement* input = toHTMLInputElement(document().getElementById("inpu t")); 209 HTMLInputElement* input = toHTMLInputElement(document().getElementById("inpu t"));
210 input->focus(); 210 input->focus();
211 input->setValue("Hello, input field"); 211 input->setValue("Hello, input field");
212 VisibleSelection oldSelection = document().frame()->selection().selection(); 212 VisibleSelection oldSelection = document().frame()->selection().selection();
213 213
214 Position newPosition(input->innerEditorElement()->firstChild(), 3); 214 Position newPosition(input->innerEditorElement()->firstChild(), 3);
215 VisibleSelection newSelection(newPosition, DOWNSTREAM); 215 VisibleSelection newSelection(newPosition, TextAffinity::Downstream);
216 document().frame()->selection().setSelection(newSelection, FrameSelection::C loseTyping | FrameSelection::ClearTypingStyle | FrameSelection::DoNotUpdateAppea rance); 216 document().frame()->selection().setSelection(newSelection, FrameSelection::C loseTyping | FrameSelection::ClearTypingStyle | FrameSelection::DoNotUpdateAppea rance);
217 ASSERT_EQ(3, input->selectionStart()); 217 ASSERT_EQ(3, input->selectionStart());
218 218
219 OwnPtrWillBePersistent<SpellChecker> spellChecker(SpellChecker::create(page( ).frame())); 219 OwnPtrWillBePersistent<SpellChecker> spellChecker(SpellChecker::create(page( ).frame()));
220 forceLayoutFlag(); 220 forceLayoutFlag();
221 int startCount = layoutCount(); 221 int startCount = layoutCount();
222 spellChecker->respondToChangedSelection(oldSelection, FrameSelection::CloseT yping | FrameSelection::ClearTypingStyle); 222 spellChecker->respondToChangedSelection(oldSelection, FrameSelection::CloseT yping | FrameSelection::ClearTypingStyle);
223 EXPECT_EQ(startCount, layoutCount()); 223 EXPECT_EQ(startCount, layoutCount());
224 } 224 }
225 225
226 } // namespace blink 226 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTextFormControlElement.cpp ('k') | Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698