Index: Source/core/rendering/RenderBlockLineLayout.cpp |
=================================================================== |
--- Source/core/rendering/RenderBlockLineLayout.cpp (revision 154315) |
+++ Source/core/rendering/RenderBlockLineLayout.cpp (working copy) |
@@ -2618,6 +2618,7 @@ |
// this to detect when we encounter a second space so we know we have to terminate |
// a run. |
bool currentCharacterIsSpace = false; |
+ bool currentCharacterShouldCollapseIfPreWap = false; |
TrailingObjects trailingObjects; |
InlineIterator lBreak = resolver.position(); |
@@ -2753,7 +2754,7 @@ |
&& shouldSkipWhitespaceAfterStartObject(m_block, current.m_obj, lineMidpointState)) { |
// Like with list markers, we start ignoring spaces to make sure that any |
// additional spaces we see will be discarded. |
- currentCharacterIsSpace = true; |
+ currentCharacterShouldCollapseIfPreWap = currentCharacterIsSpace = true; |
ignoringSpaces = true; |
} |
} |
@@ -2776,7 +2777,7 @@ |
lineInfo.setEmpty(false, m_block, &width); |
ignoringSpaces = false; |
- currentCharacterIsSpace = false; |
+ currentCharacterShouldCollapseIfPreWap = currentCharacterIsSpace = false; |
trailingObjects.clear(); |
// Optimize for a common case. If we can't find whitespace after the list |
@@ -2786,7 +2787,7 @@ |
if (blockStyle->collapseWhiteSpace() && shouldSkipWhitespaceAfterStartObject(m_block, current.m_obj, lineMidpointState)) { |
// Like with inline flows, we start ignoring spaces to make sure that any |
// additional spaces we see will be discarded. |
- currentCharacterIsSpace = true; |
+ currentCharacterShouldCollapseIfPreWap = currentCharacterIsSpace = true; |
ignoringSpaces = true; |
} |
if (toRenderListMarker(current.m_obj)->isInside()) |
@@ -2870,8 +2871,9 @@ |
UChar secondToLastCharacter = renderTextInfo.m_lineBreakIterator.secondToLastCharacter(); |
for (; current.m_pos < t->textLength(); current.fastIncrementInTextNode()) { |
bool previousCharacterIsSpace = currentCharacterIsSpace; |
+ bool previousCharacterShouldCollapseIfPreWap = currentCharacterShouldCollapseIfPreWap; |
UChar c = current.current(); |
- currentCharacterIsSpace = c == ' ' || c == '\t' || (!preserveNewline && (c == '\n')); |
+ currentCharacterShouldCollapseIfPreWap = currentCharacterIsSpace = c == ' ' || c == '\t' || (!preserveNewline && (c == '\n')); |
if (!collapseWhiteSpace || !currentCharacterIsSpace) |
lineInfo.setEmpty(false, m_block, &width); |
@@ -3057,7 +3059,7 @@ |
ignoreStart.m_pos = current.m_pos; |
} |
- if (!currentCharacterIsSpace && previousCharacterIsSpace) { |
+ if (!currentCharacterIsSpace && previousCharacterShouldCollapseIfPreWap) { |
if (autoWrap && currentStyle->breakOnlyAfterWhiteSpace()) |
lBreak.moveTo(current.m_obj, current.m_pos, current.m_nextBreakablePosition); |
} |