WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
70152
Widget window coordinate functions should use root view coordinate functions
https://bugs.webkit.org/show_bug.cgi?id=70152
Summary
Widget window coordinate functions should use root view coordinate functions
Jeff Miller
Reported
2011-10-14 15:15:49 PDT
Follow-up to
bug 69963
. Simon Fraser suggests:
> Source/WebCore/platform/Widget.cpp:106 > +IntRect Widget::convertFromRootView(const IntRect& rootRect) const > +{ > + if (const ScrollView* parentScrollView = parent()) { > + IntRect parentRect = parentScrollView->convertFromRootView(rootRect); > + return convertFromContainingView(parentRect); > + } > + return rootRect; > +} > + > +IntRect Widget::convertToRootView(const IntRect& localRect) const > +{ > + if (const ScrollView* parentScrollView = parent()) { > + IntRect parentRect = convertToContainingView(localRect); > + return parentScrollView->convertToRootView(parentRect); > + } > + return localRect; > +} > + > +IntPoint Widget::convertFromRootView(const IntPoint& rootPoint) const > +{ > + if (const ScrollView* parentScrollView = parent()) { > + IntPoint parentPoint = parentScrollView->convertFromRootView(rootPoint); > + return convertFromContainingView(parentPoint); > + } > + return rootPoint; > +} > + > +IntPoint Widget::convertToRootView(const IntPoint& localPoint) const > +{ > + if (const ScrollView* parentScrollView = parent()) { > + IntPoint parentPoint = convertToContainingView(localPoint); > + return parentScrollView->convertToRootView(parentPoint); > + } > + return localPoint; > +}
How about calling these from the existing toWindow/fromWindow calls?
Attachments
Patch
(2.81 KB, text/plain)
2011-10-17 13:15 PDT
,
Jeff Miller
darin
: review+
Details
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Jeff Miller
Comment 1
2011-10-17 13:15:27 PDT
Created
attachment 111307
[details]
Patch
WebKit Review Bot
Comment 2
2011-10-17 13:18:39 PDT
Attachment 111307
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/update-webkit', '--chromium']" exit_code: 2 Updating OpenSource From git://git.webkit.org/WebKit abfc01f..284a880 master -> 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't switch the checkout to
http://v8.googlecode.com/svn/branches/3.6@9637
; UUID don'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 'depot_tools/gclient sync' Error: Can't switch the checkout to
http://v8.googlecode.com/svn/branches/3.6@9637
; UUID don'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 'depot_tools/gclient sync' Error: Can't switch the checkout to
http://v8.googlecode.com/svn/branches/3.6@9637
; UUID don't match and there is local changes in /mnt/git/webkit-style-queue/Source/WebKit/chromium/v8. Delete the directory and try again. Error: 'depot_tools/gclient sync' failed 3 tries and returned 256 at Tools/Scripts/update-webkit-chromium line 107. Re-trying 'depot_tools/gclient sync' 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.
Jeff Miller
Comment 3
2011-10-17 13:27:56 PDT
(In reply to
comment #2
)
>
Attachment 111307
[details]
did not pass style-queue: > > Failed to run "['Tools/Scripts/update-webkit', '--chromium']" exit_code: 2 > > Updating OpenSource > From git://git.webkit.org/WebKit > abfc01f..284a880 master -> 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't switch the checkout to
http://v8.googlecode.com/svn/branches/3.6@9637
; UUID don'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 'depot_tools/gclient sync' > Error: Can't switch the checkout to
http://v8.googlecode.com/svn/branches/3.6@9637
; UUID don'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 'depot_tools/gclient sync' > Error: Can't switch the checkout to
http://v8.googlecode.com/svn/branches/3.6@9637
; UUID don't match and there is local changes in /mnt/git/webkit-style-queue/Source/WebKit/chromium/v8. Delete the directory and try again. > Error: 'depot_tools/gclient sync' failed 3 tries and returned 256 at Tools/Scripts/update-webkit-chromium line 107. > Re-trying 'depot_tools/gclient sync' > 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.
This patch passed check-webkit-style locally when I used "webkit-patch upload". This looks like a temporary failure and not an actual bug in check-webkit-style, so I'm not going to file a bug.
Jeff Miller
Comment 4
2011-10-17 13:29:09 PDT
Committed
r97641
: <
http://trac.webkit.org/changeset/97641
>
Ryosuke Niwa
Comment 5
2011-10-17 18:13:18 PDT
Reopen the bug because it was rolled out in
http://trac.webkit.org/changeset/97688
.
Jeff Miller
Comment 6
2011-10-18 10:29:02 PDT
Ryosuke Niwa notes: "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
." I will ensure these tests pass before landing a new patch.
Jeff Miller
Comment 7
2011-10-18 10:51:26 PDT
I verified that my original patch does cause these test failures.
Jeff Miller
Comment 8
2011-10-19 14:38:36 PDT
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.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug