<?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>28810</bug_id>
          
          <creation_ts>2009-08-28 07:39:37 -0700</creation_ts>
          <short_desc>offsetWidth of elements containing nested in block level elements reported as 0</short_desc>
          <delta_ts>2025-12-25 03:44:26 -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>Layout and Rendering</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>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=47618</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P4</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Wagner-Hall">dawagner</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cshempel</cc>
    
    <cc>cxescalona</cc>
    
    <cc>dbates</cc>
    
    <cc>gdennis</cc>
    
    <cc>marcoos+bwo</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>niall.smart</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>143369</commentid>
    <comment_count>0</comment_count>
      <attachid>38734</attachid>
    <who name="Daniel Wagner-Hall">dawagner</who>
    <bug_when>2009-08-28 07:39:37 -0700</bug_when>
    <thetext>Created attachment 38734
Page showing bug

The offsetWidth of elements containing block-level elements is incorrectly reported as 0, rather than the maximum offsetWidth of any of its sub-elements.

Note that IE and Firefox return different values for offsetWidth due to bounding box differences, but both behave as above for the nested case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>187326</commentid>
    <comment_count>1</comment_count>
    <who name="Carl Hempel">cshempel</who>
    <bug_when>2010-02-03 05:44:50 -0800</bug_when>
    <thetext>I&apos;m also experiencing this bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>239326</commentid>
    <comment_count>2</comment_count>
    <who name="Marek Stepien">marcoos+bwo</who>
    <bug_when>2010-06-17 03:56:31 -0700</bug_when>
    <thetext>I can also see this bug in Safari 5 and recent Chrome 6 dev builds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>268720</commentid>
    <comment_count>3</comment_count>
    <who name="Greg Dennis">gdennis</who>
    <bug_when>2010-08-24 12:41:29 -0700</bug_when>
    <thetext>I see this in Chrome 5 and Chrome 6 beta.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>407683</commentid>
    <comment_count>4</comment_count>
    <who name="Niall Smart">niall.smart</who>
    <bug_when>2011-05-22 10:54:31 -0700</bug_when>
    <thetext>Reproduced in Chrome 11.0.696.68</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>485370</commentid>
    <comment_count>5</comment_count>
    <who name="paynalton">cxescalona</who>
    <bug_when>2011-10-17 12:21:01 -0700</bug_when>
    <thetext>Confirmed on Chromium 14.0.835.163 and Safari 5.0 (7533.16).

Problem extended to multiple IMG elements into a div and another div with css

IMG:
 width:auto;
 height:100%;

Containerdiv:
 width:noSet;
 height:noSet;

ContainerContainerDiv:
 width:300px;
 height:300px;


Structure:

Div class ContainerContainerDiv
  Div class ContainerDiv
    IMG
    IMG
    IMG

javascript:

alert(IMG_DOM_ELEMENT.offsetWidth)  //Result: 0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887150</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-27 13:29:49 -0700</bug_when>
    <thetext>I am able to reproduce this bug using attached test case in Safari 15.6 on macOS 12.5 and it shows &quot;test2.offsetWidth: 0&quot; - which is what this bug about. Here are results from other browsers:

** Firefox Nightly 105 **

test1.offsetWidth: 96
test2.offsetWidth: 1277

** Chrome Canary 106 **

test1.offsetWidth: 96
test2.offsetWidth: 1287 (There was another bug where Chrome was different from Firefox with just 10 px and it was about scrollbar - just want to add some note here)

** Safari 15.6 on macOS 12.5 **

test1.offsetWidth: 96
test2.offsetWidth: 0

Just find updated results. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887208</commentid>
    <comment_count>7</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-07-27 17:53:48 -0700</bug_when>
    <thetext>&lt;rdar://problem/97694011&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2168112</commentid>
    <comment_count>8</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-12-24 20:10:01 -0800</bug_when>
    <thetext>@Alan - this is also working post blocks-in-inline, should we also close this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2168140</commentid>
    <comment_count>9</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2025-12-25 03:44:26 -0800</bug_when>
    <thetext>Fixed by [blocks-in-inline] -removing continuation.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>38734</attachid>
            <date>2009-08-28 07:39:37 -0700</date>
            <delta_ts>2009-08-28 07:39:37 -0700</delta_ts>
            <desc>Page showing bug</desc>
            <filename>offsetwidth-bug.html</filename>
            <type>text/html</type>
            <size>601</size>
            <attacher name="Daniel Wagner-Hall">dawagner</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEvL0VOIiAiaHR0cDov
L3d3dy53My5vcmcvVFIvaHRtbDQvc3RyaWN0LmR0ZCI+DQo8aHRtbD4NCiAgPGhlYWQ+DQogIDxt
ZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0
PXdpbmRvd3MtMTI1MCI+DQogIDx0aXRsZT48L3RpdGxlPg0KICA8c2NyaXB0IHR5cGU9InRleHQv
amF2YXNjcmlwdCI+DQogICAgd2luZG93Lm9ubG9hZCA9IGZ1bmN0aW9uKCkgew0KICAgICAgYWxl
cnQoInRlc3QxLm9mZnNldFdpZHRoOiAiICsgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoInRlc3Qx
Iikub2Zmc2V0V2lkdGggKyAiXG50ZXN0Mi5vZmZzZXRXaWR0aDogIiArIGRvY3VtZW50LmdldEVs
ZW1lbnRCeUlkKCJ0ZXN0MiIpLm9mZnNldFdpZHRoKTsNCiAgICB9DQogIDwvc2NyaXB0Pg0KICA8
L2hlYWQ+DQogIDxib2R5Pg0KICAgICA8YSBocmVmPSIjIiBpZD0idGVzdDEiPlNvbWUgdGV4dCBo
ZXJlPC9hPg0KICAgICA8YSBocmVmPSIjIiBpZD0idGVzdDIiPjxkaXY+U29tZSB0ZXh0IGhlcmU8
L2Rpdj48L2E+DQogIDwvYm9keT4NCjwvaHRtbD4NCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>