Title: [163663] trunk/Source/WebKit2
Revision
163663
Author
[email protected]
Date
2014-02-07 16:37:32 -0800 (Fri, 07 Feb 2014)

Log Message

Implement more of WKPreferences
https://bugs.webkit.org/show_bug.cgi?id=128411

Reviewed by Tim Horton.

Give WKPreferences an underlying WebKit::WebPreferences object, add a minimumFontSize preference
and make sure that WKWebView's initializer creates a WKPreferences object if the configuration doesn't specify one.

* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences init]):
(-[WKPreferences minimumFontSize]):
(-[WKPreferences setMinimumFontSize:]):
* UIProcess/API/Cocoa/WKPreferencesInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (163662 => 163663)


--- trunk/Source/WebKit2/ChangeLog	2014-02-08 00:30:50 UTC (rev 163662)
+++ trunk/Source/WebKit2/ChangeLog	2014-02-08 00:37:32 UTC (rev 163663)
@@ -1,3 +1,24 @@
+2014-02-07  Anders Carlsson  <[email protected]>
+
+        Implement more of WKPreferences
+        https://bugs.webkit.org/show_bug.cgi?id=128411
+
+        Reviewed by Tim Horton.
+
+        Give WKPreferences an underlying WebKit::WebPreferences object, add a minimumFontSize preference
+        and make sure that WKWebView's initializer creates a WKPreferences object if the configuration doesn't specify one.
+
+        * UIProcess/API/Cocoa/WKPreferences.h:
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences init]):
+        (-[WKPreferences minimumFontSize]):
+        (-[WKPreferences setMinimumFontSize:]):
+        * UIProcess/API/Cocoa/WKPreferencesInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm.
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView initWithFrame:configuration:]):
+        * UIProcess/WebPageProxy.h:
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2014-02-07  Brady Eidson  <[email protected]>
 
         IDB: Some Mozilla cursor mutation tests fail

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.h (163662 => 163663)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.h	2014-02-08 00:30:50 UTC (rev 163662)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.h	2014-02-08 00:37:32 UTC (rev 163663)
@@ -35,6 +35,8 @@
 WK_API_CLASS
 @interface WKPreferences : NSObject
 
+@property (nonatomic) int minimumFontSize;
+
 @end
 
 #endif // WK_API_ENABLED

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


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm	2014-02-08 00:30:50 UTC (rev 163662)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm	2014-02-08 00:37:32 UTC (rev 163663)
@@ -23,13 +23,35 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "config.h"
-#include "WKPreferences.h"
+#import "config.h"
+#import "WKPreferencesInternal.h"
 
 #if WK_API_ENABLED
 
+#import "WebPreferences.h"
+
 @implementation WKPreferences
 
+- (instancetype)init
+{
+    if ((self = [super init]))
+        return nil;
+
+    _preferences = WebKit::WebPreferences::create(String());
+
+    return self;
+}
+
+- (int)minimumFontSize
+{
+    return _preferences->minimumFontSize();
+}
+
+- (void)setMinimumFontSize:(int)minimumFontSize
+{
+    _preferences->setMinimumFontSize(minimumFontSize);
+}
+
 @end
 
 #endif // WK_API_ENABLED

Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesInternal.h (from rev 163662, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm) (0 => 163663)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesInternal.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesInternal.h	2014-02-08 00:37:32 UTC (rev 163663)
@@ -0,0 +1,42 @@
+/*
+ * 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 "WKPreferences.h"
+
+#if WK_API_ENABLED
+
+#import <wtf/RefPtr.h>
+
+namespace WebKit {
+class WebPreferences;
+}
+
+@interface WKPreferences () {
+    RefPtr<WebKit::WebPreferences> _preferences;
+}
+
+@end
+
+#endif

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (163662 => 163663)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-02-08 00:30:50 UTC (rev 163662)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-02-08 00:37:32 UTC (rev 163663)
@@ -34,6 +34,7 @@
 #import "WKBackForwardListInternal.h"
 #import "WKNavigationDelegate.h"
 #import "WKNavigationInternal.h"
+#import "WKPreferencesInternal.h"
 #import "WKProcessClass.h"
 #import "WKRemoteObjectRegistryInternal.h"
 #import "WKWebViewConfiguration.h"
@@ -86,6 +87,9 @@
     if (![_configuration processClass])
         [_configuration setProcessClass:adoptNS([[WKProcessClass alloc] init]).get()];
 
+    if (![_configuration preferences])
+        [_configuration setPreferences:adoptNS([[WKPreferences alloc] init]).get()];
+
     CGRect bounds = self.bounds;
 
 #if PLATFORM(IOS)

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (163662 => 163663)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-02-08 00:30:50 UTC (rev 163662)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-02-08 00:37:32 UTC (rev 163663)
@@ -331,7 +331,6 @@
     , public IPC::MessageReceiver
     , public IPC::MessageSender {
 public:
-
     static PassRefPtr<WebPageProxy> create(PageClient&, WebProcessProxy&, WebPageGroup&, WebPreferences&, API::Session&, uint64_t pageID);
     virtual ~WebPageProxy();
 

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (163662 => 163663)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-02-08 00:30:50 UTC (rev 163662)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-02-08 00:37:32 UTC (rev 163663)
@@ -149,6 +149,7 @@
 		1A30EAC6115D7DA30053E937 /* ConnectionMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A30EAC5115D7DA30053E937 /* ConnectionMac.cpp */; };
 		1A334DED16DE8F88006A8E38 /* StorageAreaMapMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A334DEB16DE8F88006A8E38 /* StorageAreaMapMessageReceiver.cpp */; };
 		1A334DEE16DE8F88006A8E38 /* StorageAreaMapMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A334DEC16DE8F88006A8E38 /* StorageAreaMapMessages.h */; };
