<?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>70152</bug_id>
          
          <creation_ts>2011-10-14 15:15:49 -0700</creation_ts>
          <short_desc>Widget window coordinate functions should use root view coordinate functions</short_desc>
          <delta_ts>2011-10-19 14:38:36 -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>Frames</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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>
          <dependson>70288</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jeff Miller">jeffm</reporter>
          <assigned_to name="Jeff Miller">jeffm</assigned_to>
          <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>484347</commentid>
    <comment_count>0</comment_count>
    <who name="Jeff Miller">jeffm</who>
    <bug_when>2011-10-14 15:15:49 -0700</bug_when>
    <thetext>Follow-up to bug 69963.

Simon Fraser suggests:

&gt; Source/WebCore/platform/Widget.cpp:106
&gt; +IntRect Widget::convertFromRootView(const IntRect&amp; rootRect) const
&gt; +{
&gt; +    if (const ScrollView* parentScrollView = parent()) {
&gt; +        IntRect parentRect = parentScrollView-&gt;convertFromRootView(rootRect);
&gt; +        return convertFromContainingView(parentRect);
&gt; +    }
&gt; +    return rootRect;
&gt; +}
&gt; +
&gt; +IntRect Widget::convertToRootView(const IntRect&amp; localRect) const
&gt; +{
&gt; +    if (const ScrollView* parentScrollView = parent()) {
&gt; +        IntRect parentRect = convertToContainingView(localRect);
&gt; +        return parentScrollView-&gt;convertToRootView(parentRect);
&gt; +    }
&gt; +    return localRect;
&gt; +}
&gt; +
&gt; +IntPoint Widget::convertFromRootView(const IntPoint&amp; rootPoint) const
&gt; +{
&gt; +    if (const ScrollView* parentScrollView = parent()) {
&gt; +        IntPoint parentPoint = parentScrollView-&gt;convertFromRootView(rootPoint);
&gt; +        return convertFromContainingView(parentPoint);
&gt; +    }
&gt; +    return rootPoint;
&gt; +}
&gt; +
&gt; +IntPoint Widget::convertToRootView(const IntPoint&amp; localPoint) const
&gt; +{
&gt; +    if (const ScrollView* parentScrollView = parent()) {
&gt; +        IntPoint parentPoint = convertToContainingView(localPoint);
&gt; +        return parentScrollView-&gt;convertToRootView(parentPoint);
&gt; +    }
&gt; +    return localPoint;
&gt; +}

How about calling these from the existing toWindow/fromWindow calls?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>485434</commentid>
    <comment_count>1</comment_count>
      <attachid>111307</attachid>
    <who name="Jeff Miller">jeffm</who>
    <bug_when>2011-10-17 13:15:27 -0700</bug_when>
    <thetext>Created attachment 111307
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>485439</commentid>
    <comment_count>2</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-10-17 13:18:39 -0700</bug_when>
    <thetext>Attachment 111307 did not pass style-queue:

Failed to run &quot;[&apos;Tools/Scripts/update-webkit&apos;, &apos;--chromium&apos;]&quot; exit_code: 2

Updating OpenSource
From git://git.webkit.org/WebKit
   abfc01f..284a880  master     -&gt; origin/master
	M	Source/WebKit/mac/ChangeLog
	M	Source/WebKit/mac/WebView/WebView.mm
	M	Source/WebCore/WebCore.exp.in
	M	Source/WebCore/ChangeLog
	M	Source/WebCore/page/Page.h
	M	Source/WebCore/page/Page.cpp
	M	Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
	M	Source/WebKit2/ChangeLog
r97640 = 284a880fb02564497ff4d4c705cfc8d3ca46285e (refs/remotes/trunk)
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/trunk.
Updating chromium port dependencies using gclient...
Error: Can&apos;t switch the checkout to http://v8.googlecode.com/svn/branches/3.6@9637; UUID don&apos;t match and there is local changes in /mnt/git/webkit-style-queue/Source/WebKit/chromium/v8. Delete the directory and try again.
Re-trying &apos;depot_tools/gclient sync&apos;
Error: Can&apos;t switch the checkout to http://v8.googlecode.com/svn/branches/3.6@9637; UUID don&apos;t match and there is local changes in /mnt/git/webkit-style-queue/Source/WebKit/chromium/v8. Delete the directory and try again.
Re-trying &apos;depot_tools/gclient sync&apos;
Error: Can&apos;t switch the checkout to http://v8.googlecode.com/svn/branches/3.6@9637; UUID don&apos;t match and there is local changes in /mnt/git/webkit-style-queue/Source/WebKit/chromium/v8. Delete the directory and try again.
Error: &apos;depot_tools/gclient sync&apos; failed 3 tries and returned 256 at Tools/Scripts/update-webkit-chromium line 107.
Re-trying &apos;depot_tools/gclient sync&apos;
No such file or directory at Tools/Scripts/update-webkit line 104.


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>485454</commentid>
    <comment_count>3</comment_count>
    <who name="Jeff Miller">jeffm</who>
    <bug_when>2011-10-17 13:27:56 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Attachment 111307 [details] did not pass style-queue:
