Bug 198801

Summary: Web Inspector: artificial context menus don't work when Web Inspector is zoomed
Product: WebKit Reporter: Devin Rousso <drousso>
Component: Web InspectorAssignee: Devin Rousso <drousso>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, drousso, ews-watchlist, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Devin Rousso 2019-06-12 14:05:34 PDT
:(
Comment 1 Devin Rousso 2019-06-12 14:10:19 PDT
Created attachment 371985 [details]
Patch
Comment 2 Joseph Pecoraro 2019-06-12 14:17:32 PDT
Comment on attachment 371985 [details]
Patch

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

> Source/WebCore/inspector/InspectorFrontendHost.cpp:431
>      auto& mouseEvent = downcast<MouseEvent>(event);
> +
>      IntPoint mousePoint { mouseEvent.clientX(), mouseEvent.clientY() };
> +    mousePoint.scale(zoomFactor());

Seems fine, but is there a better way to get the mouse position of zoomed content?

MouseRelatedEvent.h has:

    // Page point in "absolute" coordinates (i.e. post-zoomed, page-relative coords,
    // usable with RenderObject::absoluteToLocal).
    const LayoutPoint& absoluteLocation() const { return m_absoluteLocation; }

That ultimately uses:

    float FrameView::documentToAbsoluteScaleFactor(Optional<float> effectiveZoom) const
    {
        // If effectiveZoom is passed, it already factors in pageZoomFactor(). 
        return effectiveZoom.valueOr(frame().pageZoomFactor()) * frame().frameScaleFactor();
    }

As opposed to the current `InspectorFrontendHost::zoomFactor()` which only does the page zoom:

    m_frontendPage->mainFrame().pageZoomFactor();

So, what is `frameScaleFactor` and what is that / should that be taken into account here?
Comment 3 Joseph Pecoraro 2019-06-12 15:09:11 PDT
Comment on attachment 371985 [details]
Patch

r=me though since this can't be worse then what we currently have
Comment 4 Devin Rousso 2019-06-12 15:12:33 PDT
Created attachment 371991 [details]
Patch
Comment 5 WebKit Commit Bot 2019-06-12 15:46:20 PDT
Comment on attachment 371991 [details]
Patch

Clearing flags on attachment: 371991

Committed r246384: <https://trac.webkit.org/changeset/246384>
Comment 6 WebKit Commit Bot 2019-06-12 15:46:22 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2019-06-12 15:49:58 PDT
<rdar://problem/51686539>
Comment 8 Devin Rousso 2019-07-07 14:58:53 PDT
*** Bug 195759 has been marked as a duplicate of this bug. ***