[Mac] Stop using deprecated AppKit enumeration values
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Nov 2016 19:31:56 +0000 (19:31 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Nov 2016 19:31:56 +0000 (19:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=164494

Reviewed by Darin Adler.

Stop using deprecated AppKit enumeration values.

Source/WebCore:

* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::computedAttributesForElement):
(HTMLConverter::_processElement):
(HTMLConverter::_addMarkersToList):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::keyEvent):
(WebCore::lastEventIsMouseUp):
(WebCore::EventHandler::passSubframeEventToSubframe):
(WebCore::EventHandler::widgetDidHandleWheelEvent):
(WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
* page/mac/TextIndicatorWindow.mm:
(WebCore::TextIndicatorWindow::setTextIndicator):
* platform/graphics/mac/IconMac.mm:
(WebCore::Icon::paint):
* platform/mac/CursorMac.mm:
(WebCore::createCustomCursor):
* platform/mac/DragImageMac.mm:
(WebCore::dissolveDragImageToFraction):
(WebCore::createDragImageFromImage):
* platform/mac/EventLoopMac.mm:
(WebCore::EventLoop::cycle):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::setDragImage):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::globalPointForEvent):
(WebCore::pointForEvent):
(WebCore::mouseButtonForEvent):
(WebCore::mouseEventTypeForEvent):
(WebCore::clickCountForEvent):
(WebCore::isKeypadEvent):
(WebCore::windowsKeyCodeForKeyEvent):
(WebCore::isKeyUpEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::scrollbarControlSizeToNSControlSize):
* platform/mac/ThemeMac.mm:
(-[WebCoreThemeView window]):
(WebCore::controlSizeForFont):
(WebCore::controlSizeFromPixelSize):
(WebCore::setUpButtonCell):
(WebCore::stepperControlSizeForFont):
(WebCore::paintStepper):
(WebCore::ThemeMac::minimumControlSize):
* platform/mac/WebVideoFullscreenHUDWindowController.mm:
(-[WebVideoFullscreenHUDWindow initWithContentRect:styleMask:backing:defer:]):
(-[WebVideoFullscreenHUDWindow performKeyEquivalent:]):
(-[WebVideoFullscreenHUDWindowController init]):
(-[WebVideoFullscreenHUDWindowController keyDown:]):
(-[WebVideoFullscreenHUDWindowController windowDidLoad]):
* platform/mac/WebWindowAnimation.mm:
(WebWindowAnimationDurationFromDuration):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::updateCachedSystemFontDescription):
(WebCore::RenderThemeMac::controlSizeForFont):
(WebCore::RenderThemeMac::controlSizeForCell):
(WebCore::RenderThemeMac::controlSizeForSystemFont):
(WebCore::RenderThemeMac::paintProgressBar):
(WebCore::RenderThemeMac::popupMenuSize):
(WebCore::RenderThemeMac::sliderThumbHorizontal):
(WebCore::RenderThemeMac::sliderThumbVertical):

Source/WebKit/mac:

* Carbon/CarbonWindowAdapter.mm:
(-[CarbonWindowAdapter initWithCarbonWindowRef:takingOwnership:disableOrdering:carbon:]):
(-[CarbonWindowAdapter sendSuperEvent:]):
* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WebKit::NetscapePluginHostProxy::beginModal):
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::syntheticKeyDownWithCommandModifier):
* Plugins/Hosted/WebHostedNetscapePluginView.mm:
(-[WebHostedNetscapePluginView drawRect:]):
* Plugins/WebNetscapePluginEventHandlerCocoa.mm:
(WebNetscapePluginEventHandlerCocoa::syntheticKeyDownWithCommandModifier):
* WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::populate):
(PopupMenuMac::show):
* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::showContextMenu):
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::actionDictionary):
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::canAttach):
(-[WebInspectorWindowController window]):
* WebInspector/WebNodeHighlight.mm:
(-[WebNodeHighlight initWithTargetView:inspectorController:]):
* WebView/WebFrameView.mm:
(-[WebFrameView keyDown:keyDown:]):
* WebView/WebFullScreenController.mm:
(-[WebFullScreenController init]):
(createBackgroundFullscreenWindow):
* WebView/WebHTMLView.mm:
(-[WebHTMLView _postFakeMouseMovedEventForFlagsChangedEvent:]):
(-[WebHTMLView _setMouseDownEvent:_setMouseDownEvent:]):
(-[WebHTMLView _updateMouseoverWithFakeEvent]):
(isQuickLookEvent):
(-[WebHTMLView hitTest:]):
(-[WebHTMLView _sendToolTipMouseExited]):
(-[WebHTMLView _sendToolTipMouseEntered]):
(mouseEventIsPartOfClickOrDrag):
(-[WebHTMLView _updateMouseoverWithEvent:]):
(-[WebHTMLView _autoscroll]):
(-[WebHTMLView acceptsFirstResponder]):
(-[WebHTMLView viewDidMoveToWindow]):
(-[WebHTMLView mouseDown:mouseDown:]):
(currentKeyboardEvent):
(-[WebHTMLView _handleStyleKeyEquivalent:]):
(-[WebHTMLView _interpretKeyEvent:savingCommands:]):
* WebView/WebPDFView.mm:
(-[WebPDFView hitTest:]):
(-[WebPDFView PDFViewWillClickOnLink:withURL:]):
(-[WebPDFView _fakeKeyEventWithFunctionKey:]):
* WebView/WebTextCompletionController.mm:
(-[WebTextCompletionController _buildUI]):
(-[WebTextCompletionController _placePopupWindow:]):
* WebView/WebView.mm:
(-[WebView applicationFlags:]):

Source/WebKit2:

* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::stopNSAppRunLoop):
* Shared/mac/WebEventFactory.mm:
(WebKit::mouseButtonForEvent):
(WebKit::mouseEventTypeForEvent):
(WebKit::clickCountForEvent):
(WebKit::globalPointForEvent):
(WebKit::pointForEvent):
(WebKit::textFromEvent):
(WebKit::unmodifiedTextFromEvent):
(WebKit::isKeypadEvent):
(WebKit::isKeyUpEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::becomeFirstResponder):
(WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
(WebKit::WebViewImpl::viewDidMoveToWindow):
(WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
(WebKit::WebViewImpl::createFullScreenWindow):
(WebKit::WebViewImpl::sendToolTipMouseExited):
(WebKit::WebViewImpl::sendToolTipMouseEntered):
(WebKit::applicationFlagsForDrag):
(WebKit::WebViewImpl::setLastMouseDownEvent):
(WebKit::WebViewImpl::doneWithKeyEvent):
(WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
(WebKit::WebViewImpl::performKeyEquivalent):
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::beginModal):
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
* UIProcess/mac/WebInspectorProxyMac.mm:
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::populate):
(WebKit::WebPopupMenuProxyMac::showPopupMenu):
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::modifierFlagsFromWebEvent):
(WebKit::getEventTypeFromWebEvent):
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
(WebKit::cssAlignmentValueForNSTextAlignment):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::convertImageToBitmap):

Source/WTF:

* wtf/mac/AppKitCompatibilityDeclarations.h:

Tools:

* DumpRenderTree/mac/EventSendingController.mm:
(eventTypeForMouseButtonAndAction):
(modifierFlags):
(-[EventSendingController mouseMoveToX:Y:]):
(-[EventSendingController contextClick]):
(-[EventSendingController keyDown:withModifiers:withLocation:]):
* DumpRenderTree/mac/TextInputController.m:
(-[TextInputController interpretKeyEvents:withSender:]):
* TestWebKitAPI/Tests/WebKit2Cocoa/CommandBackForward.mm:
(simulateCommandArrow):
* TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenLayoutConstraints.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenTopContentInset.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm:
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/UserInitiatedActionInNavigationAction.mm:
(UserInitiatedActionTest::SetUp):
(UserInitiatedActionTest::click):
* TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm:
(TestWebKitAPI::AcceptsFirstMouse::runTest):
* TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm:
(TestWebKitAPI::contextMenuCopyLink):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/mac/ContextMenuDefaultItemsHaveTags.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
(TestWebKitAPI::FullscreenZoomInitialFrame::runTest):
* TestWebKitAPI/Tests/mac/MenuTypesForMouseEvents.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/mac/PlatformUtilitiesMac.mm:
(TestWebKitAPI::Util::isKeyDown):
* TestWebKitAPI/mac/PlatformWebViewMac.mm:
(TestWebKitAPI::PlatformWebView::initialize):
(TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress):
(TestWebKitAPI::PlatformWebView::simulateRightClick):
(TestWebKitAPI::PlatformWebView::simulateMouseMove):
(TestWebKitAPI::eventTypeForButton):
(TestWebKitAPI::modifierFlagsForWKModifiers):
* TestWebKitAPI/mac/TestWKWebViewMac.mm:
(__simulated_forceClickAssociatedEventsMask):
(-[TestWKWebViewHostWindow _mouseDownAtPoint:simulatePressure:]):
(-[TestWKWebView _setUpTestWindow:]):
(-[TestWKWebView typeCharacter:]):
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::eventTypeForMouseButtonAndAction):
(WTR::buildModifierFlags):
(WTR::EventSenderProxy::sendMouseDownToStartPressureEvents):
(WTR::EventSenderProxy::mouseForceClick):
(WTR::EventSenderProxy::startAndCancelMouseForceClick):
(WTR::EventSenderProxy::mouseMoveTo):
(WTR::EventSenderProxy::keyDown):
(WTR::EventSenderProxy::swipeGestureWithWheelAndMomentumPhases):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::platformResetStateToConsistentValues):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208455 268f45cc-cd09-0410-ab3c-d52691b4dbfc

75 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/mac/AppKitCompatibilityDeclarations.h
Source/WebCore/ChangeLog
Source/WebCore/WebCorePrefix.h
Source/WebCore/editing/cocoa/HTMLConverter.mm
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/page/mac/TextIndicatorWindow.mm
Source/WebCore/platform/graphics/mac/IconMac.mm
Source/WebCore/platform/ios/wak/WAKAppKitStubs.h
Source/WebCore/platform/mac/CursorMac.mm
Source/WebCore/platform/mac/DragImageMac.mm
Source/WebCore/platform/mac/EventLoopMac.mm
Source/WebCore/platform/mac/PasteboardMac.mm
Source/WebCore/platform/mac/PlatformEventFactoryMac.mm
Source/WebCore/platform/mac/ScrollbarThemeMac.mm
Source/WebCore/platform/mac/ThemeMac.mm
Source/WebCore/platform/mac/WebVideoFullscreenHUDWindowController.mm
Source/WebCore/platform/mac/WebWindowAnimation.mm
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebKit/mac/Carbon/CarbonWindowAdapter.mm
Source/WebKit/mac/Carbon/HIWebView.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebNSEventExtras.m
Source/WebKit/mac/Misc/WebNSViewExtras.m
Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
Source/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm
Source/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm
Source/WebKit/mac/WebCoreSupport/PopupMenuMac.mm
Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
Source/WebKit/mac/WebInspector/WebNodeHighlight.mm
Source/WebKit/mac/WebKitPrefix.h
Source/WebKit/mac/WebView/WebFrameView.mm
Source/WebKit/mac/WebView/WebFullScreenController.mm
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/mac/WebView/WebPDFView.mm
Source/WebKit/mac/WebView/WebTextCompletionController.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/ChildProcessMac.mm
Source/WebKit2/Shared/mac/WebEventFactory.mm
Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm
Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm
Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm
Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
Source/WebKit2/UIProcess/mac/WebPopupMenuProxyMac.mm
Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm
Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/EventSendingController.mm
Tools/DumpRenderTree/mac/TextInputController.m
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/CommandBackForward.mm
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.mm
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenLayoutConstraints.mm
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenTopContentInset.mm
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/UserInitiatedActionInNavigationAction.mm
Tools/TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm
Tools/TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm
Tools/TestWebKitAPI/Tests/mac/ContextMenuDefaultItemsHaveTags.mm
Tools/TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm
Tools/TestWebKitAPI/Tests/mac/MenuTypesForMouseEvents.mm
Tools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm
Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm
Tools/TestWebKitAPI/mac/TestWKWebViewMac.mm
Tools/WebKitTestRunner/mac/EventSenderProxy.mm
Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
Tools/WebKitTestRunner/mac/TestControllerMac.mm

index 39dbb8b..f6f9198 100644 (file)
@@ -1,3 +1,14 @@
+2016-11-09  Chris Dumez  <cdumez@apple.com>
+
+        [Mac] Stop using deprecated AppKit enumeration values
+        https://bugs.webkit.org/show_bug.cgi?id=164494
+
+        Reviewed by Darin Adler.
+
+        Stop using deprecated AppKit enumeration values.
+
+        * wtf/mac/AppKitCompatibilityDeclarations.h:
+
 2016-11-05  Konstantin Tokarev  <annulen@yandex.ru>
 
         Fixed compilation of LLInt with MinGW
index e113e80..94d3dee 100644 (file)
@@ -57,6 +57,10 @@ static const NSCompositingOperation NSCompositingOperationSourceOver = NSComposi
 
 static const NSControlSize NSControlSizeRegular = NSRegularControlSize;
 static const NSControlSize NSControlSizeSmall = NSSmallControlSize;
+static const NSControlSize NSControlSizeMini = NSMiniControlSize;
+
+static const NSSliderType NSSliderTypeLinear = NSLinearSlider;
+static const NSSliderType NSSliderTypeCircular = NSCircularSlider;
 
 static const NSEventMask NSEventMaskAny = NSAnyEventMask;
 static const NSEventMask NSEventMaskFlagsChanged = NSFlagsChangedMask;
@@ -83,12 +87,15 @@ static const NSEventModifierFlags NSEventModifierFlagNumericPad = NSNumericPadKe
 static const NSEventModifierFlags NSEventModifierFlagShift = NSShiftKeyMask;
 static const NSEventModifierFlags NSEventModifierFlagHelp = NSHelpKeyMask;
 
+static const NSEventType NSEventTypeApplicationDefined = NSApplicationDefined;
 static const NSEventType NSEventTypeFlagsChanged = NSFlagsChanged;
 static const NSEventType NSEventTypeKeyDown = NSKeyDown;
 static const NSEventType NSEventTypeKeyUp = NSKeyUp;
 static const NSEventType NSEventTypeLeftMouseDown = NSLeftMouseDown;
 static const NSEventType NSEventTypeLeftMouseDragged = NSLeftMouseDragged;
 static const NSEventType NSEventTypeLeftMouseUp = NSLeftMouseUp;
+static const NSEventType NSEventTypeMouseEntered = NSMouseEntered;
+static const NSEventType NSEventTypeMouseExited = NSMouseExited;
 static const NSEventType NSEventTypeMouseMoved = NSMouseMoved;
 static const NSEventType NSEventTypeOtherMouseDown = NSOtherMouseDown;
 static const NSEventType NSEventTypeOtherMouseDragged = NSOtherMouseDragged;
@@ -105,6 +112,11 @@ static const NSTextAlignment NSTextAlignmentRight = NSRightTextAlignment;
 static const NSTextAlignment NSTextAlignmentCenter = NSCenterTextAlignment;
 static const NSTextAlignment NSTextAlignmentLeft = NSLeftTextAlignment;
 static const NSTextAlignment NSTextAlignmentNatural = NSNaturalTextAlignment;
+static const NSTextAlignment NSTextAlignmentJustified = NSJustifiedTextAlignment;
+
+typedef NSInteger NSWritingDirectionFormatType;
+static const NSWritingDirectionFormatType = NSTextWritingDirectionOverride;
+static const NSWritingDirectionEmbedding = NSTextWritingDirectionEmbedding;
 #endif
 
 typedef NSUInteger NSWindowStyleMask;
