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

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

Issue 2875933004: Utilize Position::IsEquivalent() in {Up,Down}streamIgnoringEditingBoundaries() (Closed)
Patch Set: 2017-05-15T13:22:30 Created 3 years, 7 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/VisibleUnits.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/VisibleUnitsTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
index 127fdc983857351037aa2d0a3366ee6229ed8dda..8795eb6b3f8b2a76961c3df53c7a35e9cb522301 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
@@ -293,6 +293,21 @@ TEST_F(VisibleUnitsTest, computeInlineBoxPositionBidiIsolate) {
actual.inline_box);
}
+// http://crbug.com/716093
+TEST_F(VisibleUnitsTest, ComputeInlineBoxPositionMixedEditable) {
+ SetBodyContent(
+ "<div contenteditable id=sample>abc<input contenteditable=false></div>");
+ Element* const sample = GetDocument().getElementById("sample");
+
+ const InlineBoxPosition& actual = ComputeInlineBoxPosition(
+ Position::LastPositionInNode(sample), TextAffinity::kDownstream);
+ // Should not be in infinite-loop
+ EXPECT_EQ(nullptr, actual.inline_box);
+ // TODO(editing-dev): We should return 0 for |InlineBoxPosition| when
+ // |inline_box| is null.
+ EXPECT_EQ(2, actual.offset_in_box);
+}
+
TEST_F(VisibleUnitsTest, endOfDocument) {
const char* body_content = "<a id=host><b id=one>1</b><b id=two>22</b></a>";
const char* shadow_content =
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleUnits.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698