Commit a4d6cdc1 authored by harrison's avatar harrison

Reverted the code part of r16696, my patch for...

        Reverted the code part of r16696, my patch for <rdar://problem/4641262>, because the problem was
        addressed at a deeper level by r16696, the patch for <http://bugs.webkit.org/show_bug.cgi?id=10842>.
        Left the layout test.
        
        * rendering/bidi.cpp:
        (WebCore::checkMidpoints):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0a779084
2006-10-02 David Harrison <harrison@apple.com>
Reverted the code part of r16696, my patch for <rdar://problem/4641262>, because the problem was
addressed at a deeper level by r16696, the patch for <http://bugs.webkit.org/show_bug.cgi?id=10842>.
Left the layout test.
* rendering/bidi.cpp:
(WebCore::checkMidpoints):
2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by eseidel. Landed by eseidel.
......@@ -104,8 +104,6 @@ static bool previousLineBrokeCleanly = true;
static bool emptyRun = true;
static int numSpaces;
static const unsigned short nonBreakingSpace = 0xa0;
static void embed(UCharDirection, BidiState&);
static void appendRun(BidiState&);
......@@ -503,17 +501,6 @@ static void chopMidpointsAt(RenderObject* obj, unsigned pos)
}
}
static bool isTrimmable(RenderText* textObj, unsigned int index)
{
ASSERT(index < textObj->length());
// FIXME: Also ask ICU whether character is whitespace? Seems expensive. Is it needed for correctness?
UChar c = textObj->text()[index];
return c == ' ' || c == '\t' ||
(c == '\n' && !textObj->style()->preserveNewline()) ||
(c == nonBreakingSpace && textObj->style()->nbspMode() == SPACE);
}
static void checkMidpoints(BidiIterator& lBreak, BidiState& bidi)
{
// Check to see if our last midpoint is a start point beyond the line break. If so,
......@@ -531,9 +518,10 @@ static void checkMidpoints(BidiIterator& lBreak, BidiState& bidi)
sNumMidpoints--;
if (endpoint.obj->style()->collapseWhiteSpace()) {
if (endpoint.obj->isText()) {
// Don't shave a character off the endpoint if it was from a soft hyphen.
RenderText* textObj = static_cast<RenderText*>(endpoint.obj);
if (endpoint.pos+1 < textObj->length()) {
if (!isTrimmable(textObj, endpoint.pos+1))
if (textObj->text()[endpoint.pos+1] == SOFT_HYPHEN)
return;
} else if (startpoint.obj->isText()) {
RenderText *startText = static_cast<RenderText*>(startpoint.obj);
......@@ -1907,6 +1895,8 @@ bool RenderBlock::matchedEndLine(const BidiIterator& start, const BidiStatus& st
return false;
}
static const unsigned short nonBreakingSpace = 0xa0;
static inline bool skipNonBreakingSpace(BidiIterator &it)
{
if (it.obj->style()->nbspMode() != SPACE || it.current() != nonBreakingSpace)
......
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