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 3d71e54d8f096db05946560f3c35cb43baca6368..4a1815e1efe6f18ecaaf1f647fe78768020790d9 100644 |
--- a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp |
+++ b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp |
@@ -1997,4 +1997,14 @@ TEST_F(VisibleUnitsTest, |
EXPECT_TRUE(endsOfNodeAreVisuallyDistinctPositions(button)); |
} |
+TEST_F(VisibleUnitsTest, localSelectionRectOfPositionTemplateNotCrash) { |
+ // Repro case of crbug.com/584030 |
+ const char* bodyContent = "<div>foo<img /></div>"; |
yosin_UTC9
2017/01/20 05:59:53
No need to have |bodyContent|.
s"<img />"<img>"
yoichio
2017/01/20 08:30:41
Done.
|
+ setBodyContent(bodyContent); |
+ |
+ Node* node = document().querySelector("img"); |
+ IntRect r = absoluteSelectionBoundsOf(VisiblePosition::create( |
yosin_UTC9
2017/01/20 05:59:53
nit: Please avoid to use one letter variable name.
yoichio
2017/01/20 08:30:41
Done.
|
+ PositionWithAffinity(Position(node, PositionAnchorType::AfterChildren)))); |
+} |
yosin_UTC9
2017/01/20 05:59:53
EXPECT_EQ(IntRect(), r) ?
|
+ |
} // namespace blink |