Bug 196722

Summary: Web Inspector: save sheet should be anchored underneath the tab bar when detached
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, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

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.