Bug 198801 - Web Inspector: artificial context menus don't work when Web Inspector is zoomed
Summary: Web Inspector: artificial context menus don't work when Web Inspector is zoomed
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
Keywords: InRadar
: 195759 (view as bug list)
Depends on:
Reported: 2019-06-12 14:05 PDT by Devin Rousso
Modified: 2019-07-07 14:58 PDT (History)
6 users (show)

See Also:

Patch (1.56 KB, patch)
2019-06-12 14:10 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (1.68 KB, patch)
2019-06-12 15:12 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
Comment 2 Joseph Pecoraro 2019-06-12 14:17:32 PDT
Comment on attachment 371985 [details]

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:


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]

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]
Comment 5 WebKit Commit Bot 2019-06-12 15:46:20 PDT
Comment on attachment 371991 [details]

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
Comment 8 Devin Rousso 2019-07-07 14:58:53 PDT
*** Bug 195759 has been marked as a duplicate of this bug. ***