Index: third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h |
diff --git a/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h b/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h |
index c203467ba4fa2fc68bee0534f95a68392d6216a0..e1ce311686eed526d4cd5c9b693d4ddb10651b32 100644 |
--- a/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h |
+++ b/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h |
@@ -1159,6 +1159,14 @@ inline void BreakingContext::commitAndUpdateLineBreakIfNeeded() |
if (m_width.committedWidth()) { |
m_atEnd = true; |
+ // When a line break is inserted instead of a trailing space of text, |
+ // we need to restore the space while the text is copied(ctrl+c). |
+ // See http://crbug.com/318925 |
+ if (m_lastObject != m_current.getLineLayoutItem() && m_lastObject.isText() && m_current.getLineLayoutItem().isText()) { |
+ LineLayoutText lastLayoutText(m_lastObject); |
+ if (lastLayoutText.text().endsWith(' ')) |
+ lastLayoutText.setLineBreakForTextWrap(true); |
+ } |
return; |
} |