Title: [163514] trunk/Source/WebKit2
Revision
163514
Author
[email protected]
Date
2014-02-05 22:19:16 -0800 (Wed, 05 Feb 2014)

Log Message

[WK2] Add the minimumLayoutSizeOverride SPI to WKWebView
https://bugs.webkit.org/show_bug.cgi?id=128295

Patch by Benjamin Poulain <[email protected]> on 2014-02-05
Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView minimumLayoutSizeOverride]):
(-[WKWebView setMinimumLayoutSizeOverride:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h: Added.
* WebKit2.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (163513 => 163514)


--- trunk/Source/WebKit2/ChangeLog	2014-02-06 05:26:57 UTC (rev 163513)
+++ trunk/Source/WebKit2/ChangeLog	2014-02-06 06:19:16 UTC (rev 163514)
@@ -1,3 +1,16 @@
+2014-02-05  Benjamin Poulain  <[email protected]>
+
+        [WK2] Add the minimumLayoutSizeOverride SPI to WKWebView
+        https://bugs.webkit.org/show_bug.cgi?id=128295
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView minimumLayoutSizeOverride]):
+        (-[WKWebView setMinimumLayoutSizeOverride:]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added.
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2014-02-05  Simon Fraser  <[email protected]>
 
         Support encoding and decoding of Regions

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


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-02-06 05:26:57 UTC (rev 163513)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-02-06 06:19:16 UTC (rev 163514)
@@ -363,6 +363,22 @@
     [_scrollView setContentOffset:contentOffset];
 }
 
+#pragma mark Private API
+
+- (CGSize)_minimumLayoutSizeOverride
+{
+    ASSERT(_hasStaticMinimumLayoutSize);
+    return [_viewportHandler availableViewSize];
+}
+
+- (void)_setMinimumLayoutSizeOverride:(CGSize)minimumLayoutSizeOverride
+{
+    _hasStaticMinimumLayoutSize = YES;
+    [_viewportHandler update:^{
+        [_viewportHandler setAvailableViewSize:minimumLayoutSizeOverride];
+    }];
+}
+
 #endif
 
 #pragma mark OS X-specific methods

Added: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (0 => 163514)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	2014-02-06 06:19:16 UTC (rev 163514)
@@ -0,0 +1,38 @@
+/*
+ * 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 <WebKit2/WKWebView.h>
+
+#if WK_API_ENABLED
+
+@interface WKWebView (WKPrivate)
+
+#if TARGET_OS_IPHONE
+@property (nonatomic, setter=_setMinimumLayoutSizeOverride) CGSize _minimumLayoutSizeOverride;
+#endif
+
+@end
+
+#endif

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (163513 => 163514)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-02-06 05:26:57 UTC (rev 163513)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-02-06 06:19:16 UTC (rev 163514)
@@ -400,6 +400,7 @@
 		1FB00AC9185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FB00AC6185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h */; };
 		1QQ417CB12C00CCA002BE67B /* TextCheckerCompletion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CC417C912C00CCA002BE67B /* TextCheckerCompletion.h */; };
 		1ZZ417EF12C00D87002BE67B /* TextCheckerCompletion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1BB417C912C00CCA002BE67B /* TextCheckerCompletion.cpp */; };
+		26F9A83B18A3468100AEB88A /* WKWebViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 26F9A83A18A3463F00AEB88A /* WKWebViewPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		290F4272172A0C7400939FF0 /* ChildProcessSupplement.h in Headers */ = {isa = PBXBuildFile; fileRef = 290F4271172A0C7400939FF0 /* ChildProcessSupplement.h */; };
 		293EBEAB1627D9C9005F89F1 /* WKDOMText.h in Headers */ = {isa = PBXBuildFile; fileRef = 293EBEA91627D9C9005F89F1 /* WKDOMText.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		293EBEAC1627D9C9005F89F1 /* WKDOMText.mm in Sources */ = {isa = PBXBuildFile; fileRef = 293EBEAA1627D9C9005F89F1 /* WKDOMText.mm */; };
@@ -2072,6 +2073,7 @@
 		1FB00AC5185F76460019142E /* WKWebProcessPlugInPageGroup.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebProcessPlugInPageGroup.mm; sourceTree = "<group>"; };
 		1FB00AC6185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInPageGroupInternal.h; sourceTree = "<group>"; };
 		26659AA0185FAAED004303DD /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = "<group>"; };
+		26F9A83A18A3463F00AEB88A /* WKWebViewPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKWebViewPrivate.h; sourceTree = "<group>"; };
 		290F4271172A0C7400939FF0 /* ChildProcessSupplement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildProcessSupplement.h; sourceTree = "<group>"; };
 		293EBEA91627D9C9005F89F1 /* WKDOMText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDOMText.h; sourceTree = "<group>"; };
 		293EBEAA1627D9C9005F89F1 /* WKDOMText.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKDOMText.mm; sourceTree = "<group>"; };
@@ -4316,6 +4318,7 @@
 				1ADF59191890528E0043C145 /* WKWebViewConfiguration.h */,
 				1ADF59181890528E0043C145 /* WKWebViewConfiguration.mm */,
 				1A66BF8E18A052ED002071B4 /* WKWebViewInternal.h */,
+				26F9A83A18A3463F00AEB88A /* WKWebViewPrivate.h */,
 			);
 			path = Cocoa;
 			sourceTree = "<group>";
@@ -6239,6 +6242,7 @@
 				378E1A4A18208CD60031007A /* WKNSString.h in Headers */,
 				2D8949F1182044F600E898AA /* PlatformCALayerRemoteTiledBacking.h in Headers */,
 				0FB659231208B4DB0044816C /* DrawingAreaInfo.h in Headers */,
+				26F9A83B18A3468100AEB88A /* WKWebViewPrivate.h in Headers */,
 				1A64229A12DD029200CAAE2C /* DrawingAreaMessages.h in Headers */,
 				1ABC3DF61899E437004F0626 /* NavigationState.h in Headers */,
 				BC2652171182608100243E12 /* DrawingAreaProxy.h in Headers */,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to