<?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>9248</bug_id>
          
          <creation_ts>2006-06-02 12:02:06 -0700</creation_ts>
          <short_desc>Quirksmode: document.documentElement.scrollTop is always 0</short_desc>
          <delta_ts>2013-09-25 21:06:43 -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>420+</version>
          <rep_platform>All</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>106133</dup_id>
          
          <bug_file_loc>http://www.quirksmode.org/bugreports/archives/2006/02/scrollTop_in_select_list_in_IE_is_always_0.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>9610</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Adele Peterson">adele</reporter>
          <assigned_to name="Antonio Gomes">tonikitoo</assigned_to>
          <cc>anantha</cc>
    
    <cc>dglazkov</cc>
    
    <cc>hyatt</cc>
    
    <cc>ian</cc>
    
    <cc>joao.eiras</cc>
    
    <cc>johnnyding.webkit</cc>
    
    <cc>jon</cc>
    
    <cc>mdu</cc>
    
    <cc>peter017</cc>
    
    <cc>pivo</cc>
    
    <cc>priyajeet.hora</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>syoichi</cc>
    
    <cc>tonikitoo</cc>
    
    <cc>VE3LL</cc>
    
    <cc>webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>44413</commentid>
    <comment_count>0</comment_count>
    <who name="Adele Peterson">adele</who>
    <bug_when>2006-06-02 12:02:06 -0700</bug_when>
    <thetext>http://www.quirksmode.org/bugreports/archives/safari/index.html

&quot;It is not possible to obtain the correct scrollTop value of a select list in Explorer, regardless of strict/quirks mode. to reproduce, enter the test page, scroll the list a bit, then hit the button. The alert will display 0 value in IE, and correct value in Mozilla based browsers.

Test page http://firefang.net/~omry/bug/scrollTop.html
Workaround is not included
Reported by: Omry Yadan.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47002</commentid>
    <comment_count>1</comment_count>
    <who name="Joost de Valk (AlthA)">joost</who>
    <bug_when>2006-06-24 13:27:32 -0700</bug_when>
    <thetext>Changing component, confirming this is still a bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47003</commentid>
    <comment_count>2</comment_count>
    <who name="Joost de Valk (AlthA)">joost</who>
    <bug_when>2006-06-24 13:27:50 -0700</bug_when>
    <thetext>Changing component, confirming this is still a bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24043</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-02-12 03:37:17 -0800</bug_when>
    <thetext>The test page is 404, and I cannot find the report on quirksmode.org. 

In my testing, I&apos;m getting 0 from Firefox, too, so I am not sure what the original test could be.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24055</commentid>
    <comment_count>4</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-02-12 06:44:07 -0800</bug_when>
    <thetext>Google to the rescue!

http://www.google.com/search?client=safari&amp;rls=en&amp;q=site:quirksmode.org+Omry+Yadan&amp;ie=UTF-8&amp;oe=UTF-8

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23711</commentid>
    <comment_count>5</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2007-02-12 14:09:14 -0800</bug_when>
    <thetext>I fixed this in our new list boxes, although it&apos;s still not perfect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70504</commentid>
    <comment_count>6</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-02-13 03:06:08 -0800</bug_when>
    <thetext>Is the bug still alive? Test page was gone. A new test case uploaded would be welcome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80982</commentid>
    <comment_count>7</comment_count>
    <who name="John Russell">VE3LL</who>
    <bug_when>2008-05-20 07:23:26 -0700</bug_when>
    <thetext>I am finding that document.documentElement.scrollTop still gives
zero for WebKit nightly downloaded on May 19, 2008.
msie, firefox, opera reporting correct numbers.  My test case
is rather long but i will reduce it to a couple of thou bytes
and then share if you wish ....
john in niagara canada </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80984</commentid>
    <comment_count>8</comment_count>
    <who name="John Russell">VE3LL</who>
    <bug_when>2008-05-20 07:32:41 -0700</bug_when>
    <thetext>here is the shortened test
&lt;?xml version=&quot;1.1&quot; encoding=&quot;iso-8859-1&quot;?&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot;
&quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
&lt;html xml:lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;&lt;title&gt;StickyBug:VE3LL@RAC.CA&lt;/title&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;/&gt;
&lt;script type=&quot;text/javascript&quot;&gt;//&lt;![CDATA[
var ltop2;scrollSpeed2=20; //Screen refresh rate in msec.
function checkScrolled2(){ //backTo Top link stays in lower right
  window.status=document.documentElement.scrollTop
  document.getElementById(&apos;stickyEl&apos;).style.top =
      document.documentElement.scrollTop+ltop2+&apos;px&apos;;
  setTimeout(checkScrolled2,scrollSpeed2) ;}
function stickyInit(){
  copy=&apos;&lt;a href=&quot;jstutor5.htm&quot;&gt;GoTo Top&lt;\/a&gt;&apos;; //dynamic text only
  document.getElementById(&apos;stickyEl&apos;).innerHTML=copy; //dynamic text only
  ltop2=parseInt(document.getElementById(&apos;stickyEl&apos;).style.top,10);
  checkScrolled2();}
//]]&gt;
&lt;/script&gt;&lt;/head&gt;
&lt;body onload=&quot;stickyInit();&quot;&gt;&lt;h1&gt;StickyBug:VE3LL@RAC.CA&lt;/h1&gt;
&lt;div id=&quot;stickyEl&quot;
style=&quot;position:absolute;top:380px;left:655px;z-index:3&quot;&gt;***&lt;/div&gt;
&lt;pre&gt;
// SOME STUFF TO ALLOW SCREEN TO SCROLL -- WATCH THE GoToTop MARKER

