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

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

Issue 2709973005: Get rid of useless function VisibleSelection::updateIfNeeded() (Closed)
Patch Set: 2017-02-25T10:01:23 Do not remove FrameSelection::updateIfNeeded() Created 3 years, 9 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 | « third_party/WebKit/Source/core/editing/VisibleSelection.cpp ('k') | 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 // 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/VisibleSelection.h" 5 #include "core/editing/VisibleSelection.h"
6 6
7 #include "core/dom/Range.h" 7 #include "core/dom/Range.h"
8 #include "core/editing/EditingTestBase.h" 8 #include "core/editing/EditingTestBase.h"
9 #include "core/editing/SelectionAdjuster.h" 9 #include "core/editing/SelectionAdjuster.h"
10 10
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 .collapse(Position(sample->firstChild(), 0)) 472 .collapse(Position(sample->firstChild(), 0))
473 .build()); 473 .build());
474 EXPECT_EQ(Position(sample->firstChild(), 0), selection.start()); 474 EXPECT_EQ(Position(sample->firstChild(), 0), selection.start());
475 475
476 // Simulates modifying DOM tree to invalidate distribution. 476 // Simulates modifying DOM tree to invalidate distribution.
477 Element* host = document().getElementById("host"); 477 Element* host = document().getElementById("host");
478 host->appendChild(sample); 478 host->appendChild(sample);
479 document().updateStyleAndLayout(); 479 document().updateStyleAndLayout();
480 480
481 // Simulates to restore selection from undo stack. 481 // Simulates to restore selection from undo stack.
482 selection.updateIfNeeded(); 482 selection = createVisibleSelection(selection.asSelection());
483 EXPECT_EQ(Position(sample->firstChild(), 0), selection.start()); 483 EXPECT_EQ(Position(sample->firstChild(), 0), selection.start());
484 } 484 }
485 485
486 } // namespace blink 486 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698