index b08f825..1203c42 100644 (file)
@@ -1,3 +1,73 @@
+2016-11-09  Chris Dumez  <cdumez@apple.com>
+
+        [Mac] Stop using deprecated AppKit enumeration values
+        https://bugs.webkit.org/show_bug.cgi?id=164494
+
+        Reviewed by Darin Adler.
+
+        Stop using deprecated AppKit enumeration values.
+
+        * editing/cocoa/HTMLConverter.mm:
+        (HTMLConverter::computedAttributesForElement):
+        (HTMLConverter::_processElement):
+        (HTMLConverter::_addMarkersToList):
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::EventHandler::keyEvent):
+        (WebCore::lastEventIsMouseUp):
+        (WebCore::EventHandler::passSubframeEventToSubframe):
+        (WebCore::EventHandler::widgetDidHandleWheelEvent):
+        (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
+        * page/mac/TextIndicatorWindow.mm:
+        (WebCore::TextIndicatorWindow::setTextIndicator):
+        * platform/graphics/mac/IconMac.mm:
+        (WebCore::Icon::paint):
+        * platform/mac/CursorMac.mm:
+        (WebCore::createCustomCursor):
+        * platform/mac/DragImageMac.mm:
+        (WebCore::dissolveDragImageToFraction):
+        (WebCore::createDragImageFromImage):
+        * platform/mac/EventLoopMac.mm:
+        (WebCore::EventLoop::cycle):
+        * platform/mac/PasteboardMac.mm:
+        (WebCore::Pasteboard::setDragImage):
+        * platform/mac/PlatformEventFactoryMac.mm:
+        (WebCore::globalPointForEvent):
+        (WebCore::pointForEvent):
+        (WebCore::mouseButtonForEvent):
+        (WebCore::mouseEventTypeForEvent):
+        (WebCore::clickCountForEvent):
+        (WebCore::isKeypadEvent):
+        (WebCore::windowsKeyCodeForKeyEvent):
+        (WebCore::isKeyUpEvent):
+        (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
+        * platform/mac/ScrollbarThemeMac.mm:
+        (WebCore::scrollbarControlSizeToNSControlSize):
+        * platform/mac/ThemeMac.mm:
+        (-[WebCoreThemeView window]):
+        (WebCore::controlSizeForFont):
+        (WebCore::controlSizeFromPixelSize):
+        (WebCore::setUpButtonCell):
+        (WebCore::stepperControlSizeForFont):
+        (WebCore::paintStepper):
+        (WebCore::ThemeMac::minimumControlSize):
+        * platform/mac/WebVideoFullscreenHUDWindowController.mm:
+        (-[WebVideoFullscreenHUDWindow initWithContentRect:styleMask:backing:defer:]):
+        (-[WebVideoFullscreenHUDWindow performKeyEquivalent:]):
+        (-[WebVideoFullscreenHUDWindowController init]):
+        (-[WebVideoFullscreenHUDWindowController keyDown:]):
+        (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
+        * platform/mac/WebWindowAnimation.mm:
+        (WebWindowAnimationDurationFromDuration):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::updateCachedSystemFontDescription):
+        (WebCore::RenderThemeMac::controlSizeForFont):
+        (WebCore::RenderThemeMac::controlSizeForCell):
+        (WebCore::RenderThemeMac::controlSizeForSystemFont):
+        (WebCore::RenderThemeMac::paintProgressBar):
+        (WebCore::RenderThemeMac::popupMenuSize):
+        (WebCore::RenderThemeMac::sliderThumbHorizontal):
+        (WebCore::RenderThemeMac::sliderThumbVertical):
+
 2016-11-08  Antoine Quint  <graouts@apple.com>
 
         [Modern Media Controls] UI Library: iOS inline controls
index d5493de..9157566 100644 (file)
 #if PLATFORM(IOS)
 #import <Foundation/Foundation.h>
 #else
+#if USE(APPKIT)
 #import <Cocoa/Cocoa.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
+#endif
 #endif // PLATFORM(IOS)
 #endif
 
index 94fc7ed..96cc0f5 100644 (file)
@@ -113,10 +113,6 @@ SOFT_LINK_CLASS(UIFoundation, NSTextTab)
 #define PlatformFont                NSFont
 #define PlatformFontClass           NSFont
 
-#define NSTextAlignmentLeft         NSLeftTextAlignment
-#define NSTextAlignmentRight        NSRightTextAlignment
-#define NSTextAlignmentCenter       NSCenterTextAlignment
-#define NSTextAlignmentJustified    NSJustifiedTextAlignment
 #endif
 
 using namespace WebCore;
@@ -184,10 +180,10 @@ typedef NS_ENUM(NSInteger, NSWritingDirection) {
     NSWritingDirectionRightToLeft   =  1     // Right to left writing direction
 } NS_ENUM_AVAILABLE_IOS(6_0);
 
-typedef NS_ENUM(NSInteger, NSTextWritingDirection) {
-    NSTextWritingDirectionEmbedding     = (0 << 1),
-    NSTextWritingDirectionOverride      = (1 << 1)
-} NS_ENUM_AVAILABLE_IOS(7_0);
+typedef NS_ENUM(NSInteger, NSWritingDirectionFormatType) {
+    NSWritingDirectionEmbedding     = (0 << 1),
+    NSWritingDirectionOverride      = (1 << 1)
+} NS_ENUM_AVAILABLE_IOS(9_0);
 
 enum {
     NSEnterCharacter                = 0x0003,
@@ -1210,8 +1206,6 @@ NSDictionary *HTMLConverter::computedAttributesForElement(Element& element)
         String textAlign = _caches->propertyValueForNode(coreBlockElement, CSSPropertyTextAlign);
         if (textAlign.length()) {
             // WebKit can return -khtml-left, -khtml-right, -khtml-center
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
             if (textAlign.endsWith("left"))
                 [paragraphStyle setAlignment:NSTextAlignmentLeft];
             else if (textAlign.endsWith("right"))
@@ -1220,7 +1214,6 @@ NSDictionary *HTMLConverter::computedAttributesForElement(Element& element)
                 [paragraphStyle setAlignment:NSTextAlignmentCenter];
             else if (textAlign.endsWith("justify"))
                 [paragraphStyle setAlignment:NSTextAlignmentJustified];
-#pragma clang diagnostic pop
         }
 
         String direction = _caches->propertyValueForNode(coreBlockElement, CSSPropertyDirection);
@@ -1851,18 +1844,12 @@ BOOL HTMLConverter::_processElement(Element& element, NSInteger depth)
     else {
         String bidi = _caches->propertyValueForNode(element, CSSPropertyUnicodeBidi);
         if (bidi == "embed") {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-            NSUInteger val = NSTextWritingDirectionEmbedding;
-#pragma clang diagnostic pop
+            NSUInteger val = NSWritingDirectionEmbedding;
             if (_caches->propertyValueForNode(element, CSSPropertyDirection) == "rtl")
                 val |= NSWritingDirectionRightToLeft;
             [_writingDirectionArray addObject:[NSNumber numberWithUnsignedInteger:val]];
         } else if (bidi == "bidi-override") {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-            NSUInteger val = NSTextWritingDirectionOverride;
-#pragma clang diagnostic pop
+            NSUInteger val = NSWritingDirectionOverride;
             if (_caches->propertyValueForNode(element, CSSPropertyDirection) == "rtl")
                 val |= NSWritingDirectionRightToLeft;
             [_writingDirectionArray addObject:[NSNumber numberWithUnsignedInteger:val]];
@@ -2063,14 +2050,7 @@ void HTMLConverter::_addMarkersToList(NSTextList *list, NSRange range)
                     tab = [[PlatformNSTextTab alloc] initWithType:NSLeftTabStopType location:markerLocation];
                     [newStyle addTabStop:tab];
                     [tab release];
-#if PLATFORM(IOS)
                     tab = [[PlatformNSTextTab alloc] initWithTextAlignment:NSTextAlignmentNatural location:listLocation options:@{ }];
-#else
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-                    tab = [[PlatformNSTextTab alloc] initWithTextAlignment:NSNaturalTextAlignment location:listLocation options:@{ }];
-#pragma clang diagnostic pop
-#endif
                     [newStyle addTabStop:tab];
                     [tab release];
                     [_attrStr addAttribute:NSParagraphStyleAttributeName value:newStyle range:paragraphRange];
index 335e626..b035270 100644 (file)
@@ -150,10 +150,7 @@ bool EventHandler::keyEvent(NSEvent *event)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    ASSERT([event type] == NSKeyDown || [event type] == NSKeyUp);
-#pragma clang diagnostic pop
+    ASSERT([event type] == NSEventTypeKeyDown || [event type] == NSEventTypeKeyUp);
 
     CurrentEventScope scope(event, nil);
     return keyEvent(PlatformEventFactory::createPlatformKeyboardEvent(event));
@@ -206,12 +203,9 @@ static bool lastEventIsMouseUp()
 
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     NSEvent *currentEventAfterHandlingMouseDown = [NSApp currentEvent];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     return EventHandler::currentNSEvent() != currentEventAfterHandlingMouseDown
-        && [currentEventAfterHandlingMouseDown type] == NSLeftMouseUp
+        && [currentEventAfterHandlingMouseDown type] == NSEventTypeLeftMouseUp
         && [currentEventAfterHandlingMouseDown timestamp] >= [EventHandler::currentNSEvent() timestamp];
-#pragma clang diagnostic pop
     END_BLOCK_OBJC_EXCEPTIONS;
 
     return false;
@@ -375,58 +369,55 @@ bool EventHandler::passSubframeEventToSubframe(MouseEventWithHitTestResults& eve
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     switch ([currentNSEvent() type]) {
-        case NSLeftMouseDragged:
-        case NSOtherMouseDragged:
-        case NSRightMouseDragged:
-            // This check is bogus and results in <rdar://6813830>, but removing it breaks a number of
-            // layout tests.
-            if (!m_mouseDownWasInSubframe)
-                return false;
+    case NSEventTypeLeftMouseDragged:
+    case NSEventTypeOtherMouseDragged:
+    case NSEventTypeRightMouseDragged:
+        // This check is bogus and results in <rdar://6813830>, but removing it breaks a number of
+        // layout tests.
+        if (!m_mouseDownWasInSubframe)
+            return false;
 #if ENABLE(DRAG_SUPPORT)
-            if (subframe->page()->dragController().didInitiateDrag())
-                return false;
+        if (subframe->page()->dragController().didInitiateDrag())
+            return false;
 #endif
-        case NSMouseMoved:
-            // Since we're passing in currentNSEvent() here, we can call
-            // handleMouseMoveEvent() directly, since the save/restore of
-            // currentNSEvent() that mouseMoved() does would have no effect.
-            ASSERT(!m_sendingEventToSubview);
-            m_sendingEventToSubview = true;
-            subframe->eventHandler().handleMouseMoveEvent(currentPlatformMouseEvent(), hoveredNode);
-            m_sendingEventToSubview = false;
-            return true;
+    case NSEventTypeMouseMoved:
+        // Since we're passing in currentNSEvent() here, we can call
+        // handleMouseMoveEvent() directly, since the save/restore of
+        // currentNSEvent() that mouseMoved() does would have no effect.
+        ASSERT(!m_sendingEventToSubview);
+        m_sendingEventToSubview = true;
+        subframe->eventHandler().handleMouseMoveEvent(currentPlatformMouseEvent(), hoveredNode);
+        m_sendingEventToSubview = false;
+        return true;
         
-        case NSLeftMouseDown: {
-            Node* node = event.targetNode();
-            if (!node)
-                return false;
-            auto* renderer = node->renderer();
-            if (!is<RenderWidget>(renderer))
-                return false;
-            Widget* widget = downcast<RenderWidget>(*renderer).widget();
-            if (!widget || !widget->isFrameView())
-                return false;
-            if (!passWidgetMouseDownEventToWidget(downcast<RenderWidget>(renderer)))
-                return false;
-            m_mouseDownWasInSubframe = true;
-            return true;
-        }
-        case NSLeftMouseUp: {
-            if (!m_mouseDownWasInSubframe)
-                return false;
-            ASSERT(!m_sendingEventToSubview);
-            m_sendingEventToSubview = true;
-            subframe->eventHandler().handleMouseReleaseEvent(currentPlatformMouseEvent());
-            m_sendingEventToSubview = false;
-            return true;
-        }
-        default:
+    case NSEventTypeLeftMouseDown: {
+        Node* node = event.targetNode();
+        if (!node)
+            return false;
+        auto* renderer = node->renderer();
+        if (!is<RenderWidget>(renderer))
             return false;
+        Widget* widget = downcast<RenderWidget>(*renderer).widget();
+        if (!widget || !widget->isFrameView())
+            return false;
+        if (!passWidgetMouseDownEventToWidget(downcast<RenderWidget>(renderer)))
+            return false;
+        m_mouseDownWasInSubframe = true;
+        return true;
+    }
+    case NSEventTypeLeftMouseUp: {
+        if (!m_mouseDownWasInSubframe)
+            return false;
+        ASSERT(!m_sendingEventToSubview);
+        m_sendingEventToSubview = true;
+        subframe->eventHandler().handleMouseReleaseEvent(currentPlatformMouseEvent());
+        m_sendingEventToSubview = false;
+        return true;
+    }
+    default:
+        return false;
     }
-#pragma clang diagnostic pop
     END_BLOCK_OBJC_EXCEPTIONS;
 
     return false;
@@ -479,11 +470,8 @@ bool EventHandler::widgetDidHandleWheelEvent(const PlatformWheelEvent& wheelEven
         return downcast<FrameView>(widget).frame().eventHandler().handleWheelEvent(wheelEvent);
     }
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([currentNSEvent() type] != NSScrollWheel || m_sendingEventToSubview)
+    if ([currentNSEvent() type] != NSEventTypeScrollWheel || m_sendingEventToSubview)
         return false;
-#pragma clang diagnostic pop
 
     ASSERT(nodeView);
     ASSERT([nodeView superview]);
@@ -586,12 +574,10 @@ void EventHandler::sendFakeEventsAfterWidgetTracking(NSEvent *initiatingEvent)
 
     m_sendingEventToSubview = false;
     int eventType = [initiatingEvent type];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if (eventType == NSLeftMouseDown || eventType == NSKeyDown) {
+    if (eventType == NSEventTypeLeftMouseDown || eventType == NSEventTypeKeyDown) {
         NSEvent *fakeEvent = nil;
-        if (eventType == NSLeftMouseDown) {
-            fakeEvent = [NSEvent mouseEventWithType:NSLeftMouseUp
+        if (eventType == NSEventTypeLeftMouseDown) {
+            fakeEvent = [NSEvent mouseEventWithType:NSEventTypeLeftMouseUp
                                            location:[initiatingEvent locationInWindow]
                                       modifierFlags:[initiatingEvent modifierFlags]
                                           timestamp:[initiatingEvent timestamp]
@@ -602,8 +588,8 @@ void EventHandler::sendFakeEventsAfterWidgetTracking(NSEvent *initiatingEvent)
                                            pressure:[initiatingEvent pressure]];
         
             [NSApp postEvent:fakeEvent atStart:YES];
-        } else { // eventType == NSKeyDown
-            fakeEvent = [NSEvent keyEventWithType:NSKeyUp
+        } else { // eventType == NSEventTypeKeyDown
+            fakeEvent = [NSEvent keyEventWithType:NSEventTypeKeyUp
                                          location:[initiatingEvent locationInWindow]
                                     modifierFlags:[initiatingEvent modifierFlags]
                                         timestamp:[initiatingEvent timestamp]
@@ -619,8 +605,12 @@ void EventHandler::sendFakeEventsAfterWidgetTracking(NSEvent *initiatingEvent)
         // FIXME: We should really get the current modifierFlags here, but there's no way to poll
         // them in Cocoa, and because the event stream was stolen by the Carbon menu code we have
         // no up-to-date cache of them anywhere.
-        fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved
-                                       location:[[view->platformWidget() window] convertScreenToBase:[NSEvent mouseLocation]]
+        fakeEvent = [NSEvent mouseEventWithType:NSEventTypeMouseMoved
+                                       location:[[view->platformWidget() window]
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+                                  convertScreenToBase:[NSEvent mouseLocation]]
+#pragma clang diagnostic pop
                                   modifierFlags:[initiatingEvent modifierFlags]
                                       timestamp:[initiatingEvent timestamp]
                                    windowNumber:[initiatingEvent windowNumber]
@@ -628,7 +618,6 @@ void EventHandler::sendFakeEventsAfterWidgetTracking(NSEvent *initiatingEvent)
                                     eventNumber:0
                                      clickCount:0
                                        pressure:0];
-#pragma clang diagnostic pop
         [NSApp postEvent:fakeEvent atStart:YES];
     }
     
index a74da85..e4e20d2 100644 (file)
@@ -457,13 +457,10 @@ void TextIndicatorWindow::setTextIndicator(Ref<TextIndicator> textIndicator, CGR
     verticalMargin = CGCeiling(verticalMargin);
 
     CGRect contentRect = CGRectInset(textBoundingRectInScreenCoordinates, -horizontalMargin, -verticalMargin);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSRect windowContentRect = [NSWindow contentRectForFrameRect:NSRectFromCGRect(contentRect) styleMask:NSBorderlessWindowMask];
+    NSRect windowContentRect = [NSWindow contentRectForFrameRect:NSRectFromCGRect(contentRect) styleMask:NSWindowStyleMaskBorderless];
     NSRect integralWindowContentRect = NSIntegralRect(windowContentRect);
     NSPoint fractionalTextOffset = NSMakePoint(windowContentRect.origin.x - integralWindowContentRect.origin.x, windowContentRect.origin.y - integralWindowContentRect.origin.y);
-    m_textIndicatorWindow = adoptNS([[NSWindow alloc] initWithContentRect:integralWindowContentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
-#pragma clang diagnostic pop
+    m_textIndicatorWindow = adoptNS([[NSWindow alloc] initWithContentRect:integralWindowContentRect styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]);
     [m_textIndicatorWindow setBackgroundColor:[NSColor clearColor]];
     [m_textIndicatorWindow setOpaque:NO];
     [m_textIndicatorWindow setIgnoresMouseEvents:YES];
index 5a49f3a..211fc83 100644 (file)
@@ -28,7 +28,7 @@
 #import "LocalCurrentGraphicsContext.h"
 #import "UTIUtilities.h"
 #import <wtf/RefPtr.h>
-#include <wtf/text/WTFString.h>
+#import <wtf/text/WTFString.h>
 
 namespace WebCore {
 
@@ -98,10 +98,7 @@ void Icon::paint(GraphicsContext& context, const FloatRect& rect)
 
     LocalCurrentGraphicsContext localCurrentGC(context);
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    [m_nsImage drawInRect:rect fromRect:NSMakeRect(0, 0, [m_nsImage size].width, [m_nsImage size].height) operation:NSCompositeSourceOver fraction:1.0f];
-#pragma clang diagnostic pop
+    [m_nsImage drawInRect:rect fromRect:NSMakeRect(0, 0, [m_nsImage size].width, [m_nsImage size].height) operation:NSCompositingOperationSourceOver fraction:1.0f];
 }
 
 }
index 1166189..428d693 100644 (file)
@@ -154,15 +154,15 @@ typedef NSUInteger NSRectEdge;
 
 /* Device-independent bits found in event modifier flags */
 enum {
-    NSAlphaShiftKeyMask = 1 << 16,
-    NSShiftKeyMask =      1 << 17,
-    NSControlKeyMask =    1 << 18,
-    NSAlternateKeyMask =  1 << 19,
-    NSCommandKeyMask =    1 << 20,
-    NSNumericPadKeyMask = 1 << 21,
-    NSHelpKeyMask =       1 << 22,
-    NSFunctionKeyMask =   1 << 23,
-    NSDeviceIndependentModifierFlagsMask = 0xffff0000U
+    NSEventModifierFlagCapsLock = 1 << 16,
+    NSEventModifierFlagShift = 1 << 17,
+    NSEventModifierFlagControl = 1 << 18,
+    NSEventModifierFlagOption = 1 << 19,
+    NSEventModifierFlagCommand = 1 << 20,
+    NSEventModifierFlagNumericPad = 1 << 21,
+    NSEventModifierFlagHelp = 1 << 22,
+    NSEventModifierFlagFunction = 1 << 23,
+    NSEventModifierFlagDeviceIndependentFlagsMask = 0xffff0000U
 };
 
 typedef enum _WKWritingDirection {
index a6d7832..85cc7c5 100644 (file)
@@ -64,10 +64,7 @@ static RetainPtr<NSCursor> createCustomCursor(Image* image, const IntPoint& hotS
         NSRect fromRect = NSMakeRect(0, 0, image->width(), image->height());
 
         [expandedImage lockFocus];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        [nsImage drawInRect:toRect fromRect:fromRect operation:NSCompositeSourceOver fraction:1];
-#pragma clang diagnostic pop
+        [nsImage drawInRect:toRect fromRect:fromRect operation:NSCompositingOperationSourceOver fraction:1];
         [expandedImage unlockFocus];
 
         return adoptNS([[NSCursor alloc] initWithImage:expandedImage.get() hotSpot:hotSpot]);
index 68246be..d2f8f70 100644 (file)
@@ -75,10 +75,7 @@ RetainPtr<NSImage> dissolveDragImageToFraction(RetainPtr<NSImage> image, float d
     RetainPtr<NSImage> dissolvedImage = adoptNS([[NSImage alloc] initWithSize:[image.get() size]]);
     
     [dissolvedImage.get() lockFocus];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    [image.get() drawAtPoint:NSZeroPoint fromRect:NSMakeRect(0, 0, [image size].width, [image size].height) operation:NSCompositeCopy fraction:delta];
-#pragma clang diagnostic pop
+    [image.get() drawAtPoint:NSZeroPoint fromRect:NSMakeRect(0, 0, [image size].width, [image size].height) operation:NSCompositingOperationCopy fraction:delta];
     [dissolvedImage.get() unlockFocus];
 
     return dissolvedImage;
@@ -119,10 +116,8 @@ RetainPtr<NSImage> createDragImageFromImage(Image* image, ImageOrientationDescri
             [cocoaTransform.get() setTransformStruct:*(NSAffineTransformStruct*)&transform];
             [cocoaTransform.get() concat];
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-            [image->snapshotNSImage() drawInRect:destRect fromRect:NSMakeRect(0, 0, size.width(), size.height()) operation:NSCompositeSourceOver fraction:1.0];
-#pragma clang diagnostic pop
+            [image->snapshotNSImage() drawInRect:destRect fromRect:NSMakeRect(0, 0, size.width(), size.height()) operation:NSCompositingOperationSourceOver fraction:1.0];
+
             [rotatedDragImage.get() unlockFocus];
 
             return rotatedDragImage;
index af0a399..36c46cc 100644 (file)
@@ -31,10 +31,7 @@ namespace WebCore {
 void EventLoop::cycle()
 {
     [NSApp setWindowsNeedUpdate:YES];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    [NSApp sendEvent:[NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate dateWithTimeIntervalSinceNow:0.05] inMode:NSDefaultRunLoopMode dequeue:YES]];
-#pragma clang diagnostic pop
+    [NSApp sendEvent:[NSApp nextEventMatchingMask:NSEventMaskAny untilDate:[NSDate dateWithTimeIntervalSinceNow:0.05] inMode:NSDefaultRunLoopMode dequeue:YES]];
 }
 
 } // namespace WebCore
index a5df347..929bb30 100644 (file)
@@ -653,11 +653,8 @@ void Pasteboard::setDragImage(DragImageRef image, const IntPoint& location)
     // Hack: We must post an event to wake up the NSDragManager, which is sitting in a nextEvent call
     // up the stack from us because the CoreFoundation drag manager does not use the run loop by itself.
     // This is the most innocuous event to use, per Kristen Forster.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSEvent* event = [NSEvent mouseEventWithType:NSMouseMoved location:NSZeroPoint
+    NSEvent* event = [NSEvent mouseEventWithType:NSEventTypeMouseMoved location:NSZeroPoint
         modifierFlags:0 timestamp:0 windowNumber:0 context:nil eventNumber:0 clickCount:0 pressure:0];
-#pragma clang diagnostic pop
     [NSApp postEvent:event atStart:YES];
 }
 #endif
index d34d6ea..7705d16 100644 (file)
@@ -36,7 +36,6 @@
 #import <HIToolbox/Events.h>
 #import <mach/mach_time.h>
 #import <wtf/ASCIICType.h>
-#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 namespace WebCore {
 
@@ -52,27 +51,24 @@ static NSPoint globalPointForEvent(NSEvent *event)
 {
     switch ([event type]) {
 #if defined(__LP64__) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101003
-        case NSEventTypePressure:
+    case NSEventTypePressure:
 #endif
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        case NSLeftMouseDown:
-        case NSLeftMouseDragged:
-        case NSLeftMouseUp:
-        case NSMouseEntered:
-        case NSMouseExited:
-        case NSMouseMoved:
-        case NSOtherMouseDown:
-        case NSOtherMouseDragged:
-        case NSOtherMouseUp:
-        case NSRightMouseDown:
-        case NSRightMouseDragged:
-        case NSRightMouseUp:
-        case NSScrollWheel:
-#pragma clang diagnostic pop
-            return globalPoint([event locationInWindow], [event window]);
-        default:
-            return { 0, 0 };
+    case NSEventTypeLeftMouseDown:
+    case NSEventTypeLeftMouseDragged:
+    case NSEventTypeLeftMouseUp:
+    case NSEventTypeMouseEntered:
+    case NSEventTypeMouseExited:
+    case NSEventTypeMouseMoved:
+    case NSEventTypeOtherMouseDown:
+    case NSEventTypeOtherMouseDragged:
+    case NSEventTypeOtherMouseUp:
+    case NSEventTypeRightMouseDown:
+    case NSEventTypeRightMouseDragged:
+    case NSEventTypeRightMouseUp:
+    case NSEventTypeScrollWheel:
+        return globalPoint([event locationInWindow], [event window]);
+    default:
+        return { 0, 0 };
     }
 }
 
@@ -80,33 +76,30 @@ static IntPoint pointForEvent(NSEvent *event, NSView *windowView)
 {
     switch ([event type]) {
 #if defined(__LP64__) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101003
-        case NSEventTypePressure:
+    case NSEventTypePressure:
 #endif
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        case NSLeftMouseDown:
-        case NSLeftMouseDragged:
-        case NSLeftMouseUp:
-        case NSMouseEntered:
-        case NSMouseExited:
-        case NSMouseMoved:
-        case NSOtherMouseDown:
-        case NSOtherMouseDragged:
-        case NSOtherMouseUp:
-        case NSRightMouseDown:
-        case NSRightMouseDragged:
-        case NSRightMouseUp:
-        case NSScrollWheel: {
-            // Note: This will have its origin at the bottom left of the window unless windowView is flipped.
-            // In those cases, the Y coordinate gets flipped by Widget::convertFromContainingWindow.
-            NSPoint location = [event locationInWindow];
-            if (windowView)
-                location = [windowView convertPoint:location fromView:nil];
-            return IntPoint(location);
-        }
-#pragma clang diagnostic pop
-        default:
-            return IntPoint();
+    case NSEventTypeLeftMouseDown:
+    case NSEventTypeLeftMouseDragged:
+    case NSEventTypeLeftMouseUp:
+    case NSEventTypeMouseEntered:
+    case NSEventTypeMouseExited:
+    case NSEventTypeMouseMoved:
+    case NSEventTypeOtherMouseDown:
+    case NSEventTypeOtherMouseDragged:
+    case NSEventTypeOtherMouseUp:
+    case NSEventTypeRightMouseDown:
+    case NSEventTypeRightMouseDragged:
+    case NSEventTypeRightMouseUp:
+    case NSEventTypeScrollWheel: {
+        // Note: This will have its origin at the bottom left of the window unless windowView is flipped.
+        // In those cases, the Y coordinate gets flipped by Widget::convertFromContainingWindow.
+        NSPoint location = [event locationInWindow];
+        if (windowView)
+            location = [windowView convertPoint:location fromView:nil];
+        return IntPoint(location);
+    }
+    default:
+        return IntPoint();
     }
 }
 
@@ -114,72 +107,63 @@ static MouseButton mouseButtonForEvent(NSEvent *event)
 {
     switch ([event type]) {
 #if defined(__LP64__) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101003
-        case NSEventTypePressure:
+    case NSEventTypePressure:
 #endif
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        case NSLeftMouseDown:
-        case NSLeftMouseUp:
-        case NSLeftMouseDragged:
-            return LeftButton;
-        case NSRightMouseDown:
-        case NSRightMouseUp:
-        case NSRightMouseDragged:
-            return RightButton;
-        case NSOtherMouseDown:
-        case NSOtherMouseUp:
-        case NSOtherMouseDragged:
-            return MiddleButton;
-#pragma clang diagnostic pop
-        default:
-            return NoButton;
+    case NSEventTypeLeftMouseDown:
+    case NSEventTypeLeftMouseUp:
+    case NSEventTypeLeftMouseDragged:
+        return LeftButton;
+    case NSEventTypeRightMouseDown:
+    case NSEventTypeRightMouseUp:
+    case NSEventTypeRightMouseDragged:
+        return RightButton;
+    case NSEventTypeOtherMouseDown:
+    case NSEventTypeOtherMouseUp:
+    case NSEventTypeOtherMouseDragged:
+        return MiddleButton;
+    default:
+        return NoButton;
     }
 }
 
 static PlatformEvent::Type mouseEventTypeForEvent(NSEvent* event)
 {
     switch ([event type]) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        case NSLeftMouseDragged:
-        case NSMouseEntered:
-        case NSMouseExited:
-        case NSMouseMoved:
-        case NSOtherMouseDragged:
-        case NSRightMouseDragged:
-            return PlatformEvent::MouseMoved;
-        case NSLeftMouseDown:
-        case NSRightMouseDown:
-        case NSOtherMouseDown:
-            return PlatformEvent::MousePressed;
-        case NSLeftMouseUp:
-        case NSRightMouseUp:
-        case NSOtherMouseUp:
-            return PlatformEvent::MouseReleased;
-#pragma clang diagnostic pop
-        default:
-            return PlatformEvent::MouseMoved;
+    case NSEventTypeLeftMouseDragged:
+    case NSEventTypeMouseEntered:
+    case NSEventTypeMouseExited:
+    case NSEventTypeMouseMoved:
+    case NSEventTypeOtherMouseDragged:
+    case NSEventTypeRightMouseDragged:
+        return PlatformEvent::MouseMoved;
+    case NSEventTypeLeftMouseDown:
+    case NSEventTypeRightMouseDown:
+    case NSEventTypeOtherMouseDown:
+        return PlatformEvent::MousePressed;
+    case NSEventTypeLeftMouseUp:
+    case NSEventTypeRightMouseUp:
+    case NSEventTypeOtherMouseUp:
+        return PlatformEvent::MouseReleased;
+    default:
+        return PlatformEvent::MouseMoved;
     }
 }
 
 static int clickCountForEvent(NSEvent *event)
 {
     switch ([event type]) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        case NSLeftMouseDown:
-        case NSLeftMouseUp:
-        case NSLeftMouseDragged:
-        case NSRightMouseDown:
-        case NSRightMouseUp:
-        case NSRightMouseDragged:
-        case NSOtherMouseDown:
-        case NSOtherMouseUp:
-        case NSOtherMouseDragged:
-#pragma clang diagnostic pop
-            return [event clickCount];
-        default:
-            return 0;
+    case NSEventTypeLeftMouseDown:
+    case NSEventTypeLeftMouseUp:
+    case NSEventTypeLeftMouseDragged:
+    case NSEventTypeRightMouseDown:
+    case NSEventTypeRightMouseUp:
+    case NSEventTypeRightMouseDragged:
+    case NSEventTypeOtherMouseDown:
+    case NSEventTypeOtherMouseUp:
+    case NSEventTypeOtherMouseDragged:
+        return [event clickCount];
+    default:
+        return 0;
     }
 }
 
@@ -497,28 +481,28 @@ String keyIdentifierForKeyEvent(NSEvent* event)
 {
     if ([event type] == NSEventTypeFlagsChanged) {
         switch ([event keyCode]) {
-            case 54: // Right Command
-            case 55: // Left Command
-                return String("Meta");
-                
-            case 57: // Capslock
-                return String("CapsLock");
-                
-            case 56: // Left Shift
-            case 60: // Right Shift
-                return String("Shift");
-                
-            case 58: // Left Alt
-            case 61: // Right Alt
-                return String("Alt");
-                
-            case 59: // Left Ctrl
-            case 62: // Right Ctrl
-                return String("Control");
-                
-            default:
-                ASSERT_NOT_REACHED();
-                return emptyString();
+        case 54: // Right Command
+        case 55: // Left Command
+            return String("Meta");
+
+        case 57: // Capslock
+            return String("CapsLock");
+
+        case 56: // Left Shift
+        case 60: // Right Shift
+            return String("Shift");
+
+        case 58: // Left Alt
+        case 61: // Right Alt
+            return String("Alt");
+
+        case 59: // Left Ctrl
+        case 62: // Right Ctrl
+            return String("Control");
+
+        default:
+            ASSERT_NOT_REACHED();
+            return emptyString();
         }
     }
     
@@ -534,44 +518,38 @@ static bool isKeypadEvent(NSEvent* event)
 {
     // Check that this is the type of event that has a keyCode.
     switch ([event type]) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        case NSKeyDown:
-        case NSKeyUp:
-        case NSFlagsChanged:
-            break;
-#pragma clang diagnostic pop
-        default:
-            return false;
+    case NSEventTypeKeyDown:
+    case NSEventTypeKeyUp:
+    case NSEventTypeFlagsChanged:
+        break;
+    default:
+        return false;
     }
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([event modifierFlags] & NSNumericPadKeyMask)
-#pragma clang diagnostic pop
+    if ([event modifierFlags] & NSEventModifierFlagNumericPad)
         return true;
 
     switch ([event keyCode]) {
-        case 71: // Clear
-        case 81: // =
-        case 75: // /
-        case 67: // *
-        case 78: // -
-        case 69: // +
-        case 76: // Enter
-        case 65: // .
-        case 82: // 0
-        case 83: // 1
-        case 84: // 2
-        case 85: // 3
-        case 86: // 4
-        case 87: // 5
-        case 88: // 6
-        case 89: // 7
-        case 91: // 8
-        case 92: // 9
-            return true;
-     }
+    case 71: // Clear
+    case 81: // =
+    case 75: // /
+    case 67: // *
+    case 78: // -
+    case 69: // +
+    case 76: // Enter
+    case 65: // .
+    case 82: // 0
+    case 83: // 1
+    case 84: // 2
+    case 85: // 3
+    case 86: // 4
+    case 87: // 5
+    case 88: // 6
+    case 89: // 7
+    case 91: // 8
+    case 92: // 9
+        return true;
+    }
      
      return false;
 }
@@ -585,10 +563,7 @@ int windowsKeyCodeForKeyEvent(NSEvent* event)
     // 2. Keys for which there is no known Mac virtual key codes, like PrintScreen.
     // 3. Certain punctuation keys. On Windows, these are also remapped depending on current keyboard layout,
     //    but see comment in windowsKeyCodeForCharCode().
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if (!isKeypadEvent(event) && ([event type] == NSKeyDown || [event type] == NSKeyUp)) {
-#pragma clang diagnostic pop
+    if (!isKeypadEvent(event) && ([event type] == NSEventTypeKeyDown || [event type] == NSEventTypeKeyUp)) {
         // Cmd switches Roman letters for Dvorak-QWERTY layout, so try modified characters first.
         NSString* s = [event characters];
         code = [s length] > 0 ? windowsKeyCodeForCharCode([s characterAtIndex:0]) : 0;
@@ -646,35 +621,32 @@ double eventTimeStampSince1970(NSEvent* event)
 
 static inline bool isKeyUpEvent(NSEvent *event)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([event type] != NSFlagsChanged)
-        return [event type] == NSKeyUp;
+    if ([event type] != NSEventTypeFlagsChanged)
+        return [event type] == NSEventTypeKeyUp;
     // FIXME: This logic fails if the user presses both Shift keys at once, for example:
     // we treat releasing one of them as keyDown.
     switch ([event keyCode]) {
-        case 54: // Right Command
-        case 55: // Left Command
-            return ([event modifierFlags] & NSCommandKeyMask) == 0;
-            
-        case 57: // Capslock
-            return ([event modifierFlags] & NSAlphaShiftKeyMask) == 0;
-            
-        case 56: // Left Shift
-        case 60: // Right Shift
-            return ([event modifierFlags] & NSShiftKeyMask) == 0;
-            
-        case 58: // Left Alt
-        case 61: // Right Alt
-            return ([event modifierFlags] & NSAlternateKeyMask) == 0;
-            
-        case 59: // Left Ctrl
-        case 62: // Right Ctrl
-            return ([event modifierFlags] & NSControlKeyMask) == 0;
-            
-        case 63: // Function
-            return ([event modifierFlags] & NSFunctionKeyMask) == 0;
-#pragma clang diagnostic pop
+    case 54: // Right Command
+    case 55: // Left Command
+        return !([event modifierFlags] & NSEventModifierFlagCommand);
+
+    case 57: // Capslock
+        return !([event modifierFlags] & NSEventModifierFlagCapsLock);
+
+    case 56: // Left Shift
+    case 60: // Right Shift
+        return !([event modifierFlags] & NSEventModifierFlagShift);
+
+    case 58: // Left Alt
+    case 61: // Right Alt
+        return !([event modifierFlags] & NSEventModifierFlagOption);
+
+    case 59: // Left Ctrl
+    case 62: // Right Ctrl
+        return !([event modifierFlags] & NSEventModifierFlagControl);
+
+    case 63: // Function
+        return !([event modifierFlags] & NSEventModifierFlagFunction);
     }
     return false;
 }
@@ -818,10 +790,7 @@ public:
         m_key = keyForKeyEvent(event);
         m_code = codeForKeyEvent(event);
         m_windowsVirtualKeyCode = windowsKeyCodeForKeyEvent(event);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        m_autoRepeat = [event type] != NSFlagsChanged && [event isARepeat];
-#pragma clang diagnostic pop
+        m_autoRepeat = [event type] != NSEventTypeFlagsChanged && [event isARepeat];
         m_isKeypad = isKeypadEvent(event);
         m_isSystemKey = false; // SystemKey is always false on the Mac.
 
index 91cbedd..150fabe 100644 (file)
@@ -139,18 +139,15 @@ static ScrollbarButtonsPlacement gButtonPlacement = ScrollbarButtonsDoubleEnd;
 
 static NSControlSize scrollbarControlSizeToNSControlSize(ScrollbarControlSize controlSize)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     switch (controlSize) {
     case RegularScrollbar:
-        return NSRegularControlSize;
+        return NSControlSizeRegular;
     case SmallScrollbar:
-        return NSSmallControlSize;
+        return NSControlSizeSmall;
     }
 
     ASSERT_NOT_REACHED();
-    return NSRegularControlSize;
-#pragma clang diagnostic pop
+    return NSControlSizeRegular;
 }
 
 void ScrollbarThemeMac::didCreateScrollerImp(Scrollbar& scrollbar)
index 02472c9..2bc262d 100644 (file)
@@ -67,11 +67,8 @@ static BOOL themeWindowHasKeyAppearance;
 {
     // Using defer:YES prevents us from wasting any window server resources for this window, since we're not actually
     // going to draw into it. The other arguments match what you get when calling -[NSWindow init].
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     static WebCoreThemeWindow *window = [[WebCoreThemeWindow alloc] initWithContentRect:NSMakeRect(100, 100, 100, 100)
-        styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:YES];
-#pragma clang diagnostic pop
+        styleMask:NSWindowStyleMaskTitled backing:NSBackingStoreBuffered defer:YES];
     return window;
 }
 
@@ -144,15 +141,12 @@ Theme* platformTheme()
 
 static NSControlSize controlSizeForFont(const FontCascade& font)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     int fontSize = font.pixelSize();
     if (fontSize >= 16)
-        return NSRegularControlSize;
+        return NSControlSizeRegular;
     if (fontSize >= 11)
-        return NSSmallControlSize;
-    return NSMiniControlSize;
-#pragma clang diagnostic pop
+        return NSControlSizeSmall;
+    return NSControlSizeMini;
 }
 
 static LengthSize sizeFromNSControlSize(NSControlSize nsControlSize, const LengthSize& zoomedSize, float zoomFactor, const std::array<IntSize, 3>& sizes)
@@ -175,16 +169,13 @@ static LengthSize sizeFromFont(const FontCascade& font, const LengthSize& zoomed
 
 static ControlSize controlSizeFromPixelSize(const std::array<IntSize, 3>& sizes, const IntSize& minZoomedSize, float zoomFactor)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if (minZoomedSize.width() >= static_cast<int>(sizes[NSRegularControlSize].width() * zoomFactor) &&
-        minZoomedSize.height() >= static_cast<int>(sizes[NSRegularControlSize].height() * zoomFactor))
-        return NSRegularControlSize;
-    if (minZoomedSize.width() >= static_cast<int>(sizes[NSSmallControlSize].width() * zoomFactor) &&
-        minZoomedSize.height() >= static_cast<int>(sizes[NSSmallControlSize].height() * zoomFactor))
-        return NSSmallControlSize;
-    return NSMiniControlSize;
-#pragma clang diagnostic pop
+    if (minZoomedSize.width() >= static_cast<int>(sizes[NSControlSizeRegular].width() * zoomFactor)
+        && minZoomedSize.height() >= static_cast<int>(sizes[NSControlSizeRegular].height() * zoomFactor))
+        return NSControlSizeRegular;
+    if (minZoomedSize.width() >= static_cast<int>(sizes[NSControlSizeSmall].width() * zoomFactor)
+        && minZoomedSize.height() >= static_cast<int>(sizes[NSControlSizeSmall].height() * zoomFactor))
+        return NSControlSizeSmall;
+    return NSControlSizeMini;
 }
 
 static void setControlSize(NSCell* cell, const std::array<IntSize, 3>& sizes, const IntSize& minZoomedSize, float zoomFactor)
@@ -480,10 +471,7 @@ static void setUpButtonCell(NSButtonCell *cell, ControlPart part, const ControlS
 {
     // Set the control size based off the rectangle we're painting into.
     const std::array<IntSize, 3>& sizes = buttonSizes();
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if (part == SquareButtonPart || zoomedSize.height() > buttonSizes()[NSRegularControlSize].height() * zoomFactor) {
-#pragma clang diagnostic pop
+    if (part == SquareButtonPart || zoomedSize.height() > buttonSizes()[NSControlSizeRegular].height() * zoomFactor) {
         // Use the square button
         if ([cell bezelStyle] != NSShadowlessSquareBezelStyle)
             [cell setBezelStyle:NSShadowlessSquareBezelStyle];
@@ -579,15 +567,12 @@ static const std::array<IntSize, 3>& stepperSizes()
 // should be equal to or less than the corresponding text field height,
 static NSControlSize stepperControlSizeForFont(const FontCascade& font)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     int fontSize = font.pixelSize();
     if (fontSize >= 18)
-        return NSRegularControlSize;
+        return NSControlSizeRegular;
     if (fontSize >= 13)
-        return NSSmallControlSize;
-    return NSMiniControlSize;
-#pragma clang diagnostic pop
+        return NSControlSizeSmall;
+    return NSControlSizeMini;
 }
 
 static void paintStepper(ControlStates& states, GraphicsContext& context, const FloatRect& zoomedRect, float zoomFactor, ScrollView*)
@@ -600,15 +585,12 @@ static void paintStepper(ControlStates& states, GraphicsContext& context, const
     drawInfo.state = convertControlStatesToThemeDrawState(kThemeIncDecButton, states);
     drawInfo.adornment = kThemeAdornmentDefault;
     ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), IntSize(zoomedRect.size()), zoomFactor);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if (controlSize == NSSmallControlSize)
+    if (controlSize == NSControlSizeSmall)
         drawInfo.kind = kThemeIncDecButtonSmall;
-    else if (controlSize == NSMiniControlSize)
+    else if (controlSize == NSControlSizeMini)
         drawInfo.kind = kThemeIncDecButtonMini;
     else
         drawInfo.kind = kThemeIncDecButton;
-#pragma clang diagnostic pop
 
     IntRect rect(zoomedRect);
     GraphicsContextStateSaver stateSaver(context);
@@ -749,12 +731,9 @@ LengthSize ThemeMac::minimumControlSize(ControlPart part, const FontCascade& fon
         case ButtonPart:
             return LengthSize(Length(0, Fixed), Length(static_cast<int>(15 * zoomFactor), Fixed));
         case InnerSpinButtonPart:{
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-            IntSize base = stepperSizes()[NSMiniControlSize];
+            IntSize base = stepperSizes()[NSControlSizeMini];
             return LengthSize(Length(static_cast<int>(base.width() * zoomFactor), Fixed),
                               Length(static_cast<int>(base.height() * zoomFactor), Fixed));
-#pragma clang diagnostic pop
         }
         default:
             return Theme::minimumControlSize(part, font, zoomFactor);
index d3b9ee9..cd5b8b5 100644 (file)
@@ -73,10 +73,7 @@ using namespace WebCore;
 - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
 {
     UNUSED_PARAM(aStyle);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:bufferingType defer:flag];
-#pragma clang diagnostic pop
+    self = [super initWithContentRect:contentRect styleMask:NSWindowStyleMaskBorderless backing:bufferingType defer:flag];
     if (!self)
         return nil;
 
@@ -122,15 +119,12 @@ using namespace WebCore;
 
 - (BOOL)performKeyEquivalent:(NSEvent *)event
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     // Block all command key events while the fullscreen window is up.
-    if ([event type] != NSKeyDown)
+    if ([event type] != NSEventTypeKeyDown)
         return NO;
     
-    if (!([event modifierFlags] & NSCommandKeyMask))
+    if (!([event modifierFlags] & NSEventModifierFlagCommand))
         return NO;
-#pragma clang diagnostic pop
     return YES;
 }
 
@@ -145,11 +139,7 @@ static const NSTimeInterval HUDWindowFadeOutDelay = 3;
 
 - (id)init
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSWindow *window = [[WebVideoFullscreenHUDWindow alloc] initWithContentRect:NSMakeRect(0, 0, windowWidth, windowHeight)
-                            styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
-#pragma clang diagnostic pop
+    NSWindow *window = [[WebVideoFullscreenHUDWindow alloc] initWithContentRect:NSMakeRect(0, 0, windowWidth, windowHeight) styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
     self = [super initWithWindow:window];
     [window setDelegate:self];
     [window release];
@@ -188,20 +178,17 @@ static const NSTimeInterval HUDWindowFadeOutDelay = 3;
             case ' ':
                 [self togglePlaying:nil];
                 return;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
             case NSUpArrowFunctionKey:
-                if ([event modifierFlags] & NSAlternateKeyMask)
+                if ([event modifierFlags] & NSEventModifierFlagOption)
                     [self setVolume:[self maxVolume]];
                 else
                     [self incrementVolume];
                 return;
             case NSDownArrowFunctionKey:
-                if ([event modifierFlags] & NSAlternateKeyMask)
+                if ([event modifierFlags] & NSEventModifierFlagOption)
                     [self setVolume:0];
                 else
                     [self decrementVolume];
-#pragma clang diagnostic pop
                 return;
             default:
                 break;
@@ -378,17 +365,11 @@ static NSTextField *createTimeTextField(NSRect frame)
     [contentView addSubview:_timeline];
 
     _elapsedTimeText = createTimeTextField(NSMakeRect(timeTextFieldHorizontalMargin, timelineBottomMargin, timeTextFieldWidth, timeTextFieldHeight));
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    [_elapsedTimeText setAlignment:NSLeftTextAlignment];
-#pragma clang diagnostic pop
+    [_elapsedTimeText setAlignment:NSTextAlignmentLeft];
     [contentView addSubview:_elapsedTimeText];
 
     _remainingTimeText = createTimeTextField(NSMakeRect(windowWidth - timeTextFieldHorizontalMargin - timeTextFieldWidth, timelineBottomMargin, timeTextFieldWidth, timeTextFieldHeight));
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    [_remainingTimeText setAlignment:NSRightTextAlignment];
-#pragma clang diagnostic pop
+    [_remainingTimeText setAlignment:NSTextAlignmentRight];
     [contentView addSubview:_remainingTimeText];
 
     [window recalculateKeyViewLoop];
index 4598a03..8abc840 100644 (file)
@@ -38,10 +38,7 @@ static const CGFloat slowMotionFactor = 10;
 
 static NSTimeInterval WebWindowAnimationDurationFromDuration(NSTimeInterval duration)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    return ([[NSApp currentEvent] modifierFlags] & NSShiftKeyMask) ? duration * slowMotionFactor : duration;
-#pragma clang diagnostic pop
+    return ([[NSApp currentEvent] modifierFlags] & NSEventModifierFlagShift) ? duration * slowMotionFactor : duration;
 }
 
 static NSRect scaledRect(NSRect _initialFrame, NSRect _finalFrame, CGFloat factor)
index 3eddc03..dbf478f 100644 (file)
@@ -379,22 +379,13 @@ void RenderThemeMac::updateCachedSystemFontDescription(CSSValueID cssValueId, Fo
             fontName = AtomicString("-apple-status-bar", AtomicString::ConstructFromLiteral);
             break;
         case CSSValueWebkitMiniControl:
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-            font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSMiniControlSize]];
-#pragma clang diagnostic pop
+            font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSControlSizeMini]];
             break;
         case CSSValueWebkitSmallControl:
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-            font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]];
-#pragma clang diagnostic pop
+            font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSControlSizeSmall]];
             break;
         case CSSValueWebkitControl:
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-            font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSRegularControlSize]];
-#pragma clang diagnostic pop
+            font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSControlSizeRegular]];
             break;
         default:
             font = [NSFont systemFontOfSize:[NSFont systemFontSize]];
@@ -777,30 +768,24 @@ bool RenderThemeMac::controlSupportsTints(const RenderObject& o) const
 NSControlSize RenderThemeMac::controlSizeForFont(const RenderStyle& style) const
 {
     int fontSize = style.fontSize();
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     if (fontSize >= 16)
-        return NSRegularControlSize;
+        return NSControlSizeRegular;
     if (fontSize >= 11)
-        return NSSmallControlSize;
-    return NSMiniControlSize;
-#pragma clang diagnostic pop
+        return NSControlSizeSmall;
+    return NSControlSizeMini;
 }
 
 NSControlSize RenderThemeMac::controlSizeForCell(NSCell*, const IntSize* sizes, const IntSize& minSize, float zoomLevel) const
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if (minSize.width() >= static_cast<int>(sizes[NSRegularControlSize].width() * zoomLevel)
-        && minSize.height() >= static_cast<int>(sizes[NSRegularControlSize].height() * zoomLevel))
-        return NSRegularControlSize;
+    if (minSize.width() >= static_cast<int>(sizes[NSControlSizeRegular].width() * zoomLevel)
+        && minSize.height() >= static_cast<int>(sizes[NSControlSizeRegular].height() * zoomLevel))
+        return NSControlSizeRegular;
 
-    if (minSize.width() >= static_cast<int>(sizes[NSSmallControlSize].width() * zoomLevel)
-        && minSize.height() >= static_cast<int>(sizes[NSSmallControlSize].height() * zoomLevel))
-        return NSSmallControlSize;
+    if (minSize.width() >= static_cast<int>(sizes[NSControlSizeSmall].width() * zoomLevel)
+        && minSize.height() >= static_cast<int>(sizes[NSControlSizeSmall].height() * zoomLevel))
+        return NSControlSizeSmall;
 
-    return NSMiniControlSize;
-#pragma clang diagnostic pop
+    return NSControlSizeMini;
 }
 
 void RenderThemeMac::setControlSize(NSCell* cell, const IntSize* sizes, const IntSize& minSize, float zoomLevel)
@@ -857,15 +842,12 @@ void RenderThemeMac::setFontFromControlSize(StyleResolver&, RenderStyle& style,
 
 NSControlSize RenderThemeMac::controlSizeForSystemFont(const RenderStyle& style) const
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     int fontSize = style.fontSize();
-    if (fontSize >= [NSFont systemFontSizeForControlSize:NSRegularControlSize])
-        return NSRegularControlSize;
-    if (fontSize >= [NSFont systemFontSizeForControlSize:NSSmallControlSize])
-        return NSSmallControlSize;
-    return NSMiniControlSize;
-#pragma clang diagnostic pop
+    if (fontSize >= [NSFont systemFontSizeForControlSize:NSControlSizeRegular])
+        return NSControlSizeRegular;
+    if (fontSize >= [NSFont systemFontSizeForControlSize:NSControlSizeSmall])
+        return NSControlSizeSmall;
+    return NSControlSizeMini;
 }
 
 bool RenderThemeMac::paintTextField(const RenderObject& o, const PaintInfo& paintInfo, const FloatRect& r)
@@ -1147,10 +1129,7 @@ bool RenderThemeMac::paintProgressBar(const RenderObject& renderObject, const Pa
     const auto& renderProgress = downcast<RenderProgress>(renderObject);
     HIThemeTrackDrawInfo trackInfo;
     trackInfo.version = 0;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if (controlSize == NSRegularControlSize)
-#pragma clang diagnostic pop
+    if (controlSize == NSControlSizeRegular)
         trackInfo.kind = renderProgress.position() < 0 ? kThemeLargeIndeterminateBar : kThemeLargeProgressBar;
     else
         trackInfo.kind = renderProgress.position() < 0 ? kThemeMediumIndeterminateBar : kThemeMediumProgressBar;
@@ -1438,15 +1417,12 @@ PopupMenuStyle::PopupMenuSize RenderThemeMac::popupMenuSize(const RenderStyle& s
     NSPopUpButtonCell* popupButton = this->popupButton();
     NSControlSize size = controlSizeForCell(popupButton, popupButtonSizes(), rect.size(), style.effectiveZoom());
     switch (size) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    case NSRegularControlSize:
+    case NSControlSizeRegular:
         return PopupMenuStyle::PopupMenuSizeNormal;
-    case NSSmallControlSize:
+    case NSControlSizeSmall:
         return PopupMenuStyle::PopupMenuSizeSmall;
-    case NSMiniControlSize:
+    case NSControlSizeMini:
         return PopupMenuStyle::PopupMenuSizeMini;
-#pragma clang diagnostic pop
     default:
         return PopupMenuStyle::PopupMenuSizeNormal;
     }
@@ -2055,12 +2031,9 @@ NSSliderCell* RenderThemeMac::sliderThumbHorizontal() const
 {
     if (!m_sliderThumbHorizontal) {
         m_sliderThumbHorizontal = adoptNS([[NSSliderCell alloc] init]);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        [m_sliderThumbHorizontal.get() setSliderType:NSLinearSlider];
-        [m_sliderThumbHorizontal.get() setControlSize:NSSmallControlSize];
+        [m_sliderThumbHorizontal.get() setSliderType:NSSliderTypeLinear];
+        [m_sliderThumbHorizontal.get() setControlSize:NSControlSizeSmall];
         [m_sliderThumbHorizontal.get() setFocusRingType:NSFocusRingTypeExterior];
-#pragma clang diagnostic pop
     }
 
     return m_sliderThumbHorizontal.get();
@@ -2070,11 +2043,8 @@ NSSliderCell* RenderThemeMac::sliderThumbVertical() const
 {
     if (!m_sliderThumbVertical) {
         m_sliderThumbVertical = adoptNS([[NSSliderCell alloc] init]);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        [m_sliderThumbVertical.get() setSliderType:NSLinearSlider];
-        [m_sliderThumbVertical.get() setControlSize:NSSmallControlSize];
-#pragma clang diagnostic pop
+        [m_sliderThumbVertical.get() setSliderType:NSSliderTypeLinear];
+        [m_sliderThumbVertical.get() setControlSize:NSControlSizeSmall];
         [m_sliderThumbVertical.get() setFocusRingType:NSFocusRingTypeExterior];
     }
 
index f2a3597..96f649a 100644 (file)
@@ -173,13 +173,14 @@ static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCall
 
     // Figure out the window's style mask.
     styleMask = WKCarbonWindowMask();
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if (windowAttributes & kWindowCloseBoxAttribute) styleMask |= NSClosableWindowMask;
-    if (windowAttributes & kWindowResizableAttribute) styleMask |= NSResizableWindowMask;
-    if (windowFeatures & kWindowCanCollapse) styleMask |= NSMiniaturizableWindowMask;
-    if (windowFeatures & kWindowHasTitleBar) styleMask |= NSTitledWindowMask;
-#pragma clang diagnostic pop
+    if (windowAttributes & kWindowCloseBoxAttribute)
+        styleMask |= NSWindowStyleMaskClosable;
+    if (windowAttributes & kWindowResizableAttribute)
+        styleMask |= NSWindowStyleMaskResizable;
+    if (windowFeatures & kWindowCanCollapse)
+        styleMask |= NSWindowStyleMaskMiniaturizable;
+    if (windowFeatures & kWindowHasTitleBar)
+        styleMask |= NSWindowStyleMaskTitled;
 
     osStatus = GetWindowModality(_windowRef, &windowModality, NULL);
     if (osStatus != noErr) {
@@ -393,18 +394,12 @@ static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCall
     // Ignore some unknown event that gets sent when NSTextViews in printing accessory views are focused.  M.P. Notice - 12/7/00
     BOOL ignoreEvent = NO;
     NSEventType eventType = [inEvent type];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if (eventType==NSSystemDefined) {
-#pragma clang diagnostic pop
+    if (eventType == NSEventTypeSystemDefined) {
         short eventSubtype = [inEvent subtype];
-        if (eventSubtype==7) {
+        if (eventSubtype == 7) {
             ignoreEvent = YES;
         }
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    } else if (eventType == NSKeyDown) {
-#pragma clang diagnostic pop
+    } else if (eventType == NSEventTypeKeyDown) {
         // Handle command-space as [NSApp sendEvent:] does.
         if ([NSInputContext processInputKeyBindings:inEvent]) {
             return;
index d1c550f..0ae0147 100644 (file)
@@ -539,7 +539,7 @@ ContextMenuClick( HIWebView* inView, EventRef inEvent )
     NSPoint location = NSMakePoint(point.x, [window frame].size.height - point.y);
     
     // Make up an event with the point and send it to the window.
-    NSEvent *kitEvent = [NSEvent mouseEventWithType:NSRightMouseDown
+    NSEvent *kitEvent = [NSEvent mouseEventWithType:NSEventTypeRightMouseDown
                                            location:location
                                       modifierFlags:0
                                           timestamp:GetEventTime(inEvent)
index f370869..085a739 100644 (file)
@@ -1,3 +1,67 @@
+2016-11-09  Chris Dumez  <cdumez@apple.com>
+
+        [Mac] Stop using deprecated AppKit enumeration values
+        https://bugs.webkit.org/show_bug.cgi?id=164494
+
+        Reviewed by Darin Adler.
+
+        Stop using deprecated AppKit enumeration values.
+
+        * Carbon/CarbonWindowAdapter.mm:
+        (-[CarbonWindowAdapter initWithCarbonWindowRef:takingOwnership:disableOrdering:carbon:]):
+        (-[CarbonWindowAdapter sendSuperEvent:]):
+        * Plugins/Hosted/NetscapePluginHostProxy.mm:
+        (WebKit::NetscapePluginHostProxy::beginModal):
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::syntheticKeyDownWithCommandModifier):
+        * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+        (-[WebHostedNetscapePluginView drawRect:]):
+        * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+        (WebNetscapePluginEventHandlerCocoa::syntheticKeyDownWithCommandModifier):
+        * WebCoreSupport/PopupMenuMac.mm:
+        (PopupMenuMac::populate):
+        (PopupMenuMac::show):
+        * WebCoreSupport/WebContextMenuClient.mm:
+        (WebContextMenuClient::showContextMenu):
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::actionDictionary):
+        * WebCoreSupport/WebInspectorClient.mm:
+        (WebInspectorFrontendClient::canAttach):
+        (-[WebInspectorWindowController window]):
+        * WebInspector/WebNodeHighlight.mm:
+        (-[WebNodeHighlight initWithTargetView:inspectorController:]):
+        * WebView/WebFrameView.mm:
+        (-[WebFrameView keyDown:keyDown:]):
+        * WebView/WebFullScreenController.mm:
+        (-[WebFullScreenController init]):
+        (createBackgroundFullscreenWindow):
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _postFakeMouseMovedEventForFlagsChangedEvent:]):
+        (-[WebHTMLView _setMouseDownEvent:_setMouseDownEvent:]):
+        (-[WebHTMLView _updateMouseoverWithFakeEvent]):
+        (isQuickLookEvent):
+        (-[WebHTMLView hitTest:]):
+        (-[WebHTMLView _sendToolTipMouseExited]):
+        (-[WebHTMLView _sendToolTipMouseEntered]):
+        (mouseEventIsPartOfClickOrDrag):
+        (-[WebHTMLView _updateMouseoverWithEvent:]):
+        (-[WebHTMLView _autoscroll]):
+        (-[WebHTMLView acceptsFirstResponder]):
+        (-[WebHTMLView viewDidMoveToWindow]):
+        (-[WebHTMLView mouseDown:mouseDown:]):
+        (currentKeyboardEvent):
+        (-[WebHTMLView _handleStyleKeyEquivalent:]):
+        (-[WebHTMLView _interpretKeyEvent:savingCommands:]):
+        * WebView/WebPDFView.mm:
+        (-[WebPDFView hitTest:]):
+        (-[WebPDFView PDFViewWillClickOnLink:withURL:]):
+        (-[WebPDFView _fakeKeyEventWithFunctionKey:]):
+        * WebView/WebTextCompletionController.mm:
+        (-[WebTextCompletionController _buildUI]):
+        (-[WebTextCompletionController _placePopupWindow:]):
+        * WebView/WebView.mm:
+        (-[WebView applicationFlags:]):
+
 2016-11-09  Beth Dakin  <bdakin@apple.com>
 
         Support TouchBar in WebKit
index eeb8c92..d8fb2a1 100644 (file)
 #if !PLATFORM(IOS)
 
 #import <WebKitLegacy/WebNSEventExtras.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 @implementation NSEvent (WebExtras)
 
 -(BOOL)_web_isKeyEvent:(unichar)key
 {
     int type = [self type];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if (type != NSKeyDown && type != NSKeyUp)
-#pragma clang diagnostic pop
+    if (type != NSEventTypeKeyDown && type != NSEventTypeKeyUp)
         return NO;
     
     NSString *chars = [self charactersIgnoringModifiers];
 
 - (BOOL)_web_isOptionTabKeyEvent
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    return ([self modifierFlags] & NSAlternateKeyMask) && [self _web_isTabKeyEvent];
-#pragma clang diagnostic pop
+    return ([self modifierFlags] & NSEventModifierFlagOption) && [self _web_isTabKeyEvent];
 }
 
 - (BOOL)_web_isReturnOrEnterKeyEvent
index 3dc8f7f..74890d5 100644 (file)
@@ -38,6 +38,7 @@
 
 #if !PLATFORM(IOS)
 #import <WebKitLegacy/WebNSPasteboardExtras.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 #endif
 
 #if PLATFORM(IOS)
     NSEvent *nextEvent, *firstEvent, *dragEvent, *mouseUp;
     BOOL dragIt;
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([mouseDownEvent type] != NSLeftMouseDown) {
+    if ([mouseDownEvent type] != NSEventTypeLeftMouseDown) {
         return NO;
     }
-#pragma clang diagnostic pop
 
     nextEvent = nil;
     firstEvent = nil;
@@ -95,9 +93,7 @@
     mouseUp = nil;
     dragIt = NO;
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    while ((nextEvent = [[self window] nextEventMatchingMask:(NSLeftMouseUpMask | NSLeftMouseDraggedMask)
+    while ((nextEvent = [[self window] nextEventMatchingMask:(NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged)
                                                    untilDate:expiration
                                                       inMode:NSEventTrackingRunLoopMode
                                                      dequeue:YES]) != nil) {
             firstEvent = nextEvent;
         }
 
-        if ([nextEvent type] == NSLeftMouseDragged) {
+        if ([nextEvent type] == NSEventTypeLeftMouseDragged) {
             float deltax = ABS([nextEvent locationInWindow].x - [mouseDownEvent locationInWindow].x);
             float deltay = ABS([nextEvent locationInWindow].y - [mouseDownEvent locationInWindow].y);
             dragEvent = nextEvent;
                 dragIt = YES;
                 break;
             }
-        } else if ([nextEvent type] == NSLeftMouseUp) {
+        } else if ([nextEvent type] == NSEventTypeLeftMouseUp) {
             mouseUp = nextEvent;
             break;
         }
     }
-#pragma clang diagnostic pop
 
     // Since we've been dequeuing the events (If we don't, we'll never see the mouse up...),
     // we need to push some of the events back on.  It makes sense to put the first and last
index ead5936..2a42c73 100644 (file)
@@ -230,10 +230,7 @@ void NetscapePluginHostProxy::beginModal()
     ASSERT(!m_placeholderWindow);
     ASSERT(!m_activationObserver);
     
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    m_placeholderWindow = adoptNS([[WebPlaceholderModalWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1, 1) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
-#pragma clang diagnostic pop
+    m_placeholderWindow = adoptNS([[WebPlaceholderModalWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1, 1) styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES]);
 
     m_activationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationWillBecomeActiveNotification object:NSApp queue:nil
                                                                          usingBlock:^(NSNotification *){ applicationDidBecomeActive(); }];
index 1b4d3a9..36dbbec 100644 (file)
@@ -465,15 +465,12 @@ void NetscapePluginInstanceProxy::syntheticKeyDownWithCommandModifier(int keyCod
 {
     NSData *charactersData = [NSData dataWithBytes:&character length:1];
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     _WKPHPluginInstanceKeyboardEvent(m_pluginHostProxy->port(), m_pluginID,
                                      [NSDate timeIntervalSinceReferenceDate], 
-                                     NPCocoaEventKeyDown, NSCommandKeyMask,
+                                     NPCocoaEventKeyDown, NSEventModifierFlagCommand,
                                      const_cast<char*>(reinterpret_cast<const char*>([charactersData bytes])), [charactersData length], 
                                      const_cast<char*>(reinterpret_cast<const char*>([charactersData bytes])), [charactersData length], 
                                      false, keyCode, character);
-#pragma clang diagnostic pop
 }
 
 void NetscapePluginInstanceProxy::flagsChanged(NSEvent *event)
index 376672b..f61b723 100644 (file)
@@ -443,10 +443,7 @@ extern "C" {
 {
     if (_cachedSnapshot) {
         NSRect sourceRect = { NSZeroPoint, [_cachedSnapshot.get() size] };
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        [_cachedSnapshot.get() drawInRect:[self bounds] fromRect:sourceRect operation:NSCompositeSourceOver fraction:1];
-#pragma clang diagnostic pop
+        [_cachedSnapshot.get() drawInRect:[self bounds] fromRect:sourceRect operation:NSCompositingOperationSourceOver fraction:1];
         return;
     }
 
index f2d7e9f..68567b3 100644 (file)
@@ -62,22 +62,22 @@ static EventModifiers modifiersForEvent(NSEvent *event)
     
     modifiers = 0;
     
-    if (eventType != NSLeftMouseDown && eventType != NSRightMouseDown)
+    if (eventType != NSEventTypeLeftMouseDown && eventType != NSEventTypeRightMouseDown)
         modifiers |= btnState;
     
-    if (modifierFlags & NSCommandKeyMask)
+    if (modifierFlags & NSEventModifierFlagCommand)
         modifiers |= cmdKey;
     
-    if (modifierFlags & NSShiftKeyMask)
+    if (modifierFlags & NSEventModifierFlagShift)
         modifiers |= shiftKey;
 
-    if (modifierFlags & NSAlphaShiftKeyMask)
+    if (modifierFlags & NSEventModifierFlagCapsLock)
         modifiers |= alphaLock;
 
-    if (modifierFlags & NSAlternateKeyMask)
+    if (modifierFlags & NSEventModifierFlagOption)
         modifiers |= optionKey;
 
-    if (modifierFlags & NSControlKeyMask || eventType == NSRightMouseDown)
+    if (modifierFlags & NSEventModifierFlagControl || eventType == NSEventTypeRightMouseDown)
         modifiers |= controlKey;
     
     return modifiers;
index a1d159a..de20189 100644 (file)
@@ -161,10 +161,7 @@ void WebNetscapePluginEventHandlerCocoa::syntheticKeyDownWithCommandModifier(int
     
     NPCocoaEvent event;
     initializeEvent(&event, NPCocoaEventKeyDown);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    event.data.key.modifierFlags = NSCommandKeyMask;
-#pragma clang diagnostic pop
+    event.data.key.modifierFlags = NSEventModifierFlagCommand;
     event.data.key.keyCode = keyCode;
     event.data.key.isARepeat = false;
     event.data.key.characters = (NPNSString *)characters.get();
index c46670b..630ad85 100644 (file)
@@ -90,17 +90,11 @@ void PopupMenuMac::populate()
         }
 
         RetainPtr<NSMutableParagraphStyle> paragraphStyle = adoptNS([[NSParagraphStyle defaultParagraphStyle] mutableCopy]);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        [paragraphStyle setAlignment:menuTextDirection == LTR ? NSLeftTextAlignment : NSRightTextAlignment];
-#pragma clang diagnostic pop
+        [paragraphStyle setAlignment:menuTextDirection == LTR ? NSTextAlignmentLeft : NSTextAlignmentRight];
         NSWritingDirection writingDirection = style.textDirection() == LTR ? NSWritingDirectionLeftToRight : NSWritingDirectionRightToLeft;
         [paragraphStyle setBaseWritingDirection:writingDirection];
         if (style.hasTextDirectionOverride()) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-            RetainPtr<NSNumber> writingDirectionValue = adoptNS([[NSNumber alloc] initWithInteger:writingDirection + NSTextWritingDirectionOverride]);
-#pragma clang diagnostic pop
+            RetainPtr<NSNumber> writingDirectionValue = adoptNS([[NSNumber alloc] initWithInteger:writingDirection + NSWritingDirectionOverride]);
             RetainPtr<NSArray> writingDirectionArray = adoptNS([[NSArray alloc] initWithObjects:writingDirectionValue.get(), nil]);
             [attributes setObject:writingDirectionArray.get() forKey:NSWritingDirectionAttributeName];
         }
@@ -206,18 +200,15 @@ void PopupMenuMac::show(const IntRect& r, FrameView* v, int index)
 
     NSControlSize controlSize;
     switch (m_client->menuStyle().menuSize()) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     case PopupMenuStyle::PopupMenuSizeNormal:
-        controlSize = NSRegularControlSize;
+        controlSize = NSControlSizeRegular;
         break;
     case PopupMenuStyle::PopupMenuSizeSmall:
-        controlSize = NSSmallControlSize;
+        controlSize = NSControlSizeSmall;
         break;
     case PopupMenuStyle::PopupMenuSizeMini:
-        controlSize = NSMiniControlSize;
+        controlSize = NSControlSizeMini;
         break;
-#pragma clang diagnostic pop
     }
 
     WKPopupMenu(menu, location, roundf(NSWidth(r)), dummyView.get(), index, toNSFont(font), controlSize, !m_client->menuStyle().hasDefaultAppearance());
index 914d8e0..24e8041 100644 (file)
@@ -269,10 +269,7 @@ void WebContextMenuClient::showContextMenu()
 
     NSView* view = frameView->documentView();
     IntPoint point = frameView->contentsToWindow(page->contextMenuController().hitTestResult().roundedPointInInnerNodeFrame());
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSEvent* event = [NSEvent mouseEventWithType:NSRightMouseDown location:point modifierFlags:0 timestamp:0 windowNumber:[[view window] windowNumber] context:0 eventNumber:0 clickCount:1 pressure:1];
-#pragma clang diagnostic pop
+    NSEvent* event = [NSEvent mouseEventWithType:NSEventTypeRightMouseDown location:point modifierFlags:0 timestamp:0 windowNumber:[[view window] windowNumber] context:0 eventNumber:0 clickCount:1 pressure:1];
 
     // Show the contextual menu for this event.
     bool isServicesMenu;
index 11476a0..f0b312f 100644 (file)
@@ -1561,17 +1561,14 @@ NSDictionary *WebFrameLoaderClient::actionDictionary(const NavigationAction& act
 #if !PLATFORM(IOS)
     const UIEventWithKeyState* keyStateEvent = findEventWithKeyState(const_cast<Event*>(event));
     if (keyStateEvent && keyStateEvent->isTrusted()) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
         if (keyStateEvent->ctrlKey())
-            modifierFlags |= NSControlKeyMask;
+            modifierFlags |= NSEventModifierFlagControl;
         if (keyStateEvent->altKey())
-            modifierFlags |= NSAlternateKeyMask;
+            modifierFlags |= NSEventModifierFlagOption;
         if (keyStateEvent->shiftKey())
-            modifierFlags |= NSShiftKeyMask;
+            modifierFlags |= NSEventModifierFlagShift;
         if (keyStateEvent->metaKey())
-            modifierFlags |= NSCommandKeyMask;
-#pragma clang diagnostic pop
+            modifierFlags |= NSEventModifierFlagCommand;
     }
 #else
     // No modifier flags on iOS right now
index 90787d6..b3cb6b9 100644 (file)
@@ -191,10 +191,7 @@ void WebInspectorFrontendClient::attachAvailabilityChanged(bool available)
 
 bool WebInspectorFrontendClient::canAttach()
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([[m_frontendWindowController window] styleMask] & NSFullScreenWindowMask)
-#pragma clang diagnostic pop
+    if ([[m_frontendWindowController window] styleMask] & NSWindowStyleMaskFullScreen)
         return false;
 
     return canAttachWindow();
@@ -465,10 +462,7 @@ void WebInspectorFrontendClient::append(const String& suggestedURL, const String
     if (window)
         return window;
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSUInteger styleMask = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask | NSFullSizeContentViewWindowMask;
-#pragma clang diagnostic pop
+    NSUInteger styleMask = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable | NSWindowStyleMaskFullSizeContentView;
     window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, initialWindowWidth, initialWindowHeight) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
     [window setDelegate:self];
     [window setMinSize:NSMakeSize(minimumWindowWidth, minimumWindowHeight)];
index 02a756f..61c6aeb 100644 (file)
@@ -91,10 +91,7 @@ using namespace WebCore;
     _inspectorController = inspectorController;
 
 #if !PLATFORM(IOS)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    int styleMask = NSBorderlessWindowMask;
-#pragma clang diagnostic pop
+    int styleMask = NSWindowStyleMaskBorderless;
     NSRect contentRect = [NSWindow contentRectForFrameRect:[self _computeHighlightWindowFrame] styleMask:styleMask];
     _highlightWindow = [[NSWindow alloc] initWithContentRect:contentRect styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
     [_highlightWindow setBackgroundColor:[NSColor clearColor]];
index 66a5fcf..0edd82d 100644 (file)
@@ -77,6 +77,7 @@ typedef float CGFloat;
 #ifdef __OBJC__
 #if !TARGET_OS_IPHONE
 #import <Cocoa/Cocoa.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 #else
 #import <Foundation/Foundation.h>
 #endif
index 5ec1978..d720c7a 100644 (file)
@@ -915,9 +915,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     BOOL callSuper = YES;
     Frame* coreFrame = [self _web_frame];
     BOOL maintainsBackForwardList = coreFrame && static_cast<BackForwardList*>(coreFrame->page()->backForward().client())->enabled() ? YES : NO;
-    
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
     count = [characters length];
     for (index = 0; index < count; ++index) {
         switch ([characters characterAtIndex:index]) {
@@ -928,7 +926,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
                 }
                 // This odd behavior matches some existing browsers,
                 // including Windows IE
-                if (modifierFlags & NSShiftKeyMask) {
+                if (modifierFlags & NSEventModifierFlagShift) {
                     [self _goForward];
                 } else {
                     [self _goBack];
@@ -943,7 +941,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
                     callSuper = YES;
                     break;
                 }
-                if (modifierFlags & NSShiftKeyMask) {
+                if (modifierFlags & NSEventModifierFlagShift) {
                     [self scrollPageUp:nil];
                 } else {
                     [self scrollPageDown:nil];
@@ -984,7 +982,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
                 break;
             case NSUpArrowFunctionKey:
                 // We don't handle shifted or control-arrow keys here, so let super have a chance.
-                if (modifierFlags & (NSShiftKeyMask | NSControlKeyMask)) {
+                if (modifierFlags & (NSEventModifierFlagShift | NSEventModifierFlagControl)) {
                     callSuper = YES;
                     break;
                 }
@@ -998,9 +996,9 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
                     break;
                 }
 #endif
-                if (modifierFlags & NSCommandKeyMask) {
+                if (modifierFlags & NSEventModifierFlagCommand) {
                     [self scrollToBeginningOfDocument:nil];
-                } else if (modifierFlags & NSAlternateKeyMask) {
+                } else if (modifierFlags & NSEventModifierFlagOption) {
                     [self scrollPageUp:nil];
                 } else {
                     [self scrollLineUp:nil];
@@ -1009,7 +1007,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
                 break;
             case NSDownArrowFunctionKey:
                 // We don't handle shifted or control-arrow keys here, so let super have a chance.
-                if (modifierFlags & (NSShiftKeyMask | NSControlKeyMask)) {
+                if (modifierFlags & (NSEventModifierFlagShift | NSEventModifierFlagControl)) {
                     callSuper = YES;
                     break;
                 }
@@ -1023,9 +1021,9 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
                     break;
                 }
 #endif
-                if (modifierFlags & NSCommandKeyMask) {
+                if (modifierFlags & NSEventModifierFlagCommand) {
                     [self scrollToEndOfDocument:nil];
-                } else if (modifierFlags & NSAlternateKeyMask) {
+                } else if (modifierFlags & NSEventModifierFlagOption) {
                     [self scrollPageDown:nil];
                 } else {
                     [self scrollLineDown:nil];
@@ -1034,12 +1032,12 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
                 break;
             case NSLeftArrowFunctionKey:
                 // We don't handle shifted or control-arrow keys here, so let super have a chance.
-                if (modifierFlags & (NSShiftKeyMask | NSControlKeyMask)) {
+                if (modifierFlags & (NSEventModifierFlagShift | NSEventModifierFlagControl)) {
                     callSuper = YES;
                     break;
                 }
                 // Check back/forward related keys.
-                if (modifierFlags & NSCommandKeyMask) {
+                if (modifierFlags & NSEventModifierFlagCommand) {
                     if (!maintainsBackForwardList) {
                         callSuper = YES;
                         break;
@@ -1052,7 +1050,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
                         break;
                     }
 
-                    if (modifierFlags & NSAlternateKeyMask) {
+                    if (modifierFlags & NSEventModifierFlagOption) {
                         [self _pageHorizontally:YES];
                     } else {
                         [self _scrollLineHorizontally:YES];
@@ -1062,12 +1060,12 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
                 break;
             case NSRightArrowFunctionKey:
                 // We don't handle shifted or control-arrow keys here, so let super have a chance.
-                if (modifierFlags & (NSShiftKeyMask | NSControlKeyMask)) {
+                if (modifierFlags & (NSEventModifierFlagShift | NSEventModifierFlagControl)) {
                     callSuper = YES;
                     break;
                 }
                 // Check back/forward related keys.
-                if (modifierFlags & NSCommandKeyMask) {
+                if (modifierFlags & NSEventModifierFlagCommand) {
                     if (!maintainsBackForwardList) {
                         callSuper = YES;
                         break;
@@ -1080,7 +1078,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
                         break;
                     }
 
-                    if (modifierFlags & NSAlternateKeyMask) {
+                    if (modifierFlags & NSEventModifierFlagOption) {
                         [self _pageHorizontally:NO];
                     } else {
                         [self _scrollLineHorizontally:NO];
@@ -1090,7 +1088,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
                 break;
         }
     }
-#pragma clang diagnostic pop
     if (callSuper) {
         [super keyDown:event];
     } else {
index 9fd9566..77459b3 100644 (file)
@@ -86,11 +86,8 @@ static NSRect convertRectToScreen(NSWindow *window, NSRect rect)
 #pragma mark Initialization
 - (id)init
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     // Do not defer window creation, to make sure -windowNumber is created (needed by WebWindowScaleAnimation).
-    NSWindow *window = [[WebCoreFullScreenWindow alloc] initWithContentRect:NSZeroRect styleMask:NSClosableWindowMask backing:NSBackingStoreBuffered defer:NO];
-#pragma clang diagnostic pop
+    NSWindow *window = [[WebCoreFullScreenWindow alloc] initWithContentRect:NSZeroRect styleMask:NSWindowStyleMaskClosable backing:NSBackingStoreBuffered defer:NO];
     self = [super initWithWindow:window];
     [window release];
     if (!self)
@@ -462,10 +459,7 @@ static NSRect convertRectToScreen(NSWindow *window, NSRect rect)
 
 static RetainPtr<NSWindow> createBackgroundFullscreenWindow(NSRect frame)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSWindow *window = [[NSWindow alloc] initWithContentRect:frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
-#pragma clang diagnostic pop
+    NSWindow *window = [[NSWindow alloc] initWithContentRect:frame styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
     [window setOpaque:YES];
     [window setBackgroundColor:[NSColor blackColor]];
     [window setReleasedWhenClosed:NO];
index a056fad..a05fb48 100644 (file)
 #import <wtf/RunLoop.h>
 
 #if !PLATFORM(IOS)
+#import "WebNSEventExtras.h"
+#import "WebNSPasteboardExtras.h"
 #import <AppKit/NSAccessibility.h>
 #import <ApplicationServices/ApplicationServices.h>
 #import <WebCore/NSMenuSPI.h>
 #import <WebCore/PlatformEventFactoryMac.h>
-#import "WebNSEventExtras.h"
-#import "WebNSPasteboardExtras.h"
 #endif
 
 #import <QuartzCore/QuartzCore.h>
@@ -1351,12 +1351,9 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
 
 - (void)_postFakeMouseMovedEventForFlagsChangedEvent:(NSEvent *)flagsChangedEvent
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:flagsChangedEvent.window.mouseLocationOutsideOfEventStream
+    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSEventTypeMouseMoved location:flagsChangedEvent.window.mouseLocationOutsideOfEventStream
         modifierFlags:flagsChangedEvent.modifierFlags timestamp:flagsChangedEvent.timestamp windowNumber:flagsChangedEvent.windowNumber
         context:nullptr eventNumber:0 clickCount:0 pressure:0];
-#pragma clang diagnostic pop
     [self mouseMoved:fakeEvent];
 }
 
@@ -1506,10 +1503,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
 #endif
 {
 #if !PLATFORM(IOS)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    ASSERT(!event || [event type] == NSLeftMouseDown || [event type] == NSRightMouseDown || [event type] == NSOtherMouseDown);
-#pragma clang diagnostic pop
+    ASSERT(!event || [event type] == NSEventTypeLeftMouseDown || [event type] == NSEventTypeRightMouseDown || [event type] == NSEventTypeOtherMouseDown);
 #else
     ASSERT(!event || event.type == WebEventMouseDown);
 #endif
@@ -1661,16 +1655,17 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
 
 - (void)_updateMouseoverWithFakeEvent
 {
+    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSEventTypeMouseMoved
+        location:[[self window]
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved
-        location:[[self window] convertScreenToBase:[NSEvent mouseLocation]]
+        convertScreenToBase:[NSEvent mouseLocation]]
+#pragma clang diagnostic pop
         modifierFlags:[[NSApp currentEvent] modifierFlags]
         timestamp:[NSDate timeIntervalSinceReferenceDate]
         windowNumber:[[self window] windowNumber]
         context:nullptr
         eventNumber:0 clickCount:0 pressure:0];
-#pragma clang diagnostic pop
 
     [self _updateMouseoverWithEvent:fakeEvent];
 }
@@ -1868,11 +1863,8 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
 #if !PLATFORM(IOS)
 static BOOL isQuickLookEvent(NSEvent *event)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     const int kCGSEventSystemSubtypeHotKeyCombinationReleased = 9;
-    return [event type] == NSSystemDefined && [event subtype] == kCGSEventSystemSubtypeHotKeyCombinationReleased && [event data1] == 'lkup';
-#pragma clang diagnostic pop
+    return [event type] == NSEventTypeSystemDefined && [event subtype] == kCGSEventSystemSubtypeHotKeyCombinationReleased && [event data1] == 'lkup';
 }
 #endif
 
@@ -1928,14 +1920,11 @@ static BOOL isQuickLookEvent(NSEvent *event)
     else {
         // FIXME: Why doesn't this include mouse entered/exited events, or other mouse button events?
         NSEvent *event = [[self window] currentEvent];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        captureHitsOnSubviews = !([event type] == NSMouseMoved
-            || [event type] == NSRightMouseDown
-            || ([event type] == NSLeftMouseDown && ([event modifierFlags] & NSControlKeyMask) != 0)
-            || [event type] == NSFlagsChanged
+        captureHitsOnSubviews = !([event type] == NSEventTypeMouseMoved
+            || [event type] == NSEventTypeRightMouseDown
+            || ([event type] == NSEventTypeLeftMouseDown && [event modifierFlags] & NSEventModifierFlagControl)
+            || [event type] == NSEventTypeFlagsChanged
             || isQuickLookEvent(event));
-#pragma clang diagnostic pop
     }
 
     if (!captureHitsOnSubviews) {
@@ -2023,9 +2012,7 @@ static BOOL isQuickLookEvent(NSEvent *event)
 - (void)_sendToolTipMouseExited
 {
     // Nothing matters except window, trackingNumber, and userData.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSMouseExited
+    NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSEventTypeMouseExited
         location:NSMakePoint(0, 0)
         modifierFlags:0
         timestamp:0
@@ -2034,16 +2021,13 @@ static BOOL isQuickLookEvent(NSEvent *event)
         eventNumber:0
         trackingNumber:TRACKING_RECT_TAG
         userData:_private->trackingRectUserData];
-#pragma clang diagnostic pop
     [_private->trackingRectOwner mouseExited:fakeEvent];
 }
 
 - (void)_sendToolTipMouseEntered
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     // Nothing matters except window, trackingNumber, and userData.
-    NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSMouseEntered
+    NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSEventTypeMouseEntered
         location:NSMakePoint(0, 0)
         modifierFlags:0
         timestamp:0
@@ -2053,7 +2037,6 @@ static BOOL isQuickLookEvent(NSEvent *event)
         trackingNumber:TRACKING_RECT_TAG
         userData:_private->trackingRectUserData];
     [_private->trackingRectOwner mouseEntered:fakeEvent];
-#pragma clang diagnostic pop
 }
 #endif // !PLATFORM(IOS)
 
@@ -2089,21 +2072,18 @@ static BOOL isQuickLookEvent(NSEvent *event)
 static bool mouseEventIsPartOfClickOrDrag(NSEvent *event)
 {
     switch ([event type]) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        case NSLeftMouseDown:
-        case NSLeftMouseUp:
-        case NSLeftMouseDragged:
-        case NSRightMouseDown:
-        case NSRightMouseUp:
-        case NSRightMouseDragged:
-        case NSOtherMouseDown:
-        case NSOtherMouseUp:
-        case NSOtherMouseDragged:
-#pragma clang diagnostic pop
-            return true;
-        default:
-            return false;
+    case NSEventTypeLeftMouseDown:
+    case NSEventTypeLeftMouseUp:
+    case NSEventTypeLeftMouseDragged:
+    case NSEventTypeRightMouseDown:
+    case NSEventTypeRightMouseUp:
+    case NSEventTypeRightMouseDragged:
+    case NSEventTypeOtherMouseDown:
+    case NSEventTypeOtherMouseUp:
+    case NSEventTypeOtherMouseDragged:
+        return true;
+    default:
+        return false;
     }
 }
 
@@ -2134,16 +2114,14 @@ static bool mouseEventIsPartOfClickOrDrag(NSEvent *event)
         float yScroll = visibleRect.origin.y;
         float xScroll = visibleRect.origin.x;
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        NSEvent *event = [NSEvent mouseEventWithType:NSMouseMoved
+        NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeMouseMoved
             location:NSMakePoint(-1 - xScroll, -1 - yScroll)
             modifierFlags:[[NSApp currentEvent] modifierFlags]
             timestamp:[NSDate timeIntervalSinceReferenceDate]
             windowNumber:[[view window] windowNumber]
             context:nullptr
             eventNumber:0 clickCount:0 pressure:0];
-#pragma clang diagnostic pop
+
         if (Frame* lastHitCoreFrame = core([lastHitView _frame]))
             lastHitCoreFrame->eventHandler().mouseMoved(event, [[self _webView] _pressureEvent]);
     }
@@ -2330,16 +2308,18 @@ static bool mouseEventIsPartOfClickOrDrag(NSEvent *event)
     }
 
 #if !PLATFORM(IOS)
+    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSEventTypeLeftMouseDragged
+        location:[[self window]
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSLeftMouseDragged
-        location:[[self window] convertScreenToBase:[NSEvent mouseLocation]]
+        convertScreenToBase:[NSEvent mouseLocation]]
+#pragma clang diagnostic pop
         modifierFlags:[[NSApp currentEvent] modifierFlags]
         timestamp:[NSDate timeIntervalSinceReferenceDate]
         windowNumber:[[self window] windowNumber]
         context:nullptr
         eventNumber:0 clickCount:0 pressure:0];
-#pragma clang diagnostic pop
+
     [self mouseDragged:fakeEvent];
 #endif
 }
@@ -3354,12 +3334,9 @@ WEBCORE_COMMAND(toggleUnderline)
     // or from calls back from WebCore once we begin mouse-down event handling.
 #if !PLATFORM(IOS)            
     NSEvent *event = [NSApp currentEvent];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([event type] == NSLeftMouseDown
+    if ([event type] == NSEventTypeLeftMouseDown
             && !_private->handlingMouseDownEvent
             && NSPointInRect([event locationInWindow], [self convertRect:[self visibleRect] toView:nil])) {
-#pragma clang diagnostic pop
         return NO;
     }
 #else
@@ -3528,13 +3505,10 @@ WEBCORE_COMMAND(toggleUnderline)
 
 #if !PLATFORM(IOS)
         if (!_private->flagsChangedEventMonitor) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-            _private->flagsChangedEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSFlagsChangedMask handler:^(NSEvent *flagsChangedEvent) {
+            _private->flagsChangedEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskFlagsChanged handler:^(NSEvent *flagsChangedEvent) {
                 [self _postFakeMouseMovedEventForFlagsChangedEvent:flagsChangedEvent];
                 return flagsChangedEvent;
             }];
-#pragma clang diagnostic pop
         }
     } else {
         [NSEvent removeMonitor:_private->flagsChangedEventMonitor];
@@ -4540,11 +4514,12 @@ static BOOL currentScrollIsBlit(NSView *clipView)
     NSInputManager *currentInputManager = [NSInputManager currentInputManager];
 
     if (![currentInputManager wantsToHandleMouseEvents] || ![currentInputManager handleMouseEvent:event]) {
+#pragma clang diagnostic pop
         [_private->completionController endRevertingChange:NO moveLeft:NO];
 
         // If the web page handles the context menu event and menuForEvent: returns nil, we'll get control click events here.
         // We don't want to pass them along to KHTML a second time.
-        if (!([event modifierFlags] & NSControlKeyMask)) {
+        if (!([event modifierFlags] & NSEventModifierFlagControl)) {
             _private->ignoringMouseDraggedEvents = NO;
 
             // Let WebCore get a chance to deal with the event. This will call back to us
@@ -4553,7 +4528,6 @@ static BOOL currentScrollIsBlit(NSView *clipView)
                 coreframe->eventHandler().mouseDown(event, [[self _webView] _pressureEvent]);
         }
     }
-#pragma clang diagnostic pop
 #endif
 
     _private->handlingMouseDownEvent = NO;
@@ -4642,7 +4616,7 @@ static BOOL currentScrollIsBlit(NSView *clipView)
     
     // Once the dragging machinery kicks in, we no longer get mouse drags or the up event.
     // WebCore expects to get balanced down/up's, so we must fake up a mouseup.
-    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSLeftMouseUp
+    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSEventTypeLeftMouseUp
                                             location:windowMouseLoc
                                        modifierFlags:[[NSApp currentEvent] modifierFlags]
                                            timestamp:[NSDate timeIntervalSinceReferenceDate]
@@ -4818,19 +4792,12 @@ static PassRefPtr<KeyboardEvent> currentKeyboardEvent(Frame* coreFrame)
         return 0;
 
     switch ([event type]) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    case NSKeyDown: {
-#pragma clang diagnostic pop
-
+    case NSEventTypeKeyDown: {
         PlatformKeyboardEvent platformEvent = PlatformEventFactory::createPlatformKeyboardEvent(event);
         platformEvent.disambiguateKeyDownEvent(PlatformEvent::RawKeyDown);
         return KeyboardEvent::create(platformEvent, coreFrame->document()->defaultView());
     }
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    case NSKeyUp:
-#pragma clang diagnostic pop
+    case NSEventTypeKeyUp:
         return KeyboardEvent::create(PlatformEventFactory::createPlatformKeyboardEvent(event), coreFrame->document()->defaultView());
     default:
         return 0;
@@ -5524,11 +5491,8 @@ static PassRefPtr<KeyboardEvent> currentKeyboardEvent(Frame* coreFrame)
     if (![self _canEdit])
         return NO;
     
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if (([event modifierFlags] & NSDeviceIndependentModifierFlagsMask) != NSCommandKeyMask)
+    if (([event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask) != NSEventModifierFlagCommand)
         return NO;
-#pragma clang diagnostic pop
 
     NSString *string = [event characters];
     if ([string caseInsensitiveCompare:@"b"] == NSOrderedSame) {
@@ -6448,14 +6412,11 @@ static BOOL writingDirectionKeyBindingsEnabled()
         return NO;
 
     NSEvent *macEvent = platformEvent->macEvent();
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([macEvent type] == NSKeyDown && [_private->completionController filterKeyDown:macEvent])
+    if ([macEvent type] == NSEventTypeKeyDown && [_private->completionController filterKeyDown:macEvent])
         return YES;
     
-    if ([macEvent type] == NSFlagsChanged)
+    if ([macEvent type] == NSEventTypeFlagsChanged)
         return NO;
-#pragma clang diagnostic pop
     
     parameters.event = event;
     _private->interpretKeyEventsParameters = &parameters;
index 78f56e4..a7330e1 100644 (file)
@@ -321,10 +321,7 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
     // Override hitTest so we can override menuForEvent.
     NSEvent *event = [NSApp currentEvent];
     NSEventType type = [event type];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if (type == NSRightMouseDown || (type == NSLeftMouseDown && ([event modifierFlags] & NSControlKeyMask)))
-#pragma clang diagnostic pop
+    if (type == NSEventTypeRightMouseDown || (type == NSEventTypeLeftMouseDown && ([event modifierFlags] & NSEventModifierFlagControl)))
         return self;
 
     return [super hitTest:point];
@@ -1009,39 +1006,33 @@ static BOOL isFrameInRange(WebFrame *frame, DOMRange *range)
     int button = noButton;
     RefPtr<Event> event;
     switch ([nsEvent type]) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        case NSLeftMouseUp:
-            button = 0;
-            break;
-        case NSRightMouseUp:
-            button = 1;
-            break;
-        case NSOtherMouseUp:
-            button = [nsEvent buttonNumber];
-            break;
-        case NSKeyDown: {
-            PlatformKeyboardEvent pe = PlatformEventFactory::createPlatformKeyboardEvent(nsEvent);
-            pe.disambiguateKeyDownEvent(PlatformEvent::RawKeyDown);
-            event = KeyboardEvent::create(pe, 0);
-            break;
-        }
-#pragma clang diagnostic pop
-        default:
-            break;
+    case NSEventTypeLeftMouseUp:
+        button = 0;
+        break;
+    case NSEventTypeRightMouseUp:
+        button = 1;
+        break;
+    case NSEventTypeOtherMouseUp:
+        button = [nsEvent buttonNumber];
+        break;
+    case NSEventTypeKeyDown: {
+        PlatformKeyboardEvent pe = PlatformEventFactory::createPlatformKeyboardEvent(nsEvent);
+        pe.disambiguateKeyDownEvent(PlatformEvent::RawKeyDown);
+        event = KeyboardEvent::create(pe, 0);
+        break;
+    }
+    default:
+        break;
     }
     if (button != noButton) {
         event = MouseEvent::create(eventNames().clickEvent, true, true, currentTime(), 0, [nsEvent clickCount], 0, 0, 0, 0,
 #if ENABLE(POINTER_LOCK)
             0, 0,
 #endif
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-            [nsEvent modifierFlags] & NSControlKeyMask,
-            [nsEvent modifierFlags] & NSAlternateKeyMask,
-            [nsEvent modifierFlags] & NSShiftKeyMask,
-            [nsEvent modifierFlags] & NSCommandKeyMask,
-#pragma clang diagnostic pop
+            [nsEvent modifierFlags] & NSEventModifierFlagControl,
+            [nsEvent modifierFlags] & NSEventModifierFlagOption,
+            [nsEvent modifierFlags] & NSEventModifierFlagShift,
+            [nsEvent modifierFlags] & NSEventModifierFlagCommand,
             button, 0, WebCore::ForceAtClick, 0, 0, true);
     }
 
@@ -1149,9 +1140,7 @@ static BOOL isFrameInRange(WebFrame *frame, DOMRange *range)
     // FIXME 4400480: when PDFView implements the standard scrolling selectors that this
     // method is used to mimic, we can eliminate this method and call them directly.
     NSString *keyAsString = [NSString stringWithCharacters:&functionKey length:1];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    return [NSEvent keyEventWithType:NSKeyDown
+    return [NSEvent keyEventWithType:NSEventTypeKeyDown
                             location:NSZeroPoint
                        modifierFlags:0
                            timestamp:0
@@ -1161,7 +1150,6 @@ static BOOL isFrameInRange(WebFrame *frame, DOMRange *range)
          charactersIgnoringModifiers:keyAsString
                            isARepeat:NO
                              keyCode:0];
-#pragma clang diagnostic pop
 }
 
 - (void)_lookUpInDictionaryFromMenu:(id)sender
index 4382b04..fd4eff9 100644 (file)
@@ -112,10 +112,7 @@ using namespace WebCore;
     [scrollView setDocumentView:_tableView];
     [_tableView release];
     
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    _popupWindow = [[NSWindow alloc] initWithContentRect:scrollFrame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
-#pragma clang diagnostic pop
+    _popupWindow = [[NSWindow alloc] initWithContentRect:scrollFrame styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
     [_popupWindow setAlphaValue:0.88f];
     [_popupWindow setContentView:scrollView];
     [scrollView release];
@@ -155,8 +152,8 @@ using namespace WebCore;
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
         maxWidth = ceilf([NSScrollView frameSizeForContentSize:NSMakeSize(maxWidth, 100.0f) hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSNoBorder].width);
-        maxWidth = ceilf([NSWindow frameRectForContentRect:NSMakeRect(0.0f, 0.0f, maxWidth, 100.0f) styleMask:NSBorderlessWindowMask].size.width);
 #pragma clang diagnostic pop
+        maxWidth = ceilf([NSWindow frameRectForContentRect:NSMakeRect(0.0f, 0.0f, maxWidth, 100.0f) styleMask:NSWindowStyleMaskBorderless].size.width);
         maxWidth += 5.0f;
         windowFrame.size.width = std::max(maxWidth, windowFrame.size.width);
     }
index 8ab02ac..854e958 100644 (file)
@@ -6426,10 +6426,7 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
         flags |= DragApplicationHasAttachedSheet;
     if ([draggingInfo draggingSource] == self)
         flags |= DragApplicationIsSource;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask)
-#pragma clang diagnostic pop
+    if ([[NSApp currentEvent] modifierFlags] & NSEventModifierFlagOption)
         flags |= DragApplicationIsCopyKeyDown;
     return static_cast<DragApplicationFlags>(flags);
 }
index ec35436..6b79123 100644 (file)
@@ -1,3 +1,54 @@
+2016-11-09  Chris Dumez  <cdumez@apple.com>
+
+        [Mac] Stop using deprecated AppKit enumeration values
+        https://bugs.webkit.org/show_bug.cgi?id=164494
+
+        Reviewed by Darin Adler.
+
+        Stop using deprecated AppKit enumeration values.
+
+        * Shared/mac/ChildProcessMac.mm:
+        (WebKit::ChildProcess::stopNSAppRunLoop):
+        * Shared/mac/WebEventFactory.mm:
+        (WebKit::mouseButtonForEvent):
+        (WebKit::mouseEventTypeForEvent):
+        (WebKit::clickCountForEvent):
+        (WebKit::globalPointForEvent):
+        (WebKit::pointForEvent):
+        (WebKit::textFromEvent):
+        (WebKit::unmodifiedTextFromEvent):
+        (WebKit::isKeypadEvent):
+        (WebKit::isKeyUpEvent):
+        (WebKit::WebEventFactory::createWebKeyboardEvent):
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::becomeFirstResponder):
+        (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
+        (WebKit::WebViewImpl::viewDidMoveToWindow):
+        (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
+        (WebKit::WebViewImpl::createFullScreenWindow):
+        (WebKit::WebViewImpl::sendToolTipMouseExited):
+        (WebKit::WebViewImpl::sendToolTipMouseEntered):
+        (WebKit::applicationFlagsForDrag):
+        (WebKit::WebViewImpl::setLastMouseDownEvent):
+        (WebKit::WebViewImpl::doneWithKeyEvent):
+        (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
+        (WebKit::WebViewImpl::performKeyEquivalent):
+        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
+        (WebKit::PluginProcessProxy::beginModal):
+        * UIProcess/mac/WebContextMenuProxyMac.mm:
+        (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        * UIProcess/mac/WebPopupMenuProxyMac.mm:
+        (WebKit::WebPopupMenuProxyMac::populate):
+        (WebKit::WebPopupMenuProxyMac::showPopupMenu):
+        * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
+        (WebKit::modifierFlagsFromWebEvent):
+        (WebKit::getEventTypeFromWebEvent):
+        * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
+        (WebKit::cssAlignmentValueForNSTextAlignment):
+        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+        (WebKit::convertImageToBitmap):
+
 2016-11-09  Beth Dakin  <bdakin@apple.com>
 
         Support TouchBar in WebKit
index 2e65806..fa625e3 100644 (file)
@@ -197,10 +197,7 @@ void ChildProcess::stopNSAppRunLoop()
     ASSERT([NSApp isRunning]);
     [NSApp stop:nil];
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined location:NSMakePoint(0, 0) modifierFlags:0 timestamp:0.0 windowNumber:0 context:nil subtype:0 data1:0 data2:0];
-#pragma clang diagnostic pop
+    NSEvent *event = [NSEvent otherEventWithType:NSEventTypeApplicationDefined location:NSMakePoint(0, 0) modifierFlags:0 timestamp:0.0 windowNumber:0 context:nil subtype:0 data1:0 data2:0];
     [NSApp postEvent:event atStart:true];
 }
 #endif
index a85efca..8b06ee7 100644 (file)
@@ -63,78 +63,69 @@ static WebMouseEvent::Button currentMouseButton()
 
 static WebMouseEvent::Button mouseButtonForEvent(NSEvent *event)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     switch ([event type]) {
-        case NSLeftMouseDown:
-        case NSLeftMouseUp:
-        case NSLeftMouseDragged:
-            return WebMouseEvent::LeftButton;
-        case NSRightMouseDown:
-        case NSRightMouseUp:
-        case NSRightMouseDragged:
-            return WebMouseEvent::RightButton;
-        case NSOtherMouseDown:
-        case NSOtherMouseUp:
-        case NSOtherMouseDragged:
-            return WebMouseEvent::MiddleButton;
+    case NSEventTypeLeftMouseDown:
+    case NSEventTypeLeftMouseUp:
+    case NSEventTypeLeftMouseDragged:
+        return WebMouseEvent::LeftButton;
+    case NSEventTypeRightMouseDown:
+    case NSEventTypeRightMouseUp:
+    case NSEventTypeRightMouseDragged:
+        return WebMouseEvent::RightButton;
+    case NSEventTypeOtherMouseDown:
+    case NSEventTypeOtherMouseUp:
+    case NSEventTypeOtherMouseDragged:
+        return WebMouseEvent::MiddleButton;
 #if defined(__LP64__)
-        case NSEventTypePressure:
+    case NSEventTypePressure:
 #endif
-        case NSMouseEntered:
-        case NSMouseExited:
-            return currentMouseButton();
-        default:
-            return WebMouseEvent::NoButton;
+    case NSEventTypeMouseEntered:
+    case NSEventTypeMouseExited:
+        return currentMouseButton();
+    default:
+        return WebMouseEvent::NoButton;
     }
-#pragma clang diagnostic pop
 }
 
 static WebEvent::Type mouseEventTypeForEvent(NSEvent* event)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     switch ([event type]) {
-        case NSLeftMouseDragged:
-        case NSMouseEntered:
-        case NSMouseExited:
-        case NSMouseMoved:
-        case NSOtherMouseDragged:
-        case NSRightMouseDragged:
-            return WebEvent::MouseMove;
-        case NSLeftMouseDown:
-        case NSRightMouseDown:
-        case NSOtherMouseDown:
-            return WebEvent::MouseDown;
-        case NSLeftMouseUp:
-        case NSRightMouseUp:
-        case NSOtherMouseUp:
-            return WebEvent::MouseUp;
-        default:
-            return WebEvent::MouseMove;
+    case NSEventTypeLeftMouseDragged:
+    case NSEventTypeMouseEntered:
+    case NSEventTypeMouseExited:
+    case NSEventTypeMouseMoved:
+    case NSEventTypeOtherMouseDragged:
+    case NSEventTypeRightMouseDragged:
+        return WebEvent::MouseMove;
+    case NSEventTypeLeftMouseDown:
+    case NSEventTypeRightMouseDown:
+    case NSEventTypeOtherMouseDown:
+        return WebEvent::MouseDown;
+    case NSEventTypeLeftMouseUp:
+    case NSEventTypeRightMouseUp:
+    case NSEventTypeOtherMouseUp:
+        return WebEvent::MouseUp;
+    default:
+        return WebEvent::MouseMove;
     }
-#pragma clang diagnostic pop
 }
 
 static int clickCountForEvent(NSEvent *event)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     switch ([event type]) {
-        case NSLeftMouseDown:
-        case NSLeftMouseUp:
-        case NSLeftMouseDragged:
-        case NSRightMouseDown:
-        case NSRightMouseUp:
-        case NSRightMouseDragged:
-        case NSOtherMouseDown:
-        case NSOtherMouseUp:
-        case NSOtherMouseDragged:
-            return [event clickCount];
-        default:
-            return 0;
+    case NSEventTypeLeftMouseDown:
+    case NSEventTypeLeftMouseUp:
+    case NSEventTypeLeftMouseDragged:
+    case NSEventTypeRightMouseDown:
+    case NSEventTypeRightMouseUp:
+    case NSEventTypeRightMouseDragged:
+    case NSEventTypeOtherMouseDown:
+    case NSEventTypeOtherMouseUp:
+    case NSEventTypeOtherMouseDragged:
+        return [event clickCount];
+    default:
+        return 0;
     }
-#pragma clang diagnostic pop
 }
 
 static NSPoint globalPointForEvent(NSEvent *event)
@@ -143,22 +134,19 @@ static NSPoint globalPointForEvent(NSEvent *event)
 #if defined(__LP64__)
     case NSEventTypePressure:
 #endif
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    case NSLeftMouseDown:
-    case NSLeftMouseDragged:
-    case NSLeftMouseUp:
-    case NSMouseEntered:
-    case NSMouseExited:
-    case NSMouseMoved:
-    case NSOtherMouseDown:
-    case NSOtherMouseDragged:
-    case NSOtherMouseUp:
-    case NSRightMouseDown:
-    case NSRightMouseDragged:
-    case NSRightMouseUp:
-    case NSScrollWheel:
-#pragma clang diagnostic pop
+    case NSEventTypeLeftMouseDown:
+    case NSEventTypeLeftMouseUp:
+    case NSEventTypeLeftMouseDragged:
+    case NSEventTypeMouseEntered:
+    case NSEventTypeMouseExited:
+    case NSEventTypeMouseMoved:
+    case NSEventTypeOtherMouseDown:
+    case NSEventTypeOtherMouseUp:
+    case NSEventTypeOtherMouseDragged:
+    case NSEventTypeRightMouseDown:
+    case NSEventTypeRightMouseUp:
+    case NSEventTypeRightMouseDragged:
+    case NSEventTypeScrollWheel:
         return WebCore::globalPoint([event locationInWindow], [event window]);
     default:
         return NSZeroPoint;
@@ -171,22 +159,19 @@ static NSPoint pointForEvent(NSEvent *event, NSView *windowView)
 #if defined(__LP64__)
     case NSEventTypePressure:
 #endif
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    case NSLeftMouseDown:
-    case NSLeftMouseDragged:
-    case NSLeftMouseUp:
-    case NSMouseEntered:
-    case NSMouseExited:
-    case NSMouseMoved:
-    case NSOtherMouseDown:
-    case NSOtherMouseDragged:
-    case NSOtherMouseUp:
-    case NSRightMouseDown:
-    case NSRightMouseDragged:
-    case NSRightMouseUp:
-    case NSScrollWheel: {
-#pragma clang diagnostic pop
+    case NSEventTypeLeftMouseDown:
+    case NSEventTypeLeftMouseUp:
+    case NSEventTypeLeftMouseDragged:
+    case NSEventTypeMouseEntered:
+    case NSEventTypeMouseExited:
+    case NSEventTypeMouseMoved:
+    case NSEventTypeOtherMouseDown:
+    case NSEventTypeOtherMouseUp:
+    case NSEventTypeOtherMouseDragged:
+    case NSEventTypeRightMouseDown:
+    case NSEventTypeRightMouseUp:
+    case NSEventTypeRightMouseDragged:
+    case NSEventTypeScrollWheel: {
         // Note: This will have its origin at the bottom left of the window unless windowView is flipped.
         // In those cases, the Y coordinate gets flipped by Widget::convertFromContainingWindow.
         NSPoint location = [event locationInWindow];
@@ -240,10 +225,7 @@ static inline String textFromEvent(NSEvent* event, bool replacesSoftSpace)
 {
     if (replacesSoftSpace)
         return emptyString();
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([event type] == NSFlagsChanged)
-#pragma clang diagnostic pop
+    if ([event type] == NSEventTypeFlagsChanged)
         return emptyString();
     return String([event characters]);
 }
@@ -252,10 +234,7 @@ static inline String unmodifiedTextFromEvent(NSEvent* event, bool replacesSoftSp
 {
     if (replacesSoftSpace)
         return emptyString();
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([event type] == NSFlagsChanged)
-#pragma clang diagnostic pop
+    if ([event type] == NSEventTypeFlagsChanged)
         return emptyString();
     return String([event charactersIgnoringModifiers]);
 }
@@ -264,74 +243,68 @@ static bool isKeypadEvent(NSEvent* event)
 {
     // Check that this is the type of event that has a keyCode.
     switch ([event type]) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        case NSKeyDown:
-        case NSKeyUp:
-        case NSFlagsChanged:
-#pragma clang diagnostic pop
-            break;
-        default:
-            return false;
+    case NSEventTypeKeyDown:
+    case NSEventTypeKeyUp:
+    case NSEventTypeFlagsChanged:
+        break;
+    default:
+        return false;
     }
 
     switch ([event keyCode]) {
-        case 71: // Clear
-        case 81: // =
-        case 75: // /
-        case 67: // *
-        case 78: // -
-        case 69: // +
-        case 76: // Enter
-        case 65: // .
-        case 82: // 0
-        case 83: // 1
-        case 84: // 2
-        case 85: // 3
-        case 86: // 4
-        case 87: // 5
-        case 88: // 6
-        case 89: // 7
-        case 91: // 8
-        case 92: // 9
-            return true;
-     }
+    case 71: // Clear
+    case 81: // =
+    case 75: // /
+    case 67: // *
+    case 78: // -
+    case 69: // +
+    case 76: // Enter
+    case 65: // .
+    case 82: // 0
+    case 83: // 1
+    case 84: // 2
+    case 85: // 3
+    case 86: // 4
+    case 87: // 5
+    case 88: // 6
+    case 89: // 7
+    case 91: // 8
+    case 92: // 9
+        return true;
+    }
      
      return false;
 }
 
 static inline bool isKeyUpEvent(NSEvent *event)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([event type] != NSFlagsChanged)
-        return [event type] == NSKeyUp;
+    if ([event type] != NSEventTypeFlagsChanged)
+        return [event type] == NSEventTypeKeyUp;
     // FIXME: This logic fails if the user presses both Shift keys at once, for example:
     // we treat releasing one of them as keyDown.
     switch ([event keyCode]) {
-        case 54: // Right Command
-        case 55: // Left Command
-            return ([event modifierFlags] & NSCommandKeyMask) == 0;
-            
-        case 57: // Capslock
-            return ([event modifierFlags] & NSAlphaShiftKeyMask) == 0;
-            
-        case 56: // Left Shift
-        case 60: // Right Shift
-            return ([event modifierFlags] & NSShiftKeyMask) == 0;
-            
-        case 58: // Left Alt
-        case 61: // Right Alt
-            return ([event modifierFlags] & NSAlternateKeyMask) == 0;
-            
-        case 59: // Left Ctrl
-        case 62: // Right Ctrl
-            return ([event modifierFlags] & NSControlKeyMask) == 0;
-            
-        case 63: // Function
-            return ([event modifierFlags] & NSFunctionKeyMask) == 0;
+    case 54: // Right Command
+    case 55: // Left Command
+        return !([event modifierFlags] & NSEventModifierFlagCommand);
+
+    case 57: // Capslock
+        return !([event modifierFlags] & NSEventModifierFlagCapsLock);
+
+    case 56: // Left Shift
+    case 60: // Right Shift
+        return !([event modifierFlags] & NSEventModifierFlagShift);
+
+    case 58: // Left Alt
+    case 61: // Right Alt
+        return !([event modifierFlags] & NSEventModifierFlagOption);
+
+    case 59: // Left Ctrl
+    case 62: // Right Ctrl
+        return !([event modifierFlags] & NSEventModifierFlagControl);
+
+    case 63: // Function
+        return !([event modifierFlags] & NSEventModifierFlagFunction);
     }
-#pragma clang diagnostic pop
     return false;
 }
 
@@ -339,7 +312,6 @@ static inline WebEvent::Modifiers modifiersForEvent(NSEvent *event)
 {
     unsigned modifiers = 0;
 
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
     if ([event modifierFlags] & NSEventModifierFlagCapsLock)
         modifiers |= WebEvent::CapsLockKey;
     if ([event modifierFlags] & NSEventModifierFlagShift)
@@ -350,18 +322,6 @@ static inline WebEvent::Modifiers modifiersForEvent(NSEvent *event)
         modifiers |= WebEvent::AltKey;
     if ([event modifierFlags] & NSEventModifierFlagCommand)
         modifiers |= WebEvent::MetaKey;
-#else
-    if ([event modifierFlags] & NSAlphaShiftKeyMask)
-        modifiers |= WebEvent::CapsLockKey;
-    if ([event modifierFlags] & NSShiftKeyMask)
-        modifiers |= WebEvent::ShiftKey;
-    if ([event modifierFlags] & NSControlKeyMask)
-        modifiers |= WebEvent::ControlKey;
-    if ([event modifierFlags] & NSAlternateKeyMask)
-        modifiers |= WebEvent::AltKey;
-    if ([event modifierFlags] & NSCommandKeyMask)
-        modifiers |= WebEvent::MetaKey;
-#endif
 
     return (WebEvent::Modifiers)modifiers;
 }
@@ -484,10 +444,7 @@ WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(NSEvent *event, bool ha
     int windowsVirtualKeyCode       = windowsKeyCodeForKeyEvent(event);
     int nativeVirtualKeyCode        = [event keyCode];
     int macCharCode                 = WKGetNSEventKeyChar(event);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    bool autoRepeat                 = ([event type] != NSFlagsChanged) && [event isARepeat];
-#pragma clang diagnostic pop
+    bool autoRepeat                 = [event type] != NSEventTypeFlagsChanged && [event isARepeat];
     bool isKeypad                   = isKeypadEvent(event);
     bool isSystemKey                = false; // SystemKey is always false on the Mac.
     WebEvent::Modifiers modifiers   = modifiersForEvent(event);
index ba1996b..67e8bd3 100644 (file)
@@ -79,7 +79,6 @@ static NSEventModifierFlags toNSEventModifierFlags(WebKit::WebEvent::Modifiers m
 {
     NSEventModifierFlags modifierFlags = 0;
 
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
     if (modifiers & WebKit::WebEvent::CapsLockKey)
         modifierFlags |= NSEventModifierFlagCapsLock;
     if (modifiers & WebKit::WebEvent::ShiftKey)
@@ -90,18 +89,6 @@ static NSEventModifierFlags toNSEventModifierFlags(WebKit::WebEvent::Modifiers m
         modifierFlags |= NSEventModifierFlagOption;
     if (modifiers & WebKit::WebEvent::MetaKey)
         modifierFlags |= NSEventModifierFlagCommand;
-#else
-    if (modifiers & WebKit::WebEvent::CapsLockKey)
-        modifierFlags |= NSAlphaShiftKeyMask;
-    if (modifiers & WebKit::WebEvent::ShiftKey)
-        modifierFlags |= NSShiftKeyMask;
-    if (modifiers & WebKit::WebEvent::ControlKey)
-        modifierFlags |= NSControlKeyMask;
-    if (modifiers & WebKit::WebEvent::AltKey)
-        modifierFlags |= NSAlternateKeyMask;
-    if (modifiers & WebKit::WebEvent::MetaKey)
-        modifierFlags |= NSCommandKeyMask;
-#endif
 
     return modifierFlags;
 }
index c28ca3c..71fe19d 100644 (file)
@@ -1316,11 +1316,8 @@ bool WebViewImpl::becomeFirstResponder()
     if (direction != NSDirectSelection) {
         NSEvent *event = [NSApp currentEvent];
         NSEvent *keyboardEvent = nil;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        if ([event type] == NSKeyDown || [event type] == NSKeyUp)
+        if ([event type] == NSEventTypeKeyDown || [event type] == NSEventTypeKeyUp)
             keyboardEvent = event;
-#pragma clang diagnostic pop
         m_page->setInitialFocus(direction == NSSelectingNext, keyboardEvent != nil, NativeWebKeyboardEvent(keyboardEvent, false, false, { }), [](WebKit::CallbackBase::Error) { });
     }
     return true;
@@ -1544,10 +1541,7 @@ void WebViewImpl::updateContentInsetsIfAutomatic()
         return;
 
     NSWindow *window = m_view.window;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ((window.styleMask & NSFullSizeContentViewWindowMask) && !window.titlebarAppearsTransparent && ![m_view enclosingScrollView]) {
-#pragma clang diagnostic pop
+    if ((window.styleMask & NSWindowStyleMaskFullSizeContentView) && !window.titlebarAppearsTransparent && ![m_view enclosingScrollView]) {
         NSRect contentLayoutRect = [m_view convertRect:window.contentLayoutRect fromView:nil];
         CGFloat newTopContentInset = NSMaxY(contentLayoutRect) - NSHeight(contentLayoutRect);
         if (m_topContentInset != newTopContentInset)
@@ -1924,10 +1918,7 @@ void WebViewImpl::viewDidMoveToWindow()
 
         if (!m_flagsChangedEventMonitor) {
             auto weakThis = createWeakPtr();
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-            m_flagsChangedEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSFlagsChangedMask handler:[weakThis] (NSEvent *flagsChangedEvent) {
-#pragma clang diagnostic pop
+            m_flagsChangedEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskFlagsChanged handler:[weakThis] (NSEvent *flagsChangedEvent) {
                 if (weakThis)
                     weakThis->postFakeMouseMovedEventForFlagsChangedEvent(flagsChangedEvent);
                 return flagsChangedEvent;
@@ -1998,12 +1989,9 @@ NSView *WebViewImpl::hitTest(CGPoint point)
 
 void WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent(NSEvent *flagsChangedEvent)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:flagsChangedEvent.window.mouseLocationOutsideOfEventStream
+    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSEventTypeMouseMoved location:flagsChangedEvent.window.mouseLocationOutsideOfEventStream
         modifierFlags:flagsChangedEvent.modifierFlags timestamp:flagsChangedEvent.timestamp windowNumber:flagsChangedEvent.windowNumber
         context:nullptr eventNumber:0 clickCount:0 pressure:0];
-#pragma clang diagnostic pop
     NativeWebMouseEvent webEvent(fakeEvent, m_lastPressureEvent.get(), m_view);
     m_page->handleMouseEvent(webEvent);
 }
@@ -2352,10 +2340,7 @@ NSView *WebViewImpl::fullScreenPlaceholderView()
 NSWindow *WebViewImpl::createFullScreenWindow()
 {
 #if ENABLE(FULLSCREEN_API)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    return [[[WebCoreFullScreenWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame] styleMask:(NSBorderlessWindowMask | NSResizableWindowMask) backing:NSBackingStoreBuffered defer:NO] autorelease];
-#pragma clang diagnostic pop
+    return [[[WebCoreFullScreenWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame] styleMask:(NSWindowStyleMaskBorderless | NSWindowStyleMaskResizable) backing:NSBackingStoreBuffered defer:NO] autorelease];
 #else
     return nil;
 #endif
@@ -3327,9 +3312,7 @@ void WebViewImpl::removeTrackingRects(NSTrackingRectTag *tags, int count)
 void WebViewImpl::sendToolTipMouseExited()
 {
     // Nothing matters except window, trackingNumber, and userData.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSMouseExited
+    NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSEventTypeMouseExited
                                                 location:NSMakePoint(0, 0)
                                            modifierFlags:0
                                                timestamp:0
@@ -3338,16 +3321,13 @@ void WebViewImpl::sendToolTipMouseExited()
                                              eventNumber:0
                                           trackingNumber:TRACKING_RECT_TAG
                                                 userData:m_trackingRectUserData];
-#pragma clang diagnostic pop
     [m_trackingRectOwner mouseExited:fakeEvent];
 }
 
 void WebViewImpl::sendToolTipMouseEntered()
 {
     // Nothing matters except window, trackingNumber, and userData.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSMouseEntered
+    NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSEventTypeMouseEntered
                                                 location:NSMakePoint(0, 0)
                                            modifierFlags:0
                                                timestamp:0
@@ -3356,7 +3336,6 @@ void WebViewImpl::sendToolTipMouseEntered()
                                              eventNumber:0
                                           trackingNumber:TRACKING_RECT_TAG
                                                 userData:m_trackingRectUserData];
-#pragma clang diagnostic pop
     [m_trackingRectOwner mouseEntered:fakeEvent];
 }
 
@@ -3512,10 +3491,7 @@ static WebCore::DragApplicationFlags applicationFlagsForDrag(NSView *view, id <N
         flags |= WebCore::DragApplicationHasAttachedSheet;
     if (draggingInfo.draggingSource == view)
         flags |= WebCore::DragApplicationIsSource;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([NSApp currentEvent].modifierFlags & NSAlternateKeyMask)
-#pragma clang diagnostic pop
+    if ([NSApp currentEvent].modifierFlags & NSEventModifierFlagOption)
         flags |= WebCore::DragApplicationIsCopyKeyDown;
     return static_cast<WebCore::DragApplicationFlags>(flags);
 
@@ -4055,10 +4031,7 @@ void WebViewImpl::smartMagnifyWithEvent(NSEvent *event)
 
 void WebViewImpl::setLastMouseDownEvent(NSEvent *event)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    ASSERT(!event || event.type == NSLeftMouseDown || event.type == NSRightMouseDown || event.type == NSOtherMouseDown);
-#pragma clang diagnostic pop
+    ASSERT(!event || event.type == NSEventTypeLeftMouseDown || event.type == NSEventTypeRightMouseDown || event.type == NSEventTypeOtherMouseDown);
 
     if (event == m_lastMouseDownEvent.get())
         return;
@@ -4095,11 +4068,8 @@ void WebViewImpl::didRestoreScrollPosition()
 
 void WebViewImpl::doneWithKeyEvent(NSEvent *event, bool eventWasHandled)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([event type] != NSKeyDown)
+    if ([event type] != NSEventTypeKeyDown)
         return;
-#pragma clang diagnostic pop
 
     if (tryPostProcessPluginComplexTextInputKeyDown(event))
         return;
@@ -4175,11 +4145,8 @@ Vector<WebCore::KeypressCommand> WebViewImpl::collectKeyboardLayoutCommandsForEv
 {
     Vector<WebCore::KeypressCommand> commands;
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([event type] != NSKeyDown)
+    if ([event type] != NSEventTypeKeyDown)
         return commands;
-#pragma clang diagnostic pop
 
     ASSERT(!m_collectedKeypressCommands);
     m_collectedKeypressCommands = &commands;
@@ -4554,11 +4521,8 @@ bool WebViewImpl::performKeyEquivalent(NSEvent *event)
     // We get Esc key here after processing either Esc or Cmd+period. The former starts as a keyDown, and the latter starts as a key equivalent,
     // but both get transformed to a cancelOperation: command, executing which passes an Esc key event to -performKeyEquivalent:.
     // Don't interpret this event again, avoiding re-entrancy and infinite loops.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    if ([[event charactersIgnoringModifiers] isEqualToString:@"\e"] && !([event modifierFlags] & NSDeviceIndependentModifierFlagsMask))
+    if ([[event charactersIgnoringModifiers] isEqualToString:@"\e"] && !([event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask))
         return [m_view _web_superPerformKeyEquivalent:event];
-#pragma clang diagnostic pop
 
     if (m_keyDownEventBeingResent) {
         // WebCore has already seen the event, no need for custom processing.
index f07d279..268d09e 100644 (file)
@@ -231,10 +231,7 @@ void PluginProcessProxy::beginModal()
     ASSERT(!m_placeholderWindow);
     ASSERT(!m_activationObserver);
     
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    m_placeholderWindow = adoptNS([[WKPlaceholderModalWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1, 1) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
-#pragma clang diagnostic pop
+    m_placeholderWindow = adoptNS([[WKPlaceholderModalWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1, 1) styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES]);
     [m_placeholderWindow setReleasedWhenClosed:NO];
     
     m_activationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationWillBecomeActiveNotification object:NSApp queue:nil
index a483964..47da217 100644 (file)
@@ -463,10 +463,7 @@ void WebContextMenuProxyMac::showContextMenuWithItems(const Vector<WebContextMen
     [[WKMenuTarget sharedMenuTarget] setMenuProxy:this];
 
     NSPoint menuLocation = [m_webView convertPoint:m_context.menuLocation() toView:nil];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseUp location:menuLocation modifierFlags:0 timestamp:0 windowNumber:m_webView.window.windowNumber context:nil eventNumber:0 clickCount:0 pressure:0];
-#pragma clang diagnostic pop
+    NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeRightMouseUp location:menuLocation modifierFlags:0 timestamp:0 windowNumber:m_webView.window.windowNumber context:nil eventNumber:0 clickCount:0 pressure:0];
     [NSMenu popUpContextMenu:m_menu.get() withEvent:event forView:m_webView];
 
     if (m_contextMenuListener) {
index 0a79913..818bd39 100644 (file)
@@ -48,10 +48,7 @@ SOFT_LINK_STAGED_FRAMEWORK(WebInspectorUI, PrivateFrameworks, A)
 using namespace WebCore;
 using namespace WebKit;
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-static const NSUInteger windowStyleMask = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask | NSFullSizeContentViewWindowMask;
-#pragma clang diagnostic pop
+static const NSUInteger windowStyleMask = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable | NSWindowStyleMaskFullSizeContentView;
 
 // The time we keep our WebView alive before closing it and its process.
 // Reusing the WebView improves start up time for people that jump in and out of the Inspector.
index d29d089..d30194d 100644 (file)
@@ -74,19 +74,13 @@ void WebPopupMenuProxyMac::populate(const Vector<WebPopupItem>& items, NSFont *f
             RetainPtr<NSMutableParagraphStyle> paragraphStyle = adoptNS([[NSParagraphStyle defaultParagraphStyle] mutableCopy]);
             NSWritingDirection writingDirection = items[i].m_textDirection == LTR ? NSWritingDirectionLeftToRight : NSWritingDirectionRightToLeft;
             [paragraphStyle setBaseWritingDirection:writingDirection];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-            [paragraphStyle setAlignment:menuTextDirection == LTR ? NSLeftTextAlignment : NSRightTextAlignment];
-#pragma clang diagnostic pop
+            [paragraphStyle setAlignment:menuTextDirection == LTR ? NSTextAlignmentLeft : NSTextAlignmentRight];
             RetainPtr<NSMutableDictionary> attributes = adoptNS([[NSMutableDictionary alloc] initWithObjectsAndKeys:
                 paragraphStyle.get(), NSParagraphStyleAttributeName,
                 font, NSFontAttributeName,
             nil]);
             if (items[i].m_hasTextDirectionOverride) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-                RetainPtr<NSNumber> writingDirectionValue = adoptNS([[NSNumber alloc] initWithInteger:writingDirection + NSTextWritingDirectionOverride]);
-#pragma clang diagnostic pop
+                RetainPtr<NSNumber> writingDirectionValue = adoptNS([[NSNumber alloc] initWithInteger:writingDirection + NSWritingDirectionOverride]);
                 RetainPtr<NSArray> writingDirectionArray = adoptNS([[NSArray alloc] initWithObjects:writingDirectionValue.get(), nil]);
                 [attributes setObject:writingDirectionArray.get() forKey:NSWritingDirectionAttributeName];
             }
@@ -154,18 +148,15 @@ void WebPopupMenuProxyMac::showPopupMenu(const IntRect& rect, TextDirection text
 
     NSControlSize controlSize;
     switch (data.menuSize) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     case WebCore::PopupMenuStyle::PopupMenuSizeNormal:
-        controlSize = NSRegularControlSize;
+        controlSize = NSControlSizeRegular;
         break;
     case WebCore::PopupMenuStyle::PopupMenuSizeSmall:
-        controlSize = NSSmallControlSize;
+        controlSize = NSControlSizeSmall;
         break;
     case WebCore::PopupMenuStyle::PopupMenuSizeMini:
-        controlSize = NSMiniControlSize;
+        controlSize = NSControlSizeMini;
         break;
-#pragma clang diagnostic pop
     }
 
     Ref<WebPopupMenuProxyMac> protect(*this);
@@ -183,13 +174,11 @@ void WebPopupMenuProxyMac::showPopupMenu(const IntRect& rect, TextDirection text
     if (!m_client->currentlyProcessedMouseDownEvent())
         return;
     
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     NSEvent* initiatingNSEvent = m_client->currentlyProcessedMouseDownEvent()->nativeEvent();
-    if ([initiatingNSEvent type] != NSLeftMouseDown)
+    if ([initiatingNSEvent type] != NSEventTypeLeftMouseDown)
         return;
 
-    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSLeftMouseUp
+    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSEventTypeLeftMouseUp
                                             location:[initiatingNSEvent locationInWindow]
                                        modifierFlags:[initiatingNSEvent modifierFlags]
                                            timestamp:[initiatingNSEvent timestamp]
@@ -198,13 +187,14 @@ void WebPopupMenuProxyMac::showPopupMenu(const IntRect& rect, TextDirection text
                                          eventNumber:[initiatingNSEvent eventNumber]
                                           clickCount:[initiatingNSEvent clickCount]
                                             pressure:[initiatingNSEvent pressure]];
-#pragma clang diagnostic pop
 
     [NSApp postEvent:fakeEvent atStart:YES];
+    fakeEvent = [NSEvent mouseEventWithType:NSEventTypeMouseMoved
+                                   location:[[m_webView window]
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved
-                                   location:[[m_webView window] convertScreenToBase:[NSEvent mouseLocation]]
+                        convertScreenToBase:[NSEvent mouseLocation]]
+#pragma clang diagnostic pop
                               modifierFlags:[initiatingNSEvent modifierFlags]
                                   timestamp:[initiatingNSEvent timestamp]
                                windowNumber:[initiatingNSEvent windowNumber]
@@ -212,7 +202,6 @@ void WebPopupMenuProxyMac::showPopupMenu(const IntRect& rect, TextDirection text
                                 eventNumber:0
                                  clickCount:0
                                    pressure:0];
-#pragma clang diagnostic pop
     [NSApp postEvent:fakeEvent atStart:YES];
 }
 
index 1f9930e..b926db0 100644 (file)
@@ -475,13 +475,13 @@ static uint32_t modifierFlags(const WebEvent& event)
     uint32_t modifiers = 0;
 
     if (event.shiftKey())
-        modifiers |= NSShiftKeyMask;
+        modifiers |= NSEventModifierFlagShift;
     if (event.controlKey())
-        modifiers |= NSControlKeyMask;
+        modifiers |= NSEventModifierFlagControl;
     if (event.altKey())
-        modifiers |= NSAlternateKeyMask;
+        modifiers |= NSEventModifierFlagOption;
     if (event.metaKey())
-        modifiers |= NSCommandKeyMask;
+        modifiers |= NSEventModifierFlagCommand;
     
     return modifiers;
 }
@@ -706,15 +706,15 @@ static unsigned modifierFlags(const WebKeyboardEvent& keyboardEvent)
     unsigned modifierFlags = 0;
 
     if (keyboardEvent.capsLockKey())
-        modifierFlags |= NSAlphaShiftKeyMask;
+        modifierFlags |= NSEventModifierFlagCapsLock;
     if (keyboardEvent.shiftKey())
-        modifierFlags |= NSShiftKeyMask;
+        modifierFlags |= NSEventModifierFlagShift;
     if (keyboardEvent.controlKey())
-        modifierFlags |= NSControlKeyMask;
+        modifierFlags |= NSEventModifierFlagControl;
     if (keyboardEvent.altKey())
-        modifierFlags |= NSAlternateKeyMask;
+        modifierFlags |= NSEventModifierFlagOption;
     if (keyboardEvent.metaKey())
-        modifierFlags |= NSCommandKeyMask;
+        modifierFlags |= NSEventModifierFlagCommand;
 
     return modifierFlags;
 }
index 5ede56e..f9f339a 100644 (file)
@@ -1278,33 +1278,28 @@ void PDFPlugin::didEvaluateJavaScript(uint64_t, const WTF::String&)
     
 static NSUInteger modifierFlagsFromWebEvent(const WebEvent& event)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    return (event.shiftKey() ? NSShiftKeyMask : 0)
-        | (event.controlKey() ? NSControlKeyMask : 0)
-        | (event.altKey() ? NSAlternateKeyMask : 0)
-        | (event.metaKey() ? NSCommandKeyMask : 0);
-#pragma clang diagnostic pop
+    return (event.shiftKey() ? NSEventModifierFlagShift : 0)
+        | (event.controlKey() ? NSEventModifierFlagControl : 0)
+        | (event.altKey() ? NSEventModifierFlagOption : 0)
+        | (event.metaKey() ? NSEventModifierFlagCommand : 0);
 }
     
 static bool getEventTypeFromWebEvent(const WebEvent& event, NSEventType& eventType)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     switch (event.type()) {
     case WebEvent::KeyDown:
-        eventType = NSKeyDown;
+        eventType = NSEventTypeKeyDown;
         return true;
     case WebEvent::KeyUp:
-        eventType = NSKeyUp;
+        eventType = NSEventTypeKeyUp;
         return true;
     case WebEvent::MouseDown:
         switch (static_cast<const WebMouseEvent&>(event).button()) {
         case WebMouseEvent::LeftButton:
-            eventType = NSLeftMouseDown;
+            eventType = NSEventTypeLeftMouseDown;
             return true;
         case WebMouseEvent::RightButton:
-            eventType = NSRightMouseDown;
+            eventType = NSEventTypeRightMouseDown;
             return true;
         default:
             return false;
@@ -1312,10 +1307,10 @@ static bool getEventTypeFromWebEvent(const WebEvent& event, NSEventType& eventTy
     case WebEvent::MouseUp:
         switch (static_cast<const WebMouseEvent&>(event).button()) {
         case WebMouseEvent::LeftButton:
-            eventType = NSLeftMouseUp;
+            eventType = NSEventTypeLeftMouseUp;
             return true;
         case WebMouseEvent::RightButton:
-            eventType = NSRightMouseUp;
+            eventType = NSEventTypeRightMouseUp;
             return true;
         default:
             return false;
@@ -1323,13 +1318,13 @@ static bool getEventTypeFromWebEvent(const WebEvent& event, NSEventType& eventTy
     case WebEvent::MouseMove:
         switch (static_cast<const WebMouseEvent&>(event).button()) {
         case WebMouseEvent::LeftButton:
-            eventType = NSLeftMouseDragged;
+            eventType = NSEventTypeLeftMouseDragged;
             return true;
         case WebMouseEvent::RightButton:
-            eventType = NSRightMouseDragged;
+            eventType = NSEventTypeRightMouseDragged;
             return true;
         case WebMouseEvent::NoButton:
-            eventType = NSMouseMoved;
+            eventType = NSEventTypeMouseMoved;
             return true;
         default:
             return false;
@@ -1337,7 +1332,6 @@ static bool getEventTypeFromWebEvent(const WebEvent& event, NSEventType& eventTy
     default:
         return false;
     }
-#pragma clang diagnostic pop
 }
     
 NSEvent *PDFPlugin::nsEventForWebMouseEvent(const WebMouseEvent& event)
index c4d256c..4a72ab7 100644 (file)
@@ -963,10 +963,10 @@ void PDFPlugin::didEvaluateJavaScript(uint64_t, const WTF::String&)
 
 static NSUInteger modifierFlagsFromWebEvent(const WebEvent& event)
 {
-    return (event.shiftKey() ? NSShiftKeyMask : 0)
-        | (event.controlKey() ? NSControlKeyMask : 0)
-        | (event.altKey() ? NSAlternateKeyMask : 0)
-        | (event.metaKey() ? NSCommandKeyMask : 0);
+    return (event.shiftKey() ? NSEventModifierFlagShift : 0)
+        | (event.controlKey() ? NSEventModifierFlagControl : 0)
+        | (event.altKey() ? NSEventModifierFlagOption : 0)
+        | (event.metaKey() ? NSEventModifierFlagCommand : 0);
 }
     
 static bool getEventTypeFromWebEvent(const WebEvent& event, NSEventType& eventType)
@@ -975,10 +975,10 @@ static bool getEventTypeFromWebEvent(const WebEvent& event, NSEventType& eventTy
     case WebEvent::MouseDown:
         switch (static_cast<const WebMouseEvent&>(event).button()) {
         case WebMouseEvent::LeftButton:
-            eventType = NSLeftMouseDown;
+            eventType = NSEventTypeLeftMouseDown;
             return true;
         case WebMouseEvent::RightButton:
-            eventType = NSRightMouseDown;
+            eventType = NSEventTypeRightMouseDown;
             return true;
         default:
             return false;
@@ -986,10 +986,10 @@ static bool getEventTypeFromWebEvent(const WebEvent& event, NSEventType& eventTy
     case WebEvent::MouseUp:
         switch (static_cast<const WebMouseEvent&>(event).button()) {
         case WebMouseEvent::LeftButton:
-            eventType = NSLeftMouseUp;
+            eventType = NSEventTypeLeftMouseUp;
             return true;
         case WebMouseEvent::RightButton:
-            eventType = NSRightMouseUp;
+            eventType = NSEventTypeRightMouseUp;
             return true;
         default:
             return false;
@@ -997,13 +997,13 @@ static bool getEventTypeFromWebEvent(const WebEvent& event, NSEventType& eventTy
     case WebEvent::MouseMove:
         switch (static_cast<const WebMouseEvent&>(event).button()) {
         case WebMouseEvent::LeftButton:
-            eventType = NSLeftMouseDragged;
+            eventType = NSEventTypeLeftMouseDragged;
             return true;
         case WebMouseEvent::RightButton:
-            eventType = NSRightMouseDragged;
+            eventType = NSEventTypeRightMouseDragged;
             return true;
         case WebMouseEvent::NoButton:
-            eventType = NSMouseMoved;
+            eventType = NSEventTypeMouseMoved;
             return true;
         default:
             return false;
@@ -1756,11 +1756,11 @@ bool PDFPlugin::HUD::mouseEvent(PageOverlay&, const PlatformMouseEvent& event)
 
     switch (event.type()) {
     case PlatformEvent::MouseMoved:
-        return [pdfLayerController mouseDragged:eventWithType(NSLeftMouseDragged) inHUDWithBounds:HUDRectInRootViewCoordinates];
+        return [pdfLayerController mouseDragged:eventWithType(NSEventTypeLeftMouseDragged) inHUDWithBounds:HUDRectInRootViewCoordinates];
     case PlatformEvent::MousePressed:
-        return [pdfLayerController mouseDown:eventWithType(NSLeftMouseDown) inHUDWithBounds:HUDRectInRootViewCoordinates];
+        return [pdfLayerController mouseDown:eventWithType(NSEventTypeLeftMouseDown) inHUDWithBounds:HUDRectInRootViewCoordinates];
     case PlatformEvent::MouseReleased:
-        return [pdfLayerController mouseUp:eventWithType(NSLeftMouseUp) inHUDWithBounds:HUDRectInRootViewCoordinates];
+        return [pdfLayerController mouseUp:eventWithType(NSEventTypeLeftMouseUp) inHUDWithBounds:HUDRectInRootViewCoordinates];
     default:
         break;
     }
index 6c60bdd..bcf9c55 100644 (file)
@@ -53,21 +53,18 @@ using namespace HTMLNames;
 
 static const String cssAlignmentValueForNSTextAlignment(NSTextAlignment alignment)
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     switch (alignment) {
-    case NSLeftTextAlignment:
+    case NSTextAlignmentLeft:
         return "left";
-    case NSRightTextAlignment:
+    case NSTextAlignmentRight:
         return "right";
-    case NSCenterTextAlignment:
+    case NSTextAlignmentCenter:
         return "center";
-    case NSJustifiedTextAlignment:
+    case NSTextAlignmentJustified:
         return "justify";
-    case NSNaturalTextAlignment:
+    case NSTextAlignmentNatural:
         return "-webkit-start";
     }
-#pragma clang diagnostic pop
     ASSERT_NOT_REACHED();
     return String();
 }
index a36f3b3..af2695f 100644 (file)
@@ -63,10 +63,7 @@ static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image, const In
     RetainPtr<NSGraphicsContext> savedContext = [NSGraphicsContext currentContext];
 
     [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:graphicsContext->platformContext() flipped:YES]];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    [image drawInRect:NSMakeRect(0, 0, bitmap->size().width(), bitmap->size().height()) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1 respectFlipped:YES hints:nil];
-#pragma clang diagnostic pop
+    [image drawInRect:NSMakeRect(0, 0, bitmap->size().width(), bitmap->size().height()) fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1 respectFlipped:YES hints:nil];
 
     [NSGraphicsContext setCurrentContext:savedContext.get()];
 
index 354272a..c5386b9 100644 (file)
@@ -1,3 +1,72 @@
+2016-11-09  Chris Dumez  <cdumez@apple.com>
+
+        [Mac] Stop using deprecated AppKit enumeration values
+        https://bugs.webkit.org/show_bug.cgi?id=164494
+
+        Reviewed by Darin Adler.
+
+        Stop using deprecated AppKit enumeration values.
+
+        * DumpRenderTree/mac/EventSendingController.mm:
+        (eventTypeForMouseButtonAndAction):
+        (modifierFlags):
+        (-[EventSendingController mouseMoveToX:Y:]):
+        (-[EventSendingController contextClick]):
+        (-[EventSendingController keyDown:withModifiers:withLocation:]):
+        * DumpRenderTree/mac/TextInputController.m:
+        (-[TextInputController interpretKeyEvents:withSender:]):
+        * TestWebKitAPI/Tests/WebKit2Cocoa/CommandBackForward.mm:
+        (simulateCommandArrow):
+        * TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.mm:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenLayoutConstraints.mm:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenTopContentInset.mm:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm:
+        (TEST):
+        * TestWebKitAPI/Tests/WebKit2Cocoa/UserInitiatedActionInNavigationAction.mm:
+        (UserInitiatedActionTest::SetUp):
+        (UserInitiatedActionTest::click):
+        * TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm:
+        (TestWebKitAPI::AcceptsFirstMouse::runTest):
+        * TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm:
+        (TestWebKitAPI::contextMenuCopyLink):
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/mac/ContextMenuDefaultItemsHaveTags.mm:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
+        (TestWebKitAPI::FullscreenZoomInitialFrame::runTest):
+        * TestWebKitAPI/Tests/mac/MenuTypesForMouseEvents.mm:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/mac/PlatformUtilitiesMac.mm:
+        (TestWebKitAPI::Util::isKeyDown):
+        * TestWebKitAPI/mac/PlatformWebViewMac.mm:
+        (TestWebKitAPI::PlatformWebView::initialize):
+        (TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress):
+        (TestWebKitAPI::PlatformWebView::simulateRightClick):
+        (TestWebKitAPI::PlatformWebView::simulateMouseMove):
+        (TestWebKitAPI::eventTypeForButton):
+        (TestWebKitAPI::modifierFlagsForWKModifiers):
+        * TestWebKitAPI/mac/TestWKWebViewMac.mm:
+        (__simulated_forceClickAssociatedEventsMask):
+        (-[TestWKWebViewHostWindow _mouseDownAtPoint:simulatePressure:]):
+        (-[TestWKWebView _setUpTestWindow:]):
+        (-[TestWKWebView typeCharacter:]):
+        * WebKitTestRunner/mac/EventSenderProxy.mm:
+        (WTR::eventTypeForMouseButtonAndAction):
+        (WTR::buildModifierFlags):
+        (WTR::EventSenderProxy::sendMouseDownToStartPressureEvents):
+        (WTR::EventSenderProxy::mouseForceClick):
+        (WTR::EventSenderProxy::startAndCancelMouseForceClick):
+        (WTR::EventSenderProxy::mouseMoveTo):
+        (WTR::EventSenderProxy::keyDown):
+        (WTR::EventSenderProxy::swipeGestureWithWheelAndMomentumPhases):
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        (WTR::PlatformWebView::PlatformWebView):
+        * WebKitTestRunner/mac/TestControllerMac.mm:
+        (WTR::TestController::platformResetStateToConsistentValues):
+
 2016-11-09  Beth Dakin  <bdakin@apple.com>
 
         Support TouchBar in WebKit
index e1b3efa..65e2c1f 100644 (file)
@@ -43,6 +43,7 @@
 
 #if !PLATFORM(IOS)
 #import <Carbon/Carbon.h> // for GetCurrentEventTime()
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 #endif
 
 #if PLATFORM(IOS)
@@ -355,33 +356,33 @@ BOOL replayingSavedEvents;
 static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction action)
 {
     switch (button) {
-        case LeftMouseButton:
-            switch (action) {
-                case MouseDown:
-                    return NSLeftMouseDown;
-                case MouseUp:
-                    return NSLeftMouseUp;
-                case MouseDragged:
-                    return NSLeftMouseDragged;
-            }
-        case RightMouseButton:
-            switch (action) {
-                case MouseDown:
-                    return NSRightMouseDown;
-                case MouseUp:
-                    return NSRightMouseUp;
-                case MouseDragged:
-                    return NSRightMouseDragged;
-            }
-        default:
-            switch (action) {
-                case MouseDown:
-                    return NSOtherMouseDown;
-                case MouseUp:
-                    return NSOtherMouseUp;
-                case MouseDragged:
-                    return NSOtherMouseDragged;
-            }
+    case LeftMouseButton:
+        switch (action) {
+        case MouseDown:
+            return NSEventTypeLeftMouseDown;
+        case MouseUp:
+            return NSEventTypeLeftMouseUp;
+        case MouseDragged:
+            return NSEventTypeLeftMouseDragged;
+        }
+    case RightMouseButton:
+        switch (action) {
+        case MouseDown:
+            return NSEventTypeRightMouseDown;
+        case MouseUp:
+            return NSEventTypeRightMouseUp;
+        case MouseDragged:
+            return NSEventTypeRightMouseDragged;
+        }
+    default:
+        switch (action) {
+        case MouseDown:
+            return NSEventTypeOtherMouseDown;
+        case MouseUp:
+            return NSEventTypeOtherMouseUp;
+        case MouseDragged:
+            return NSEventTypeOtherMouseDragged;
+        }
     }
     assert(0);
     return static_cast<NSEventType>(0);
@@ -433,11 +434,11 @@ static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction acti
 static int modifierFlags(const NSString* modifierName)
 {
 #if !PLATFORM(IOS)
-    const int controlKeyMask = NSControlKeyMask;
-    const int shiftKeyMask = NSShiftKeyMask;
-    const int alternateKeyMask = NSAlternateKeyMask;
-    const int commandKeyMask = NSCommandKeyMask;
-    const int capsLockKeyMask = NSAlphaShiftKeyMask;
+    const int controlKeyMask = NSEventModifierFlagControl;
+    const int shiftKeyMask = NSEventModifierFlagShift;
+    const int alternateKeyMask = NSEventModifierFlagOption;
+    const int commandKeyMask = NSEventModifierFlagCommand;
+    const int capsLockKeyMask = NSEventModifierFlagCapsLock;
 #else
     const int controlKeyMask = WebEventFlagMaskControl;
     const int shiftKeyMask = WebEventFlagMaskShift;
@@ -643,7 +644,7 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
     NSView *view = [mainFrame webView];
 #if !PLATFORM(IOS)
     lastMousePosition = [view convertPoint:NSMakePoint(x, [view frame].size.height - y) toView:nil];
-    NSEvent *event = [NSEvent mouseEventWithType:(leftMouseButtonDown ? NSLeftMouseDragged : NSMouseMoved)
+    NSEvent *event = [NSEvent mouseEventWithType:(leftMouseButtonDown ? NSEventTypeLeftMouseDragged : NSEventTypeMouseMoved)
                                         location:lastMousePosition 
                                    modifierFlags:0 
                                        timestamp:[self currentEventTime]
@@ -777,7 +778,7 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
     [[[mainFrame frameView] documentView] layout];
     [self updateClickCountForButton:RightMouseButton];
 
-    NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseDown
+    NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeRightMouseDown
                                         location:lastMousePosition 
                                    modifierFlags:0 
                                        timestamp:[self currentEventTime]
@@ -1013,7 +1014,7 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
 
     if ([character length] == 1 && [character characterAtIndex:0] >= 'A' && [character characterAtIndex:0] <= 'Z') {
 #if !PLATFORM(IOS)
-        modifierFlags |= NSShiftKeyMask;
+        modifierFlags |= NSEventModifierFlagShift;
 #else
         modifierFlags |= WebEventFlagMaskAlphaShift;
 #endif
@@ -1023,12 +1024,12 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
     modifierFlags |= buildModifierFlags(modifiers);
 
     if (location == DOM_KEY_LOCATION_NUMPAD)
-        modifierFlags |= NSNumericPadKeyMask;
+        modifierFlags |= NSEventModifierFlagNumericPad;
 
     [[[mainFrame frameView] documentView] layout];
 
 #if !PLATFORM(IOS)
-    NSEvent *event = [NSEvent keyEventWithType:NSKeyDown
+    NSEvent *event = [NSEvent keyEventWithType:NSEventTypeKeyDown
                         location:NSMakePoint(5, 5)
                         modifierFlags:modifierFlags
                         timestamp:[self currentEventTime]
@@ -1060,7 +1061,7 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
 #endif
 
 #if !PLATFORM(IOS)
-    event = [NSEvent keyEventWithType:NSKeyUp
+    event = [NSEvent keyEventWithType:NSEventTypeKeyUp
                         location:NSMakePoint(5, 5)
                         modifierFlags:modifierFlags
                         timestamp:[self currentEventTime]
index 5ec2a99..74f1b11 100644 (file)
@@ -51,6 +51,7 @@ NSString *NSTextInsertionUndoableAttributeName;
 #import <WebKit/WebScriptObject.h>
 #import <WebKit/WebTypesInternal.h>
 #import <WebKit/WebView.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 @interface TextInputController (DumpRenderTreeInputMethodHandler)
 - (BOOL)interpretKeyEvents:(NSArray *)eventArray withSender:(WebHTMLView *)sender;
@@ -507,21 +508,21 @@ NSString *NSTextInsertionUndoableAttributeName;
     NSEvent *event = [eventArray objectAtIndex:0];
     unsigned modifierFlags = [event modifierFlags]; 
     NSMutableArray *modifiers = [[NSMutableArray alloc] init];
-    if (modifierFlags & NSAlphaShiftKeyMask)
+    if (modifierFlags & NSEventModifierFlagCapsLock)
         [modifiers addObject:@"NSAlphaShiftKeyMask"];
-    if (modifierFlags & NSShiftKeyMask)
+    if (modifierFlags & NSEventModifierFlagShift)
         [modifiers addObject:@"NSShiftKeyMask"];
-    if (modifierFlags & NSControlKeyMask)
+    if (modifierFlags & NSEventModifierFlagControl)
         [modifiers addObject:@"NSControlKeyMask"];
-    if (modifierFlags & NSAlternateKeyMask)
+    if (modifierFlags & NSEventModifierFlagOption)
         [modifiers addObject:@"NSAlternateKeyMask"];
-    if (modifierFlags & NSCommandKeyMask)
+    if (modifierFlags & NSEventModifierFlagCommand)
         [modifiers addObject:@"NSCommandKeyMask"];
-    if (modifierFlags & NSNumericPadKeyMask)
+    if (modifierFlags & NSEventModifierFlagNumericPad)
         [modifiers addObject:@"NSNumericPadKeyMask"];
-    if (modifierFlags & NSHelpKeyMask)
+    if (modifierFlags & NSEventModifierFlagHelp)
         [modifiers addObject:@"NSHelpKeyMask"];
-    if (modifierFlags & NSFunctionKeyMask)
+    if (modifierFlags & NSEventModifierFlagFunction)
         [modifiers addObject:@"NSFunctionKeyMask"];
     
     WebScriptObject* eventParam = [inputMethodHandler evaluateWebScript:@"new Object();"];
index 6786700..ad04c5e 100644 (file)
@@ -34,6 +34,7 @@
 #import <WebKit/WKRetainPtr.h>
 #import <WebKit/WKViewPrivate.h>
 #import <wtf/RetainPtr.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 @interface CommandBackForwardOffscreenWindow : NSWindow
 @end
@@ -62,9 +63,9 @@ static void simulateCommandArrow(NSView *view, ArrowDirection direction)
     NSString *eventCharacter = (direction == Left) ? [NSString stringWithCharacters:&left length:1] : [NSString stringWithCharacters:&right length:1];
     unsigned short keyCode = (direction == Left) ? 0x7B : 0x7C;
 
-    NSEvent *event = [NSEvent keyEventWithType:NSKeyDown
+    NSEvent *event = [NSEvent keyEventWithType:NSEventTypeKeyDown
                                       location:NSMakePoint(5, 5)
-                                 modifierFlags:NSCommandKeyMask
+                                 modifierFlags:NSEventModifierFlagCommand
                                      timestamp:GetCurrentEventTime()
                                   windowNumber:[view.window windowNumber]
                                        context:[NSGraphicsContext currentContext]
@@ -75,9 +76,9 @@ static void simulateCommandArrow(NSView *view, ArrowDirection direction)
 
     [view keyDown:event];
 
-    event = [NSEvent keyEventWithType:NSKeyUp
+    event = [NSEvent keyEventWithType:NSEventTypeKeyUp
                              location:NSMakePoint(5, 5)
-                        modifierFlags:NSCommandKeyMask
+                        modifierFlags:NSEventModifierFlagCommand
                             timestamp:GetCurrentEventTime()
                          windowNumber:[view.window windowNumber]
                               context:[NSGraphicsContext currentContext]
index ebe88b6..84dcbe2 100644 (file)
@@ -33,6 +33,7 @@
 #import <WebKit/WKWebViewPrivate.h>
 #import <WebKit/_WKFullscreenDelegate.h>
 #import <wtf/RetainPtr.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 static bool receivedLoadedMessage;
 static bool receivedWillEnterFullscreenMessage;
@@ -83,14 +84,14 @@ TEST(Fullscreen, Delegate)
     [[configuration userContentController] addScriptMessageHandler:handler.get() name:@"fullscreenChangeHandler"];
     [webView _setFullscreenDelegate:handler.get()];
 
-    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
+    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]);
     [[window contentView] addSubview:webView.get()];
 
     NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"FullscreenDelegate" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
     [webView loadRequest:request];
     TestWebKitAPI::Util::run(&receivedLoadedMessage);
 
-    NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseDown location:NSMakePoint(5, 5) modifierFlags:0 timestamp:0 windowNumber:window.get().windowNumber context:0 eventNumber:0 clickCount:0 pressure:0];
+    NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeLeftMouseDown location:NSMakePoint(5, 5) modifierFlags:0 timestamp:0 windowNumber:window.get().windowNumber context:0 eventNumber:0 clickCount:0 pressure:0];
     [webView mouseDown:event];
 
     ASSERT_FALSE([webView _isInFullscreen]);
index 4dea0bc..bc30b68 100644 (file)
@@ -32,6 +32,7 @@
 #import <WebKit/WKWebViewConfigurationPrivate.h>
 #import <WebKit/WKWebViewPrivate.h>
 #import <wtf/RetainPtr.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 static bool receivedLoadedMessage;
 static bool receivedFullscreenChangeMessage;
@@ -60,7 +61,7 @@ TEST(Fullscreen, LayoutConstraints)
     RetainPtr<FullscreenStateChangeMessageHandler> handler = adoptNS([[FullscreenStateChangeMessageHandler alloc] init]);
     [[configuration userContentController] addScriptMessageHandler:handler.get() name:@"fullscreenStateChangeHandler"];
 
-    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
+    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]);
     webView.get().translatesAutoresizingMaskIntoConstraints = NO;
     [[window contentView] addSubview:webView.get()];
     
@@ -74,14 +75,14 @@ TEST(Fullscreen, LayoutConstraints)
     [webView loadRequest:request];
     TestWebKitAPI::Util::run(&receivedLoadedMessage);
 
-    NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseDown location:NSMakePoint(5, 5) modifierFlags:0 timestamp:0 windowNumber:window.get().windowNumber context:0 eventNumber:0 clickCount:0 pressure:0];
+    NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeLeftMouseDown location:NSMakePoint(5, 5) modifierFlags:0 timestamp:0 windowNumber:window.get().windowNumber context:0 eventNumber:0 clickCount:0 pressure:0];
     [webView mouseDown:event];
 
     TestWebKitAPI::Util::run(&receivedFullscreenChangeMessage);
     
     receivedFullscreenChangeMessage = false;
     
-    NSEvent *exitFSEvent = [NSEvent mouseEventWithType:NSLeftMouseDown location:NSMakePoint(5, 5) modifierFlags:0 timestamp:0 windowNumber:window.get().windowNumber context:0 eventNumber:0 clickCount:0 pressure:0];
+    NSEvent *exitFSEvent = [NSEvent mouseEventWithType:NSEventTypeLeftMouseDown location:NSMakePoint(5, 5) modifierFlags:0 timestamp:0 windowNumber:window.get().windowNumber context:0 eventNumber:0 clickCount:0 pressure:0];
     [webView mouseDown:exitFSEvent];
     
     TestWebKitAPI::Util::run(&receivedFullscreenChangeMessage);
index bf1d0cb..01f6e88 100644 (file)
@@ -32,6 +32,7 @@
 #import <WebKit/WKWebViewConfigurationPrivate.h>
 #import <WebKit/WKWebViewPrivate.h>
 #import <wtf/RetainPtr.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 static bool receivedLoadedMessage;
 static bool receivedFullscreenChangeMessage;
@@ -61,14 +62,14 @@ TEST(Fullscreen, TopContentInset)
     RetainPtr<FullscreenChangeMessageHandler> handler = adoptNS([[FullscreenChangeMessageHandler alloc] init]);
     [[configuration userContentController] addScriptMessageHandler:handler.get() name:@"fullscreenChangeHandler"];
 
-    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
+    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]);
     [[window contentView] addSubview:webView.get()];
 
     NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"FullscreenTopContentInset" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
     [webView loadRequest:request];
     TestWebKitAPI::Util::run(&receivedLoadedMessage);
 
-    NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseDown location:NSMakePoint(5, 5) modifierFlags:0 timestamp:0 windowNumber:window.get().windowNumber context:0 eventNumber:0 clickCount:0 pressure:0];
+    NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeLeftMouseDown location:NSMakePoint(5, 5) modifierFlags:0 timestamp:0 windowNumber:window.get().windowNumber context:0 eventNumber:0 clickCount:0 pressure:0];
     [webView mouseDown:event];
 
     TestWebKitAPI::Util::run(&receivedFullscreenChangeMessage);
index 3aba970..1ac3d92 100644 (file)
@@ -31,6 +31,7 @@
 #import <WebKit/WKNavigationActionPrivate.h>
 #import <WebKit/WKWebViewPrivate.h>
 #import <wtf/RetainPtr.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 #if WK_API_ENABLED
 
@@ -73,7 +74,7 @@ TEST(WebKit2, ShouldOpenExternalURLsInWindowOpen)
 {
     auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
 
-    auto window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+    auto window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES]);
     [[window contentView] addSubview:webView.get()];
 
     auto controller = adoptNS([[ShouldOpenExternalURLsInNewWindowActionsController alloc] init]);
@@ -86,8 +87,8 @@ TEST(WebKit2, ShouldOpenExternalURLsInWindowOpen)
 
     NSPoint clickPoint = NSMakePoint(100, 100);
 
-    [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
-    [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSEventTypeLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSEventTypeLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
     TestWebKitAPI::Util::run(&createdWebView);
     createdWebView = false;
 
@@ -108,8 +109,8 @@ TEST(WebKit2, ShouldOpenExternalURLsInWindowOpen)
     TestWebKitAPI::Util::run(&finishedNavigation);
     finishedNavigation = false;
 
-    [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
-    [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSEventTypeLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSEventTypeLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
     TestWebKitAPI::Util::run(&createdWebView);
     createdWebView = false;
 
@@ -134,7 +135,7 @@ TEST(WebKit2, ShouldOpenExternalURLsInTargetedLink)
 {
     auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
 
-    auto window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+    auto window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES]);
     [[window contentView] addSubview:webView.get()];
 
     auto controller = adoptNS([[ShouldOpenExternalURLsInNewWindowActionsController alloc] init]);
@@ -148,8 +149,8 @@ TEST(WebKit2, ShouldOpenExternalURLsInTargetedLink)
     NSPoint clickPoint = NSMakePoint(100, 100);
 
     decidedPolicy = false;
-    [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
-    [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSEventTypeLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSEventTypeLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
     TestWebKitAPI::Util::run(&decidedPolicy);
     decidedPolicy = false;
 
@@ -178,8 +179,8 @@ TEST(WebKit2, ShouldOpenExternalURLsInTargetedLink)
     finishedNavigation = false;
 
     decidedPolicy = false;
-    [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
-    [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSEventTypeLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSEventTypeLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
     TestWebKitAPI::Util::run(&decidedPolicy);
     decidedPolicy = false;
 
@@ -210,7 +211,7 @@ TEST(WebKit2, ShouldOpenExternalURLsInTargetedLink)
 TEST(WebKit2, RestoreShouldOpenExternalURLsPolicyAfterCrash)
 {
     auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
-    auto window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+    auto window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES]);
     [[window contentView] addSubview:webView.get()];
     auto controller = adoptNS([[ShouldOpenExternalURLsInNewWindowActionsController alloc] init]);
     [webView setNavigationDelegate:controller.get()];
index 6fdc075..c844b2e 100644 (file)
@@ -33,6 +33,7 @@
 #import <WebKit/WKWebViewPrivate.h>
 #import <WebKit/_WKUserInitiatedAction.h>
 #import <wtf/RetainPtr.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 #if WK_API_ENABLED
 
@@ -72,7 +73,7 @@ public:
     {
         webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
 
-        window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+        window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES]);
         [[window contentView] addSubview:webView.get()];
 
         delegate = adoptNS([[UserInitiatedActionInNavigationActionDelegate alloc] init]);
@@ -99,8 +100,8 @@ public:
     {
         NSPoint clickPoint = NSMakePoint(100, 100);
 
-        [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
-        [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+        [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSEventTypeLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+        [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSEventTypeLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
     }
 };
 
index dec7888..7c34494 100644 (file)
@@ -27,6 +27,7 @@
 #include "WebKitAgnosticTest.h"
 
 #include <wtf/RetainPtr.h>
+#include <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 @interface NSApplication (TestWebKitAPINSApplicationDetails)
 - (void)_setCurrentEvent:(NSEvent *)event;
@@ -47,17 +48,17 @@ public:
 template <typename View>
 void AcceptsFirstMouse::runTest(View view)
 {
-    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:view.frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:view.frame styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES]);
     [[window.get() contentView] addSubview:view];
 
     CGFloat viewHeight = view.bounds.size.height;
 
     NSPoint pointInsideSelection = NSMakePoint(50, viewHeight - 50);
-    NSEvent *mouseEventInsideSelection = [NSEvent mouseEventWithType:NSLeftMouseDown location:pointInsideSelection modifierFlags:0 timestamp:0 windowNumber:[window.get() windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1];
+    NSEvent *mouseEventInsideSelection = [NSEvent mouseEventWithType:NSEventTypeLeftMouseDown location:pointInsideSelection modifierFlags:0 timestamp:0 windowNumber:[window.get() windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1];
     EXPECT_TRUE([[view hitTest:pointInsideSelection] acceptsFirstMouse:mouseEventInsideSelection]);
 
     NSPoint pointOutsideSelection = NSMakePoint(50, viewHeight - 150);
-    NSEvent *mouseEventOutsideSelection = [NSEvent mouseEventWithType:NSLeftMouseDown location:pointOutsideSelection modifierFlags:0 timestamp:0 windowNumber:[window.get() windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1];
+    NSEvent *mouseEventOutsideSelection = [NSEvent mouseEventWithType:NSEventTypeLeftMouseDown location:pointOutsideSelection modifierFlags:0 timestamp:0 windowNumber:[window.get() windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1];
     EXPECT_FALSE([[view hitTest:pointInsideSelection] acceptsFirstMouse:mouseEventOutsideSelection]);
 }
 
index 8dab637..d957639 100644 (file)
@@ -33,6 +33,7 @@
 #import <WebKit/DOM.h>
 #import <Carbon/Carbon.h>
 #import <wtf/RetainPtr.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 
 @interface ContextMenuCanCopyURLDelegate : NSObject <WebFrameLoadDelegate> {
@@ -61,7 +62,7 @@ static void contextMenuCopyLink(WebView* webView, int itemIndex)
     DOMHTMLAnchorElement *anchor = (DOMHTMLAnchorElement *)[[documentElement querySelectorAll:@"a"] item:itemIndex];
 
     NSWindow *window = [webView window];
-    NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseDown
+    NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeRightMouseDown
                                         location:NSMakePoint(anchor.offsetLeft + anchor.offsetWidth / 2, window.frame.size.height - (anchor.offsetTop + anchor.offsetHeight / 2))
                                    modifierFlags:0
                                        timestamp:GetCurrentEventTime()
@@ -89,7 +90,7 @@ static void contextMenuCopyLink(WebView* webView, int itemIndex)
 TEST(WebKit1, ContextMenuCanCopyURL)
 {
     RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0,0,800,600) frameName:nil groupName:nil]);
-    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:NSMakeRect(100, 100, 800, 600) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:NSMakeRect(100, 100, 800, 600) styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES]);
     RetainPtr<ContextMenuCanCopyURLDelegate> delegate = adoptNS([[ContextMenuCanCopyURLDelegate alloc] init]);
 
     [window.get().contentView addSubview:webView.get()];
index 9e047f6..58f0217 100644 (file)
@@ -29,6 +29,7 @@
 #import "PlatformWebView.h"
 #import <Carbon/Carbon.h>
 #import <wtf/RetainPtr.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 @interface ContextMenuDefaultItemsHaveTagsDelegate : NSObject <WebFrameLoadDelegate>
 @end
@@ -49,7 +50,7 @@ namespace TestWebKitAPI {
 TEST(WebKit1, ContextMenuDefaultItemsHaveTags)
 {
     RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) frameName:nil groupName:nil]);
-    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:NSMakeRect(100, 100, 800, 600) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:NSMakeRect(100, 100, 800, 600) styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES]);
     RetainPtr<ContextMenuDefaultItemsHaveTagsDelegate> delegate = adoptNS([[ContextMenuDefaultItemsHaveTagsDelegate alloc] init]);
 
     [window.get().contentView addSubview:webView.get()];
@@ -59,7 +60,7 @@ TEST(WebKit1, ContextMenuDefaultItemsHaveTags)
 
     Util::run(&didFinishLoad);
 
-    NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseDown location:NSMakePoint(400, 300) modifierFlags:0 timestamp:[NSDate timeIntervalSinceReferenceDate]
+    NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeRightMouseDown location:NSMakePoint(400, 300) modifierFlags:0 timestamp:[NSDate timeIntervalSinceReferenceDate]
         windowNumber:[window windowNumber] context:[NSGraphicsContext currentContext] eventNumber:0 clickCount:0 pressure:0];
     NSView *subView = [webView hitTest:[event locationInWindow]];
     NSMenu *menu = [subView menuForEvent:event];
index d32aace..ffc0c6e 100644 (file)
@@ -34,6 +34,7 @@
 #import <WebKit/WKViewPrivate.h>
 #import <WebKit/WKPreferencesPrivate.h>
 #import <wtf/RetainPtr.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 @interface NSWindowController (WebKitFullScreenAdditions)
 - (NSRect)initialFrame;
@@ -150,12 +151,12 @@ void FullscreenZoomInitialFrame::sendMouseDownEvent(WKView *wkView, NSEvent *eve
 template <typename View>
 void FullscreenZoomInitialFrame::runTest(View view)
 {
-    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:view.frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
+    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:view.frame styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]);
     [window.get().contentView addSubview:view];
 
     setPageScale(view, 2);
 
-    NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseDown location:NSMakePoint(5, 5) modifierFlags:0 timestamp:0 windowNumber:window.get().windowNumber context:0 eventNumber:0 clickCount:0 pressure:0];
+    NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeLeftMouseDown location:NSMakePoint(5, 5) modifierFlags:0 timestamp:0 windowNumber:window.get().windowNumber context:0 eventNumber:0 clickCount:0 pressure:0];
 
     isWaitingForPageSignalToContinue = true;
     didGetPageSignalToContinue = false;
index 8e4b4f7..2320740 100644 (file)
@@ -30,6 +30,7 @@
 #import <WebCore/PlatformEventFactoryMac.h>
 #import <wtf/AutodrainedPool.h>
 #import <wtf/RetainPtr.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 namespace TestWebKitAPI {
 
@@ -63,77 +64,77 @@ static void buildAndPerformTest(NSEventType buttonEvent, NSEventModifierFlags mo
 
 TEST(WebKit1, MenuAndButtonForNormalLeftClick)
 {
-    buildAndPerformTest(NSLeftMouseDown, 0, WebCore::LeftButton, NSMenuTypeNone);
+    buildAndPerformTest(NSEventTypeLeftMouseDown, 0, WebCore::LeftButton, NSMenuTypeNone);
 }
 
 TEST(WebKit1, MenuAndButtonForNormalRightClick)
 {
-    buildAndPerformTest(NSRightMouseDown, 0, WebCore::RightButton, NSMenuTypeContextMenu);
+    buildAndPerformTest(NSEventTypeRightMouseDown, 0, WebCore::RightButton, NSMenuTypeContextMenu);
 }
 
 TEST(WebKit1, MenuAndButtonForNormalMiddleClick)
 {
-    buildAndPerformTest(NSOtherMouseDown, 0, WebCore::MiddleButton, NSMenuTypeNone);
+    buildAndPerformTest(NSEventTypeOtherMouseDown, 0, WebCore::MiddleButton, NSMenuTypeNone);
 }
 
 TEST(WebKit1, MenuAndButtonForControlLeftClick)
 {
-    buildAndPerformTest(NSLeftMouseDown, NSControlKeyMask, WebCore::LeftButton, NSMenuTypeContextMenu);
+    buildAndPerformTest(NSEventTypeLeftMouseDown, NSEventModifierFlagControl, WebCore::LeftButton, NSMenuTypeContextMenu);
 }
 
 TEST(WebKit1, MenuAndButtonForControlRightClick)
 {
-    buildAndPerformTest(NSRightMouseDown, NSControlKeyMask, WebCore::RightButton, NSMenuTypeContextMenu);
+    buildAndPerformTest(NSEventTypeRightMouseDown, NSEventModifierFlagControl, WebCore::RightButton, NSMenuTypeContextMenu);
 }
 
 TEST(WebKit1, MenuAndButtonForControlMiddleClick)
 {
-    buildAndPerformTest(NSOtherMouseDown, NSControlKeyMask, WebCore::MiddleButton, NSMenuTypeNone);
+    buildAndPerformTest(NSEventTypeOtherMouseDown, NSEventModifierFlagControl, WebCore::MiddleButton, NSMenuTypeNone);
 }
     
 TEST(WebKit1, MenuAndButtonForShiftLeftClick)
 {
-    buildAndPerformTest(NSLeftMouseDown, NSShiftKeyMask, WebCore::LeftButton, NSMenuTypeNone);
+    buildAndPerformTest(NSEventTypeLeftMouseDown, NSEventModifierFlagShift, WebCore::LeftButton, NSMenuTypeNone);
 }
 
 TEST(WebKit1, MenuAndButtonForShiftRightClick)
 {
-    buildAndPerformTest(NSRightMouseDown, NSShiftKeyMask, WebCore::RightButton, NSMenuTypeContextMenu);
+    buildAndPerformTest(NSEventTypeRightMouseDown, NSEventModifierFlagShift, WebCore::RightButton, NSMenuTypeContextMenu);
 }
 
 TEST(WebKit1, MenuAndButtonForShiftMiddleClick)
 {
-    buildAndPerformTest(NSOtherMouseDown, NSShiftKeyMask, WebCore::MiddleButton, NSMenuTypeNone);
+    buildAndPerformTest(NSEventTypeOtherMouseDown, NSEventModifierFlagShift, WebCore::MiddleButton, NSMenuTypeNone);
 }
 
 TEST(WebKit1, MenuAndButtonForCommandLeftClick)
 {
-    buildAndPerformTest(NSLeftMouseDown, NSCommandKeyMask, WebCore::LeftButton, NSMenuTypeNone);
+    buildAndPerformTest(NSEventTypeLeftMouseDown, NSEventModifierFlagCommand, WebCore::LeftButton, NSMenuTypeNone);
 }
 
 TEST(WebKit1, MenuAndButtonForCommandRightClick)
 {
-    buildAndPerformTest(NSRightMouseDown, NSCommandKeyMask, WebCore::RightButton, NSMenuTypeContextMenu);
+    buildAndPerformTest(NSEventTypeRightMouseDown, NSEventModifierFlagCommand, WebCore::RightButton, NSMenuTypeContextMenu);
 }
 
 TEST(WebKit1, MenuAndButtonForCommandMiddleClick)
 {
-    buildAndPerformTest(NSOtherMouseDown, NSCommandKeyMask, WebCore::MiddleButton, NSMenuTypeNone);
+    buildAndPerformTest(NSEventTypeOtherMouseDown, NSEventModifierFlagCommand, WebCore::MiddleButton, NSMenuTypeNone);
 }
 
 TEST(WebKit1, MenuAndButtonForAltLeftClick)
 {
-    buildAndPerformTest(NSLeftMouseDown, NSAlternateKeyMask, WebCore::LeftButton, NSMenuTypeNone);
+    buildAndPerformTest(NSEventTypeLeftMouseDown, NSEventModifierFlagOption, WebCore::LeftButton, NSMenuTypeNone);
 }
 
 TEST(WebKit1, MenuAndButtonForAltRightClick)
 {
-    buildAndPerformTest(NSRightMouseDown, NSAlternateKeyMask, WebCore::RightButton, NSMenuTypeContextMenu);
+    buildAndPerformTest(NSEventTypeRightMouseDown, NSEventModifierFlagOption, WebCore::RightButton, NSMenuTypeContextMenu);
 }
 
 TEST(WebKit1, MenuAndButtonForAltMiddleClick)
 {
-    buildAndPerformTest(NSOtherMouseDown, NSAlternateKeyMask, WebCore::MiddleButton, NSMenuTypeNone);
+    buildAndPerformTest(NSEventTypeOtherMouseDown, NSEventModifierFlagOption, WebCore::MiddleButton, NSMenuTypeNone);
 }
 
 
index 9c638ff..a0c42e7 100644 (file)
@@ -32,6 +32,7 @@
 #include <WebKit/WKURLResponseNS.h>
 #include <wtf/RetainPtr.h>
 #include <wtf/StdLibExtras.h>
+#include <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 namespace TestWebKitAPI {
 namespace Util {
@@ -62,7 +63,7 @@ WKRetainPtr<WKStringRef> MIMETypeForWKURLResponse(WKURLResponseRef wkResponse)
 
 bool isKeyDown(WKNativeEventPtr event)
 {
-    return [event type] == NSKeyDown;
+    return [event type] == NSEventTypeKeyDown;
 }
 
 } // namespace Util
index ad35f58..2e39ca4 100644 (file)
@@ -29,6 +29,7 @@
 #import <Carbon/Carbon.h>
 #import <WebKit/WKRetainPtr.h>
 #import <WebKit/WKViewPrivate.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 @interface ActiveOffscreenWindow : NSWindow
 @end
@@ -53,7 +54,7 @@ void PlatformWebView::initialize(WKPageConfigurationRef configuration, Class wkV
     [m_view setWindowOcclusionDetectionEnabled:NO];
 
     NSRect windowRect = NSOffsetRect(rect, -10000, [(NSScreen *)[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000);
-    m_window = [[ActiveOffscreenWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
+    m_window = [[ActiveOffscreenWindow alloc] initWithContentRect:windowRect styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES];
     [m_window setColorSpace:[[NSScreen mainScreen] colorSpace]];
     [[m_window contentView] addSubview:m_view];
     [m_window orderBack:nil];
@@ -121,7 +122,7 @@ void PlatformWebView::focus()
 
 void PlatformWebView::simulateSpacebarKeyPress()
 {
-    NSEvent *event = [NSEvent keyEventWithType:NSKeyDown
+    NSEvent *event = [NSEvent keyEventWithType:NSEventTypeKeyDown
                                       location:NSMakePoint(5, 5)
                                  modifierFlags:0
                                      timestamp:GetCurrentEventTime()
@@ -134,7 +135,7 @@ void PlatformWebView::simulateSpacebarKeyPress()
 
     [m_view keyDown:event];
 
-    event = [NSEvent keyEventWithType:NSKeyUp
+    event = [NSEvent keyEventWithType:NSEventTypeKeyUp
                              location:NSMakePoint(5, 5)
                         modifierFlags:0
                             timestamp:GetCurrentEventTime()
@@ -150,7 +151,7 @@ void PlatformWebView::simulateSpacebarKeyPress()
 
 void PlatformWebView::simulateRightClick(unsigned x, unsigned y)
 {
-    NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseDown
+    NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeRightMouseDown
                                         location:NSMakePoint(x, y)
                                    modifierFlags:0
                                        timestamp:GetCurrentEventTime()
@@ -163,7 +164,7 @@ void PlatformWebView::simulateRightClick(unsigned x, unsigned y)
 
     [m_view rightMouseDown:event];
 
-    event = [NSEvent mouseEventWithType:NSRightMouseUp
+    event = [NSEvent mouseEventWithType:NSEventTypeRightMouseUp
                                location:NSMakePoint(x, y)
                           modifierFlags:0
                               timestamp:GetCurrentEventTime()
@@ -179,7 +180,7 @@ void PlatformWebView::simulateRightClick(unsigned x, unsigned y)
     
 void PlatformWebView::simulateMouseMove(unsigned x, unsigned y)
 {   
-    NSEvent *event = [NSEvent mouseEventWithType:NSMouseMoved
+    NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeMouseMoved
                                location:NSMakePoint(x, y)
                           modifierFlags:0
                               timestamp:GetCurrentEventTime()
@@ -197,31 +198,31 @@ static NSEventType eventTypeForButton(WKEventMouseButton button)
 {
     switch (button) {
     case kWKEventMouseButtonLeftButton:
-        return NSLeftMouseDown;
+        return NSEventTypeLeftMouseDown;
     case kWKEventMouseButtonRightButton:
-        return NSRightMouseDown;
+        return NSEventTypeRightMouseDown;
     case kWKEventMouseButtonMiddleButton:
-        return NSOtherMouseDown;
+        return NSEventTypeOtherMouseDown;
     case kWKEventMouseButtonNoButton:
-        return NSLeftMouseDown;
+        return NSEventTypeLeftMouseDown;
     }
 
-    return NSLeftMouseDown;
+    return NSEventTypeLeftMouseDown;
 }
 
 static NSEventModifierFlags modifierFlagsForWKModifiers(WKEventModifiers modifiers)
 {
     NSEventModifierFlags returnVal = 0;
     if (modifiers & kWKEventModifiersShiftKey)
-        returnVal |= NSShiftKeyMask;
+        returnVal |= NSEventModifierFlagShift;
     if (modifiers & kWKEventModifiersControlKey)
-        returnVal |= NSControlKeyMask;
+        returnVal |= NSEventModifierFlagControl;
     if (modifiers & kWKEventModifiersAltKey)
-        returnVal |= NSAlternateKeyMask;
+        returnVal |= NSEventModifierFlagOption;
     if (modifiers & kWKEventModifiersMetaKey)
-        returnVal |= NSCommandKeyMask;
+        returnVal |= NSEventModifierFlagCommand;
     if (modifiers & kWKEventModifiersCapsLockKey)
-        returnVal |= NSAlphaShiftKeyMask;
+        returnVal |= NSEventModifierFlagCapsLock;
 
     return returnVal;
 }
index 1a6665b..893b1bc 100644 (file)
@@ -36,6 +36,7 @@
 #import <WebKit/WebKitPrivate.h>
 #import <objc/runtime.h>
 #import <wtf/RetainPtr.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 @implementation TestMessageHandler {
     NSMutableDictionary<NSString *, dispatch_block_t> *_messageHandlers;
@@ -70,21 +71,13 @@ static int gEventNumber = 1;
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101003
 NSEventMask __simulated_forceClickAssociatedEventsMask(id self, SEL _cmd)
 {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
     return NSEventMaskPressure | NSEventMaskLeftMouseDown | NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged;
-#else
-    return NSEventMaskPressure | (1 << NSLeftMouseDown) | (1 << NSLeftMouseUp) | (1 << NSLeftMouseDragged);
-#endif
 }
 #endif
 
 - (void)_mouseDownAtPoint:(NSPoint)point simulatePressure:(BOOL)simulatePressure
 {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
     NSEventType mouseEventType = NSEventTypeLeftMouseDown;
-#else
-    NSEventType mouseEventType = NSLeftMouseDown;
-#endif
 
     NSEventMask modifierFlags = 0;
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101003
@@ -157,7 +150,7 @@ NSEventMask __simulated_forceClickAssociatedEventsMask(id self, SEL _cmd)
 
 - (void)_setUpTestWindow:(NSRect)frame
 {
-    _hostWindow = [[TestWKWebViewHostWindow alloc] initWithContentRect:frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
+    _hostWindow = [[TestWKWebViewHostWindow alloc] initWithContentRect:frame styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
     [_hostWindow setFrameOrigin:NSMakePoint(0, 0)];
     [[_hostWindow contentView] addSubview:self];
     [_hostWindow setIsVisible:YES];
@@ -193,13 +186,8 @@ NSEventMask __simulated_forceClickAssociatedEventsMask(id self, SEL _cmd)
 
 - (void)typeCharacter:(char)character {
     NSString *characterAsString = [NSString stringWithFormat:@"%c" , character];
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
     NSEventType keyDownEventType = NSEventTypeKeyDown;
     NSEventType keyUpEventType = NSEventTypeKeyUp;
-#else
-    NSEventType keyDownEventType = NSKeyDown;
-    NSEventType keyUpEventType = NSKeyUp;
-#endif
     [self keyDown:[NSEvent keyEventWithType:keyDownEventType location:NSZeroPoint modifierFlags:0 timestamp:GetCurrentEventTime() windowNumber:_hostWindow.windowNumber context:nil characters:characterAsString charactersIgnoringModifiers:characterAsString isARepeat:NO keyCode:character]];
     [self keyUp:[NSEvent keyEventWithType:keyUpEventType location:NSZeroPoint modifierFlags:0 timestamp:GetCurrentEventTime() windowNumber:_hostWindow.windowNumber context:nil characters:characterAsString charactersIgnoringModifiers:characterAsString isARepeat:NO keyCode:character]];
 }
index cafc3ed..d5bcdd7 100644 (file)
@@ -36,6 +36,7 @@
 #import <WebKit/WKPagePrivate.h>
 #import <WebKit/WKWebView.h>
 #import <wtf/RetainPtr.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 @interface NSApplication (Details)
 - (void)_setCurrentEvent:(NSEvent *)event;
@@ -207,33 +208,33 @@ struct KeyMappingEntry {
 static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction action)
 {
     switch (button) {
-        case LeftMouseButton:
-            switch (action) {
-                case MouseDown:
-                    return NSLeftMouseDown;
-                case MouseUp:
-                    return NSLeftMouseUp;
-                case MouseDragged:
-                    return NSLeftMouseDragged;
-            }
-        case RightMouseButton:
-            switch (action) {
-                case MouseDown:
-                    return NSRightMouseDown;
-                case MouseUp:
-                    return NSRightMouseUp;
-                case MouseDragged:
-                    return NSRightMouseDragged;
-            }
-        default:
-            switch (action) {
-                case MouseDown:
-                    return NSOtherMouseDown;
-                case MouseUp:
-                    return NSOtherMouseUp;
-                case MouseDragged:
-                    return NSOtherMouseDragged;
-            }
+    case LeftMouseButton:
+        switch (action) {
+        case MouseDown:
+            return NSEventTypeLeftMouseDown;
+        case MouseUp:
+            return NSEventTypeLeftMouseUp;
+        case MouseDragged:
+            return NSEventTypeLeftMouseDragged;
+        }
+    case RightMouseButton:
+        switch (action) {
+        case MouseDown:
+            return NSEventTypeRightMouseDown;
+        case MouseUp:
+            return NSEventTypeRightMouseUp;
+        case MouseDragged:
+            return NSEventTypeRightMouseDragged;
+        }
+    default:
+        switch (action) {
+        case MouseDown:
+            return NSEventTypeOtherMouseDown;
+        case MouseUp:
+            return NSEventTypeOtherMouseUp;
+        case MouseDragged:
+            return NSEventTypeOtherMouseDragged;
+        }
     }
     assert(0);
     return static_cast<NSEventType>(0);
@@ -243,15 +244,15 @@ static int buildModifierFlags(WKEventModifiers modifiers)
 {
     int flags = 0;
     if (modifiers & kWKEventModifiersControlKey)
-        flags |= NSControlKeyMask;
+        flags |= NSEventModifierFlagControl;
     if (modifiers & kWKEventModifiersShiftKey)
-        flags |= NSShiftKeyMask;
+        flags |= NSEventModifierFlagShift;
     if (modifiers & kWKEventModifiersAltKey)
-        flags |= NSAlternateKeyMask;
+        flags |= NSEventModifierFlagOption;
     if (modifiers & kWKEventModifiersMetaKey)
-        flags |= NSCommandKeyMask;
+        flags |= NSEventModifierFlagCommand;
     if (modifiers & kWKEventModifiersCapsLockKey)
-        flags |= NSAlphaShiftKeyMask;
+        flags |= NSEventModifierFlagCapsLock;
     return flags;
 }
 
@@ -351,7 +352,7 @@ void EventSenderProxy::sendMouseDownToStartPressureEvents()
 {
     updateClickCountForButton(0);
 
-    NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseDown
+    NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeLeftMouseDown
         location:NSMakePoint(m_position.x, m_position.y)
         modifierFlags:NSEventMaskPressure
         timestamp:absoluteTimeForEventTime(currentEventTime())
@@ -415,7 +416,7 @@ void EventSenderProxy::mouseForceClick()
     RetainPtr<NSEvent> preForceClick = pressureChangeEvent(1, PressureChangeDirection::Increasing);
     RetainPtr<NSEvent> forceClick = pressureChangeEvent(2, PressureChangeDirection::Increasing);
     RetainPtr<NSEvent> releasingPressure = pressureChangeEvent(1, PressureChangeDirection::Decreasing);
-    NSEvent *mouseUp = [NSEvent mouseEventWithType:NSLeftMouseUp
+    NSEvent *mouseUp = [NSEvent mouseEventWithType:NSEventTypeLeftMouseUp
         location:NSMakePoint(m_position.x, m_position.y)
         modifierFlags:0
         timestamp:absoluteTimeForEventTime(currentEventTime())
@@ -452,7 +453,7 @@ void EventSenderProxy::startAndCancelMouseForceClick()
     RetainPtr<NSEvent> beginPressure = beginPressureEvent(1);
     RetainPtr<NSEvent> increasingPressure = pressureChangeEvent(1, PressureChangeDirection::Increasing);
     RetainPtr<NSEvent> releasingPressure = pressureChangeEvent(1, PressureChangeDirection::Decreasing);
-    NSEvent *mouseUp = [NSEvent mouseEventWithType:NSLeftMouseUp
+    NSEvent *mouseUp = [NSEvent mouseEventWithType:NSEventTypeLeftMouseUp
         location:NSMakePoint(m_position.x, m_position.y)
         modifierFlags:0
         timestamp:absoluteTimeForEventTime(currentEventTime())
@@ -602,7 +603,7 @@ void EventSenderProxy::mouseMoveTo(double x, double y)
     NSPoint position = [view convertPoint:NSMakePoint(x, y) toView:nil];
     m_position.x = position.x;
     m_position.y = position.y;
-    NSEvent *event = [NSEvent mouseEventWithType:(m_leftMouseButtonDown ? NSLeftMouseDragged : NSMouseMoved)
+    NSEvent *event = [NSEvent mouseEventWithType:(m_leftMouseButtonDown ? NSEventTypeLeftMouseDragged : NSEventTypeMouseMoved)
                                         location:position
                                    modifierFlags:0 
                                        timestamp:absoluteTimeForEventTime(currentEventTime())
@@ -798,16 +799,16 @@ void EventSenderProxy::keyDown(WKStringRef key, WKEventModifiers modifiers, unsi
     int modifierFlags = 0;
 
     if ([character length] == 1 && [character characterAtIndex:0] >= 'A' && [character characterAtIndex:0] <= 'Z') {
-        modifierFlags |= NSShiftKeyMask;
+        modifierFlags |= NSEventModifierFlagShift;
         charactersIgnoringModifiers = [character lowercaseString];
     }
 
     modifierFlags |= buildModifierFlags(modifiers);
 
     if (keyLocation == 0x03 /*DOM_KEY_LOCATION_NUMPAD*/)
-        modifierFlags |= NSNumericPadKeyMask;
+        modifierFlags |= NSEventModifierFlagNumericPad;
 
-    NSEvent *event = [NSEvent keyEventWithType:NSKeyDown
+    NSEvent *event = [NSEvent keyEventWithType:NSEventTypeKeyDown
                         location:NSMakePoint(5, 5)
                         modifierFlags:modifierFlags
                         timestamp:absoluteTimeForEventTime(currentEventTime())
@@ -822,7 +823,7 @@ void EventSenderProxy::keyDown(WKStringRef key, WKEventModifiers modifiers, unsi
     [[m_testController->mainWebView()->platformWindow() firstResponder] keyDown:event];
     [NSApp _setCurrentEvent:nil];
 
-    event = [NSEvent keyEventWithType:NSKeyUp
+    event = [NSEvent keyEventWithType:NSEventTypeKeyUp
                         location:NSMakePoint(5, 5)
                         modifierFlags:modifierFlags
                         timestamp:absoluteTimeForEventTime(currentEventTime())
@@ -918,7 +919,7 @@ void EventSenderProxy::swipeGestureWithWheelAndMomentumPhases(int x, int y, int
     RetainPtr<EventSenderSyntheticEvent> event = adoptNS([[EventSenderSyntheticEvent alloc] init]);
 
     // "mayBegin" a swipe is actually a scroll wheel event.
-    event->_eventSender_type = (phase == 128) ? NSScrollWheel : NSEventTypeGesture;
+    event->_eventSender_type = (phase == 128) ? NSEventTypeScrollWheel : NSEventTypeGesture;
     event->_eventSender_subtype = 6; // kIOHIDEventTypeScroll
     event->_eventSender_locationInWindow = NSMakePoint(m_position.x, m_position.y);
     event->_eventSender_location = ([m_testController->mainWebView()->platformWindow() convertRectToScreen:NSMakeRect(m_position.x, m_position.y, 1, 1)].origin);
index fb7cd85..8338502 100644 (file)
@@ -34,6 +34,7 @@
 #import <WebKit/WKWebViewConfiguration.h>
 #import <WebKit/WKWebViewPrivate.h>
 #import <wtf/RetainPtr.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 #if WK_API_ENABLED
 @interface WKWebView (Details)
@@ -145,7 +146,7 @@ PlatformWebView::PlatformWebView(WKWebViewConfiguration* configuration, const Te
 
     NSScreen *firstScreen = [[NSScreen screens] objectAtIndex:0];
     NSRect windowRect = m_options.shouldShowWebView ? NSOffsetRect(rect, 100, 100) : NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000);
-    m_window = [[WebKitTestRunnerWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:(NSBackingStoreType)_NSBackingStoreUnbuffered defer:YES];
+    m_window = [[WebKitTestRunnerWindow alloc] initWithContentRect:windowRect styleMask:NSWindowStyleMaskBorderless backing:(NSBackingStoreType)_NSBackingStoreUnbuffered defer:YES];
     m_window.platformWebView = this;
     [m_window setColorSpace:[firstScreen colorSpace]];
     [m_window setCollectionBehavior:NSWindowCollectionBehaviorStationary];
index cf87e69..5d1dd1e 100644 (file)
@@ -45,6 +45,7 @@
 #import <WebKit/_WKUserContentExtensionStorePrivate.h>
 #import <mach-o/dyld.h>
 #import <wtf/ObjcRuntimeExtras.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 @interface NSSound ()
 + (void)_setAlertType:(NSUInteger)alertType;
@@ -103,7 +104,7 @@ void TestController::platformResetStateToConsistentValues()
 {
     cocoaResetStateToConsistentValues();
 
-    while ([NSApp nextEventMatchingMask:NSEventMaskGesture | NSScrollWheelMask untilDate:nil inMode:NSDefaultRunLoopMode dequeue:YES]) {
+    while ([NSApp nextEventMatchingMask:NSEventMaskGesture | NSEventTypeScrollWheel untilDate:nil inMode:NSDefaultRunLoopMode dequeue:YES]) {
         // Clear out (and ignore) any pending gesture and scroll wheel events.
     }
 }