Index: Source/core/editing/PlainTextRange.cpp |
diff --git a/Source/core/editing/PlainTextRange.cpp b/Source/core/editing/PlainTextRange.cpp |
index 1ebc8f4716fb1799a702f0b3bebb88d5e8f3b1a4..957e1c25e15ba983708734b231a8f97200f6afaa 100644 |
--- a/Source/core/editing/PlainTextRange.cpp |
+++ b/Source/core/editing/PlainTextRange.cpp |
@@ -110,9 +110,10 @@ PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeFor(const ContainerNode |
// Fix textRunRange->endPosition(), but only if foundStart || foundEnd, because it is only |
// in those cases that textRunRange is used. |
if (foundEnd) { |
- // FIXME: This is a workaround for the fact that the end of a run is often at the wrong |
- // position for emitted '\n's. |
- if (len == 1 && it.characterAt(0) == '\n') { |
+ // FIXME: This is a workaround for the fact that the end of a run |
+ // is often at the wrong position for emitted '\n's or if the |
+ // renderer of the current node is a replaced element. |
+ if (len == 1 && (it.characterAt(0) == '\n' || it.isInsideReplacedElement())) { |
scope.document().updateLayoutIgnorePendingStylesheets(); |
it.advance(); |
if (!it.atEnd()) { |