<?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>121419</bug_id>
          
          <creation_ts>2013-09-16 03:21:04 -0700</creation_ts>
          <short_desc>[GTK] [Stable] [Regression] document.body.scrollTop is always 0</short_desc>
          <delta_ts>2013-09-16 08:38:48 -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>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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>0</everconfirmed>
          <reporter name="Guillaume Desmottes">gdesmott</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>gustavo</cc>
    
    <cc>zan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>929600</commentid>
    <comment_count>0</comment_count>
    <who name="Guillaume Desmottes">gdesmott</who>
    <bug_when>2013-09-16 03:21:04 -0700</bug_when>
    <thetext>Original bug report: https://bugzilla.gnome.org/show_bug.cgi?id=707781

- Start an empathy chat and reduce the window size so the vertical scrollbar appears
- Move up the scrollbar so the latest lines aren&apos;t visible
- Send a message

Expected result: the window scroll down so the sent message is visible
Actual result: the window doesn&apos;t scroll down

Empathy uses a nearBottom() JS function (empathy/data/Template.html) to check if it should automatically scroll down when a new message is displayed. This function is broken because document.body.scrollTop is always 0, ignoring the actual position of the scrollbar.

This can also be easily reproduced using the WebKit inspector to check the value of scrollTop. Just use &apos;gsettings set org.gnome.Empathy.conversation enable-webkit-developer-tools true&apos; and then right click in the chat window.

I can only reproduce this bug using webkit-2.2 branch. It works fine using 2.0.4 so that&apos;s probably a regression.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>929698</commentid>
    <comment_count>1</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2013-09-16 07:39:09 -0700</bug_when>
    <thetext>document.body.scrollTop and document.body.scrollLeft are returning 0 if the document is not in quirks mode after r154614.
http://trac.webkit.org/changeset/154614

The simplest way to enter the quirks mode is to remove the DOCTYPE or change it into something that would induce the quirks mode, for instance
&lt;!DOCTYPE html PUBLIC&gt;

Could you give that a go?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>929713</commentid>
    <comment_count>2</comment_count>
    <who name="Guillaume Desmottes">gdesmott</who>
    <bug_when>2013-09-16 08:27:29 -0700</bug_when>
    <thetext>Indeed removing the DOCTYPE solves this problem. I guess that&apos;s not really a bug then?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>929722</commentid>
    <comment_count>3</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2013-09-16 08:38:48 -0700</bug_when>
    <thetext>No, this is an intended change in behavior.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>