MiniBrowser sets the WKView’s frame incorrectly
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Jan 2012 00:58:20 +0000 (00:58 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Jan 2012 00:58:20 +0000 (00:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=75393

Reviewed by Anders Carlsson.

* MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj: Removed Make Launchable build phase,
which is not needed since the binray is linked with the frameworks search path set to the
built products directory.
* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController awakeFromNib]): Changed to set the WKView’s frame to its
container’s bounds rather than its frame.
* MiniBrowser/mac/make-launchable.sh: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103866 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj
Tools/MiniBrowser/mac/BrowserWindowController.m
Tools/MiniBrowser/mac/make-launchable.sh [deleted file]

index 15b722d..587d294 100644 (file)
@@ -1,3 +1,18 @@
+2011-12-31  Dan Bernstein  <mitz@apple.com>
+
+        MiniBrowser sets the WKView’s frame incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=75393
+
+        Reviewed by Anders Carlsson.
+
+        * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj: Removed Make Launchable build phase,
+        which is not needed since the binray is linked with the frameworks search path set to the
+        built products directory.
+        * MiniBrowser/mac/BrowserWindowController.m:
+        (-[BrowserWindowController awakeFromNib]): Changed to set the WKView’s frame to its
+        container’s bounds rather than its frame.
+        * MiniBrowser/mac/make-launchable.sh: Removed.
+
 2011-12-29  Dan Bernstein  <mitz@apple.com>
 
         debug-safari --no-saved-state fails to start the debugger
index 24fc0e8..fb69e89 100644 (file)
@@ -61,7 +61,6 @@
                51E244F811EFCE07008228D1 /* MBToolbarItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBToolbarItem.h; sourceTree = "<group>"; };
                51E244F911EFCE07008228D1 /* MBToolbarItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBToolbarItem.m; sourceTree = "<group>"; };
                8D1107320486CEB800E47090 /* MiniBrowser.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MiniBrowser.app; sourceTree = BUILT_PRODUCTS_DIR; };
-               BC1770121188DF19007D9E9A /* make-launchable.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "make-launchable.sh"; path = "mac/make-launchable.sh"; sourceTree = "<group>"; };
                BC329486116A92E2008635D0 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = mac/main.m; sourceTree = "<group>"; };
                BC329496116A941B008635D0 /* BrowserWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BrowserWindowController.h; path = mac/BrowserWindowController.h; sourceTree = "<group>"; };
                BC329497116A941B008635D0 /* BrowserWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BrowserWindowController.m; path = mac/BrowserWindowController.m; sourceTree = "<group>"; };
                                BCBD382B11B089F700E01E54 /* WebBundle */,
                                29B97317FDCFA39411CA2CEA /* Resources */,
                                BCA8CBDA11E5787800812FB7 /* Configurations */,
-                               BC1770481188EB05007D9E9A /* Scripts */,
                                29B97323FDCFA39411CA2CEA /* Frameworks */,
                                19C28FACFE9D520D11CA2CBB /* Products */,
                        );
                        name = Frameworks;
                        sourceTree = "<group>";
                };
-               BC1770481188EB05007D9E9A /* Scripts */ = {
-                       isa = PBXGroup;
-                       children = (
-                               BC1770121188DF19007D9E9A /* make-launchable.sh */,
-                       );
-                       name = Scripts;
-                       sourceTree = "<group>";
-               };
                BCA8CBDA11E5787800812FB7 /* Configurations */ = {
                        isa = PBXGroup;
                        children = (
                                BCBD38CF11B08C0100E01E54 /* Copy WebBundle */,
                                8D11072C0486CEB800E47090 /* Sources */,
                                8D11072E0486CEB800E47090 /* Frameworks */,
-                               BC17701E1188DFB4007D9E9A /* Make Launchable */,
                        );
                        buildRules = (
                        );
                };
 /* End PBXResourcesBuildPhase section */
 
-/* Begin PBXShellScriptBuildPhase section */
-               BC17701E1188DFB4007D9E9A /* Make Launchable */ = {
-                       isa = PBXShellScriptBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       inputPaths = (
-                       );
-                       name = "Make Launchable";
-                       outputPaths = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = "mac/make-launchable.sh\n";
-               };
-/* End PBXShellScriptBuildPhase section */
-
 /* Begin PBXSourcesBuildPhase section */
                8D11072C0486CEB800E47090 /* Sources */ = {
                        isa = PBXSourcesBuildPhase;
index 4993aa9..8ba4eee 100644 (file)
@@ -574,12 +574,10 @@ static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParameters
 
 - (void)awakeFromNib
 {
-    _webView = [[WKView alloc] initWithFrame:[containerView frame] contextRef:_context pageGroupRef:_pageGroup];
+    _webView = [[WKView alloc] initWithFrame:[containerView bounds] contextRef:_context pageGroupRef:_pageGroup];
 
-    [containerView addSubview:_webView];
-    [_webView setFrame:[containerView frame]];
-    
     [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
+    [containerView addSubview:_webView];
     
     WKPageLoaderClient loadClient = {
         kWKPageLoaderClientCurrentVersion,
diff --git a/Tools/MiniBrowser/mac/make-launchable.sh b/Tools/MiniBrowser/mac/make-launchable.sh
deleted file mode 100755 (executable)
index 7fba058..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2010 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-echo "Making app bundle launchable";
-defaults write "${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH%.plist}" LSEnvironment -dict DYLD_FRAMEWORK_PATH "${BUILT_PRODUCTS_DIR}"