<?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>16981</bug_id>
          
          <creation_ts>2008-01-22 21:02:56 -0800</creation_ts>
          <short_desc>Thai word break support for platforms which don&apos;t use ICU</short_desc>
          <delta_ts>2012-08-02 04:17:20 -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>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://linux.thai.net/viewvc/viewvc.cgi/software/webkit/webkit-0svn25144/webkit_wordbreak.diff?revision=1.4&amp;view=markup</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>60786</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Pattara Kiatisevi">pattara</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>alp</cc>
    
    <cc>ap</cc>
    
    <cc>hausmann</cc>
    
    <cc>lars.knoll</cc>
    
    <cc>mitz</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68007</commentid>
    <comment_count>0</comment_count>
    <who name="Pattara Kiatisevi">pattara</who>
    <bug_when>2008-01-22 21:02:56 -0800</bug_when>
    <thetext>In Thai, a sentence is composed of several words without space in between like in English. Therefore it is neccessary for the software to know word boundary locations so that it can wrap the line properly (i.e., wrap between words, not in the middle of the word).

This patch adds Thai word break support for WebKit using libthai library (http://sourceforge.net/projects/libthai). The algorithm/code is very similar to the one in KDE&apos;s KHTML.

As a Thai, I think it&apos;s best to link WebKit with libthai since the compile time so that webkit will always come with full Thai support, but I understand the rest of the world who don&apos;t read Thai might not want to install libthai library when they don&apos;t really use it. Therefore the patch checks to load libthai dynamically (using dlopen) if libthai is not linked.

http://linux.thai.net/viewvc/viewvc.cgi/software/webkit/webkit-0svn25144/webkit_wordbreak.diff?revision=1.4&amp;view=markup</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68008</commentid>
    <comment_count>1</comment_count>
      <attachid>18616</attachid>
    <who name="Pattara Kiatisevi">pattara</who>
    <bug_when>2008-01-22 21:04:32 -0800</bug_when>
    <thetext>Created attachment 18616
Patch to enable Thai wordbreaking in WebKit

Tested with Ubuntu libqtwebkit0d package version 0~svn27674-1~gutsy1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68012</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-01-23 00:16:09 -0800</bug_when>
    <thetext>I&apos;m not sure about the scope of this bug. Does this work on Mac/Windows WebKit already, thanks to ICU? If not, could you please provide a test case showing the problems?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68016</commentid>
    <comment_count>3</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-01-23 00:26:35 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; I&apos;m not sure about the scope of this bug. Does this work on Mac/Windows WebKit
&gt; already, thanks to ICU?

On Mac OS X WebKit uses UCCreateTextBreakLocator precisely because the version of ICU that ships on the system does not support Thai (see bug 12175).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68022</commentid>
    <comment_count>4</comment_count>
    <who name="Pattara Kiatisevi">pattara</who>
    <bug_when>2008-01-23 03:44:22 -0800</bug_when>
    <thetext>Test page:

http://www.mm.co.th/~pattara/thai/wbrtest-short.html

In a working system, sentences should be wrapped at the boundaries of words, not in between.

But I think in MAC and Windows, if it doesn&apos;t work already, the solution should be different as those systems already have API for Thai word breaking, e.g., ATSUI, UniScribe, we should just use them, no need to use libthai)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68024</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-01-23 04:15:31 -0800</bug_when>
    <thetext>To have this patch reviewed, please mark it review? by clicking Edit link to the right of the patch.

There are a number of coding style issues that would definitely make it rejected though, so you may want to read &lt;http://webkit.org/coding/contributing.html&gt;. It&apos;s also OK to request review if you&apos;d like to get feedback on the substance of the patch first, and fix style later.

Sounds like this fix will be very important for platforms that can not use existing Thai support from ICU - thank you very much for working on it!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68043</commentid>
    <comment_count>6</comment_count>
    <who name="Pattara Kiatisevi">pattara</who>
    <bug_when>2008-01-23 10:12:56 -0800</bug_when>
    <thetext>I think ICU is another possible option.

I saw &lt;a href=http://bugs.webkit.org/show_bug.cgi?id=4628&gt;Bug 4628&lt;/a&gt;. We could add a check -- if LINUX then use ICU for Thai word breaking instead of Carbon?

