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

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

Issue 2760533004: CANCELLED Non-laid-out node should not be considered as user-select:contain (Closed)
Patch Set: 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/VisibleUnits.h" 5 #include "core/editing/VisibleUnits.h"
6 6
7 #include <ostream> // NOLINT 7 #include <ostream> // NOLINT
8 #include "bindings/core/v8/V8BindingForTesting.h" 8 #include "bindings/core/v8/V8BindingForTesting.h"
9 #include "core/dom/Text.h" 9 #include "core/dom/Text.h"
10 #include "core/editing/EditingTestBase.h" 10 #include "core/editing/EditingTestBase.h"
(...skipping 2019 matching lines...) Expand 10 before | Expand all | Expand 10 after
2030 TEST_F(VisibleUnitsTest, 2030 TEST_F(VisibleUnitsTest,
2031 canonicalizationWithCollapsedSpaceAndIsolatedCombiningCharacter) { 2031 canonicalizationWithCollapsedSpaceAndIsolatedCombiningCharacter) {
2032 setBodyContent("<p> &#x20E3;</p>"); // Leading space is necessary 2032 setBodyContent("<p> &#x20E3;</p>"); // Leading space is necessary
2033 2033
2034 Node* paragraph = document().querySelector("p"); 2034 Node* paragraph = document().querySelector("p");
2035 Node* text = paragraph->firstChild(); 2035 Node* text = paragraph->firstChild();
2036 Position start = canonicalPositionOf(Position::beforeNode(paragraph)); 2036 Position start = canonicalPositionOf(Position::beforeNode(paragraph));
2037 EXPECT_EQ(Position(text, 2), start); 2037 EXPECT_EQ(Position(text, 2), start);
2038 } 2038 }
2039 2039
2040 // Regression test for crbug.com/702756
2041 TEST_F(VisibleUnitsTest, canonicalizeSelectOutOfFlatTree) {
2042 setBodyContent("<div id=host><select></select></div>");
2043 setShadowContent("foo", "host");
2044
2045 Element* select = document().querySelector("select");
2046 EXPECT_EQ(PositionInFlatTree(),
2047 canonicalPositionOf(PositionInFlatTree::afterNode(select)));
yoichio 2017/03/21 06:48:43 Getting an node which is after of the node that do
yosin_UTC9 2017/03/21 08:48:51 Agree, we should not accept position not in flat t
Xiaocheng 2017/03/21 20:27:48 It's found when trying to remove layout update fro
yosin_UTC9 2017/03/22 03:19:28 Yes, this is valid for SelectionInDOMTree. But, no
2048 }
2049
2040 } // namespace blink 2050 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698