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

Unified Diff: Source/core/rendering/InlineIterator.h

Issue 813133002: iter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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 | « no previous file | Source/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/InlineIterator.h
diff --git a/Source/core/rendering/InlineIterator.h b/Source/core/rendering/InlineIterator.h
index c2d2f53047398d9439514682904c8b56c41a6c3c..6176099e323c4e45fa8d19da64a673fecd7e224f 100644
--- a/Source/core/rendering/InlineIterator.h
+++ b/Source/core/rendering/InlineIterator.h
@@ -484,6 +484,11 @@ inline int InlineBidiResolver::findFirstTrailingSpaceAtRun(BidiRun* run)
return run->m_stop;
RenderText* lastText = toRenderText(lastObject);
+
+ // There can only be trailing space if the lastText node has two or more code-points.
+ if (lastText->textLength() <= 1)
+ return run->stop();
+
int firstSpace;
if (lastText->is8Bit())
firstSpace = findFirstTrailingSpace(lastText, lastText->characters8(), run->start(), run->stop());
« no previous file with comments | « no previous file | Source/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698