<?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>33851</bug_id>
          
          <creation_ts>2010-01-19 11:33:23 -0800</creation_ts>
          <short_desc>ScrollView::platformVisibleContentRect returns incorrectly sized rectangle when includeScrollbars == true</short_desc>
          <delta_ts>2010-03-17 17:06:26 -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>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.6</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>PlatformOnly</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Bates">dbates</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bdakin</cc>
    
    <cc>darin</cc>
    
    <cc>hyatt</cc>
    
    <cc>mitz</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>182341</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2010-01-19 11:33:23 -0800</bug_when>
    <thetext>For the Apple Mac port, the method ScrollView::platformVisibleContentRect returns an incorrectly sized rectangle when includeScrollbars == true.

Moreover, the dimensions of this rectangle disagree with both the comment in file ScrollView.h &lt;http://trac.webkit.org/browser/trunk/WebCore/platform/ScrollView.h?rev=53259#L112&gt; and the rectangle that would be returned by the method ScrollView::visibleContentRect &lt;http://trac.webkit.org/browser/trunk/WebCore/platform/ScrollView.cpp?rev=53259#L182&gt; had the widget not been platform-specific (i.e. platformWidget() == false).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182348</commentid>
    <comment_count>1</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2010-01-19 11:37:24 -0800</bug_when>
    <thetext>From my understanding of the hierarchy of a NSScrollView (*), when includeScrollbars == true, ScrollView::platformVisibleContentRect returns the rectangle of the document within the content view of the scroll view. And this rectangle has the same size as the rectangle returned by -[NSScrollView documentVisibleRect] (i.e. the rectangle returned when includeScrollbars == false).

(*) See subsection Components of a Scroll View of section How Scroll Views Work of the Scroll View Programming Guide for Cocoa &lt;http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/NSScrollViewGuide/Articles/Introduction.html#//apple_ref/doc/uid/TP40003460&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182353</commentid>
    <comment_count>2</comment_count>
      <attachid>46931</attachid>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2010-01-19 11:45:34 -0800</bug_when>
    <thetext>Created attachment 46931
Patch

No test included, since I cannot think of a way to test this change using either a manual or DRT test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182385</commentid>
    <comment_count>3</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-01-19 12:43:56 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; No test included, since I cannot think of a way to test this change using
&gt; either a manual or DRT test.

If this has no effect on browser behavior, how did you discover the problem?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182391</commentid>
    <comment_count>4</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2010-01-19 12:56:49 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; No test included, since I cannot think of a way to test this change using
&gt; &gt; either a manual or DRT test.
&gt; 
&gt; If this has no effect on browser behavior, how did you discover the problem?

In looking into another bug involving scrolling I noticed that the result of ScrollView::visibleContentRect was a rectangle whose dimensions did not include scrollbar even when I passed the parameter includeScrollbars == true. Upon inspection and from my understanding of the API of NSScrollView, NSClipView, NSView, and the description in Scroll View Programming Guide for Cocoa, it seems that [[NSScrollView documentView] visibleRect] == [[NSScrollView documentVisibleRect].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182398</commentid>
    <comment_count>5</comment_count>
      <attachid>46931</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-01-19 13:02:40 -0800</bug_when>
    <thetext>Comment on attachment 46931
Patch

rs=me

Seems safe to do this since it currently has no effect. Later it might come in handy to have a correct implementation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182438</commentid>
    <comment_count>6</comment_count>
      <attachid>46931</attachid>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2010-01-19 13:54:43 -0800</bug_when>
    <thetext>Comment on attachment 46931
Patch

Clearing flags on attachment: 46931

Committed r53490: &lt;http://trac.webkit.org/changeset/53490&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182439</commentid>
    <comment_count>7</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2010-01-19 13:54:56 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201039</commentid>
    <comment_count>8</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2010-03-17 16:48:10 -0700</bug_when>
    <thetext>This broke autoscrolling in Mail on Mac. -documentVisibleRect is not equivalent to -visibleRect, because the latter takes all enclosing views into account. This is required to make drag-scrolling work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201043</commentid>
    <comment_count>9</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-03-17 16:55:16 -0700</bug_when>
    <thetext>Darn, that&apos;s not good! Can we just roll this out?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201053</commentid>
    <comment_count>10</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2010-03-17 17:06:26 -0700</bug_when>
    <thetext>Spoke to Simon Fraser on IRC about this. There is still an issue with the returned dimensions. Simon mentioned that he will look to fix the issue while preventing the regression. I am also looking into this issue. If needed, feel free to rollout this patch.

(In reply to comment #9)
&gt; Darn, that&apos;s not good! Can we just roll this out?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>46931</attachid>
            <date>2010-01-19 11:45:34 -0800</date>
            <delta_ts>2010-01-19 13:54:43 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>Bug33851_1.patch</filename>
            <type>text/plain</type>
            <size>2402</size>
            <attacher name="Daniel Bates">dbates</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA1MzM4OSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMzEgQEAKKzIwMTAtMDEtMTkgIERhbmllbCBCYXRlcyAgPGRiYXRlc0ByaW0uY29t
PgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIGh0dHBz
Oi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0zMzg1MQorCisgICAgICAgIEZpeGVz
IGFuIGlzc3VlIGluIHRoZSBBcHBsZSBNYWMgcG9ydCB3aGVyZSBTY3JvbGxWaWV3OjpwbGF0Zm9y
bVZpc2libGVDb250ZW50UmVjdAorICAgICAgICByZXR1cm5zIHRoZSByZWN0YW5nbGUgb2YgdGhl
IGRvY3VtZW50IHdpdGhpbiB0aGUgY29udGVudCB2aWV3IG9mCisgICAgICAgIHRo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