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

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: Fix style issues. 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..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()) {
« no previous file with comments | « LayoutTests/editing/inserting/insert-with-javascript-protocol-crash-expected.txt ('k') | Source/core/editing/TextIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698