But then we need an explicit dependency between ICU and WebKit (in Ubuntu where I tested there seems none though). The above patch will look for libthai and use it dynamicially if exists, without forcing users to install it. For Thais, compile-time linking is of course better but for the rest non-Thai-speaking users, this dynamic method may save their bandwidth and disk space. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68049</commentid>
    <comment_count>7</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2008-01-23 12:17:37 -0800</bug_when>
    <thetext>The patch mentions &quot;libkhtml.&quot;  Was this code lifted from KHTML and moved into WebKit?  If so, please make sure to include the appropriate copyright attributions at the top of break_lines.cpp.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68086</commentid>
    <comment_count>8</comment_count>
    <who name="Pattara Kiatisevi">pattara</who>
    <bug_when>2008-01-23 19:00:46 -0800</bug_when>
    <thetext>It was lifted from KHTML and it was us who submitted to KHTML. Anyway, will add attributions as you suggested.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68318</commentid>
    <comment_count>9</comment_count>
      <attachid>18616</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-26 14:18:22 -0800</bug_when>
    <thetext>Comment on attachment 18616
Patch to enable Thai wordbreaking in WebKit

First, let me thank you VERY MUCH for taking the time to contribute to WebKit.  We strongly value new contributions, and I would like to encourage you to contribute more in the future.

That said, we&apos;re not going to take this patch.  More information below:


Ok, so it looks like ICU does support Thai breaking.  Safari 3.0.4 on Mac OS X already gets this test case correct:
http://www.mm.co.th/~pattara/thai/wbrtest-short.html
(as far as I can tell)

So this bug only applies to platforms which are not able to use ICU.  Both WebKitWinApple and WebKitMac use ICU.  I&apos;m not certain about WebKitGtk or WebKitQt.

In order for this bug to move forward, we would need an example of a platform combination under active development which did not support proper Thai word breaks.

In that case, we would need to re-write this patch to apply to the TextIterator platform abstraction model (which looks to be possible.

This patch has a raft of style issues, as previously mentioned, as well as memory leaks (the entire thai cached leaks).

I&apos;m marking this r-, and I recommend with close the bug as &quot;INVALID&quot; unless we can come up with a paltform combination which doesn&apos;t already have thai word break support.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68319</commentid>
    <comment_count>10</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-26 14:22:00 -0800</bug_when>
    <thetext>I meant &quot;TextBreakIterator&quot; when I said TextIterator.

The files in question can be found under:
WebCore/platform/text
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68320</commentid>
    <comment_count>11</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-01-26 14:26:38 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; Ok, so it looks like ICU does support Thai breaking.  Safari 3.0.4 on Mac OS X
&gt; already gets this test case correct:
&gt; http://www.mm.co.th/~pattara/thai/wbrtest-short.html
&gt; (as far as I can tell)

The Mac OS X port of WebKit does not use ICU for word-breaking because the version of ICU that ships with Tiger does not support Thai. Instead, WebKit uses Carbon&apos;s Unicode Utilities on both Tiger and Leopard.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68342</commentid>
    <comment_count>12</comment_count>
    <who name="Pattara Kiatisevi">pattara</who>
    <bug_when>2008-01-26 22:17:56 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; (From update of attachment 18616 [edit])
&gt; First, let me thank you VERY MUCH for taking the time to contribute to WebKit. 
&gt; We strongly value new contributions, and I would like to encourage you to
&gt; contribute more in the future.
&gt; That said, we&apos;re not going to take this patch.  More information below:
&gt; Ok, so it looks like ICU does support Thai breaking.  Safari 3.0.4 on Mac OS X
&gt; already gets this test case correct:
&gt; http://www.mm.co.th/~pattara/thai/wbrtest-short.html
&gt; (as far as I can tell)
&gt; So this bug only applies to platforms which are not able to use ICU.  Both
&gt; WebKitWinApple and WebKitMac use ICU.  I&apos;m not certain about WebKitGtk or
&gt; WebKitQt.

Safari on Mac works ok (thanks to Carbon). But as far as we have tested, Thai word breaking is NOT working in WebKitQt on Linux. 

As I mentioned in #6, maybe the problem is better solved using ICU provided that WebKit and ICU is already connected. But as I see on my Linux box that the WebKitQt package doesn&apos;t depend on libicu. So we guess maybe WebKit is not using libicu and hence propose this patch which uses libthai as a possible solution for word breaking, similar to in KHTML and Firefox. The bottom line is just to have propert Thai word breaking in WebKit. Any solution is actually fine.

Please let us know if we can be of any further help regarding this (testing, etc..). </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68343</commentid>
    <comment_count>13</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-01-26 23:30:11 -0800</bug_when>
    <thetext>Many non-Apple ports do not want to use ICU (because it&apos;s too large), so I think that this work is of good value. CC&apos;ing some people that would know for sure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112182</commentid>
    <comment_count>14</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2009-03-04 04:18:50 -0800</bug_when>
    <thetext>I think for non-ICU builds, such as the Qt one, the TextBreakIterator should continue to work correctly for Thai. The TextBreakIterator for the Qt build uses QTextBoundaryFinder. That&apos;s the class that may need some additional fixing for Thai. I&apos;m working with Pattara on that :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>685215</commentid>
    <comment_count>15</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2012-08-02 04:17:20 -0700</bug_when>
    <thetext>For the Qt port we have chosen to use ICU, which I think means now that all ports are using ICU and this bug can be closed :)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>18616</attachid>
            <date>2008-01-22 21:04:32 -0800</date>
            <delta_ts>2010-06-10 16:41:40 -0700</delta_ts>
            <desc>Patch to enable Thai wordbreaking in WebKit</desc>
            <filename>webkit_wordbreak.diff</filename>
            <type>text/plain</type>
            <size>5492</size>
            <attacher name="Pattara Kiatisevi">pattara</attacher>
            
              <data encoding="base64">ZGlmZiAtdU5yIHdlYmtpdC0wfnN2bjI1MTQ0Lm9yaWcvV2ViQ29yZS9yZW5kZXJpbmcvYnJlYWtf
