Title: [172994] trunk
Revision
172994
Author
mli...@apple.com
Date
2014-08-26 20:17:40 -0700 (Tue, 26 Aug 2014)

Log Message

Add WebKit SPI to control the navigator.standalone property
https://bugs.webkit.org/show_bug.cgi?id=136189

Reviewed by Andy Estes.

Source/WebKit2:

Add a property to WKPreferences that allows toggling this setting.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _isStandalone]):
(-[WKPreferences _setStandalone:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

Add API test for WKPreferences

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/Preferences.mm:
(TEST):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (172993 => 172994)


--- trunk/Source/WebKit2/ChangeLog	2014-08-27 02:05:26 UTC (rev 172993)
+++ trunk/Source/WebKit2/ChangeLog	2014-08-27 03:17:40 UTC (rev 172994)
@@ -1,3 +1,17 @@
+2014-08-26  Matt Lilek  <m...@apple.com>
+
+        Add WebKit SPI to control the navigator.standalone property
+        https://bugs.webkit.org/show_bug.cgi?id=136189
+
+        Reviewed by Andy Estes.
+
+        Add a property to WKPreferences that allows toggling this setting.
+
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences _isStandalone]):
+        (-[WKPreferences _setStandalone:]):
+        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
+
 2014-08-26  Joseph Pecoraro  <pecor...@apple.com>
 
         FileReader cannot read files selected with <input type="file"> in iOS 8

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm (172993 => 172994)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm	2014-08-27 02:05:26 UTC (rev 172993)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm	2014-08-27 03:17:40 UTC (rev 172994)
@@ -213,6 +213,16 @@
     _preferences->setDeveloperExtrasEnabled(developerExtrasEnabled);
 }
 
+- (BOOL)_isStandalone
+{
+    return _preferences->standalone();
+}
+
+- (void)_setStandalone:(BOOL)standalone
+{
+    _preferences->setStandalone(standalone);
+}
+
 @end
 
 #endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h (172993 => 172994)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2014-08-27 02:05:26 UTC (rev 172993)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2014-08-27 03:17:40 UTC (rev 172994)
@@ -49,6 +49,8 @@
 
 @property (nonatomic, setter=_setDeveloperExtrasEnabled:) BOOL _developerExtrasEnabled;
 
+@property (nonatomic, setter=_setStandalone:, getter=_isStandalone) BOOL _standalone;
+
 // FIXME: This should be configured on the WKWebsiteDataStore.
 // FIXME: This property should not have the verb "is" in it.
 @property (nonatomic, setter=_setOfflineApplicationCacheIsEnabled:) BOOL _offlineApplicationCacheIsEnabled;

Modified: trunk/Tools/ChangeLog (172993 => 172994)


--- trunk/Tools/ChangeLog	2014-08-27 02:05:26 UTC (rev 172993)
+++ trunk/Tools/ChangeLog	2014-08-27 03:17:40 UTC (rev 172994)
@@ -1,3 +1,16 @@
+2014-08-26  Matt Lilek  <m...@apple.com>
+
+        Add WebKit SPI to control the navigator.standalone property
+        https://bugs.webkit.org/show_bug.cgi?id=136189
+
+        Reviewed by Andy Estes.
+
+        Add API test for WKPreferences
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKit2Cocoa/Preferences.mm:
+        (TEST):
+
 2014-08-26  Gyuyoung Kim  <gyuyoung....@samsung.com>
 
         Remove ENABLE_DRT environment variable to enable SHARED_CORE

Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (172993 => 172994)


--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2014-08-27 02:05:26 UTC (rev 172993)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2014-08-27 03:17:40 UTC (rev 172994)
@@ -235,6 +235,7 @@
 		C54237F016B8955800E638FC /* PasteboardNotifications.mm in Sources */ = {isa = PBXBuildFile; fileRef = C54237EE16B8955800E638FC /* PasteboardNotifications.mm */; };
 		C54237F116B8957D00E638FC /* PasteboardNotifications_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C54237ED16B8955800E638FC /* PasteboardNotifications_Bundle.cpp */; };
 		C5E1AFFE16B221F1006CC1F2 /* execCopy.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C5E1AFFD16B22179006CC1F2 /* execCopy.html */; };
+		C95501BF19AD2FAF0049BE3E /* Preferences.mm in Sources */ = {isa = PBXBuildFile; fileRef = C95501BE19AD2FAF0049BE3E /* Preferences.mm */; };
 		CD5393C81757BA9700C07123 /* MD5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5393C71757BA9700C07123 /* MD5.cpp */; };
 		CD5393CA1757BAC400C07123 /* SHA1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5393C91757BAC400C07123 /* SHA1.cpp */; };
 		CD5497B415857F0C00B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497B315857F0C00B5BC30 /* MediaTime.cpp */; };
@@ -596,6 +597,7 @@
 		C54237ED16B8955800E638FC /* PasteboardNotifications_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PasteboardNotifications_Bundle.cpp; sourceTree = "<group>"; };
 		C54237EE16B8955800E638FC /* PasteboardNotifications.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardNotifications.mm; sourceTree = "<group>"; };
 		C5E1AFFD16B22179006CC1F2 /* execCopy.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = execCopy.html; sourceTree = "<group>"; };
+		C95501BE19AD2FAF0049BE3E /* Preferences.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Preferences.mm; sourceTree = "<group>"; };
 		CD5393C71757BA9700C07123 /* MD5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MD5.cpp; sourceTree = "<group>"; };
 		CD5393C91757BAC400C07123 /* SHA1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SHA1.cpp; sourceTree = "<group>"; };
 		CD5497B315857F0C00B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTime.cpp; sourceTree = "<group>"; };
@@ -704,6 +706,7 @@
 			children = (
 				A1A4FE5D18DD3DB700B5EA8A /* Download.mm */,
 				1ABC3DED1899BE6D004F0626 /* Navigation.mm */,
+				C95501BE19AD2FAF0049BE3E /* Preferences.mm */,
 				7CC3E1FA197E234100BE6252 /* UserContentController.mm */,
 			);
 			name = "WebKit2 Cocoa";
@@ -1272,6 +1275,7 @@
 				2D640B5517875DFF00BFAF99 /* ScrollPinningBehaviors.cpp in Sources */,
 				26300B1816755CD90066886D /* ListHashSet.cpp in Sources */,
 				A1A4FE5F18DD3DB700B5EA8A /* Download.mm in Sources */,
+				C95501BF19AD2FAF0049BE3E /* Preferences.mm in Sources */,
 				52CB47411448FB9300873995 /* LoadAlternateHTMLStringWithNonDirectoryURL.cpp in Sources */,
 				33DC8911141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp in Sources */,
 				8AA28C1A16D2FA7B002FF4DB /* LoadPageOnCrash.cpp in Sources */,

Copied: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Preferences.mm (from rev 172993, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h) (0 => 172994)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Preferences.mm	                        (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Preferences.mm	2014-08-27 03:17:40 UTC (rev 172994)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+#import "config.h"
+
+#if WK_API_ENABLED
+
+#import "Test.h"
+#import <WebKit/WKFoundation.h>
+#import <WebKit/WKPreferencesPrivate.h>
+#import <wtf/RetainPtr.h>
+
+TEST(WebKit2, DefaultWKPreferences)
+{
+    RetainPtr<WKPreferences> preferences = adoptNS([[WKPreferences alloc] init]);
+
+    EXPECT_FALSE([preferences _isStandalone]);
+    [preferences _setStandalone:YES];
+    EXPECT_TRUE([preferences _isStandalone]);
+}
+
+#endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to