Index: Source/core/rendering/RenderText.cpp |
diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp |
index 5c2ff91236b44a3f6956448dff3cfa445c9d364e..2cd6e5a0f5051b9ba565ef30f3a2b1c60d60ec2d 100644 |
--- a/Source/core/rendering/RenderText.cpp |
+++ b/Source/core/rendering/RenderText.cpp |
@@ -818,7 +818,7 @@ void RenderText::trimmedPrefWidths(float leadWidth, |
maxW += font.wordSpacing(); |
} |
- stripFrontSpaces = collapseWhiteSpace && m_hasEndWS; |
+ stripFrontSpaces = collapseWhiteSpace && m_hasEndWhiteSpace; |
if (!style()->autoWrap() || minW > maxW) |
minW = maxW; |
@@ -946,6 +946,7 @@ void RenderText::computePreferredLogicalWidths(float leadWidth, HashSet<const Si |
m_hasTab = false; |
m_hasBeginWS = false; |
m_hasEndWS = false; |
+ m_hasEndWhiteSpace = false; |
RenderStyle* styleToUse = style(); |
const Font& f = styleToUse->font(); // FIXME: This ignores first-line. |
@@ -1008,10 +1009,13 @@ void RenderText::computePreferredLogicalWidths(float leadWidth, HashSet<const Si |
} else |
isSpace = c == ' '; |
- if ((isSpace || isNewline) && !i) |
- m_hasBeginWS = true; |
- if ((isSpace || isNewline) && i == len - 1) |
- m_hasEndWS = true; |
+ bool isBreakableLocation = isNewline || (isSpace && styleToUse->autoWrap()); |
+ if (!i) |
+ m_hasBeginWS = isBreakableLocation; |
+ if (i == len - 1) { |
+ m_hasEndWS = isBreakableLocation; |
+ m_hasEndWhiteSpace = isNewline || isSpace; |
cbiesinger
2013/06/14 22:45:50
OK, so the difference between m_hasEndWS and m_has
ojan
2013/06/14 22:53:37
There's a FIXME in RenderText.h to renamed m_hasEn
|
+ } |
if (!ignoringSpaces && styleToUse->collapseWhiteSpace() && previousCharacterIsSpace && isSpace) |
ignoringSpaces = true; |