// and then the status line for what scrollTop is returning

// repeat with MSIE, FireFox and Opera

/* checked with jsLint 2008 04 22 */

// scripts for tutorial #5 - DOM and DHTML

/* BackToTop link that sticks in one spot */

var ltop2;scrollSpeed2=20; //Screen refresh rate in msec.?

function checkScrolled2(){ //backTo Top link stays in lower right

  window.status=document.documentElement.scrollTop

  document.getElementById(&apos;stickyEl&apos;).style.top=

           document.documentElement.scrollTop+ltop2+&apos;px&apos;;

  setTimeout(checkScrolled2,scrollSpeed2);}

function stickyInit(){    //write link dynamically

  document.getElementById(&apos;stickyEl&apos;).innerHTML=copy;

  ltop2=parseInt(document.getElementById(&apos;stickyEl&apos;).style.top,10);

  checkScrolled2();}

&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86761</commentid>
    <comment_count>9</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-07-23 13:20:45 -0700</bug_when>
    <thetext>Nice demo how browsers deal with scrollTop is available on http://13thparallel.com/archive/viewport/example6.htm

You can notice that in WebKit only working property is document.body.scrollTop and it works in quirks mode and strict mode. 

Only document.documentElement.scrollTop is unsupported.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86763</commentid>
    <comment_count>10</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-07-23 13:21:40 -0700</bug_when>
    <thetext>*** Bug 16911 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>149345</commentid>
    <comment_count>11</comment_count>
    <who name="Peter Potrowl">peter017</who>
    <bug_when>2009-09-23 03:38:28 -0700</bug_when>
    <thetext>At this date, the bug is still here, and it is not Mac-specific (same problem with Google Chrome and Konqueror when using Webkit)...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156424</commentid>
    <comment_count>12</comment_count>
    <who name="johnnyding">johnnyding.webkit</who>
    <bug_when>2009-10-21 00:22:57 -0700</bug_when>
    <thetext>Now IE6/7/8 and Firefox get scrollTop from document.documentElement.scrollTop under standards mode and from document.body.scrollTop under quirks mode.
But all WebKit based browsers (like Safari and Chrome), under both standards and quirks mode, all only get scrollTop from document.body.scrollTop, and document.documentElement.scrollTop is always 0.

Since there is no standard/universal way to get scrollTop,
How about to get scrollTop by : document.documentElement.scrollTop &gt;= 
document.body.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop.

scrollLeft is similar as scrollTop.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>310183</commentid>
    <comment_count>13</comment_count>
      <attachid>74095</attachid>
    <who name="João Eiras">joao.eiras</who>
    <bug_when>2010-11-17 02:33:01 -0800</bug_when>
    <thetext>Created attachment 74095
Testcase

My testcase tests standards mode and shows that in webkit, documentElement.scrollTop/Left are 0.

However, scrollLeft and scrollTop on the document element should returns the amount of viewport scrolled in that direction, while the same properties on body must be zero (unless the body also overflows, which is not the case in the testcase).

Known victim: http://www.is-real.net/experiments/css3/wonder-webkit/
Site relies on this behavior and breaks in all the other browser, although the others implement the *correct* behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>933171</commentid>
    <comment_count>14</comment_count>
    <who name="Antonio Gomes">tonikitoo</who>
    <bug_when>2013-09-25 13:15:23 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 106133 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>933346</commentid>
    <comment_count>15</comment_count>
    <who name="Antonio Gomes">tonikitoo</who>
    <bug_when>2013-09-25 21:06:43 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; 
&gt; *** This bug has been marked as a duplicate of bug 106133 ***

bug 106133 fixed the problem that WebKit had handling scrollTop/Left for document.documentElement and document.body in quirks and strict modes.

Setters of these properties do not work still, so the URL below still. Fails.

http://maisqi.com/outros/bugs/chrome/CHN6

File bug 106133.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>74095</attachid>
            <date>2010-11-17 02:33:01 -0800</date>
            <delta_ts>2010-11-17 02:33:01 -0800</delta_ts>
            <desc>Testcase</desc>
            <filename>bigviewport.html</filename>
            <type>text/html</type>
            <size>1152</size>
            <attacher name="João Eiras">joao.eiras</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEvL0VOIiAiaHR0cDov
L3d3dy53My5vcmcvVFIvaHRtbDQvc3RyaWN0LmR0ZCI+CjxodG1sPgo8aGVhZD4KCTx0aXRsZT48
L3RpdGxlPgoJPG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0
bWw7IGNoYXJzZXQ9dXRmLTgiPgoJPHN0eWxlPgoJCWJvZHksZGl2LHB7bWFyZ2luOjA7Zm9udC1m
YW1pbHk6c2Fucy1zZXJpZn0KCTwvc3R5bGU+CjwvaGVhZD4KPGJvZHk+Cgk8ZGl2IHN0eWxlPSJi
YWNrZ3JvdW5kLWNvbG9yOmxpZ2h0Z3JleTt3aWR0aDo4MDAwcHg7aGVpZ2h0OjgwMDBweCI+CgkJ
PHAgaWQ9ImxvZyI+RkFJTEVEIChKYXZhc2NyaXB0IG11c3QgYmUgb24pPC9wPgoJPC9kaXY+CgoJ
PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQ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