<?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>26020</bug_id>
          
          <creation_ts>2009-05-26 07:19:32 -0700</creation_ts>
          <short_desc>The offsetLeft of an element with non-absolute position whose offsetParent is the position:static body does not include the html element&apos;s left margin</short_desc>
          <delta_ts>2022-07-28 13:17:04 -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>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>GoogleBug</keywords>
          <priority>P2</priority>
          <bug_severity>Minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Aharon (Vladimir) Lanin">aharon</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>dglazkov</cc>
    
    <cc>hyatt</cc>
    
    <cc>mitz</cc>
    
    <cc>playmobil</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>123123</commentid>
    <comment_count>0</comment_count>
    <who name="Aharon (Vladimir) Lanin">aharon</who>
    <bug_when>2009-05-26 07:19:32 -0700</bug_when>
    <thetext>If you have:

&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;style type=&quot;text/css&quot;&gt;
      html {margin-left: 10px}
      body {margin: 0px}
    &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id=&quot;static&quot;&gt;static&lt;/div&gt;
    &lt;div id=&quot;absolute&quot; style=&quot;position:absolute&quot;&gt;absolute&lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;

Then static.offsetLeft is 0. It should be 10, i.e. include the html margin, the same as absolute.offsetLeft. It already includes the html left border and padding and the body left margin and border and padding. This is the way it is in IE8, and it makes sense. In IE7, it only includes the body padding, which is a bug they fixed in IE8.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123124</commentid>
    <comment_count>1</comment_count>
      <attachid>30668</attachid>
    <who name="Aharon (Vladimir) Lanin">aharon</who>
    <bug_when>2009-05-26 07:20:43 -0700</bug_when>
    <thetext>Created attachment 30668
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>322063</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-12-14 11:24:53 -0800</bug_when>
    <thetext>See also: &lt;http://www.w3.org/TR/cssom-view/#offset-attributes&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>362523</commentid>
    <comment_count>3</comment_count>
    <who name="Jeremy Moskovich">playmobil</who>
    <bug_when>2011-03-04 08:35:00 -0800</bug_when>
    <thetext>Aharon: It appears that FF also behaves this way, up to and including FF4, have you filed a bug against them as well?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>362571</commentid>
    <comment_count>4</comment_count>
    <who name="Jeremy Moskovich">playmobil</who>
    <bug_when>2011-03-04 09:45:41 -0800</bug_when>
    <thetext>Another bit of information: Operat matches IE8 here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>363980</commentid>
    <comment_count>5</comment_count>
    <who name="Aharon (Vladimir) Lanin">aharon</who>
    <bug_when>2011-03-08 09:13:26 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; Aharon: It appears that FF also behaves this way, up to and including FF4, have you filed a bug against them as well?

As far as I can see from my notes at the time that I filed this bug, I tested it in FF (2 &amp; 3), and found that it did *not* behave this way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>363987</commentid>
    <comment_count>6</comment_count>
    <who name="Aharon (Vladimir) Lanin">aharon</who>
    <bug_when>2011-03-08 09:21:57 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #3)
&gt; &gt; Aharon: It appears that FF also behaves this way, up to and including FF4, have you filed a bug against them as well?
&gt; 
&gt; As far as I can see from my notes at the time that I filed this bug, I tested it in FF (2 &amp; 3), and found that it did *not* behave this way.

To clarify, I see that FF 3.6.13 (which is what I currently have installed) behaves that way, but according to my notes the version of FF 3 I tested back then did not. Unfortunately, I did not note which version of FF 3 I had used.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887418</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-28 12:41:22 -0700</bug_when>
    <thetext>All browsers (Chrome Canary 106, Firefox Nightly 105 and Safari 15.6 on macOS 12.5) match with each other in attached test case show following:

___


static
absolute

static.offsetLeft: 0 (supposed to be 10)
absolute.offsetLeft: 10 (supposed to be 10)

___

Do we need to do anything more here as per web-spec or this can be marked as &quot;RESOLVED CONFIGURATION CHANGED&quot;? Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887429</commentid>
    <comment_count>8</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-07-28 13:17:04 -0700</bug_when>
    <thetext>Nice!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>30668</attachid>
            <date>2009-05-26 07:20:43 -0700</date>
            <delta_ts>2009-05-26 07:20:43 -0700</delta_ts>
            <desc>test case</desc>
            <filename>offsetLeft-should-include-html-margin.htm</filename>
            <type>text/html</type>
            <size>875</size>
            <attacher name="Aharon (Vladimir) Lanin">aharon</attacher>
            
              <data encoding="base64">PC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