Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp b/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp |
| index e0c1ebccd012d0dfb37624b74ba9f51157e18f4b..ac210fca7cc0e2abceb87eafa4f1d960801a1b12 100644 |
| --- a/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp |
| +++ b/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp |
| @@ -70,6 +70,26 @@ VisibleSelectionTemplate<Strategy> expandUsingGranularity( |
| .build()); |
| } |
| +// For http://crbug.com/700368 |
| +TEST_F(VisibleSelectionTest, appendTrailingWhitespaceWithAfterAnchor) { |
| + setBodyContent( |
| + "<input type=checkbox>" |
| + "<div style='user-select:none'>abc</div>"); |
| + Element* const input = document().querySelector("input"); |
| + |
| + // Simulate double-clicking "abc" |
|
yoichio
2017/03/15 04:49:29
double-clicking on user-select:none should not sel
yosin_UTC9
2017/03/15 05:34:26
No, this is current behavior and the test case pro
|
| + VisibleSelection selection = |
| + createVisibleSelection(SelectionInDOMTree::Builder() |
| + .collapse(Position::beforeNode(input)) |
| + .extend(Position::afterNode(input)) |
| + .setGranularity(WordGranularity) |
| + .build()); |
| + selection.appendTrailingWhitespace(); |
| + |
| + EXPECT_EQ(Position::beforeNode(input), selection.start()); |
| + EXPECT_EQ(Position::afterNode(input), selection.end()); |
| +} |
| + |
| TEST_F(VisibleSelectionTest, expandUsingGranularity) { |
| const char* bodyContent = |
| "<span id=host><a id=one>1</a><a id=two>22</a></span>"; |