<?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>32534</bug_id>
          
          <creation_ts>2009-12-14 17:01:09 -0800</creation_ts>
          <short_desc>Confusing, possibly buggy code in RenderLayer::updateScrollInfoAfterLayout()</short_desc>
          <delta_ts>2009-12-18 22:40:37 -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>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Peter Kasting">pkasting</reporter>
          <assigned_to name="Peter Kasting">pkasting</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>hyatt</cc>
    
    <cc>mitz</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>171630</commentid>
    <comment_count>0</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2009-12-14 17:01:09 -0800</bug_when>
    <thetext>(Mentioned this to smfr on IRC, he didn&apos;t know what to make of it either and suggested filing this bug)

At the bottom of RenderLayer::updateScrollInfoAfterLayout() is some code that resets the horizontal and vertical scrollbars.  The blocks are identical, except that the horizontal scrollbar gets a setValue() call and the vertical scrollbar doesn&apos;t.  Is this a bug?  If not can we comment about why?

This dates from 2005, when darin checked in r11521 to fix bug 5826.  Before this change, neither block had a setValue(); the change added the setValue() call to just the horizontal scrollbar block.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171633</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-12-14 17:14:59 -0800</bug_when>
    <thetext>If we can find a symptom, then we can fix the bug. I don’t think we should change any code based on just seeing it’s different. I’ll look at the patch and see if I can remember anything from the distant past.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171635</commentid>
    <comment_count>2</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2009-12-14 17:18:04 -0800</bug_when>
    <thetext>Yes, I wish I knew what this code did so I could figure out how to test this codepath.  Of course, if I knew that much, I could just say whether the code was right :P</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171637</commentid>
    <comment_count>3</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-12-14 17:20:40 -0800</bug_when>
    <thetext>(In reply to comment #0)
&gt; This dates from 2005, when darin checked in r11521 to fix bug 5826.

Note that the change r11521 was done by Mitz Pettel. I was just the committer. Back then I was the commit bot.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171641</commentid>
    <comment_count>4</comment_count>
    <who name="">mitz</who>
    <bug_when>2009-12-14 17:36:34 -0800</bug_when>
    <thetext>This code ensures that when a right-to-left scrollable area’s width (or content width) changes, the top right corner of the content doesn’t shift with respect to the top right corner of the area. Conceptually, right-to-left areas have their origin at the top-right, but RenderLayer is top-left oriented, so this is needed to keep everything working (see how scrollXOffset() differs from srollYOffsset() to get an idea of why the horizontal and vertical scrollbars need to be treated differently).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171644</commentid>
    <comment_count>5</comment_count>
    <who name="">mitz</who>
    <bug_when>2009-12-14 17:42:01 -0800</bug_when>
    <thetext>I’m pretty sure there are regression tests that cover this already, but here’s the simplest one:

&lt;div style=&quot;direction: rtl; width: 100px; overflow: auto;&quot;&gt;
    &lt;div id=&quot;target&quot; style=&quot;width: 150px; height: 100px;&quot;&gt;&lt;/div&gt;
&lt;/div&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171645</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-12-14 17:42:35 -0800</bug_when>
    <thetext>Setting a resolution based on Mitz’s comments.

Or we could add a comment explaining this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171646</commentid>
    <comment_count>7</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2009-12-14 17:49:24 -0800</bug_when>
    <thetext>It&apos;d be awesome to add a comment in the code.  All my checkouts are in use at the moment, but if no one gets to it before me I&apos;ll add something like comment 4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>173430</commentid>
    <comment_count>8</comment_count>
      <attachid>45213</attachid>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2009-12-18 17:19:21 -0800</bug_when>
    <thetext>Created attachment 45213
Add comment

This patch basically adds mitz&apos; comment verbatim into the code.  I think this is really useful when trying to figure out why the code does what it does.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>173431</commentid>
    <comment_count>9</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2009-12-18 17:20:28 -0800</bug_when>
    <thetext>Attachment 45213 did not pass style-queue:

Failed to run &quot;WebKitTools/Scripts/check-webkit-style&quot; exit_code: 1
WebCore/rendering/RenderLayer.cpp:1895:  Line contains invalid UTF-8 (or Unicode replacement character).  [readability/utf8] [5]
Total errors found: 1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>173432</commentid>
    <comment_count>10</comment_count>
      <attachid>45214</attachid>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2009-12-18 17:22:25 -0800</bug_when>
    <thetext>Created attachment 45214
Add comment, v2

Fix apostrophe</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>173433</commentid>
    <comment_count>11</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2009-12-18 17:25:47 -0800</bug_when>
    <thetext>style-queue ran check-webkit-style on attachment 45214 without any errors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>173481</commentid>
    <comment_count>12</comment_count>
      <attachid>45214</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-12-18 22:40:31 -0800</bug_when>
    <thetext>Comment on attachment 45214
Add comment, v2

Clearing flags on attachment: 45214

Committed r52379: &lt;http://trac.webkit.org/changeset/52379&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>173482</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-12-18 22:40:37 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>45213</attachid>
            <date>2009-12-18 17:19:21 -0800</date>
            <delta_ts>2009-12-18 17:22:25 -0800</delta_ts>
            <desc>Add comment</desc>
            <filename>patch</filename>
            <type>text/plain</type>
            <size>1834</size>
            <attacher name="Peter Kasting">pkasting</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQotLS0gV2ViQ29yZS9DaGFuZ2VM
b2cJKHJldmlzaW9uIDUyMzY2KQorKysgV2ViQ29yZS9DaGFuZ2VMb2cJKHdvcmtpbmcgY29weSkK
QEAgLTEsMyArMSwxNCBAQAorMjAwOS0xMi0xOCAgUGV0ZXIgS2FzdGluZyAgPHBrYXN0aW5nQGdv
b2dsZS5jb20+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAg
ICAgQWRkIGEgY29tbWVudCBhYm91dCBzb21lIGNvbm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cm9sbFdpZHRoKTsKKyAgICAgICAg
Ly8gRXhwbGljaXRseSBzZXQgdGhlIGhvcml6b250YWwgc2Nyb2xsIHZhbHVlLiAgVGhpcyBlbnN1
cmVzIHRoYXQgd2hlbiBhCisgICAgICAgIC8vIHJpZ2h0LXRvLWxlZnQgc2Nyb2xsYWJsZSBhcmVh
J3Mgd2lkdGggKG9yIGNvbnRlbnQgd2lkdGgpIGNoYW5nZXMsIHRoZQorICAgICAgICAvLyB0b3Ag
cmlnaHQgY29ybmVyIG9mIHRoZSBjb250ZW50IGRvZXNuknQgc2hpZnQgd2l0aCByZXNwZWN0IHRv
IHRoZSB0b3AKKyAgICAgICAgLy8gcmlnaHQgY29ybmVyIG9mIHRoZSBhcmVhLiBDb25jZXB0dWFs
bHksIHJpZ2h0LXRvLWxlZnQgYXJlYXMgaGF2ZQorICAgICAgICAvLyB0aGVpciBvcmlnaW4gYXQg
dGhlIHRvcC1yaWdodCwgYnV0IFJlbmRlckxheWVyIGlzIHRvcC1sZWZ0IG9yaWVudGVkLAorICAg
ICAgICAvLyBzbyB0aGlzIGlzIG5lZWRlZCB0byBrZWVwIGV2ZXJ5dGhpbmcgd29ya2luZyAoc2Vl
IGhvdyBzY3JvbGxYT2Zmc2V0KCkKKyAgICAgICAgLy8gZGlmZmVycyBmcm9tIHNjcm9sbFlPZmZz
ZXQoKSB0byBnZXQgYW4gaWRlYSBvZiB3aHkgdGhlIGhvcml6b250YWwgYW5kCisgICAgICAgIC8v
IHZlcnRpY2FsIHNjcm9sbGJhcnMgbmVlZCB0byBiZSB0cmVhdGVkIGRpZmZlcmVudGx5KS4KICAg
ICAgICAgbV9oQmFyLT5zZXRWYWx1ZShzY3JvbGxYT2Zmc2V0KCkpOwogICAgIH0KICAgICBpZiAo
bV92QmFyKSB7Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>45214</attachid>
            <date>2009-12-18 17:22:25 -0800</date>
            <delta_ts>2009-12-18 22:40:31 -0800</delta_ts>
            <desc>Add comment, v2</desc>
            <filename>patch</filename>
            <type>text/plain</type>
            <size>1834</size>
            <attacher name="Peter Kasting">pkasting</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQotLS0gV2ViQ29yZS9DaGFuZ2VM
b2cJKHJldmlzaW9uIDUyMzY2KQorKysgV2ViQ29yZS9DaGFuZ2VMb2cJKHdvcmtpbmcgY29weSkK
QEAgLTEsMyArMSwxNCBAQAorMjAwOS0xMi0xOCAgUGV0ZXIgS2FzdGluZyAgPHBrYXN0aW5nQGdv
b2dsZS5jb20+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAg
ICAgQWRkIGEgY29tbWVudCBhYm91dCBzb21lIGNvbmZ1c2luZyBjb2RlIHRoYXQgb3RoZXJ3aXNl
IHdvdWxkIGxvb2sgbGlrZQorICAgICAgICBpdCBtaWdodCBiZSBhIGJ1Zy4KKyAgICAgICAgaHR0
cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTMyNTM0CisKKyAgICAgICAgKiBy
ZW5kZXJpbmcvUmVuZGVyTGF5ZXIuY3BwOgorICAgICAgICAoV2ViQ29yZTo6UmVuZGVyTGF5ZXI6
OnVwZGF0ZVNjcm9sbEluZm9BZnRlckxheW91dCk6CisKIDIwMDktMTItMTggIEpvbiBIb25leWN1
dHQgIDxqaG9uZXljdXR0QGFwcGxlLmNvbT4KIAogICAgICAgICBSRUdSRVNTSU9OKHI1MjIzMyk6
IE1TQUE6IEFjY2Vzc2liaWxpdHkgcm9sZSBvZiBsaXN0cyBpcyB3cm9uZwpJbmRleDogV2ViQ29y
ZS9yZW5kZXJpbmcvUmVuZGVyTGF5ZXIuY3BwDQo9PT09PT09PT09PT09PT09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