<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>27593</bug_id>
          
          <creation_ts>2009-07-22 20:39:19 -0700</creation_ts>
          <short_desc>[Qt] Hyphenation is broken (no hyphens visible) for QtWebkit</short_desc>
          <delta_ts>2012-03-16 04:18:28 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Text</component>
          <version>420+</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt, QtTriaged</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexei Puzikov">puzikov</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cmarcelo</cc>
    
    <cc>jesus</cc>
    
    <cc>joseph.wild</cc>
    
    <cc>jturcotte</cc>
    
    <cc>kinbot</cc>
    
    <cc>kovid</cc>
    
    <cc>laszlo.gombos</cc>
    
    <cc>pierre.rossi</cc>
    
    <cc>vestbo</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>134012</commentid>
    <comment_count>0</comment_count>
    <who name="Alexei Puzikov">puzikov</who>
    <bug_when>2009-07-22 20:39:19 -0700</bug_when>
    <thetext>Steps to reproduce:

1. With any QtWebkit-based browser or example (tested with Arora+Qt4.5.2 and Browser demo from the same Qt) browse to http://www.cs.tut.fi/~jkorpela/shytest.html
2. Resize browser window.
3. Observe that words are hyphenated/broken, but no hyphens are visible.

Works OK with:
Safari, Konqueror, Firefox</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145204</commentid>
    <comment_count>1</comment_count>
    <who name="Tor Arne Vestbø">vestbo</who>
    <bug_when>2009-09-07 10:39:31 -0700</bug_when>
    <thetext>Confirmed in WebKit trunk (r48110), against Qt 4.6 (77fd77d6), on Mac OS 10.5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>196984</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-03-06 23:34:57 -0800</bug_when>
    <thetext>*** Bug 29576 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>196986</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-03-06 23:35:03 -0800</bug_when>
    <thetext>*** Bug 29573 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>196988</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-03-06 23:35:08 -0800</bug_when>
    <thetext>*** Bug 35838 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>225514</commentid>
    <comment_count>5</comment_count>
    <who name="Jesus Sanchez-Palencia">jesus</who>
    <bug_when>2010-05-13 14:35:26 -0700</bug_when>
    <thetext>Reproduced on Snow Leopard with Qt 4.7 trunk (HEAD 03f8f1df0d88f5ffe0b3120cffce614cbeefdb70) and WebKit trunk (r59155).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>359212</commentid>
    <comment_count>6</comment_count>
    <who name="Joe Wild">joseph.wild</who>
    <bug_when>2011-02-28 11:50:28 -0800</bug_when>
    <thetext>https://bugs.webkit.org/show_bug.cgi?id=27593
3. 27593 Nor P2 All webkit-unassigned@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 (&amp;Shy;).

Below is a edited call stack.  I replaced soft hyphen char with
&quot;\xAD&quot;.  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-&gt;setPosition(pos);
        int newpos = bi-&gt;toNextBoundary();
        DEBUG() &lt;&lt; &quot;textBreakFollowing&quot; &lt;&lt; pos &lt;&lt; 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&apos;t have Qt enabled for debugging, I traced that by looking
at the source.

The QTextBoundaryFinder::toNextBoundary() for Line skips anything &lt;
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 &lt; length &amp;&amp; d-&gt;attributes[pos-1].lineBreakType &lt; 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 &lt; HB_SoftHyphen or 
is there a deeper problem.  Need to investigate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>360163</commentid>
    <comment_count>7</comment_count>
    <who name="Joe Wild">joseph.wild</who>
    <bug_when>2011-03-01 13:12:34 -0800</bug_when>
    <thetext>
When I enable ICU in WebKit with the following, the test case passes.
  build-webkit --qt --debug --qmakearg=CONFIG+=text_breaking_with_icu 

This further points to this code
  ./src/corelib/tools/qtextboundaryfinder.cpp
  int QTextBoundaryFinder::toNextBoundary()

which is not called when ICU is enabled.

There is a corresponding Qt error
  https://qtrequirements.europe.nokia.com/browse/QT-4657
which I need to get reopened.  I think we closed the wrong error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>580361</commentid>
    <comment_count>8</comment_count>
    <who name="Pierre Rossi">pierre.rossi</who>
    <bug_when>2012-03-16 04:18:28 -0700</bug_when>
    <thetext>This seems to work well these days. Could be a side effect of fixing QTextBoundaryFinder. :)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>