&gt; 
&gt; Failed to run &quot;[&apos;Tools/Scripts/update-webkit&apos;, &apos;--chromium&apos;]&quot; exit_code: 2
&gt; 
&gt; Updating OpenSource
&gt; From git://git.webkit.org/WebKit
&gt;    abfc01f..284a880  master     -&gt; origin/master
&gt;     M    Source/WebKit/mac/ChangeLog
&gt;     M    Source/WebKit/mac/WebView/WebView.mm
&gt;     M    Source/WebCore/WebCore.exp.in
&gt;     M    Source/WebCore/ChangeLog
&gt;     M    Source/WebCore/page/Page.h
&gt;     M    Source/WebCore/page/Page.cpp
&gt;     M    Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
&gt;     M    Source/WebKit2/ChangeLog
&gt; r97640 = 284a880fb02564497ff4d4c705cfc8d3ca46285e (refs/remotes/trunk)
&gt; First, rewinding head to replay your work on top of it...
&gt; Fast-forwarded master to refs/remotes/trunk.
&gt; Updating chromium port dependencies using gclient...
&gt; Error: Can&apos;t switch the checkout to http://v8.googlecode.com/svn/branches/3.6@9637; UUID don&apos;t match and there is local changes in /mnt/git/webkit-style-queue/Source/WebKit/chromium/v8. Delete the directory and try again.
&gt; Re-trying &apos;depot_tools/gclient sync&apos;
&gt; Error: Can&apos;t switch the checkout to http://v8.googlecode.com/svn/branches/3.6@9637; UUID don&apos;t match and there is local changes in /mnt/git/webkit-style-queue/Source/WebKit/chromium/v8. Delete the directory and try again.
&gt; Re-trying &apos;depot_tools/gclient sync&apos;
&gt; Error: Can&apos;t switch the checkout to http://v8.googlecode.com/svn/branches/3.6@9637; UUID don&apos;t match and there is local changes in /mnt/git/webkit-style-queue/Source/WebKit/chromium/v8. Delete the directory and try again.
&gt; Error: &apos;depot_tools/gclient sync&apos; failed 3 tries and returned 256 at Tools/Scripts/update-webkit-chromium line 107.
&gt; Re-trying &apos;depot_tools/gclient sync&apos;
&gt; No such file or directory at Tools/Scripts/update-webkit line 104.
&gt; 
&gt; 
&gt; If any of these errors are false positives, please file a bug against check-webkit-style.

This patch passed check-webkit-style locally when I used &quot;webkit-patch upload&quot;. This looks like a temporary failure and not an actual bug in check-webkit-style, so I&apos;m not going to file a bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>485456</commentid>
    <comment_count>4</comment_count>
    <who name="Jeff Miller">jeffm</who>
    <bug_when>2011-10-17 13:29:09 -0700</bug_when>
    <thetext>Committed r97641: &lt;http://trac.webkit.org/changeset/97641&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>485702</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-10-17 18:13:18 -0700</bug_when>
    <thetext>Reopen the bug because it was rolled out in http://trac.webkit.org/changeset/97688.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>486145</commentid>
    <comment_count>6</comment_count>
    <who name="Jeff Miller">jeffm</who>
    <bug_when>2011-10-18 10:29:02 -0700</bug_when>
    <thetext>Ryosuke Niwa notes:

&quot;This patch appears to have caused 15+ tests to fail on Snow Leopard:
http://build.webkit.org/results/SnowLeopard%20Intel%20Debug%20(Tests)/r97655%20(2609)/results.html

Tests passed on r97640 but fail on r97646.&quot;

I will ensure these tests pass before landing a new patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>486163</commentid>
    <comment_count>7</comment_count>
    <who name="Jeff Miller">jeffm</who>
    <bug_when>2011-10-18 10:51:26 -0700</bug_when>
    <thetext>I verified that my original patch does cause these test failures.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>487017</commentid>
    <comment_count>8</comment_count>
    <who name="Jeff Miller">jeffm</who>
    <bug_when>2011-10-19 14:38:36 -0700</bug_when>
    <thetext>After further investigation, it would be sub-optimal to try to leverage the new root view coordinate functions when dealing with window coordinates. Since convertFromRootToContainingWindow() and convertFromContainingWindowToRoot() require the root widget, so we would have to walk up the view hierarchy twice.

