[Webkit-unassigned] [Bug 27593] [Qt] Hyphenation is broken (no hyphens visible) for QtWebkit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 28 11:50:28 PST 2011


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


Joe Wild <joseph.wild at nokia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joseph.wild at nokia.com




--- Comment #6 from Joe Wild <joseph.wild at nokia.com>  2011-02-28 11:50:28 PST ---
https://bugs.webkit.org/show_bug.cgi?id=27593
3. 27593 Nor P2 All webkit-unassigned at lists.web...  NEW [Qt] Hyphenation
is broken (no hyphens visible) for QtWebkit

>From what I can tell the Qt line text breaking code does not honor the
soft hypen (&Shy;).

Below is a edited call stack.  I replaced soft hyphen char with
"\xAD".  Basically, it shows the WebCore line breaking calling into
the Qt TextBreakIterator and then into Qt
QTextBoundaryFinder::toNextBoundary(),


#0  WebCore::textBreakFollowing (bi=0x340bfe0, pos=19)
    /Source/WebCore/platform/text/qt/TextBreakIteratorQt.cpp:12

    int textBreakFollowing(TextBreakIterator* bi, int pos)
    {
        bi->setPosition(pos);
        int newpos = bi->toNextBoundary();
        DEBUG() << "textBreakFollowing" << pos << newpos;
        return newpos;
    }
#1  WebCore::lineBreakIterator
    /Source/WebCore/platform/text/qt/TextBreakIteratorQt.cpp:95
#2  WebCore::nextBreakablePosition 
#3  WebCore::isBreakable 
    /Source/WebCore/rendering/break_lines.h:33
#4  WebCore::RenderBlock::findNextLineBreak
    /Source/WebCore/rendering/RenderBlockLineLayout.cpp:1725
#5  WebCore::RenderBlock::layoutInlineChildren 
    /Source/WebCore/rendering/RenderBlockLineLayout.cpp:681
#6  WebCore::RenderBlock::layoutBlock 
    /Source/WebCore/rendering/RenderBlock.cpp:1222


Since I don't have Qt enabled for debugging, I traced that by looking
at the source.

The QTextBoundaryFinder::toNextBoundary() for Line skips anything <
HB_Break which means it will only return the position for HB_Break or
HB_ForcedBreak.  HB_SoftHyphen is ignored.  This routine returns when
it encounters the next whitespace ignoring any soft hyphens.

int QTextBoundaryFinder::toNextBoundary()
{
...
    case Line:
        Q_ASSERT(pos);
        while (pos < length && d->attributes[pos-1].lineBreakType < HB_Break)
            ++pos;
        break;

toNextBoundary uses harfbuzz.
./3rdparty/harfbuzz/src/harfbuzz-shaper.h:


typedef enum {
    HB_NoBreak,
    HB_SoftHyphen,
    HB_Break,
    HB_ForcedBreak
} HB_LineBreakType;

So is this as simple as changing the condition to < HB_SoftHyphen or 
is there a deeper problem.  Need to investigate.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list