<?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>127995</bug_id>
          
          <creation_ts>2014-01-31 08:40:53 -0800</creation_ts>
          <short_desc>SVG with small height inside pixel sized div renders below div</short_desc>
          <delta_ts>2022-07-15 17:30:13 -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>SVG</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</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="Hugh Zhang">hugh.zhang</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>hugh.zhang</cc>
    
    <cc>pdr</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>974304</commentid>
    <comment_count>0</comment_count>
    <who name="Hugh Zhang">hugh.zhang</who>
    <bug_when>2014-01-31 08:40:53 -0800</bug_when>
    <thetext>With the following SVG, the black rectangle should render inside the div with red border.  It renders about 5 pixels below the div instead.

&lt;div style=&quot;border: 1px solid red;width:100px;height:5px&quot;&gt;
  &lt;svg&gt;
    &lt;rect width=&quot;100&quot; height=&quot;5&quot; fill=&quot;black&quot;&gt;
  &lt;/svg&gt;
&lt;/div&gt;

The issue becomes less severe as div height increases, disappearing completely at around 14 to 15 pixels:

&lt;div style=&quot;border: 1px solid red;width:100px;height:14px&quot;&gt;
  &lt;svg&gt;
    &lt;rect width=&quot;100&quot; height=&quot;5&quot; fill=&quot;black&quot;&gt;
  &lt;/svg&gt;
&lt;/div&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>974318</commentid>
    <comment_count>1</comment_count>
    <who name="Hugh Zhang">hugh.zhang</who>
    <bug_when>2014-01-31 09:13:53 -0800</bug_when>
    <thetext>Apparently this only happens with &lt;!DOCTYPE HTML&gt;. It doesn&apos;t reproduce with &lt;!DOCTYPE HTML PUBLIC&gt;.

&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
  &lt;body&gt;
    &lt;div style=&quot;border: 1px solid red;width:100px;height:5px;&quot;&gt;
      &lt;svg&gt;
        &lt;rect width=&quot;100&quot; height=&quot;5&quot; fill=&quot;black&quot;/&gt;
      &lt;/svg&gt;
    &lt;/div&gt;
    &lt;br/&gt;
    &lt;div style=&quot;border: 1px solid red;width:100px;height:14px&quot;&gt;
      &lt;svg&gt;
        &lt;rect width=&quot;100&quot; height=&quot;5&quot; fill=&quot;black&quot;/&gt;
      &lt;/svg&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>974320</commentid>
    <comment_count>2</comment_count>
    <who name="Hugh Zhang">hugh.zhang</who>
    <bug_when>2014-01-31 09:21:34 -0800</bug_when>
    <thetext>Sorry about not getting this all in the original report.  It looks like this issue is connected to the font-size.  If &quot;font-size:1px;&quot; is set on the outer div, then the issue doesn&apos;t occur.  Similarly, if a larger font-size is set, then the issue occurs for larger elements.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>974891</commentid>
    <comment_count>3</comment_count>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2014-02-02 19:28:44 -0800</bug_when>
    <thetext>This appears to happen with an &lt;img&gt; as well:
&lt;div style=&quot;border: 1px solid red;width:100px;height:5px&quot;&gt;
  &lt;img width=&quot;100&quot; height=&quot;5&quot; src=&quot;[img here]&quot;&gt;
&lt;/div&gt;

This may be a bug in all replaced elements (svg, img, etc).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1884476</commentid>
    <comment_count>4</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-07-15 17:30:13 -0700</bug_when>
    <thetext>Safari, Chrome, and Firefox all agree on rendering for this test case. I don&apos;t believe there is any remaining compatibility issue.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>