- Revision
- 176105
- Author
- [email protected]
- Date
- 2014-11-13 16:34:29 -0800 (Thu, 13 Nov 2014)
Log Message
[iOS] NSGeometry data types are not available in the public SDK
https://bugs.webkit.org/show_bug.cgi?id=137536
Reviewed by David Kilzer.
Source/WebCore:
Towards building iOS WebKit with the public iOS SDK, define NSGeometry
data types and functions in terms of CGGeometry data types and functions
because the former is SPI on iOS.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Include
header WAKAppKitStubs.h when building for iOS. Otherwise, include header NSGeometry.h.
* platform/graphics/ca/mac/PlatformCALayerMac.mm: Remove import of private header NSGeometry.h.
We will use the NSGeometry data types defined in WAKAppKitStubs.h, which is implicitly imported
by header WAKWindow.h.
* platform/graphics/mac/MediaPlayerProxy.h: Substitute WAKAppKitStubs.h for NSGeometry.h.
* platform/ios/PlatformEventFactoryIOS.mm: Ditto. Also fix up style issues with #import directives.
* platform/ios/WebEvent.mm: Ditto.
* platform/ios/wak/WAKAppKitStubs.h: Define typedefs and macros that map NSGeometry data types
and functions to the analogous CGGeometry data types and functions. Also, remove #ifdef __OBJC__-
guard as the existing content in WAKAppKitStubs.h assumes that this file will only be included
in an Objective-C/Objective-C++ file.
* platform/ios/wak/WAKView.h: Import header WAKAppKitStubs.h instead of defining macros for some
NSGeometry data types.
Source/WebKit/mac:
Substitute header WAKAppKitStubs.h for NSGeometry.h as the latter is a
private header.
* DOM/WebDOMOperationsPrivate.h:
Source/WebKit2:
Substitute header WAKAppKitStubs.h for NSGeometry.h as the latter is a
private header.
* Shared/ios/NativeWebTouchEventIOS.mm:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (176104 => 176105)
--- trunk/Source/WebCore/ChangeLog 2014-11-14 00:33:03 UTC (rev 176104)
+++ trunk/Source/WebCore/ChangeLog 2014-11-14 00:34:29 UTC (rev 176105)
@@ -1,3 +1,29 @@
+2014-11-13 Daniel Bates <[email protected]>
+
+ [iOS] NSGeometry data types are not available in the public SDK
+ https://bugs.webkit.org/show_bug.cgi?id=137536
+
+ Reviewed by David Kilzer.
+
+ Towards building iOS WebKit with the public iOS SDK, define NSGeometry
+ data types and functions in terms of CGGeometry data types and functions
+ because the former is SPI on iOS.
+
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Include
+ header WAKAppKitStubs.h when building for iOS. Otherwise, include header NSGeometry.h.
+ * platform/graphics/ca/mac/PlatformCALayerMac.mm: Remove import of private header NSGeometry.h.
+ We will use the NSGeometry data types defined in WAKAppKitStubs.h, which is implicitly imported
+ by header WAKWindow.h.
+ * platform/graphics/mac/MediaPlayerProxy.h: Substitute WAKAppKitStubs.h for NSGeometry.h.
+ * platform/ios/PlatformEventFactoryIOS.mm: Ditto. Also fix up style issues with #import directives.
+ * platform/ios/WebEvent.mm: Ditto.
+ * platform/ios/wak/WAKAppKitStubs.h: Define typedefs and macros that map NSGeometry data types
+ and functions to the analogous CGGeometry data types and functions. Also, remove #ifdef __OBJC__-
+ guard as the existing content in WAKAppKitStubs.h assumes that this file will only be included
+ in an Objective-C/Objective-C++ file.
+ * platform/ios/wak/WAKView.h: Import header WAKAppKitStubs.h instead of defining macros for some
+ NSGeometry data types.
+
2014-11-13 Simon Fraser <[email protected]>
[WK2] Fire a layout milestone on session restore based on render tree size
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (176104 => 176105)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2014-11-14 00:33:03 UTC (rev 176104)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2014-11-14 00:34:29 UTC (rev 176105)
@@ -76,11 +76,12 @@
#include "TextTrack.h"
#endif
-#import <Foundation/NSGeometry.h>
#import <AVFoundation/AVFoundation.h>
#if PLATFORM(IOS)
+#import "WAKAppKitStubs.h"
#import <CoreImage/CoreImage.h>
#else
+#import <Foundation/NSGeometry.h>
#import <QuartzCore/CoreImage.h>
#endif
#import <CoreMedia/CoreMedia.h>
Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm (176104 => 176105)
--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm 2014-11-14 00:33:03 UTC (rev 176104)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm 2014-11-14 00:34:29 UTC (rev 176105)
@@ -56,7 +56,6 @@
#import "WKGraphics.h"
#import "WebCoreThread.h"
#import "WebTiledLayer.h"
-#import <Foundation/NSGeometry.h>
#import <QuartzCore/CATiledLayerPrivate.h>
#else
#import "ThemeMac.h"
Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerProxy.h (176104 => 176105)
--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerProxy.h 2014-11-14 00:33:03 UTC (rev 176104)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerProxy.h 2014-11-14 00:34:29 UTC (rev 176105)
@@ -28,7 +28,7 @@
#if TARGET_OS_IPHONE
#if defined(__OBJC__)
-#import <Foundation/NSGeometry.h>
+#import <WebCore/WAKAppKitStubs.h>
#endif
// Needed since this is a WebKit private header on iOS.
Modified: trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm (176104 => 176105)
--- trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm 2014-11-14 00:33:03 UTC (rev 176104)
+++ trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm 2014-11-14 00:34:29 UTC (rev 176105)
@@ -26,11 +26,11 @@
#import "config.h"
#import "PlatformEventFactoryIOS.h"
-#import <Foundation/NSGeometry.h>
-#import <IntPoint.h>
-#import <KeyEventCocoa.h>
-#import <Logging.h>
-#import <WebEvent.h>
+#import "IntPoint.h"
+#import "KeyEventCocoa.h"
+#import "Logging.h"
+#import "WAKAppKitStubs.h"
+#import "WebEvent.h"
namespace WebCore {
Modified: trunk/Source/WebCore/platform/ios/WebEvent.mm (176104 => 176105)
--- trunk/Source/WebCore/platform/ios/WebEvent.mm 2014-11-14 00:33:03 UTC (rev 176104)
+++ trunk/Source/WebCore/platform/ios/WebEvent.mm 2014-11-14 00:34:29 UTC (rev 176105)
@@ -29,13 +29,14 @@
#import "WebEvent.h"
#import "KeyEventCocoa.h"
-#import <Foundation/NSGeometry.h>
#import <wtf/Assertions.h>
using namespace WebCore;
#if PLATFORM(IOS)
+#import "WAKAppKitStubs.h"
+
@implementation WebEvent
@synthesize type = _type;
Modified: trunk/Source/WebCore/platform/ios/wak/WAKAppKitStubs.h (176104 => 176105)
--- trunk/Source/WebCore/platform/ios/wak/WAKAppKitStubs.h 2014-11-14 00:33:03 UTC (rev 176104)
+++ trunk/Source/WebCore/platform/ios/wak/WAKAppKitStubs.h 2014-11-14 00:34:29 UTC (rev 176105)
@@ -32,8 +32,6 @@
#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>
-// FIXME: <rdar://problem/6669434> Switch from using NSGeometry methods to CGGeometry methods
-#import <Foundation/NSGeometry.h>
#ifndef NSClipView
#define NSClipView WAKClipView
@@ -54,13 +52,105 @@
#define NSResponder WAKResponder
#endif
-#ifdef __OBJC__
+// FIXME: <rdar://problem/6669434> Switch from using NSGeometry methods to CGGeometry methods
+//
+// We explicitly use __has_include() instead of the macro define WTF_USE_APPLE_INTERNAL_SDK as
+// the condition for including the header Foundation/NSGeometry.h to support internal Apple
+// clients that build without header wtf/Platform.h.
+#if __has_include(<Foundation/NSGeometry.h>)
+
+#import <Foundation/NSGeometry.h>
+
+#else
+
+typedef CGPoint NSPoint;
+typedef CGRect NSRect;
+typedef CGSize NSSize;
+typedef NSUInteger NSRectEdge;
+
+#ifndef NSZeroPoint
+#define NSZeroPoint CGPointZero
+#endif
+#ifndef NSZeroRect
+#define NSZeroRect CGRectZero
+#endif
+#ifndef NSZeroSize
+#define NSZeroSize CGSizeZero
+#endif
+#ifndef NSMakePoint
+#define NSMakePoint CGPointMake
+#endif
+#ifndef NSMakeRect
+#define NSMakeRect CGRectMake
+#endif
+#ifndef NSMakeSize
+#define NSMakeSize CGSizeMake
+#endif
+#ifndef NSEqualPoints
+#define NSEqualPoints CGPointEqualToPoint
+#endif
+#ifndef NSEqualRects
+#define NSEqualRects CGRectEqualToRect
+#endif
+#ifndef NSEqualSizes
+#define NSEqualSizes CGSizeEqualToSize
+#endif
+#ifndef NSInsetRect
+#define NSInsetRect CGRectInset
+#endif
+#ifndef NSIntersectionRect
+#define NSIntersectionRect CGRectIntersection
+#endif
+#ifndef NSIsEmptyRect
+#define NSIsEmptyRect CGRectIsEmpty
+#endif
+#ifndef NSContainsRect
+#define NSContainsRect CGRectContainsRect
+#endif
+#ifndef NSPointInRect
+#define NSPointInRect(x, y) CGRectContainsPoint((y), (x))
+#endif
+#ifndef NSMinX
+#define NSMinX CGRectGetMinX
+#endif
+#ifndef NSMinY
+#define NSMinY CGRectGetMinY
+#endif
+#ifndef NSMaxX
+#define NSMaxX CGRectGetMaxX
+#endif
+#ifndef NSMaxY
+#define NSMaxY CGRectGetMaxY
+#endif
+#ifndef NSMinXEdge
+#define NSMinXEdge CGRectMinXEdge
+#endif
+#ifndef NSMinYEdge
+#define NSMinYEdge CGRectMinYEdge
+#endif
+#ifndef NSMaxXEdge
+#define NSMaxXEdge CGRectMaxXEdge
+#endif
+#ifndef NSMaxYEdge
+#define NSMaxYEdge CGRectMaxYEdge
+#endif
+
+@interface NSValue (NSGeometryDetails)
++ (NSValue *)valueWithPoint:(NSPoint)point;
++ (NSValue *)valueWithRect:(NSRect)rect;
++ (NSValue *)valueWithSize:(NSSize)size;
+@property (readonly) NSPoint pointValue;
+@property (readonly) NSRect rectValue;
+@property (readonly) NSSize sizeValue;
+@end
+
+#endif // __has_include(<Foundation/NSGeometry.h>)
+
@class WAKClipView;
@class WAKResponder;
@class WAKScrollView;
@class WAKView;
@class WAKWindow;
-#endif
/* Device-independent bits found in event modifier flags */
enum {
Modified: trunk/Source/WebCore/platform/ios/wak/WAKView.h (176104 => 176105)
--- trunk/Source/WebCore/platform/ios/wak/WAKView.h 2014-11-14 00:33:03 UTC (rev 176104)
+++ trunk/Source/WebCore/platform/ios/wak/WAKView.h 2014-11-14 00:34:29 UTC (rev 176105)
@@ -28,16 +28,11 @@
#if TARGET_OS_IPHONE
+#import "WAKAppKitStubs.h"
#import "WAKResponder.h"
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
-#ifndef NSRect
-#define NSRect CGRect
-#endif
-#define NSPoint CGPoint
-#define NSSize CGSize
-
extern NSString *WAKViewFrameSizeDidChangeNotification;
extern NSString *WAKViewDidScrollNotification;
Modified: trunk/Source/WebKit/mac/ChangeLog (176104 => 176105)
--- trunk/Source/WebKit/mac/ChangeLog 2014-11-14 00:33:03 UTC (rev 176104)
+++ trunk/Source/WebKit/mac/ChangeLog 2014-11-14 00:34:29 UTC (rev 176105)
@@ -1,3 +1,15 @@
+2014-11-13 Daniel Bates <[email protected]>
+
+ [iOS] NSGeometry data types are not available in the public SDK
+ https://bugs.webkit.org/show_bug.cgi?id=137536
+
+ Reviewed by David Kilzer.
+
+ Substitute header WAKAppKitStubs.h for NSGeometry.h as the latter is a
+ private header.
+
+ * DOM/WebDOMOperationsPrivate.h:
+
2014-11-13 Beth Dakin <[email protected]>
WK1: Support default actions for video
Modified: trunk/Source/WebKit/mac/DOM/WebDOMOperationsPrivate.h (176104 => 176105)
--- trunk/Source/WebKit/mac/DOM/WebDOMOperationsPrivate.h 2014-11-14 00:33:03 UTC (rev 176104)
+++ trunk/Source/WebKit/mac/DOM/WebDOMOperationsPrivate.h 2014-11-14 00:34:29 UTC (rev 176105)
@@ -30,7 +30,7 @@
#import <_javascript_Core/JSBase.h>
#if TARGET_OS_IPHONE
-#import <Foundation/NSGeometry.h>
+#import <WebKitLegacy/WAKAppKitStubs.h>
#else
#import <AppKit/NSEvent.h>
#import <WebKitLegacy/DOMWheelEvent.h>
Modified: trunk/Source/WebKit2/ChangeLog (176104 => 176105)
--- trunk/Source/WebKit2/ChangeLog 2014-11-14 00:33:03 UTC (rev 176104)
+++ trunk/Source/WebKit2/ChangeLog 2014-11-14 00:34:29 UTC (rev 176105)
@@ -1,3 +1,15 @@
+2014-11-13 Daniel Bates <[email protected]>
+
+ [iOS] NSGeometry data types are not available in the public SDK
+ https://bugs.webkit.org/show_bug.cgi?id=137536
+
+ Reviewed by David Kilzer.
+
+ Substitute header WAKAppKitStubs.h for NSGeometry.h as the latter is a
+ private header.
+
+ * Shared/ios/NativeWebTouchEventIOS.mm:
+
2014-11-13 Simon Fraser <[email protected]>
[WK2] Fire a layout milestone on session restore based on render tree size
Modified: trunk/Source/WebKit2/Shared/ios/NativeWebTouchEventIOS.mm (176104 => 176105)
--- trunk/Source/WebKit2/Shared/ios/NativeWebTouchEventIOS.mm 2014-11-14 00:33:03 UTC (rev 176104)
+++ trunk/Source/WebKit2/Shared/ios/NativeWebTouchEventIOS.mm 2014-11-14 00:34:29 UTC (rev 176105)
@@ -29,10 +29,10 @@
#if PLATFORM(IOS)
#import "WebEvent.h"
-#import <Foundation/NSGeometry.h>
#import <UIKit/UITouch.h>
#import <UIKit/UIWebTouchEventsGestureRecognizer.h>
#import <WebCore/IntPoint.h>
+#import <WebCore/WAKAppKitStubs.h>
#import <wtf/CurrentTime.h>
namespace WebKit {