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

Side by Side Diff: third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp

Issue 2286203004: Revert of Fix paint invalidation and painting for composited-scrolling input elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 "core/editing/FrameSelection.h" 5 #include "core/editing/FrameSelection.h"
6 6
7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/Element.h" 9 #include "core/dom/Element.h"
10 #include "core/dom/Text.h" 10 #include "core/dom/Text.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // To force layout in next updateLayout calling, widen view. 114 // To force layout in next updateLayout calling, widen view.
115 FrameView& frameView = dummyPageHolder().frameView(); 115 FrameView& frameView = dummyPageHolder().frameView();
116 IntRect frameRect = frameView.frameRect(); 116 IntRect frameRect = frameView.frameRect();
117 frameRect.setWidth(frameRect.width() + 1); 117 frameRect.setWidth(frameRect.width() + 1);
118 frameRect.setHeight(frameRect.height() + 1); 118 frameRect.setHeight(frameRect.height() + 1);
119 dummyPageHolder().frameView().setFrameRect(frameRect); 119 dummyPageHolder().frameView().setFrameRect(frameRect);
120 } 120 }
121 std::unique_ptr<PaintController> paintController = PaintController::create() ; 121 std::unique_ptr<PaintController> paintController = PaintController::create() ;
122 { 122 {
123 GraphicsContext context(*paintController); 123 GraphicsContext context(*paintController);
124 DrawingRecorder drawingRecorder(context, *dummyPageHolder().frameView(). layoutView(), DisplayItem::Caret, LayoutRect::infiniteIntRect());
124 selection().paintCaret(context, LayoutPoint()); 125 selection().paintCaret(context, LayoutPoint());
125 } 126 }
126 paintController->commitNewDisplayItems(); 127 paintController->commitNewDisplayItems();
127 EXPECT_EQ(startCount, layoutCount()); 128 EXPECT_EQ(startCount, layoutCount());
128 } 129 }
129 130
130 TEST_F(FrameSelectionTest, InvalidatePreviousCaretAfterRemovingLastCharacter) 131 TEST_F(FrameSelectionTest, InvalidatePreviousCaretAfterRemovingLastCharacter)
131 { 132 {
132 Text* text = appendTextNode("Hello, World!"); 133 Text* text = appendTextNode("Hello, World!");
133 document().view()->updateAllLifecyclePhases(); 134 document().view()->updateAllLifecyclePhases();
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 selection().updateIfNeeded(); 312 selection().updateIfNeeded();
312 313
313 // TODO(yosin): Once lazy canonicalization implemented, selection.start 314 // TODO(yosin): Once lazy canonicalization implemented, selection.start
314 // should be Position(HTML, 0). 315 // should be Position(HTML, 0).
315 EXPECT_EQ(Position(), selection().start()) 316 EXPECT_EQ(Position(), selection().start())
316 << "updateIfNeeded() makes selection to null."; 317 << "updateIfNeeded() makes selection to null.";
317 EXPECT_EQ(selection().start(), caretPosition().position()); 318 EXPECT_EQ(selection().start(), caretPosition().position());
318 } 319 }
319 320
320 } // namespace blink 321 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameCaret.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698