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

Unified Diff: third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h

Issue 2280513004: Restore a collapsed trailing space of text used for line break (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add CJK and word-break: break-all cases Created 4 years, 4 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: 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;
}

Powered by Google App Engine
This is Rietveld 408576698