OLD | NEW |
---|---|
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 Loading... | |
2030 TEST_F(VisibleUnitsTest, | 2030 TEST_F(VisibleUnitsTest, |
2031 canonicalizationWithCollapsedSpaceAndIsolatedCombiningCharacter) { | 2031 canonicalizationWithCollapsedSpaceAndIsolatedCombiningCharacter) { |
2032 setBodyContent("<p> ⃣</p>"); // Leading space is necessary | 2032 setBodyContent("<p> ⃣</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 |
OLD | NEW |