<?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>65035</bug_id>
          
          <creation_ts>2011-07-22 11:10:59 -0700</creation_ts>
          <short_desc>[Cairo] Text extent of shadowed text is calculated incorrectly</short_desc>
          <delta_ts>2012-03-16 19:54:56 -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>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P3</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>64744</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Martin Robinson">mrobinson</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>igor.oliveira</cc>
    
    <cc>krit</cc>
    
    <cc>leandro</cc>
    
    <cc>o.gorter</cc>
    
    <cc>rakuco</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>441031</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2011-07-22 11:10:59 -0700</bug_when>
    <thetext>This became apparently during conversion of Cairo shadows to using ShadowBlur. The failure is covered by LayoutTests/fast/canvas/fillText-shadow.html.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>542196</commentid>
    <comment_count>1</comment_count>
    <who name="Onne Gorter">o.gorter</who>
    <bug_when>2012-01-25 04:43:59 -0800</bug_when>
    <thetext>I confirm and have a patch:

--- a/Source/WebCore/platform/graphics/cairo/FontCairo.cpp
+++ b/Source/WebCore/platform/graphics/cairo/FontCairo.cpp
@@ -85,7 +85,7 @@ static void drawGlyphsShadow(GraphicsContext* graphicsContext, const FloatPoint&amp;
 
     cairo_text_extents_t extents;
     cairo_scaled_font_glyph_extents(font-&gt;platformData().scaledFont(), glyphs, numGlyphs, &amp;extents);
-    FloatRect fontExtentsRect(point.x(), point.y() - extents.height, extents.width, extents.height);
+    FloatRect fontExtentsRect(point.x(), point.y() + extents.y_bearing, extents.width, extents.height);
     if (GraphicsContext* shadowContext = shadow.beginShadowLayer(graphicsContext, fontExtentsRect)) {
         drawGlyphsToContext(shadowContext-&gt;platformContext()-&gt;cr(), font, glyphs, numGlyphs);
         shadow.endShadowLayer(graphicsContext);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>542197</commentid>
    <comment_count>2</comment_count>
      <attachid>123923</attachid>
    <who name="Onne Gorter">o.gorter</who>
    <bug_when>2012-01-25 04:45:28 -0800</bug_when>
    <thetext>Created attachment 123923
use y_bearing instead of height to correctly get rect covering the shadow</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>546461</commentid>
    <comment_count>3</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-01-31 13:51:33 -0800</bug_when>
    <thetext>Thanks for your contribution. Do you mind attaching a changelog as explained here? http://www.webkit.org/coding/contributing.html? If you do that I can commit your patch straight from this bug. Please just remove the line about missing tests and replace it with a statement that it&apos;s covered by the test I listed above.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>581227</commentid>
    <comment_count>4</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-03-16 19:51:50 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; I confirm and have a patch:
&gt; 
&gt; --- a/Source/WebCore/platform/graphics/cairo/FontCairo.cpp
&gt; +++ b/Source/WebCore/platform/graphics/cairo/FontCairo.cpp
&gt; @@ -85,7 +85,7 @@ static void drawGlyphsShadow(GraphicsContext* graphicsContext, const FloatPoint&amp;
&gt; 
&gt;      cairo_text_extents_t extents;
&gt;      cairo_scaled_font_glyph_extents(font-&gt;platformData().scaledFont(), glyphs, numGlyphs, &amp;extents);
&gt; -    FloatRect fontExtentsRect(point.x(), point.y() - extents.height, extents.width, extents.height);
&gt; +    FloatRect fontExtentsRect(point.x(), point.y() + extents.y_bearing, extents.width, extents.height);

It seems that we also need to look at the x_bearing here as well. Will make this change and land this patch. Thanks for the contribution!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>581228</commentid>
    <comment_count>5</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-03-16 19:54:56 -0700</bug_when>
    <thetext>Committed r111110: &lt;http://trac.webkit.org/changeset/111110&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>123923</attachid>
            <date>2012-01-25 04:45:28 -0800</date>
            <delta_ts>2012-01-25 04:45:28 -0800</delta_ts>
            <desc>use y_bearing instead of height to correctly get rect covering the shadow</desc>
            <filename>text-shadow-extents.patch</filename>
            <type>text/plain</type>
            <size>961</size>
            <attacher name="Onne Gorter">o.gorter</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL3BsYXRmb3JtL2dyYXBoaWNzL2NhaXJvL0ZvbnRD
YWlyby5jcHAgYi9Tb3VyY2UvV2ViQ29yZS9wbGF0Zm9ybS9ncmFwaGljcy9jYWlyby9Gb250Q2Fp
cm8uY3BwCmluZGV4IDM1ZDFlNWIuLjVhODQ3ZDQgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XZWJDb3Jl
L3BsYXRmb3JtL2dyYXBoaWNzL2NhaXJvL0ZvbnRDYWlyby5jcHAKKysrIGIvU291cmNlL1dlYkNv
cmUvcGxhdGZvcm0vZ3JhcGhpY3MvY2Fpcm8vRm9udENhaXJvLm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