<?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>51566</bug_id>
          
          <creation_ts>2010-12-23 15:20:43 -0800</creation_ts>
          <short_desc>TextMetrics::width is an integer, but the member is a float</short_desc>
          <delta_ts>2010-12-24 03:50:55 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</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>
          
          <blocked>51551</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Evan Martin">evan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>hyatt</cc>
    
    <cc>jamesr</cc>
    
    <cc>mitz</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>326316</commentid>
    <comment_count>0</comment_count>
    <who name="Evan Martin">evan</who>
    <bug_when>2010-12-23 15:20:43 -0800</bug_when>
    <thetext>In WebCore/html/TextMetrics.idl it says:
    readonly attribute float width;
in .../TextMetrics.h:
    float m_width;

But there&apos;s a getter with this confusing comment:

    // FIXME: Is coercing to an integer value intentional? If so, there should be a static_cast&lt;unsigned&gt;() here.
    unsigned width() const { return m_width; }

From my greps around, it appears this getter is unused, but I unsure how the idl interacts with this (perhaps the idl generates code that calls width().)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>326324</commentid>
    <comment_count>1</comment_count>
    <who name="Evan Martin">evan</who>
    <bug_when>2010-12-23 15:26:15 -0800</bug_when>
    <thetext>CC hyatt, original author of the code (correct bug this time)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>326326</commentid>
    <comment_count>2</comment_count>
    <who name="Evan Martin">evan</who>
    <bug_when>2010-12-23 15:28:41 -0800</bug_when>
    <thetext>in LayoutTests/fast/canvas/canvas-text-baseline.html
if I dump out all the widths found by ctx.measureText(text).width
they are always integers.  Not sure if it&apos;s intentional (or perhaps in Chrome we always have integer width fonts for other reasons)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>326355</commentid>
    <comment_count>3</comment_count>
    <who name="Evan Martin">evan</who>
    <bug_when>2010-12-23 16:26:23 -0800</bug_when>
    <thetext>I tried changing it to a float and still got integers out.

Spec says the width should be &quot;CSS pixels&quot;, which I think can be floating point.  I&apos;ll upload a patch and see what y&apos;all think.

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-measuretext</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>326363</commentid>
    <comment_count>4</comment_count>
      <attachid>77385</attachid>
    <who name="Evan Martin">evan</who>
    <bug_when>2010-12-23 16:43:13 -0800</bug_when>
    <thetext>Created attachment 77385
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>326365</commentid>
    <comment_count>5</comment_count>
    <who name="Evan Martin">evan</who>
    <bug_when>2010-12-23 16:44:34 -0800</bug_when>
    <thetext>I tried modifying the test to use text of width 32.1 pixels, but even after this change the &quot;width&quot; field came out as an integer.  Again, this could be due to some other code in Chrome rounding text widths.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>326575</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-12-24 03:49:32 -0800</bug_when>
    <thetext>The commit-queue encountered the following flaky tests while processing attachment 77385:

inspector/elements-panel-styles.html bug 50987 (author: pfeldman@chromium.org)
The commit-queue is continuing to process your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>326577</commentid>
    <comment_count>7</comment_count>
      <attachid>77385</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-12-24 03:50:48 -0800</bug_when>
    <thetext>Comment on attachment 77385
Patch

Clearing flags on attachment: 77385

Committed r74628: &lt;http://trac.webkit.org/changeset/74628&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>326578</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-12-24 03:50:55 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>77385</attachid>
            <date>2010-12-23 16:43:13 -0800</date>
            <delta_ts>2010-12-24 03:50:48 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-51566-20101223164309.patch</filename>
            <type>text/plain</type>
            <size>1488</size>
            <attacher name="Evan Martin">evan</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
NTBiZGE4NGYyYjUwMDc5ODNlNjZmNGY1ODUxYzYzNGJlZTc1ZTlmZS4uNTUwYWY4MmI0ZGNhNDc4
MzhiNzNhMGU4OWI4Y2U4MDBkYmRiZGQyZiAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cK
KysrIGIvV2ViQ29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxOSBAQAorMjAxMC0xMi0yMyAgRXZh
biBNYXJ0aW4gIDxldmFuQGNocm9taXVtLm9yZz4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JP
RFkgKE9PUFMhKS4KKworICAgICAgICBUZXh0TWV0cmljczo6d2lkdGggaXMgYW4ga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