bGluZXMuY3BwIHdlYmtpdC0wfnN2bjI1MTQ0L1dlYkNvcmUvcmVuZGVyaW5nL2JyZWFrX2xpbmVz
LmNwcAotLS0gd2Via2l0LTB+c3ZuMjUxNDQub3JpZy9XZWJDb3JlL3JlbmRlcmluZy9icmVha19s
aW5lcy5jcHAJMjAwNy0wOC0xOSAxMjoxNToxNS4wMDAwMDAwMDAgKzA3MDAKKysrIHdlYmtpdC0w
fnN2bjI1MTQ0L1dlYkNvcmUvcmVuZGVyaW5nL2JyZWFrX2xpbmVzLmNwcAkyMDA4LTAxLTIyIDA5
OjMzOjA0LjAwMDAwMDAwMCArMDcwMApAQCAtMTExLDQgKzExMSwxMzggQEAKICAgICByZXR1cm4g
bGVuOwogfQogCisjaWYgUExBVEZPUk0oVU5JWCkKKy8qIFRoYWkgU3VwcG9ydCAKKyAqIElmIEhB
VkVfTElCVEhBSSBpcyBkZWZpbmVkLCBsaWJraHRtbCB3aWxsIGxpbmsgYWdhaW5zdAorICogbGli
dGhhaSBzaW5jZSBjb21waWxlIHRpbWUuIE90aGVyd2lzZSBpdCB3aWxsIHRyeSB0bworICogZGxv
cGVuIGF0IHJ1bi10aW1lCisgKgorICogT3R0IFBhdHRhcmEsIEpha2thcHVuIEt3YW5yb2VuZ2ph
aSAxNiBKYW4gMjAwOAorICovCisjaWZuZGVmIEhBVkVfTElCVEhBSQordHlwZWRlZiBpbnQgKCp0
aF9icmtfZGVmKShjb25zdCB1bnNpZ25lZCBjaGFyKiwgaW50W10sIGludCk7CitzdGF0aWMgdGhf
YnJrX2RlZiB0aF9icmsgPSAwOwordHlwZWRlZiBpbnQgKCp0aF91bmkydGlzX2xpbmVfZGVmKShj
b25zdCB3Y2hhcl90KiwgdW5zaWduZWQgY2hhciosIGludCk7CitzdGF0aWMgdGhfdW5pMnRpc19s
aW5lX2RlZiB0aF91bmkydGlzX2xpbmUgPSAwOworI2Vsc2UKKyNpbmNsdWRlIDx0aGFpL3RoYWls
aWIuaD4KKyNpbmNsdWRlIDx0aGFpL3RoYnJrLmg+CisjZW5kaWYKKworc3RydWN0IFRoYWlDYWNo
ZQoreworICAgIFRoYWlDYWNoZSgpIHsKKyAgICAgICAgc3RyaW5nID0gMDsKKyAgICAgICAgYWxs
b2NhdGVkID0gMHg0MDA7CisgICAgICAgIHdicnBvcyA9IChpbnQgKikgbWFsbG9jKGFsbG9jYXRl
ZCpzaXplb2YoaW50KSk7CisgICAgICAgIG51bXdicnBvcyA9IDA7CisgICAgICAgIG51bWlzYnJl
YWthYmxlID0gMHg0MDA7CisgICAgICAgIGlzYnJlYWthYmxlID0gKGludCAqKSBtYWxsb2MobnVt
aXNicmVha2FibGUqc2l6ZW9mKGludCkpOworICAgIH0KKyAgICB+VGhhaUNhY2hlKCkgeworICAg
ICAgICBmcmVlKHdicnBvcyk7CisgICAgICAgIGZyZWUoaXNicmVha2FibGUpOworICAgIH0KKyAg
IC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X2JyayAmJiB0cnltb3JlICkgeworICAgIAltb2R1bGUgPSBk
bG9wZW4oImxpYnRoYWkuc28uMCIsIFJUTERfTEFaWSk7CisgICAgCWlmICghbW9kdWxlKSB7Cisg
ICAgICAJICBwcmludGYoIldhcm5pbmc6IGNvdWxkbid0IG9wZW4gbGlidGhhaS5zbzogJXMsIHRo
YWkgd29yZCBicmVhayBmZWF0dXJlIGRpc2FibGVkXG4iLCBkbGVycm9yKCkpOworICAgICAgICAg
IC8vIG5vIHdvcmRjdXQgbGlicmFyeSwgYnJlYWsgYW55d2hlcmUgaXMgb2sKKyAgICAgICAgICB0
cnltb3JlID0gMDsKKyAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAg
ICAgICAvKiBHZXQgc3ltYm9sICovCisgICAgICAgICAgZGxlcnJvcigpOworICAgICAgICAgIHRo
X2JyayA9ICh0aF9icmtfZGVmKSBkbHN5bShtb2R1bGUsICJ0aF9icmsiKTsKKwkJICB0aF91bmky
dGlzX2xpbmUgPSAodGhfdW5pMnRpc19saW5lX2RlZikgZGxzeW0obW9kdWxlLCAidGhfdW5pMnRp
c19saW5lIik7CisKKyAgICAgICAgICBpZiAoZXJyb3IgPSBkbGVycm9yKCkpIHsKKyAgICAgICAg
ICAgIHByaW50ZigiV2FybmluZzogY291bGRuJ3QgZmluZCBsaWJ0aGFpOiAlc1xuIixlcnJvcik7
CisgICAgICAgICAgICAvLyBubyB3b3JraW5nIHdvcmRjdXQgbGlicmFyeSwgYnJlYWsgYW55d2hl
cmUgaXMgb2sKKyAgICAgICAgICAgIHRyeW1vcmUgPSAwOworICAgICAgICAgICAgcmV0dXJuIDA7
CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHByaW50ZigiTGlidGhhaSBsb2FkZWQg
c3VjY2Vzc2Z1bGx5Li5cbiIpOworCSAgCSAgfQorICAgICAgICB9CisgICAgfQorCisgICAgaWYg
KCF0aF9icmsgfHwgIXRoX3Vua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AgICAgICBpZiAocG9z
ID4gbmV4dEJyZWFrYWJsZSkKICAgICAgICAgICAgIG5leHRCcmVha2FibGUgPSBuZXh0QnJlYWth
YmxlUG9zaXRpb24oc3RyLCBwb3MsIGxlbiwgYnJlYWtOQlNQKTsKICAgICAgICAgcmV0dXJuIHBv
cyA9PSBuZXh0QnJlYWthYmxlOwo=
</data>
<flag name="review"
          id="8145"
          type_id="1"
          status="-"
          setter="eric"
    />
          </attachment>
      

    </bug>

</bugzilla>