OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. |
4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
5 * Copyright (C) 2013 Adobe Systems Incorporated. | 5 * Copyright (C) 2013 Adobe Systems Incorporated. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1152 } | 1152 } |
1153 | 1153 |
1154 ASSERT_WITH_SECURITY_IMPLICATION(m_currentStyle->refCount() > 0); | 1154 ASSERT_WITH_SECURITY_IMPLICATION(m_currentStyle->refCount() > 0); |
1155 if (checkForBreak && !m_width.fitsOnLine()) { | 1155 if (checkForBreak && !m_width.fitsOnLine()) { |
1156 // if we have floats, try to get below them. | 1156 // if we have floats, try to get below them. |
1157 if (m_currentCharacterIsSpace && !m_ignoringSpaces && m_currentStyle->co
llapseWhiteSpace()) | 1157 if (m_currentCharacterIsSpace && !m_ignoringSpaces && m_currentStyle->co
llapseWhiteSpace()) |
1158 m_trailingObjects.clear(); | 1158 m_trailingObjects.clear(); |
1159 | 1159 |
1160 if (m_width.committedWidth()) { | 1160 if (m_width.committedWidth()) { |
1161 m_atEnd = true; | 1161 m_atEnd = true; |
| 1162 // When a line break is inserted instead of a trailing space of text
, |
| 1163 // we need to restore the space while the text is copied(ctrl+c). |
| 1164 // See http://crbug.com/318925 |
| 1165 if (m_lastObject != m_current.getLineLayoutItem() && m_lastObject.is
Text() && m_current.getLineLayoutItem().isText()) { |
| 1166 LineLayoutText lastLayoutText(m_lastObject); |
| 1167 if (lastLayoutText.text().endsWith(' ')) |
| 1168 lastLayoutText.setLineBreakForTextWrap(true); |
| 1169 } |
1162 return; | 1170 return; |
1163 } | 1171 } |
1164 | 1172 |
1165 m_width.fitBelowFloats(m_lineInfo.isFirstLine()); | 1173 m_width.fitBelowFloats(m_lineInfo.isFirstLine()); |
1166 | 1174 |
1167 // |width| may have been adjusted because we got shoved down past a floa
t (thus | 1175 // |width| may have been adjusted because we got shoved down past a floa
t (thus |
1168 // giving us more room), so we need to retest, and only jump to | 1176 // giving us more room), so we need to retest, and only jump to |
1169 // the end label if we still don't fit on the line. -dwh | 1177 // the end label if we still don't fit on the line. -dwh |
1170 if (!m_width.fitsOnLine()) { | 1178 if (!m_width.fitsOnLine()) { |
1171 m_atEnd = true; | 1179 m_atEnd = true; |
(...skipping 23 matching lines...) Expand all Loading... |
1195 | 1203 |
1196 if (style.getTextIndentType() == TextIndentHanging) | 1204 if (style.getTextIndentType() == TextIndentHanging) |
1197 indentText = indentText == IndentText ? DoNotIndentText : IndentText; | 1205 indentText = indentText == IndentText ? DoNotIndentText : IndentText; |
1198 | 1206 |
1199 return indentText; | 1207 return indentText; |
1200 } | 1208 } |
1201 | 1209 |
1202 } // namespace blink | 1210 } // namespace blink |
1203 | 1211 |
1204 #endif // BreakingContextInlineHeaders_h | 1212 #endif // BreakingContextInlineHeaders_h |
OLD | NEW |