<?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>56613</bug_id>
          
          <creation_ts>2011-03-17 17:05:09 -0700</creation_ts>
          <short_desc>inline elements with padding in a table cell cause an unnecessary line break</short_desc>
          <delta_ts>2022-07-12 14:27:27 -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>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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="Philip Rogers">pdr</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>shanestephens</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>369418</commentid>
    <comment_count>0</comment_count>
      <attachid>86119</attachid>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2011-03-17 17:05:09 -0700</bug_when>
    <thetext>Created attachment 86119
Test case of the bug

Nested span elements with padding appear to cause a wrapping table cell to force an unnecessary line break.

This was found when laying out several strings wrapped in spans all inside a table cell. When padding or margin was applied to the group (so that there is space to the left of the first element), the last element would fall onto a new line even though the table cell was wide enough to fit all the elements.

Consider the following markup:
&lt;div style=&quot;display:table-cell&quot;&gt;&lt;span style=&quot;padding-left:6px&quot;&gt;&lt;span&gt;A &lt;span&gt;B&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;

Webkit calculates the table cell width as 33px when the span&apos;s left padding is 6px, and 27px when the span&apos;s left padding is 0px. I think both of these are correct. When the padding is 6px, there is a linebreak after the &quot;A &quot;, but when the padding is 0px there is no linebreak. It appears that Webkit is correctly calculating the table cell&apos;s width, but inserts an unnecessary linebreak.

Expected: There should be no linebreak and &quot;A B&quot; should be rendered in the div.

Actual: There is a linebreak inserted after &quot;A &quot;, causing &quot;B&quot; to get bumped to the next line.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>370265</commentid>
    <comment_count>1</comment_count>
    <who name="Shane Stephens">shanestephens</who>
    <bug_when>2011-03-20 20:31:24 -0700</bug_when>
    <thetext>Do you know of any websites that are currently broken by this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>370352</commentid>
    <comment_count>2</comment_count>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2011-03-21 06:47:28 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Do you know of any websites that are currently broken by this?

The bug was encountered while developing the change history portion of adwords (there is a series of checkboxes under a chart and one of the checkboxes would fall onto a new line) but was worked around before release.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1882580</commentid>
    <comment_count>3</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-07-12 14:27:27 -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>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>86119</attachid>
            <date>2011-03-17 17:05:09 -0700</date>
            <delta_ts>2011-03-17 17:05:09 -0700</delta_ts>
            <desc>Test case of the bug</desc>
            <filename>TableLineBreak.html</filename>
            <type>text/html</type>
            <size>106</size>
            <attacher name="Philip Rogers">pdr</attacher>
            
              <data encoding="base64">PGRpdiBzdHlsZT0iZGlzcGxheTp0YWJsZS1jZWxsIj48c3BhbiBzdHlsZT0icGFkZGluZy1sZWZ0
OjZweCI+PHNwYW4+QSA8c3Bhbj5CPC9zcGFuPjwvc3Bhbj48L3NwYW4+PC9kaXY+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>