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 "core/dom/Text.h" | 7 #include "core/dom/Text.h" |
8 #include "core/editing/EditingTestBase.h" | 8 #include "core/editing/EditingTestBase.h" |
9 #include "core/editing/VisiblePosition.h" | 9 #include "core/editing/VisiblePosition.h" |
10 #include "core/html/HTMLTextFormControlElement.h" | 10 #include "core/html/HTMLTextFormControlElement.h" |
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 logicalEndOfLine(createVisiblePositionInFlatTree(*one, 1)) | 1162 logicalEndOfLine(createVisiblePositionInFlatTree(*one, 1)) |
1163 .deepEquivalent()); | 1163 .deepEquivalent()); |
1164 | 1164 |
1165 EXPECT_EQ(Position(seven, 7), | 1165 EXPECT_EQ(Position(seven, 7), |
1166 logicalEndOfLine(createVisiblePositionInDOMTree(*two, 0)) | 1166 logicalEndOfLine(createVisiblePositionInDOMTree(*two, 0)) |
1167 .deepEquivalent()); | 1167 .deepEquivalent()); |
1168 EXPECT_EQ(PositionInFlatTree(two, 2), | 1168 EXPECT_EQ(PositionInFlatTree(two, 2), |
1169 logicalEndOfLine(createVisiblePositionInFlatTree(*two, 0)) | 1169 logicalEndOfLine(createVisiblePositionInFlatTree(*two, 0)) |
1170 .deepEquivalent()); | 1170 .deepEquivalent()); |
1171 | 1171 |
1172 // TODO(yosin) logicalEndOfLine(two, 1) -> (five, 5) is a broken result. We ke
ep | 1172 // TODO(yosin) logicalEndOfLine(two, 1) -> (five, 5) is a broken result. We |
1173 // it as a marker for future change. | 1173 // keep it as a marker for future change. |
1174 EXPECT_EQ(Position(five, 5), | 1174 EXPECT_EQ(Position(five, 5), |
1175 logicalEndOfLine(createVisiblePositionInDOMTree(*two, 1)) | 1175 logicalEndOfLine(createVisiblePositionInDOMTree(*two, 1)) |
1176 .deepEquivalent()); | 1176 .deepEquivalent()); |
1177 EXPECT_EQ(PositionInFlatTree(two, 2), | 1177 EXPECT_EQ(PositionInFlatTree(two, 2), |
1178 logicalEndOfLine(createVisiblePositionInFlatTree(*two, 1)) | 1178 logicalEndOfLine(createVisiblePositionInFlatTree(*two, 1)) |
1179 .deepEquivalent()); | 1179 .deepEquivalent()); |
1180 | 1180 |
1181 EXPECT_EQ(Position(five, 5), | 1181 EXPECT_EQ(Position(five, 5), |
1182 logicalEndOfLine(createVisiblePositionInDOMTree(*three, 0)) | 1182 logicalEndOfLine(createVisiblePositionInDOMTree(*three, 0)) |
1183 .deepEquivalent()); | 1183 .deepEquivalent()); |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1993 // Repro case of crbug.com/584030 | 1993 // Repro case of crbug.com/584030 |
1994 const char* bodyContent = | 1994 const char* bodyContent = |
1995 "<button><rt><script>document.designMode = 'on'</script></rt></button>"; | 1995 "<button><rt><script>document.designMode = 'on'</script></rt></button>"; |
1996 setBodyContent(bodyContent); | 1996 setBodyContent(bodyContent); |
1997 | 1997 |
1998 Node* button = document().querySelector("button"); | 1998 Node* button = document().querySelector("button"); |
1999 EXPECT_TRUE(endsOfNodeAreVisuallyDistinctPositions(button)); | 1999 EXPECT_TRUE(endsOfNodeAreVisuallyDistinctPositions(button)); |
2000 } | 2000 } |
2001 | 2001 |
2002 } // namespace blink | 2002 } // namespace blink |
OLD | NEW |