Bug 196722 - Web Inspector: save sheet should be anchored underneath the tab bar when detached
Summary: Web Inspector: save sheet should be anchored underneath the tab bar when deta...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-08 19:22 PDT by Devin Rousso
Modified: 2019-04-10 19:05 PDT (History)
7 users (show)

See Also:


Attachments
Patch (35.11 KB, patch)
2019-04-08 19:31 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (35.11 KB, patch)
2019-04-10 15:46 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (35.46 KB, patch)
2019-04-10 16:06 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (35.46 KB, patch)
2019-04-10 18:46 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-04-08 19:22:05 PDT
# STEPS TO REPRODUCE:
1. inspect any page
2. detach Web Inspector so it's its own window
3. view the main resource of the page
4. save the resource (⌘S)
 => the save sheet appears from the top of the window, rather than underneath the tab bar (like Safari)
Comment 1 Devin Rousso 2019-04-08 19:22:18 PDT
<rdar://problem/49613280>
Comment 2 Devin Rousso 2019-04-08 19:31:07 PDT
Created attachment 367016 [details]
Patch
Comment 3 Devin Rousso 2019-04-08 19:33:49 PDT
Comment on attachment 367016 [details]
Patch

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

> Source/WebKit/UIProcess/mac/RemoteWebInspectorProxyMac.mm:57
> +        return NSMakeRect(0, _inspectorProxy->sheetRect().height(), _inspectorProxy->sheetRect().width(), 0);

At first this appeared really weird to me, but after logging `rect` and reading the docs <https://developer.apple.com/documentation/appkit/nswindowdelegate/1419611-window?language=objc#discussion>, I think this is the right way to go.

> Source/WebKit/UIProcess/mac/WebInspectorProxyMac.mm:99
> +        return NSMakeRect(0, _inspectorProxy->sheetRect().height(), _inspectorProxy->sheetRect().width(), 0);

Ditto (>RemoteWebInspectorProxyMac.mm:57).

> Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm:519
> +        return NSMakeRect(0, _frontendClient->sheetRect().height(), _frontendClient->sheetRect().width(), 0);

Ditto (>RemoteWebInspectorProxyMac.mm:57).
Comment 4 Timothy Hatcher 2019-04-10 15:27:44 PDT
Comment on attachment 367016 [details]
Patch

Nice! Need to fix other platforms.
Comment 5 Devin Rousso 2019-04-10 15:46:54 PDT
Created attachment 367172 [details]
Patch
Comment 6 Devin Rousso 2019-04-10 16:06:37 PDT
Created attachment 367174 [details]
Patch
Comment 7 WebKit Commit Bot 2019-04-10 17:33:53 PDT Comment hidden (obsolete)
Comment 8 Devin Rousso 2019-04-10 18:46:47 PDT
Created attachment 367187 [details]
Patch
Comment 9 WebKit Commit Bot 2019-04-10 19:05:03 PDT
Comment on attachment 367187 [details]
Patch

Clearing flags on attachment: 367187

Committed r244180: <https://trac.webkit.org/changeset/244180>
Comment 10 WebKit Commit Bot 2019-04-10 19:05:05 PDT
All reviewed patches have been landed.  Closing bug.