<?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>30562</bug_id>
          
          <creation_ts>2009-10-20 04:16:50 -0700</creation_ts>
          <short_desc>[GTK] fast/text/zero-width-characters.html fails in GTK+</short_desc>
          <delta_ts>2010-11-04 17:44:14 -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>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Xan Lopez">xan.lopez</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>hyatt</cc>
    
    <cc>mitz</cc>
    
    <cc>mrobinson</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>156125</commentid>
    <comment_count>0</comment_count>
    <who name="Xan Lopez">xan.lopez</who>
    <bug_when>2009-10-20 04:16:50 -0700</bug_when>
    <thetext>From a brief investigation it seems our implementation fails to find the character used for the ZWS, so when latter all non-visible characters are rendered with its length they are rendered with non zero width. See WebCore/platform/graphics/GlyphPageTreeNode.cpp.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156883</commentid>
    <comment_count>1</comment_count>
    <who name="Xan Lopez">xan.lopez</who>
    <bug_when>2009-10-22 07:57:13 -0700</bug_when>
    <thetext>OK, after looking at this a bit more: it seems what&apos;s happening is that our port reports glyph 0 as the one to be used for the character 0, ie (from SimpleFontData.cpp):

    Glyph zeroWidthSpaceGlyph = glyphPageZero-&gt;glyphDataForCharacter(0).glyph;

zeroWidthSpaceGlyph will be 0.

The next few lines prevent this from being used:

    if (zeroWidthSpaceGlyph) {
        if (zeroWidthSpaceGlyph != m_spaceGlyph)
            m_glyphToWidthMap.setWidthForGlyph(zeroWidthSpaceGlyph, 0);
        else
            LOG_ERROR(&quot;Font maps SPACE and ZERO WIDTH SPACE to the same glyph. Glyph width not overridden.&quot;);
    }

So we never force the width of the ZWS to be 0, and later in the test 4 is used, which seems to be the width of the space glyph.

If I remove the if (zeroWidthSpaceGlyph) check our test passes, so question: does the 0 glyph have any special significance? Is it a bug in our platform that we are returning it for the character 0?

CCing hyatt and mitz since they were the ones last touching this code (2 years ago!).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156904</commentid>
    <comment_count>2</comment_count>
    <who name="">mitz</who>
    <bug_when>2009-10-22 09:28:33 -0700</bug_when>
    <thetext>0 indicates the missing glyph, so it appears that the font doesn’t have a glyph for ZWS. The code is written to avoid overriding the width of the missing glyph.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156905</commentid>
    <comment_count>3</comment_count>
    <who name="Xan Lopez">xan.lopez</who>
    <bug_when>2009-10-22 09:31:01 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; 0 indicates the missing glyph, so it appears that the font doesn’t have a glyph
&gt; for ZWS. The code is written to avoid overriding the width of the missing
&gt; glyph.

Shouldn&apos;t we still somehow force width 0 even if the font lacks a glyph for those characters?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>157659</commentid>
    <comment_count>4</comment_count>
    <who name="">mitz</who>
    <bug_when>2009-10-25 19:20:59 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; 0 indicates the missing glyph, so it appears that the font doesn’t have a glyph
&gt; &gt; for ZWS. The code is written to avoid overriding the width of the missing
&gt; &gt; glyph.
&gt; 
&gt; Shouldn&apos;t we still somehow force width 0 even if the font lacks a glyph for
&gt; those characters?

If the font lacks a glyph for ZWS, then the next font from the font-family list will be used as fallback, and eventually the system fallback font will be used. Is it really the case that not even the system fallback font has a glyph for ZWS, or is there some other bug? If it’s the former, then maybe the fix should be targeted at the system fallback font case only somehow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>305048</commentid>
    <comment_count>5</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2010-11-04 17:44:14 -0700</bug_when>
    <thetext>This seems to be passing after http://trac.webkit.org/changeset/70688 , so I will unskip this test.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>