Bug 134684

Summary: ServicesOverlayController menus show up in the wrong place
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebKit2Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue, thorton
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: All   
Bug Depends on: 134783    
Bug Blocks:    
Attachments:
Description Flags
Patch v1
none
Patch v2 thorton: review+

Description Brady Eidson 2014-07-07 10:21:12 PDT
ServicesOverlayController menus show up in the wrong place.

This is despite the fact that they use the context menu mechanism which does display context menus in the right place.

The difference is that context menu clicks undergo a hit test and have their coordinate translated to window-space.

We need to do the same for Services.

<rdar://problem/17130576>
Comment 1 Brady Eidson 2014-07-07 10:25:25 PDT
Created attachment 234496 [details]
Patch v1
Comment 2 Tim Horton 2014-07-07 11:04:36 PDT
Comment on attachment 234496 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=234496&action=review

> Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm:434
> +void ServicesOverlayController::handleClick(const WebCore::IntPoint& clickPoint)

This seems wrong. The incoming point is always in a consistent coordinate space (though I'm not sure at the moment which one), not dependent on what frame you click on. Am I wrong and this somehow actually works in subframes?
Comment 3 Brady Eidson 2014-07-07 11:31:46 PDT
Discussed with Tim in person - This patch wasn't *wrong*, it was just more work than was needed.

Simpler patch coming up, that also includes a fix for a subframe crasher that showed up in testing subframes.
Comment 4 Brady Eidson 2014-07-07 11:40:09 PDT
Created attachment 234499 [details]
Patch v2

Confirmed with various main frame scroll positions, subframe scroll positions, and page zoom situations, that this patch gives the same coordinates as the hit test patch.
Comment 5 Tim Horton 2014-07-07 11:41:50 PDT
Comment on attachment 234499 [details]
Patch v2

View in context: https://bugs.webkit.org/attachment.cgi?id=234499&action=review

> Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm:435
> +    Page* page = m_webPage->corePage();

Please use WebPage::mainFrameView() instead of all of this.
Comment 6 Brady Eidson 2014-07-07 11:51:28 PDT
http://trac.webkit.org/changeset/170852
Comment 7 WebKit Commit Bot 2014-07-09 16:57:27 PDT
Re-opened since this is blocked by bug 134783
Comment 8 Brady Eidson 2014-07-09 17:09:44 PDT
(In reply to comment #7)
> Re-opened since this is blocked by bug 134783

That was just a test of webkitbot.  All is well.