+		1A3C888018A5ABAE00C4C962 /* WKPreferencesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3C887F18A5ABAE00C4C962 /* WKPreferencesInternal.h */; };
 		1A3CC16618906ACF001E6ED8 /* WKWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3CC16418906ACF001E6ED8 /* WKWebView.mm */; };
 		1A3CC16718906ACF001E6ED8 /* WKWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3CC16518906ACF001E6ED8 /* WKWebView.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		1A3CC16918907EB0001E6ED8 /* WKProcessClassInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3CC16818907EB0001E6ED8 /* WKProcessClassInternal.h */; };
@@ -1811,6 +1812,7 @@
 		1A334DEA16DE8B68006A8E38 /* StorageAreaMap.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = StorageAreaMap.messages.in; sourceTree = "<group>"; };
 		1A334DEB16DE8F88006A8E38 /* StorageAreaMapMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageAreaMapMessageReceiver.cpp; sourceTree = "<group>"; };
 		1A334DEC16DE8F88006A8E38 /* StorageAreaMapMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageAreaMapMessages.h; sourceTree = "<group>"; };
+		1A3C887F18A5ABAE00C4C962 /* WKPreferencesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPreferencesInternal.h; sourceTree = "<group>"; };
 		1A3CC16418906ACF001E6ED8 /* WKWebView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebView.mm; sourceTree = "<group>"; };
 		1A3CC16518906ACF001E6ED8 /* WKWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebView.h; sourceTree = "<group>"; };
 		1A3CC16818907EB0001E6ED8 /* WKProcessClassInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKProcessClassInternal.h; sourceTree = "<group>"; };
@@ -4348,6 +4350,7 @@
 				1A1B0EB718A424CD0038481A /* WKNavigationResponseInternal.h */,
 				1AFDD3161891C94700153970 /* WKPreferences.h */,
 				1AFDD3181891CA1200153970 /* WKPreferences.mm */,
+				1A3C887F18A5ABAE00C4C962 /* WKPreferencesInternal.h */,
 				1A158418189044F50017616C /* WKProcessClass.h */,
 				1A158417189044F50017616C /* WKProcessClass.mm */,
 				1A43E828188F3CDC009E4D30 /* WKProcessClassConfiguration.h */,
@@ -6864,6 +6867,7 @@
 				BC9099801256A98200083756 /* WKStringPrivate.h in Headers */,
 				1A4A9AA812B7E796008FE984 /* WKTextInputWindowController.h in Headers */,
 				5175095A1897249700408FAC /* IDBIdentifier.h in Headers */,
+				1A3C888018A5ABAE00C4C962 /* WKPreferencesInternal.h in Headers */,
 				BC407608124FF0270068F20A /* WKType.h in Headers */,
 				7CD5EBBF1746B04C000C1C45 /* WKTypeRefWrapper.h in Headers */,
 				BC40760A124FF0270068F20A /* WKURL.h in Headers */,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to