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

Unified Diff: Source/core/editing/PlainTextRange.cpp

Issue 342483002: The length of a TextIterator containing replaced element is at least 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated patch Created 6 years, 6 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
Index: Source/core/editing/PlainTextRange.cpp
diff --git a/Source/core/editing/PlainTextRange.cpp b/Source/core/editing/PlainTextRange.cpp
index 1ebc8f4716fb1799a702f0b3bebb88d5e8f3b1a4..1bc69378452a4c9bc83b8754b7cc76f378f5f6a2 100644
--- a/Source/core/editing/PlainTextRange.cpp
+++ b/Source/core/editing/PlainTextRange.cpp
@@ -111,8 +111,8 @@ PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeFor(const ContainerNode
// 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') {
+ // position for emitted '\n's or if the renderer of the current node is a replaced element.
tkent 2014/06/27 05:02:43 nit: Recommend to wrap comments in 80-columns.
+ if (len == 1 && (it.characterAt(0) == '\n' || it.isInsideReplacedElement())) {
scope.document().updateLayoutIgnorePendingStylesheets();
it.advance();
if (!it.atEnd()) {

Powered by Google App Engine
This is Rietveld 408576698