Title: [186948] branches/safari-601.1-branch/Source

Diff

Modified: branches/safari-601.1-branch/Source/WebKit/mac/ChangeLog (186947 => 186948)


--- branches/safari-601.1-branch/Source/WebKit/mac/ChangeLog	2015-07-17 06:15:32 UTC (rev 186947)
+++ branches/safari-601.1-branch/Source/WebKit/mac/ChangeLog	2015-07-17 06:15:36 UTC (rev 186948)
@@ -1,5 +1,21 @@
 2015-07-16  Matthew Hanson  <[email protected]>
 
+        Merge r186919. rdar://problem/21834578
+
+    2015-07-16  Joseph Pecoraro  <[email protected]>
+
+            Web Inspector: [Mac] Save dialog not working when inspector is docked
+            https://bugs.webkit.org/show_bug.cgi?id=146991
+
+            Reviewed by Sam Weinig.
+
+            * WebCoreSupport/WebInspectorClient.mm:
+            (WebInspectorFrontendClient::save):
+            (-[WebInspectorWindowController webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:]):
+            When the window is nil (docked) use a non-window version of running the dialog.
+
+2015-07-16  Matthew Hanson  <[email protected]>
+
         Merge r186909. rdar://problem/21802456
 
     2015-07-13  Simon Fraser  <[email protected]>

Modified: branches/safari-601.1-branch/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm (186947 => 186948)


--- branches/safari-601.1-branch/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm	2015-07-17 06:15:32 UTC (rev 186947)
+++ branches/safari-601.1-branch/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm	2015-07-17 06:15:36 UTC (rev 186948)
@@ -347,12 +347,18 @@
     panel.nameFieldStringValue = platformURL.lastPathComponent;
     panel.directoryURL = [platformURL URLByDeletingLastPathComponent];
 
-    [panel beginSheetModalForWindow:[[m_windowController webView] window] completionHandler:^(NSInteger result) {
+    auto completionHandler = ^(NSInteger result) {
         if (result == NSFileHandlingPanelCancelButton)
             return;
         ASSERT(result == NSFileHandlingPanelOKButton);
         saveToURL(panel.URL);
-    }];
+    };
+
+    NSWindow *window = [[m_windowController webView] window];
+    if (window)
+        [panel beginSheetModalForWindow:window completionHandler:completionHandler];
+    else
+        completionHandler([panel runModal]);
 }
 
 void WebInspectorFrontendClient::append(const String& suggestedURL, const String& content)
@@ -704,7 +710,7 @@
     panel.canChooseFiles = YES;
     panel.allowsMultipleSelection = allowMultipleFiles;
 
-    [panel beginSheetModalForWindow:_webView.window completionHandler:^(NSInteger result) {
+    auto completionHandler = ^(NSInteger result) {
         if (result == NSFileHandlingPanelCancelButton) {
             [resultListener cancel];
             return;
@@ -713,11 +719,16 @@
 
         NSArray *URLs = panel.URLs;
         NSMutableArray *filenames = [NSMutableArray arrayWithCapacity:URLs.count];
-        for (NSURL *URL in URLs) {
+        for (NSURL *URL in URLs)
             [filenames addObject:URL.path];
-        }
+
         [resultListener chooseFilenames:filenames];
-    }];
+    };
+
+    if (_webView.window)
+        [panel beginSheetModalForWindow:_webView.window completionHandler:completionHandler];
+    else
+        completionHandler([panel runModal]);
 }
 
 - (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier

Modified: branches/safari-601.1-branch/Source/WebKit2/ChangeLog (186947 => 186948)


--- branches/safari-601.1-branch/Source/WebKit2/ChangeLog	2015-07-17 06:15:32 UTC (rev 186947)
+++ branches/safari-601.1-branch/Source/WebKit2/ChangeLog	2015-07-17 06:15:36 UTC (rev 186948)
@@ -1,5 +1,21 @@
 2015-07-16  Matthew Hanson  <[email protected]>
 
+        Merge r186919. rdar://problem/21834578
+
+    2015-07-16  Joseph Pecoraro  <[email protected]>
+
+            Web Inspector: [Mac] Save dialog not working when inspector is docked
+            https://bugs.webkit.org/show_bug.cgi?id=146991
+
+            Reviewed by Sam Weinig.
+
+            * UIProcess/mac/WebInspectorProxyMac.mm:
+            (WebKit::runOpenPanel):
+            (WebKit::WebInspectorProxy::platformSave):
+            When the window is nil (docked) use a non-window version of running the dialog.
+
+2015-07-16  Matthew Hanson  <[email protected]>
+
         Merge r186887. rdar://problem/21692212
 
     2015-07-15  Brady Eidson  <[email protected]>

Modified: branches/safari-601.1-branch/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (186947 => 186948)


--- branches/safari-601.1-branch/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2015-07-17 06:15:32 UTC (rev 186947)
+++ branches/safari-601.1-branch/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2015-07-17 06:15:36 UTC (rev 186948)
@@ -234,8 +234,7 @@
 
     WKRetain(listener);
 
-    // If the inspector is detached, then openPanel will be window-modal; otherwise, openPanel is opened in a new window.
-    [openPanel beginSheetModalForWindow:webInspectorProxy->inspectorWindow() completionHandler:^(NSInteger result) {
+    auto completionHandler = ^(NSInteger result) {
         if (result == NSFileHandlingPanelOKButton) {
             WKMutableArrayRef fileURLs = WKMutableArrayCreate();
 
@@ -252,7 +251,12 @@
             WKOpenPanelResultListenerCancel(listener);
 
         WKRelease(listener);
-    }];
+    };
+
+    if (webInspectorProxy->inspectorWindow())
+        [openPanel beginSheetModalForWindow:webInspectorProxy->inspectorWindow() completionHandler:completionHandler];
+    else
+        completionHandler([openPanel runModal]);
 }
 
 void WebInspectorProxy::attachmentViewDidChange(NSView *oldView, NSView *newView)
@@ -618,12 +622,17 @@
     panel.nameFieldStringValue = platformURL.lastPathComponent;
     panel.directoryURL = [platformURL URLByDeletingLastPathComponent];
 
-    [panel beginSheetModalForWindow:m_inspectorWindow.get() completionHandler:^(NSInteger result) {
+    auto completionHandler = ^(NSInteger result) {
         if (result == NSFileHandlingPanelCancelButton)
             return;
         ASSERT(result == NSFileHandlingPanelOKButton);
         saveToURL(panel.URL);
-    }];
+    };
+
+    if (m_inspectorWindow)
+        [panel beginSheetModalForWindow:m_inspectorWindow.get() completionHandler:completionHandler];
+    else
+        completionHandler([panel runModal]);
 }
 
 void WebInspectorProxy::platformAppend(const String& suggestedURL, const String& content)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to