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

Unified Diff: third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp

Issue 2723913002: Relax text validation in FrameSelection::selectWordAroundPosition (Closed)
Patch Set: update Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
index 63aaf27acca6c9f8983ae59bce0187bdb46a8d43..722dbb0452d4b09cf878c401071c4246bf8cbb36 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
@@ -127,6 +127,19 @@ TEST_F(FrameSelectionTest, SelectWordAroundPosition) {
EXPECT_EQ_SELECTED_TEXT("Baz");
}
+// crbug.com/657996
+TEST_F(FrameSelectionTest, SelectWordAroundPosition2) {
+ setBodyContent(
+ "<p style='width:70px; font-size:14px'>foo bar<em>+</em> baz</p>");
+ // "foo bar
+ // b|az"
+ Node* const baz = document().body()->firstChild()->lastChild();
+ EXPECT_TRUE(selection().selectWordAroundPosition(
+ createVisiblePosition(Position(baz, 2))));
+ // TODO(yoichio): We should select only "baz".
+ EXPECT_EQ_SELECTED_TEXT(" baz");
+}
+
TEST_F(FrameSelectionTest, ModifyExtendWithFlatTree) {
setBodyContent("<span id=host></span>one");
setShadowContent("two<content></content>", "host");
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698