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

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

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Back out non-Oilpan experiment + tidy up by adding frame() ref accessors Created 6 years, 3 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 // 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/Position.h" 8 #include "core/dom/Position.h"
9 #include "core/dom/Text.h" 9 #include "core/dom/Text.h"
10 #include "core/editing/FrameSelection.h" 10 #include "core/editing/FrameSelection.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 HTMLInputElement* input = toHTMLInputElement(document().getElementById("inpu t")); 211 HTMLInputElement* input = toHTMLInputElement(document().getElementById("inpu t"));
212 input->focus(); 212 input->focus();
213 input->setValue("Hello, input field"); 213 input->setValue("Hello, input field");
214 VisibleSelection oldSelection = document().frame()->selection().selection(); 214 VisibleSelection oldSelection = document().frame()->selection().selection();
215 215
216 Position newPosition(input->innerEditorElement()->firstChild(), 3, Position: :PositionIsOffsetInAnchor); 216 Position newPosition(input->innerEditorElement()->firstChild(), 3, Position: :PositionIsOffsetInAnchor);
217 VisibleSelection newSelection(newPosition, DOWNSTREAM); 217 VisibleSelection newSelection(newPosition, DOWNSTREAM);
218 document().frame()->selection().setSelection(newSelection, FrameSelection::C loseTyping | FrameSelection::ClearTypingStyle | FrameSelection::DoNotUpdateAppea rance); 218 document().frame()->selection().setSelection(newSelection, FrameSelection::C loseTyping | FrameSelection::ClearTypingStyle | FrameSelection::DoNotUpdateAppea rance);
219 ASSERT_EQ(3, input->selectionStart()); 219 ASSERT_EQ(3, input->selectionStart());
220 220
221 OwnPtr<SpellChecker> spellChecker(SpellChecker::create(page().frame())); 221 OwnPtrWillBePersistent<SpellChecker> spellChecker(SpellChecker::create(page( ).frame()));
222 forceLayoutFlag(); 222 forceLayoutFlag();
223 int startCount = layoutCount(); 223 int startCount = layoutCount();
224 spellChecker->respondToChangedSelection(oldSelection, FrameSelection::CloseT yping | FrameSelection::ClearTypingStyle); 224 spellChecker->respondToChangedSelection(oldSelection, FrameSelection::CloseT yping | FrameSelection::ClearTypingStyle);
225 EXPECT_EQ(startCount, layoutCount()); 225 EXPECT_EQ(startCount, layoutCount());
226 } 226 }
227 227
228 } 228 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698