ASSERT failure due to combine-text with preceding spaces

https://bugs.webkit.org/show_bug.cgi?id=65147

Patch by Ken Buchanan <kenrb@chromium.org> on 2012-01-06
Reviewed by David Hyatt.

Source/WebCore:

A couple of ASSERTs were failing due to a parsing problem when
advancing an inline iterator to the next linebreak in a
RenderCombineText. skipLeadingWhitespace advances the iterator
over leading whitespace but when searching for the line break
nextLineBreak would call RenderCombineText::combineText(),
collapsing the text so that the iterator is pointing past the
end of it.

This patch causes combineText() to be called during
skipLeadingWhiteSpace before iteration over the RenderCombineText
begins.

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::LineBreaker::nextLineBreak):
(WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):

LayoutTests:

New test with combine-text that begins with mutiple spaces,
showing ASSERT failures in bug 65147.

* fast/text/international/spaces-combined-in-vertical-text.html: Added
* fast/text/international/spaces-combined-in-vertical-text-expected.txt: Added

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 40542f9b
2012-01-06 Ken Buchanan <kenrb@chromium.org>
ASSERT failure due to combine-text with preceding spaces
https://bugs.webkit.org/show_bug.cgi?id=65147
Reviewed by David Hyatt.
New test with combine-text that begins with mutiple spaces,
showing ASSERT failures in bug 65147.
* fast/text/international/spaces-combined-in-vertical-text.html: Added
* fast/text/international/spaces-combined-in-vertical-text-expected.txt: Added
2012-01-06 Abhishek Arya <inferno@chromium.org>
Crash with range selection across different documents.
<body
style="-webkit-columns: rosybrown; -webkit-writing-mode: vertical-lr; ">
<div style="-webkit-hyphenate-character: floating; zoom: 900; -webkit-text-combine: horizontal; font-size: 600; ">
PASS if no ASSERT fail or crash in debug build.</div></body>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
2012-01-06 Ken Buchanan <kenrb@chromium.org>
ASSERT failure due to combine-text with preceding spaces
https://bugs.webkit.org/show_bug.cgi?id=65147
Reviewed by David Hyatt.
A couple of ASSERTs were failing due to a parsing problem when
advancing an inline iterator to the next linebreak in a
RenderCombineText. skipLeadingWhitespace advances the iterator
over leading whitespace but when searching for the line break
nextLineBreak would call RenderCombineText::combineText(),
collapsing the text so that the iterator is pointing past the
end of it.
This patch causes combineText() to be called during
skipLeadingWhiteSpace before iteration over the RenderCombineText
begins.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::LineBreaker::nextLineBreak):
(WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
2012-01-06 Anders Carlsson <andersca@apple.com>
Make ScrollAnimatorMac::snapRubberBandTimerFired use m_scrollElasticityController in more places
......@@ -1889,6 +1889,10 @@ void RenderBlock::LineBreaker::skipLeadingWhitespace(InlineBidiResolver& resolve
}
} else if (object->isFloating())
m_block->positionNewFloatOnLine(m_block->insertFloatingObject(toRenderBox(object)), lastFloatFromPreviousLine, lineInfo, width);
else if (object->isText() && object->style()->hasTextCombine() && object->isCombineText()) {
toRenderCombineText(object)->combineText();
continue;
}
resolver.increment();
}
resolver.commitExplicitEmbedding();
......@@ -2279,7 +2283,7 @@ InlineIterator RenderBlock::LineBreaker::nextLineBreak(InlineBidiResolver& resol
#endif
RenderStyle* style = t->style(lineInfo.isFirstLine());
if (style->hasTextCombine() && current.m_obj->isCombineText())
if (style->hasTextCombine() && current.m_obj->isCombineText() && !toRenderCombineText(current.m_obj)->isCombined())
toRenderCombineText(current.m_obj)->combineText();
const Font& f = style->font();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment