WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
96593
[Chromium] REGRESSION(
r127457
): Context menu on textarea is displayed in the wrong place
https://bugs.webkit.org/show_bug.cgi?id=96593
Summary
[Chromium] REGRESSION(r127457): Context menu on textarea is displayed in the ...
Julien Chaffraix
Reported
2012-09-12 19:51:43 PDT
Created
attachment 163765
[details]
Screenshot of the issue How to reproduce: * Open
http://www.google.com/transliterate
on Chromium on Linux or Windows. * Right click on the textarea, and check the context menu. Issue: The context menu doesn't come up next to the mouse cursor. Please see attached image. Rolling out
r127457
(and the following refactoring) locally fixes the issue. Not sure if other platforms are impacted, for some reason Safari and Chromium Mac don't show the issue. Allan, could you have a look?
Attachments
Screenshot of the issue
(378.48 KB, image/png)
2012-09-12 19:51 PDT
,
Julien Chaffraix
no flags
Details
Proposed fix. Tested on Chromium Linux, need testing on Chromium Mac. Would love to test that.
(1.82 KB, patch)
2012-09-13 10:58 PDT
,
Julien Chaffraix
no flags
Details
Formatted Diff
Diff
Proposed fix: Same as previously, ChangeLog updated, passes Mac testing.
(1.94 KB, patch)
2012-09-13 11:42 PDT
,
Julien Chaffraix
no flags
Details
Formatted Diff
Diff
Patch for landing
(1.94 KB, patch)
2012-09-13 13:29 PDT
,
Julien Chaffraix
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Allan Sandfeld Jensen
Comment 1
2012-09-13 02:19:01 PDT
I can not reproduce the issue on Qt either. I have a guess on the cause though. EventHandler::hitTestResultAtPoint used to have a quirk/bug where it changed the result.point() so that after the function it was in the coordinates of the last frame it hit-tested. It no longer does that, if you use that position for the context menu have code that corrects for the old bug, it might be wrong now that it is no longer necessary.
Allan Sandfeld Jensen
Comment 2
2012-09-13 02:35:10 PDT
(In reply to
comment #1
)
> I can not reproduce the issue on Qt either. > > I have a guess on the cause though. EventHandler::hitTestResultAtPoint used to have a quirk/bug where it changed the result.point() so that after the function it was in the coordinates of the last frame it hit-tested. It no longer does that, if you use that position for the context menu have code that corrects for the old bug, it might be wrong now that it is no longer necessary.
No, I have checked the chromium code now, and the only place that uses the returned position hitTestResultAtPoint is WebFrameImpl::characterIndexForPoint, and that one should work more correctly now.
Allan Sandfeld Jensen
Comment 3
2012-09-13 07:56:55 PDT
Possibly related to
bug #96541
Julien Chaffraix
Comment 4
2012-09-13 08:27:52 PDT
(In reply to
comment #3
)
> Possibly related to
bug #96541
Tried the fix locally but it didn't solve the issue AFAICT. (In reply to
comment #2
)
> (In reply to
comment #1
) > > I can not reproduce the issue on Qt either. > > > > I have a guess on the cause though. EventHandler::hitTestResultAtPoint used to have a quirk/bug where it changed the result.point() so that after the function it was in the coordinates of the last frame it hit-tested. It no longer does that, if you use that position for the context menu have code that corrects for the old bug, it might be wrong now that it is no longer necessary.
Toying with the example, this is exactly the issue. We seem to be converting the result of hitTestResultAtPoint to the window coordinates, therefore adding the iframe's position twice to the context menu's top left point.
> No, I have checked the chromium code now, and the only place that uses the returned position hitTestResultAtPoint is WebFrameImpl::characterIndexForPoint, and that one should work more correctly now.
After your change, anything that manipulates the returned position from hitTestResultAtPoint across frames can be wrong. I am not super happy that this was completely overlooked. Debugging the issue, ContextMenuController is doing exactly that and would be my bet for what is wrong.
Allan Sandfeld Jensen
Comment 5
2012-09-13 08:40:53 PDT
(In reply to
comment #4
)
> (In reply to
comment #3
) > > Possibly related to
bug #96541
> > Tried the fix locally but it didn't solve the issue AFAICT. > > (In reply to
comment #2
) > > (In reply to
comment #1
) > > > I can not reproduce the issue on Qt either. > > > > > > I have a guess on the cause though. EventHandler::hitTestResultAtPoint used to have a quirk/bug where it changed the result.point() so that after the function it was in the coordinates of the last frame it hit-tested. It no longer does that, if you use that position for the context menu have code that corrects for the old bug, it might be wrong now that it is no longer necessary. > > Toying with the example, this is exactly the issue. We seem to be converting the result of hitTestResultAtPoint to the window coordinates, therefore adding the iframe's position twice to the context menu's top left point. >
Okay, at least that is better than not knowing the source.
> > No, I have checked the chromium code now, and the only place that uses the returned position hitTestResultAtPoint is WebFrameImpl::characterIndexForPoint, and that one should work more correctly now. > > After your change, anything that manipulates the returned position from hitTestResultAtPoint across frames can be wrong. I am not super happy that this was completely overlooked. Debugging the issue, ContextMenuController is doing exactly that and would be my bet for what is wrong.
It wasn't overlooked, I checked all the call sites I could find of the function, and in the places I found that used the position it would either not make a difference, or would actually fix rare corner cases. I will take a deeper look at the contextMenuController. In general though the point in hitTestResult should probably be deprecated, it is just a left-over from when HitTestPoint and HitTestResult were the same.
Julien Chaffraix
Comment 6
2012-09-13 10:58:20 PDT
Created
attachment 163909
[details]
Proposed fix. Tested on Chromium Linux, need testing on Chromium Mac. Would love to test that.
Julien Chaffraix
Comment 7
2012-09-13 11:42:55 PDT
Created
attachment 163920
[details]
Proposed fix: Same as previously, ChangeLog updated, passes Mac testing.
Julien Chaffraix
Comment 8
2012-09-13 11:43:40 PDT
CC'ing some people who have reviewed this code in the past.
Adam Barth
Comment 9
2012-09-13 13:10:24 PDT
Comment on
attachment 163920
[details]
Proposed fix: Same as previously, ChangeLog updated, passes Mac testing. ok
Julien Chaffraix
Comment 10
2012-09-13 13:25:07 PDT
Comment on
attachment 163920
[details]
Proposed fix: Same as previously, ChangeLog updated, passes Mac testing. Actually need to update the bug title.
Julien Chaffraix
Comment 11
2012-09-13 13:29:18 PDT
Created
attachment 163950
[details]
Patch for landing
WebKit Review Bot
Comment 12
2012-09-13 14:05:32 PDT
Comment on
attachment 163950
[details]
Patch for landing Clearing flags on attachment: 163950 Committed
r128505
: <
http://trac.webkit.org/changeset/128505
>
WebKit Review Bot
Comment 13
2012-09-13 14:05:38 PDT
All reviewed patches have been landed. Closing bug.
Allan Sandfeld Jensen
Comment 14
2012-09-13 15:49:11 PDT
I believe from reading the source code that the webkit1 win-platform (I guess Safari on Windows?), have the same issue. It would be great if someone could confirm it, and we could fix it.
Jessie Berlin
Comment 15
2012-09-14 16:03:25 PDT
http://trac.webkit.org/changeset/127457
also broke Apple Mac context menus, not just Chromium context menus. The fix in
http://trac.webkit.org/changeset/128505
only fixed Chromium.
Julien Chaffraix
Comment 16
2012-09-14 16:15:24 PDT
(In reply to
comment #15
)
>
http://trac.webkit.org/changeset/127457
also broke Apple Mac context menus, not just Chromium context menus. > > The fix in
http://trac.webkit.org/changeset/128505
only fixed Chromium.
Yes, my apologies for just fixing one platform without looking at the others. For the record, the fix in this bug will be rolled out along
r127457
in
bug 96830
as the approach has caused (at least) another regression.
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