Diff
Modified: trunk/Source/WebCore/ChangeLog (221472 => 221473)
--- trunk/Source/WebCore/ChangeLog 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebCore/ChangeLog 2017-09-01 06:00:33 UTC (rev 221473)
@@ -1,3 +1,20 @@
+2017-08-31 Andy Estes <[email protected]>
+
+ [Mac] Upstream AppKit-related WebKitSystemInterface functions
+ https://bugs.webkit.org/show_bug.cgi?id=176175
+
+ Reviewed by Brady Eidson.
+
+ * Configurations/WebCore.xcconfig: Added -ObjC to OTHER_LDFLAGS so that Objective-C classes
+ in PAL are exported by WebCore even if WebCore doesn't use them.
+ * platform/mac/PlatformEventFactoryMac.h:
+ * platform/mac/PlatformEventFactoryMac.mm:
+ (WebCore::getWheelEventDeltas):
+ (WebCore::keyCharForEvent):
+ (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder):
+ * platform/mac/WebCoreSystemInterface.h:
+ * platform/mac/WebCoreSystemInterface.mm:
+
2017-08-31 Alex Christensen <[email protected]>
Fix Windows build after r221422
Modified: trunk/Source/WebCore/Configurations/WebCore.xcconfig (221472 => 221473)
--- trunk/Source/WebCore/Configurations/WebCore.xcconfig 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebCore/Configurations/WebCore.xcconfig 2017-09-01 06:00:33 UTC (rev 221473)
@@ -77,7 +77,7 @@
LIBWEBRTC_LIBRARY_DIR_USE_OVERRIDE_FRAMEWORKS_DIR_YES = $(WK_OVERRIDE_FRAMEWORKS_DIR);
OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) $(WK_UNDEFINED_SYMBOLS_LDFLAGS) $(OTHER_LDFLAGS_PLATFORM);
-OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE -framework CoreAudio -framework Metal -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy;
+OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE -framework CoreAudio -framework Metal -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -ObjC;
// FIXME: Reduce the number of allowable_client <rdar://problem/31823969>
OTHER_LDFLAGS_BASE_ios = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework MobileCoreServices -framework OpenGLES -lMobileGestalt $(WK_IOS_BINCOMPAT_LDFLAGS) -allowable_client WebKit -allowable_client iTunesU -allowable_client Casablanca -allowable_client Remote -allowable_client TVBooks -allowable_client DumpRenderTree -allowable_client WebKitTestRunner -allowable_client TestWebKitAPI;
OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface -framework GraphicsServices $(LIBWEBRTC_LDFLAGS);
Modified: trunk/Source/WebCore/PAL/ChangeLog (221472 => 221473)
--- trunk/Source/WebCore/PAL/ChangeLog 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebCore/PAL/ChangeLog 2017-09-01 06:00:33 UTC (rev 221473)
@@ -1,3 +1,18 @@
+2017-08-31 Andy Estes <[email protected]>
+
+ [Mac] Upstream AppKit-related WebKitSystemInterface functions
+ https://bugs.webkit.org/show_bug.cgi?id=176175
+
+ Reviewed by Brady Eidson.
+
+ * PAL.xcodeproj/project.pbxproj:
+ * pal/spi/mac/HIToolboxSPI.h:
+ * pal/spi/mac/NSResponderSPI.h: Copied from Source/WebCore/PAL/pal/spi/mac/NSWindowSPI.h.
+ * pal/spi/mac/NSWindowSPI.h:
+ * pal/system/mac/WebPanel.h: Copied from Source/WebCore/PAL/pal/spi/mac/NSWindowSPI.h.
+ * pal/system/mac/WebPanel.mm: Copied from Source/WebCore/PAL/pal/spi/mac/HIToolboxSPI.h.
+ (-[WebPanel init]):
+
2017-08-31 Ryan Haddad <[email protected]>
Unreviewed, rolling out r221445.
Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (221472 => 221473)
--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj 2017-09-01 06:00:33 UTC (rev 221473)
@@ -101,6 +101,9 @@
A10265891F56747A00B4C844 /* HIToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10265881F56747A00B4C844 /* HIToolboxSPI.h */; };
A102658B1F56748C00B4C844 /* QuickDrawSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A102658A1F56748C00B4C844 /* QuickDrawSPI.h */; };
A102658E1F567E9D00B4C844 /* HIServicesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A102658D1F567E9D00B4C844 /* HIServicesSPI.h */; };
+ A10826F11F573BCA004772AC /* NSResponderSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10826F01F573BCA004772AC /* NSResponderSPI.h */; };
+ A10826F91F576292004772AC /* WebPanel.h in Headers */ = {isa = PBXBuildFile; fileRef = A10826F71F576292004772AC /* WebPanel.h */; };
+ A10826FA1F576292004772AC /* WebPanel.mm in Sources */ = {isa = PBXBuildFile; fileRef = A10826F81F576292004772AC /* WebPanel.mm */; };
A1F55DCF1F5528EC00EDB75F /* MetadataSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F55DCE1F5528EC00EDB75F /* MetadataSPI.h */; };
A30D41211F0DD0EA00B71954 /* KillRing.h in Headers */ = {isa = PBXBuildFile; fileRef = A30D411E1F0DD0EA00B71954 /* KillRing.h */; };
A30D41221F0DD0EA00B71954 /* KillRing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A30D411F1F0DD0EA00B71954 /* KillRing.cpp */; };
@@ -217,6 +220,9 @@
A10265881F56747A00B4C844 /* HIToolboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HIToolboxSPI.h; sourceTree = "<group>"; };
A102658A1F56748C00B4C844 /* QuickDrawSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuickDrawSPI.h; sourceTree = "<group>"; };
A102658D1F567E9D00B4C844 /* HIServicesSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HIServicesSPI.h; sourceTree = "<group>"; };
+ A10826F01F573BCA004772AC /* NSResponderSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSResponderSPI.h; sourceTree = "<group>"; };
+ A10826F71F576292004772AC /* WebPanel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebPanel.h; sourceTree = "<group>"; };
+ A10826F81F576292004772AC /* WebPanel.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPanel.mm; sourceTree = "<group>"; };
A1F55DCE1F5528EC00EDB75F /* MetadataSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MetadataSPI.h; sourceTree = "<group>"; };
A30D411E1F0DD0EA00B71954 /* KillRing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KillRing.h; sourceTree = "<group>"; };
A30D411F1F0DD0EA00B71954 /* KillRing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KillRing.cpp; sourceTree = "<group>"; };
@@ -353,6 +359,7 @@
0C7785791F45130F00F4EBB6 /* NSMenuSPI.h */,
0C77857A1F45130F00F4EBB6 /* NSPasteboardSPI.h */,
0C77857B1F45130F00F4EBB6 /* NSPopoverSPI.h */,
+ A10826F01F573BCA004772AC /* NSResponderSPI.h */,
0C77857C1F45130F00F4EBB6 /* NSScrollerImpSPI.h */,
0C77857D1F45130F00F4EBB6 /* NSScrollingInputFilterSPI.h */,
0C77857E1F45130F00F4EBB6 /* NSScrollingMomentumCalculatorSPI.h */,
@@ -473,6 +480,8 @@
A3788E9D1F05B78E00679425 /* SoundMac.mm */,
A3AB6E621F3D217F009C14B1 /* SystemSleepListenerMac.h */,
A3AB6E631F3D217F009C14B1 /* SystemSleepListenerMac.mm */,
+ A10826F71F576292004772AC /* WebPanel.h */,
+ A10826F81F576292004772AC /* WebPanel.mm */,
);
path = mac;
sourceTree = "<group>";
@@ -546,6 +555,7 @@
0C7785921F45130F00F4EBB6 /* NSMenuSPI.h in Headers */,
0C7785931F45130F00F4EBB6 /* NSPasteboardSPI.h in Headers */,
0C7785941F45130F00F4EBB6 /* NSPopoverSPI.h in Headers */,
+ A10826F11F573BCA004772AC /* NSResponderSPI.h in Headers */,
0C7785951F45130F00F4EBB6 /* NSScrollerImpSPI.h in Headers */,
0C7785961F45130F00F4EBB6 /* NSScrollingInputFilterSPI.h in Headers */,
0C7785971F45130F00F4EBB6 /* NSScrollingMomentumCalculatorSPI.h in Headers */,
@@ -580,6 +590,7 @@
0C7785A11F45130F00F4EBB6 /* TUCallSPI.h in Headers */,
0C5AF9221F43A4C7002EAC02 /* UIKitSPI.h in Headers */,
0C2DA1591F3BEB4900DBC317 /* WebFilterEvaluatorSPI.h in Headers */,
+ A10826F91F576292004772AC /* WebPanel.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -678,6 +689,7 @@
A3788E9E1F05B78E00679425 /* SoundMac.mm in Sources */,
A3AB6E571F3D1DDB009C14B1 /* SystemSleepListener.cpp in Sources */,
A3AB6E651F3D217F009C14B1 /* SystemSleepListenerMac.mm in Sources */,
+ A10826FA1F576292004772AC /* WebPanel.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: trunk/Source/WebCore/PAL/pal/spi/mac/HIToolboxSPI.h (221472 => 221473)
--- trunk/Source/WebCore/PAL/pal/spi/mac/HIToolboxSPI.h 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebCore/PAL/pal/spi/mac/HIToolboxSPI.h 2017-09-01 06:00:33 UTC (rev 221473)
@@ -37,6 +37,9 @@
typedef struct __TSMInputSource* TSMInputSourceRef;
typedef CFStringRef TSMInputSourcePropertyTag;
+typedef struct OpaqueEventRef* EventRef;
+typedef OSType EventParamName;
+typedef OSType EventParamType;
WTF_EXTERN_C_BEGIN
@@ -45,5 +48,6 @@
OSStatus TSMProcessRawKeyEvent(EventRef);
EventRef GetCurrentEvent();
CFTypeRef TSMGetInputSourceProperty(TSMInputSourceRef, TSMInputSourcePropertyTag);
+OSStatus GetEventParameter(EventRef, EventParamName inName, EventParamType inDesiredType, EventParamType* outActualType, ByteCount inBufferSize, ByteCount* outActualSize, void* outData);
WTF_EXTERN_C_END
Copied: trunk/Source/WebCore/PAL/pal/spi/mac/NSResponderSPI.h (from rev 221472, trunk/Source/WebCore/PAL/pal/spi/mac/NSWindowSPI.h) (0 => 221473)
--- trunk/Source/WebCore/PAL/pal/spi/mac/NSResponderSPI.h (rev 0)
+++ trunk/Source/WebCore/PAL/pal/spi/mac/NSResponderSPI.h 2017-09-01 06:00:33 UTC (rev 221473)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+#if PLATFORM(MAC)
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <AppKit/NSResponder_Private.h>
+
+#else
+
+@interface NSResponder ()
+- (void)_setShouldPostEventNotifications:(BOOL)postNotifications;
+@end
+
+#endif
+
+#endif // PLATFORM(MAC)
Modified: trunk/Source/WebCore/PAL/pal/spi/mac/NSWindowSPI.h (221472 => 221473)
--- trunk/Source/WebCore/PAL/pal/spi/mac/NSWindowSPI.h 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebCore/PAL/pal/spi/mac/NSWindowSPI.h 2017-09-01 06:00:33 UTC (rev 221473)
@@ -42,9 +42,14 @@
@end
enum {
+ NSSideUtilityWindowMask = 1 << 9,
+ NSSmallWindowMask = 1 << 10,
_NSCarbonWindowMask = 1 << 25,
};
#endif
+extern NSString *NSWindowWillOrderOnScreenNotification;
+extern NSString *NSWindowWillOrderOffScreenNotification;
+
#endif // PLATFORM(MAC)
Copied: trunk/Source/WebCore/PAL/pal/system/mac/WebPanel.h (from rev 221472, trunk/Source/WebCore/PAL/pal/spi/mac/NSWindowSPI.h) (0 => 221473)
--- trunk/Source/WebCore/PAL/pal/system/mac/WebPanel.h (rev 0)
+++ trunk/Source/WebCore/PAL/pal/system/mac/WebPanel.h 2017-09-01 06:00:33 UTC (rev 221473)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+#if PLATFORM(MAC)
+
+#import <AppKit/AppKit.h>
+
+PAL_EXPORT @interface WebPanel : NSPanel
+
+- (instancetype)init;
+
+@end
+
+#endif
Copied: trunk/Source/WebCore/PAL/pal/system/mac/WebPanel.mm (from rev 221472, trunk/Source/WebCore/PAL/pal/spi/mac/HIToolboxSPI.h) (0 => 221473)
--- trunk/Source/WebCore/PAL/pal/system/mac/WebPanel.mm (rev 0)
+++ trunk/Source/WebCore/PAL/pal/system/mac/WebPanel.mm 2017-09-01 06:00:33 UTC (rev 221473)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2017 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"
+#import "WebPanel.h"
+
+#if PLATFORM(MAC)
+
+#import <pal/spi/mac/NSWindowSPI.h>
+
+@implementation WebPanel
+
+- (instancetype)init
+{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ static NSUInteger styleMask = NSMiniaturizableWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSTitledWindowMask | NSSmallWindowMask | NSSideUtilityWindowMask | NSUtilityWindowMask;
+#pragma clang diagnostic pop
+
+ return [super initWithContentRect:NSZeroRect styleMask:styleMask backing:NSBackingStoreBuffered defer:YES];
+}
+
+@end
+
+#endif // PLATFORM(MAC)
Modified: trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.h (221472 => 221473)
--- trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.h 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.h 2017-09-01 06:00:33 UTC (rev 221473)
@@ -49,6 +49,9 @@
WEBCORE_EXPORT String keyForKeyEvent(NSEvent *);
WEBCORE_EXPORT String codeForKeyEvent(NSEvent *);
WEBCORE_EXPORT double eventTimeStampSince1970(NSEvent *);
+
+WEBCORE_EXPORT void getWheelEventDeltas(NSEvent *, float& deltaX, float& deltaY, BOOL& continuous);
+WEBCORE_EXPORT UInt8 keyCharForEvent(NSEvent *);
#endif
Modified: trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm (221472 => 221473)
--- trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm 2017-09-01 06:00:33 UTC (rev 221473)
@@ -32,8 +32,11 @@
#import "Scrollbar.h"
#import "WebCoreSystemInterface.h"
#import "WindowsKeyboardCodes.h"
+#import <HIToolbox/CarbonEvents.h>
#import <HIToolbox/Events.h>
#import <mach/mach_time.h>
+#import <pal/spi/mac/HIToolboxSPI.h>
+#import <pal/spi/mac/NSEventSPI.h>
#import <pal/spi/mac/NSMenuSPI.h>
#import <wtf/ASCIICType.h>
@@ -674,6 +677,39 @@
return static_cast<int>([NSMenu menuTypeForEvent:event]);
}
+void getWheelEventDeltas(NSEvent *event, float& deltaX, float& deltaY, BOOL& continuous)
+{
+ ASSERT(event);
+ if (event.hasPreciseScrollingDeltas) {
+ deltaX = event.scrollingDeltaX;
+ deltaY = event.scrollingDeltaY;
+ continuous = YES;
+ } else {
+ deltaX = event.deltaX;
+ deltaY = event.deltaY;
+ continuous = NO;
+ }
+}
+
+UInt8 keyCharForEvent(NSEvent *event)
+{
+ EventRef eventRef = (EventRef)[event _eventRef];
+ if (!eventRef)
+ return 0;
+
+ ByteCount keyCharCount = 0;
+ if (GetEventParameter(eventRef, kEventParamKeyMacCharCodes, typeChar, 0, 0, &keyCharCount, 0) != noErr)
+ return 0;
+ if (keyCharCount != 1)
+ return 0;
+
+ UInt8 keyChar = 0;
+ if (GetEventParameter(eventRef, kEventParamKeyMacCharCodes, typeChar, 0, sizeof(keyChar), &keyCharCount, &keyChar) != noErr)
+ return 0;
+
+ return keyChar;
+}
+
class PlatformMouseEventBuilder : public PlatformMouseEvent {
public:
PlatformMouseEventBuilder(NSEvent *event, NSEvent *correspondingPressureEvent, NSView *windowView)
@@ -744,7 +780,7 @@
m_granularity = ScrollByPixelWheelEvent;
BOOL continuous;
- wkGetWheelEventDeltas(event, &m_deltaX, &m_deltaY, &continuous);
+ getWheelEventDeltas(event, m_deltaX, m_deltaY, continuous);
if (continuous) {
m_wheelTicksX = m_deltaX / static_cast<float>(Scrollbar::pixelsPerLineStep());
m_wheelTicksY = m_deltaY / static_cast<float>(Scrollbar::pixelsPerLineStep());
Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h (221472 => 221473)
--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h 2017-09-01 06:00:33 UTC (rev 221473)
@@ -139,7 +139,6 @@
extern void (*wkDrawMediaUIPart)(int part, CGContextRef context, CGRect rect, unsigned state);
extern double (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response);
extern BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
-extern void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
extern UInt8 (*wkGetNSEventKeyChar)(NSEvent *);
extern BOOL (*wkHitTestMediaUIPart)(int part, CGRect bounds, CGPoint point);
extern void (*wkMeasureMediaUIPart)(int part, CGRect *bounds, CGSize *naturalSize);
Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm (221472 => 221473)
--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm 2017-09-01 06:00:33 UTC (rev 221473)
@@ -48,7 +48,6 @@
void (*wkWindowSetScaledFrame)(NSWindow *, NSRect, NSRect);
NSTimeInterval (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response);
BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
-void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
UInt8 (*wkGetNSEventKeyChar)(NSEvent *);
void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*, NSControlSize controlSize, bool usesCustomAppearance);
unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
Modified: trunk/Source/WebKit/ChangeLog (221472 => 221473)
--- trunk/Source/WebKit/ChangeLog 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebKit/ChangeLog 2017-09-01 06:00:33 UTC (rev 221473)
@@ -1,3 +1,20 @@
+2017-08-31 Andy Estes <[email protected]>
+
+ [Mac] Upstream AppKit-related WebKitSystemInterface functions
+ https://bugs.webkit.org/show_bug.cgi?id=176175
+
+ Reviewed by Brady Eidson.
+
+ * PluginProcess/mac/PluginProcessMac.mm:
+ (WebKit::initializeCocoaOverrides):
+ * Shared/mac/WebEventFactory.mm:
+ (WebKit::WebEventFactory::createWebWheelEvent):
+ (WebKit::WebEventFactory::createWebKeyboardEvent):
+ * UIProcess/mac/WKTextInputWindowController.mm:
+ (-[WKTextInputPanel init]):
+ * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+ (InitWebCoreSystemInterface):
+
2017-08-31 Alex Christensen <[email protected]>
Add WKUIDelegatePrivate equivalent of WKPageUIClient's isPlayingAudioDidChange
Modified: trunk/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm (221472 => 221473)
--- trunk/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm 2017-09-01 06:00:33 UTC (rev 221473)
@@ -47,6 +47,7 @@
#import <mach/vm_statistics.h>
#import <objc/runtime.h>
#import <pal/spi/mac/HIToolboxSPI.h>
+#import <pal/spi/mac/NSWindowSPI.h>
#import <sysexits.h>
#import <wtf/HashSet.h>
#import <wtf/NeverDestroyed.h>
@@ -441,12 +442,12 @@
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
// Track when any Cocoa window is about to be be shown.
- id orderOnScreenObserver = [defaultCenter addObserverForName:WKWindowWillOrderOnScreenNotification()
+ id orderOnScreenObserver = [defaultCenter addObserverForName:NSWindowWillOrderOnScreenNotification
object:nil
queue:nil
usingBlock:^(NSNotification *notification) { fullscreenWindowTracker().windowShown([notification object]); }];
// Track when any Cocoa window is about to be hidden.
- id orderOffScreenObserver = [defaultCenter addObserverForName:WKWindowWillOrderOffScreenNotification()
+ id orderOffScreenObserver = [defaultCenter addObserverForName:NSWindowWillOrderOffScreenNotification
object:nil
queue:nil
usingBlock:^(NSNotification *notification) { fullscreenWindowTracker().windowHidden([notification object]); }];
Modified: trunk/Source/WebKit/Shared/mac/WebEventFactory.mm (221472 => 221473)
--- trunk/Source/WebKit/Shared/mac/WebEventFactory.mm 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebKit/Shared/mac/WebEventFactory.mm 2017-09-01 06:00:33 UTC (rev 221473)
@@ -385,7 +385,7 @@
float wheelTicksX = 0;
float wheelTicksY = 0;
- WKGetWheelEventDeltas(event, &deltaX, &deltaY, &continuous);
+ getWheelEventDeltas(event, deltaX, deltaY, continuous);
if (continuous) {
// smooth scroll events
@@ -433,7 +433,7 @@
String keyIdentifier = keyIdentifierForKeyEvent(event);
int windowsVirtualKeyCode = windowsKeyCodeForKeyEvent(event);
int nativeVirtualKeyCode = [event keyCode];
- int macCharCode = WKGetNSEventKeyChar(event);
+ int macCharCode = keyCharForEvent(event);
bool autoRepeat = [event type] != NSEventTypeFlagsChanged && [event isARepeat];
bool isKeypad = isKeypadEvent(event);
bool isSystemKey = false; // SystemKey is always false on the Mac.
Modified: trunk/Source/WebKit/UIProcess/mac/WKTextInputWindowController.mm (221472 => 221473)
--- trunk/Source/WebKit/UIProcess/mac/WKTextInputWindowController.mm 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebKit/UIProcess/mac/WKTextInputWindowController.mm 2017-09-01 06:00:33 UTC (rev 221473)
@@ -29,6 +29,7 @@
#if USE(APPKIT)
#import <WebKitSystemInterface.h>
+#import <pal/system/mac/WebPanel.h>
@interface WKTextInputView : NSTextView {
}
@@ -47,7 +48,7 @@
@end
-@interface WKTextInputPanel : NSPanel {
+@interface WKTextInputPanel : WebPanel {
NSTextView *_inputTextView;
}
@@ -74,7 +75,7 @@
- (id)init
{
- self = [super initWithContentRect:NSZeroRect styleMask:WKGetInputPanelWindowStyle() backing:NSBackingStoreBuffered defer:YES];
+ self = [super init];
if (!self)
return nil;
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm (221472 => 221473)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm 2017-09-01 06:00:33 UTC (rev 221473)
@@ -52,7 +52,6 @@
#endif
INIT(CGContextIsPDFContext);
#if !PLATFORM(IOS)
- INIT(GetWheelEventDeltas);
INIT(GetNSEventKeyChar);
INIT(HitTestMediaUIPart);
INIT(MeasureMediaUIPart);
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (221472 => 221473)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2017-09-01 06:00:33 UTC (rev 221473)
@@ -1,3 +1,26 @@
+2017-08-31 Andy Estes <[email protected]>
+
+ [Mac] Upstream AppKit-related WebKitSystemInterface functions
+ https://bugs.webkit.org/show_bug.cgi?id=176175
+
+ Reviewed by Brady Eidson.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::keyEvent):
+ * Plugins/Hosted/WebTextInputWindowController.m:
+ (-[WebTextInputPanel init]):
+ * WebCoreSupport/WebSystemInterface.mm:
+ (InitWebCoreSystemInterface):
+ * WebView/WebDynamicScrollBarsView.mm:
+ (-[WebDynamicScrollBarsView scrollWheel:]):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _removeWindowObservers]):
+ (-[WebHTMLView addWindowObservers]):
+ * WebView/WebView.mm:
+ (-[WebView addWindowObserversForWindow:]):
+ (-[WebView removeWindowObservers]):
+ (-[WebView viewWillMoveToWindow:]):
+
2017-08-31 Alex Christensen <[email protected]>
Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolveWebGLLoadPolicy
Modified: trunk/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm (221472 => 221473)
--- trunk/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm 2017-09-01 06:00:33 UTC (rev 221473)
@@ -54,10 +54,11 @@
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
#import <WebCore/FrameTree.h>
-#import <WebCore/URL.h>
+#import <WebCore/PlatformEventFactoryMac.h>
#import <WebCore/ProxyServer.h>
#import <WebCore/SecurityOrigin.h>
#import <WebCore/ScriptController.h>
+#import <WebCore/URL.h>
#import <WebCore/UserGestureIndicator.h>
#import <WebCore/npruntime_impl.h>
#import <WebCore/runtime_object.h>
@@ -459,7 +460,7 @@
type, [event modifierFlags],
const_cast<char*>(reinterpret_cast<const char*>([charactersData bytes])), [charactersData length],
const_cast<char*>(reinterpret_cast<const char*>([charactersIgnoringModifiersData bytes])), [charactersIgnoringModifiersData length],
- [event isARepeat], [event keyCode], WKGetNSEventKeyChar(event));
+ [event isARepeat], [event keyCode], keyCharForEvent(event));
}
void NetscapePluginInstanceProxy::syntheticKeyDownWithCommandModifier(int keyCode, char character)
Modified: trunk/Source/WebKitLegacy/mac/Plugins/Hosted/WebTextInputWindowController.m (221472 => 221473)
--- trunk/Source/WebKitLegacy/mac/Plugins/Hosted/WebTextInputWindowController.m 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebKitLegacy/mac/Plugins/Hosted/WebTextInputWindowController.m 2017-09-01 06:00:33 UTC (rev 221473)
@@ -28,6 +28,7 @@
#import "WebTextInputWindowController.h"
#import <WebKitSystemInterface.h>
+#import <pal/system/mac/WebPanel.h>
@interface WebTextInputView : NSTextView {
}
@@ -46,7 +47,7 @@
@end
-@interface WebTextInputPanel : NSPanel {
+@interface WebTextInputPanel : WebPanel {
NSTextView *_inputTextView;
}
@@ -70,7 +71,7 @@
- (id)init
{
- self = [super initWithContentRect:NSZeroRect styleMask:WKGetInputPanelWindowStyle() backing:NSBackingStoreBuffered defer:YES];
+ self = [super init];
if (!self)
return nil;
Modified: trunk/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm (221472 => 221473)
--- trunk/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm 2017-09-01 06:00:33 UTC (rev 221473)
@@ -30,6 +30,7 @@
#import "WebNetscapePluginView.h"
#import "WebKitLogging.h"
#import "WebKitSystemInterface.h"
+#import <HIToolbox/CarbonEvents.h>
#import <pal/spi/mac/HIToolboxSPI.h>
#import <pal/spi/mac/NSEventSPI.h>
Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebSystemInterface.mm (221472 => 221473)
--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebSystemInterface.mm 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebSystemInterface.mm 2017-09-01 06:00:33 UTC (rev 221473)
@@ -55,7 +55,6 @@
INIT(DrawCellFocusRingWithFrameAtTime);
INIT(DrawMediaUIPart);
INIT(DrawMediaSliderTrack);
- INIT(GetWheelEventDeltas);
INIT(GetNSEventKeyChar);
INIT(HitTestMediaUIPart);
INIT(MeasureMediaUIPart);
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebDynamicScrollBarsView.mm (221472 => 221473)
--- trunk/Source/WebKitLegacy/mac/WebView/WebDynamicScrollBarsView.mm 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebDynamicScrollBarsView.mm 2017-09-01 06:00:33 UTC (rev 221473)
@@ -31,6 +31,7 @@
#import "WebHTMLViewInternal.h"
#import <WebCore/Frame.h>
#import <WebCore/FrameView.h>
+#import <WebCore/PlatformEventFactoryMac.h>
#import <WebKitSystemInterface.h>
using namespace WebCore;
@@ -535,7 +536,7 @@
float deltaX;
float deltaY;
BOOL isContinuous;
- WKGetWheelEventDeltas(event, &deltaX, &deltaY, &isContinuous);
+ getWheelEventDeltas(event, deltaX, deltaY, isContinuous);
NSEventPhase momentumPhase = [event momentumPhase];
BOOL isLatchingEvent = momentumPhase & NSEventPhaseBegan || momentumPhase & NSEventPhaseStationary;
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (221472 => 221473)
--- trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm 2017-09-01 06:00:33 UTC (rev 221473)
@@ -132,6 +132,7 @@
#import <pal/spi/cocoa/NSURLFileTypeMappingsSPI.h>
#import <pal/spi/mac/NSSpellCheckerSPI.h>
#import <pal/spi/mac/NSViewSPI.h>
+#import <pal/spi/mac/NSWindowSPI.h>
#import <runtime/InitializeThreading.h>
#import <wtf/BlockObjCExceptions.h>
#import <wtf/MainThread.h>
@@ -1409,8 +1410,8 @@
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter removeObserver:self name:NSWindowDidBecomeKeyNotification object:nil];
[notificationCenter removeObserver:self name:NSWindowDidResignKeyNotification object:nil];
- [notificationCenter removeObserver:self name:WKWindowWillOrderOnScreenNotification() object:window];
- [notificationCenter removeObserver:self name:WKWindowWillOrderOffScreenNotification() object:window];
+ [notificationCenter removeObserver:self name:NSWindowWillOrderOnScreenNotification object:window];
+ [notificationCenter removeObserver:self name:NSWindowWillOrderOffScreenNotification object:window];
[notificationCenter removeObserver:self name:NSWindowWillCloseNotification object:window];
_private->observingWindowNotifications = false;
@@ -3449,8 +3450,8 @@
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:nil];
[notificationCenter addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:nil];
- [notificationCenter addObserver:self selector:@selector(windowWillOrderOnScreen:) name:WKWindowWillOrderOnScreenNotification() object:window];
- [notificationCenter addObserver:self selector:@selector(windowWillOrderOffScreen:) name:WKWindowWillOrderOffScreenNotification() object:window];
+ [notificationCenter addObserver:self selector:@selector(windowWillOrderOnScreen:) name:NSWindowWillOrderOnScreenNotification object:window];
+ [notificationCenter addObserver:self selector:@selector(windowWillOrderOffScreen:) name:NSWindowWillOrderOffScreenNotification object:window];
[notificationCenter addObserver:self selector:@selector(windowWillClose:) name:NSWindowWillCloseNotification object:window];
_private->observingWindowNotifications = true;
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (221472 => 221473)
--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2017-09-01 05:41:08 UTC (rev 221472)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2017-09-01 06:00:33 UTC (rev 221473)
@@ -211,7 +211,9 @@
#import <pal/spi/cf/CFNetworkSPI.h>
#import <pal/spi/cocoa/NSTouchBarSPI.h>
#import <pal/spi/cocoa/NSURLFileTypeMappingsSPI.h>
+#import <pal/spi/mac/NSResponderSPI.h>
#import <pal/spi/mac/NSSpellCheckerSPI.h>
+#import <pal/spi/mac/NSWindowSPI.h>
#import <runtime/ArrayPrototype.h>
#import <runtime/CatchScope.h>
#import <runtime/DateInstance.h>
@@ -5866,9 +5868,9 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowKeyStateChanged:)
name:NSWindowDidResignKeyNotification object:window];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillOrderOnScreen:)
- name:WKWindowWillOrderOnScreenNotification() object:window];
+ name:NSWindowWillOrderOnScreenNotification object:window];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillOrderOffScreen:)
- name:WKWindowWillOrderOffScreenNotification() object:window];
+ name:NSWindowWillOrderOffScreenNotification object:window];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeBackingProperties:)
name:windowDidChangeBackingPropertiesNotification object:window];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeScreen:)
@@ -5890,9 +5892,9 @@
[[NSNotificationCenter defaultCenter] removeObserver:self
name:NSWindowDidResignKeyNotification object:window];
[[NSNotificationCenter defaultCenter] removeObserver:self
- name:WKWindowWillOrderOnScreenNotification() object:window];
+ name:NSWindowWillOrderOnScreenNotification object:window];
[[NSNotificationCenter defaultCenter] removeObserver:self
- name:WKWindowWillOrderOffScreenNotification() object:window];
+ name:NSWindowWillOrderOffScreenNotification object:window];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:windowDidChangeBackingPropertiesNotification object:window];
[[NSNotificationCenter defaultCenter] removeObserver:self
@@ -5923,7 +5925,7 @@
// The following are expensive enough that we don't want to call them over
// and over, so do them when we move into a window.
[window setAcceptsMouseMovedEvents:YES];
- WKSetNSWindowShouldPostEventNotifications(window, YES);
+ [window _setShouldPostEventNotifications:YES];
} else if (!_private->closed) {
_private->page->setCanStartMedia(false);
_private->page->setIsInWindow(false);