The test failures were being caused by the fact that I was passing the non-root widget to these two member functions, which led to incorrect results on the Mac.

Closing as WONTFIX.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>111307</attachid>
            <date>2011-10-17 13:15:27 -0700</date>
            <delta_ts>2011-10-18 10:29:52 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-70152-20111017131525.patch</filename>
            <type>text/plain</type>
            <size>2874</size>
            <attacher name="Jeff Miller">jeffm</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJ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SkgewotICAgICAgICBJbnRSZWN0IHBhcmVudFJlY3QgPSBjb252ZXJ0VG9Db250YWluaW5nVmll
dyhsb2NhbFJlY3QpOwotICAgICAgICByZXR1cm4gcGFyZW50U2Nyb2xsVmlldy0+Y29udmVydFRv
Q29udGFpbmluZ1dpbmRvdyhwYXJlbnRSZWN0KTsKLSAgICB9Ci0gICAgcmV0dXJuIGNvbnZlcnRG
cm9tUm9vdFRvQ29udGFpbmluZ1dpbmRvdyh0aGlzLCBsb2NhbFJlY3QpOworICAgIHJldHVybiBj
b252ZXJ0RnJvbVJvb3RUb0NvbnRhaW5pbmdXaW5kb3codGhpcywgY29udmVydFRvUm9vdFZpZXco
bG9jYWxSZWN0KSk7CiB9CiAKIEludFBvaW50IFdpZGdldDo6Y29udmVydEZyb21Db250YWluaW5n
V2luZG93KGNvbnN0IEludFBvaW50JiB3aW5kb3dQb2ludCkgY29uc3QKIHsKLSAgICBpZiAoY29u
c3QgU2Nyb2xsVmlldyogcGFyZW50U2Nyb2xsVmlldyA9IHBhcmVudCgpKSB7Ci0gICAgICAgIElu
dFBvaW50IHBhcmVudFBvaW50ID0gcGFyZW50U2Nyb2xsVmlldy0+Y29udmVydEZyb21Db250YWlu
aW5nV2luZG93KHdpbmRvd1BvaW50KTsKLSAgICAgICAgcmV0dXJuIGNvbnZlcnRGcm9tQ29udGFp
bmluZ1ZpZXcocGFyZW50UG9pbnQpOwotICAgIH0KLSAgICByZXR1cm4gY29udmVydEZyb21Db250
YWluaW5nV2luZG93VG9Sb290KHRoaXMsIHdpbmRvd1BvaW50KTsKKyAgICByZXR1cm4gY29udmVy
dEZyb21Sb290Vmlldyhjb252ZXJ0RnJvbUNvbnRhaW5pbmdXaW5kb3dUb1Jvb3QodGhpcywgd2lu
ZG93UG9pbnQpKTsKIH0KIAogSW50UG9pbnQgV2lkZ2V0Ojpjb252ZXJ0VG9Db250YWluaW5nV2lu
ZG93KGNvbnN0IEludFBvaW50JiBsb2NhbFBvaW50KSBjb25zdAogewotICAgIGlmIChjb25zdCBT
Y3JvbGxWaWV3KiBwYXJlbnRTY3JvbGxWaWV3ID0gcGFyZW50KCkpIHsKLSAgICAgICAgSW50UG9p
bnQgcGFyZW50UG9pbnQgPSBjb252ZXJ0VG9Db250YWluaW5nVmlldyhsb2NhbFBvaW50KTsKLSAg
ICAgICAgcmV0dXJuIHBhcmVudFNjcm9sbFZpZXctPmNvbnZlcnRUb0NvbnRhaW5pbmdXaW5kb3co
cGFyZW50UG9pbnQpOwotICAgIH0KLSAgICByZXR1cm4gY29udmVydEZyb21Sb290VG9Db250YWlu
aW5nV2luZG93KHRoaXMsIGxvY2FsUG9pbnQpOworICAgIHJldHVybiBjb252ZXJ0RnJvbVJvb3RU
b0NvbnRhaW5pbmdXaW5kb3codGhpcywgY29udmVydFRvUm9vdFZpZXcobG9jYWxQb2ludCkpOwog
fQogCiAjaWYgIVBMQVRGT1JNKE1BQykK
</data>
<flag name="review"
          id="109106"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>