<?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>54301</bug_id>
          
          <creation_ts>2011-02-11 11:38:49 -0800</creation_ts>
          <short_desc>RenderBR::width() tries but fails to override RenderText::width()</short_desc>
          <delta_ts>2011-02-21 14:39:43 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</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>54367</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Nico Weber">thakis</reporter>
          <assigned_to name="Nico Weber">thakis</assigned_to>
          <cc>andersca</cc>
    
    <cc>darin</cc>
    
    <cc>hyatt</cc>
    
    <cc>jamesr</cc>
    
    <cc>mitz</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>349880</commentid>
    <comment_count>0</comment_count>
    <who name="Nico Weber">thakis</who>
    <bug_when>2011-02-11 11:38:49 -0800</bug_when>
    <thetext>RenderBR::width() tries but fails to override RenderText::width()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349883</commentid>
    <comment_count>1</comment_count>
      <attachid>82158</attachid>
    <who name="Nico Weber">thakis</who>
    <bug_when>2011-02-11 11:40:44 -0800</bug_when>
    <thetext>Created attachment 82158
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349884</commentid>
    <comment_count>2</comment_count>
    <who name="Nico Weber">thakis</who>
    <bug_when>2011-02-11 11:41:00 -0800</bug_when>
    <thetext>Found by clang&apos;s new -Woverload-virtual:

In file included from ../rendering/InlineBox.h:24:
../rendering/RenderBR.h:43:22: error: &apos;WebCore::RenderBR::width&apos; hides overloaded virtual functions [-Woverloaded-virtual]
    virtual unsigned width(unsigned /*from*/, unsigned /*len*/, const Font&amp;, int /*xpos*/) const { return 0; }
                     ^
In file included from /b/build/slave/mac_clang/build/src/third_party/WebKit/Source/WebCore/WebCore.gyp/../dom/Node.cpp:72:
In file included from ../rendering/RenderBlock.h:30:
In file included from ../rendering/RootInlineBox.h:25:
In file included from ../rendering/InlineFlowBox.h:24:
In file included from ../rendering/InlineBox.h:24:
In file included from ../rendering/RenderBR.h:24:
../rendering/RenderText.h:74:22: note: hidden overloaded virtual function &apos;WebCore::RenderText::width&apos; declared here
    virtual unsigned width(unsigned from, unsigned len, const Font&amp;, int xPos, HashSet&lt;const SimpleFontData*&gt;* fallbackFonts = 0, GlyphOverflow* = 0) const;
                     ^
../rendering/RenderText.h:75:22: note: hidden overloaded virtual function &apos;WebCore::RenderText::width&apos; declared here
    virtual unsigned width(unsigned from, unsigned len, int xPos, bool firstLine = false, HashSet&lt;const SimpleFontData*&gt;* fallbackFonts = 0, GlyphOverflow* = 0) const;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349898</commentid>
    <comment_count>3</comment_count>
      <attachid>82158</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-02-11 12:04:05 -0800</bug_when>
    <thetext>Comment on attachment 82158
Patch

What’s the symptom of this bug? We need a test case that will catch this if we make the same mistake in the future.

Did you try to make a test case?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349899</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-02-11 12:04:35 -0800</bug_when>
    <thetext>Oh, I see, the compiler found it. Still, can we make a test case?

Does fixing this change any regression test results?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349914</commentid>
    <comment_count>5</comment_count>
    <who name="Nico Weber">thakis</who>
    <bug_when>2011-02-11 12:27:59 -0800</bug_when>
    <thetext>I&apos;m trying to get webkit building with -Woverloaded-virtual so that the compiler catches this problem automatically. Does webkit generally use test cases for things that are found by compilers? If so, I will try to come up with one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349916</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-02-11 12:28:56 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; Does webkit generally use test cases for things that are found by compilers?

Yes, if the compiler reveals a mistake that should have caused incorrect behavior.

No, if the compiler catches something that has no real effect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350433</commentid>
    <comment_count>7</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-02-13 11:49:30 -0800</bug_when>
    <thetext>This doesn&apos;t seem to change the results of any layout tests on my snow leopard mac.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350464</commentid>
    <comment_count>8</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2011-02-13 15:13:04 -0800</bug_when>
    <thetext>The only (In reply to comment #4)
&gt; Oh, I see, the compiler found it. Still, can we make a test case?
&gt; 
&gt; Does fixing this change any regression test results?

Before this, the width of a RenderBR would take the slower RenderText codepath, which would return 0. (Assuming the width of the string &quot;\n&quot; is 0). I don&apos;t think we could make a test case for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350465</commentid>
    <comment_count>9</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2011-02-13 15:13:57 -0800</bug_when>
    <thetext>I&apos;m going to go ahead and land this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350466</commentid>
    <comment_count>10</comment_count>
      <attachid>82158</attachid>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2011-02-13 15:19:50 -0800</bug_when>
    <thetext>Comment on attachment 82158
Patch

Clearing flags on attachment: 82158

Committed r78444: &lt;http://trac.webkit.org/changeset/78444&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350467</commentid>
    <comment_count>11</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2011-02-13 15:19:56 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>82158</attachid>
            <date>2011-02-11 11:40:44 -0800</date>
            <delta_ts>2011-02-13 15:19:50 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-54301-20110211114042.patch</filename>
            <type>text/plain</type>
            <size>1928</size>
            <attacher name="Nico Weber">thakis</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogNzgzNTEKZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwppbmRleCBmOWYzOWY5OTA3MzQyOWNh
Zjk0ZmExMTFkZGVkMjNhYTIzZjNkOWMwLi43ZDNmMDdkZWJiYmQwMmMxNjhjMzE4MjY5OWMzNzA3
M2EwN2IwNzAyIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvU291
cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTcgQEAKKzIwMTEtMDItMTEgIE5pY28g
V2ViZXIgIDx0aGFraXNAY2hyb21pdW0ub3JnPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9E
WSAoT09QUyEpLgorCisgICAgICAgIFJlbmRlckJSOjp3aWR0aCgpIHRyaWVzIGJ1dCBmYWlscyB0
byBvdmVycmlkZSBSZW5kZXJUZXh0Ojp3aWR0aCgpCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJr
aXQub3Jn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