Issue #1751 -- Remove XP_MACOSX conditionals from the rest of the tree.

This also removes some PP abuse and takes file entries out of PP when no longer
needed without XP_MACOSX conditionals.
This commit is contained in:
Moonchild 2021-05-06 09:24:03 +00:00 • committed by roytam1
commit a4b0f333ba
153 changed files with 173 additions and 4556 deletions

View file

@ -54,11 +54,7 @@ class CompositorWidgetChild;
class WidgetRenderingContext
{
public:
#ifdef XP_MACOSX
WidgetRenderingContext() : mLayerManager(nullptr) {}
layers::LayerManagerComposite* mLayerManager;
#endif
/** Mac Stub **/
};
/**

View file

@ -1,4 +1,3 @@
/* vim: se cin sw=2 ts=2 et : */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
@ -652,13 +651,6 @@ MatchingOperatingSystems(OperatingSystem aBlockedOS, OperatingSystem aSystemOS)
}
#endif
#if defined (XP_MACOSX)
if (aBlockedOS == OperatingSystem::OSX) {
// We do want even "unknown" aSystemOS to fall under "all OS X"
return true;
}
#endif
return aSystemOS == aBlockedOS;
}

View file

@ -27,12 +27,6 @@
#define CODE_MAP_WIN(aCPPCodeName, aNativeKey) \
NS_NATIVE_KEY_TO_DOM_CODE_NAME_INDEX(aNativeKey, \
CODE_NAME_INDEX_##aCPPCodeName)
#elif defined(XP_MACOSX)
#undef CODE_MAP_MAC
// aNativeKey is key code starting with kVK_.
#define CODE_MAP_MAC(aCPPCodeName, aNativeKey) \
NS_NATIVE_KEY_TO_DOM_CODE_NAME_INDEX(aNativeKey, \
CODE_NAME_INDEX_##aCPPCodeName)
#elif defined(MOZ_WIDGET_GTK)
#undef CODE_MAP_X11
// aNativeKey is hardware_keycode of GDKEvent or nativeScanCode of QKeyEvent.

View file

@ -61,10 +61,6 @@
#else
#error Any NS_*_TO_DOM_KEY_NAME_INDEX() is not defined.
#endif // #if defined(NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX) ...
#elif defined(XP_MACOSX)
#undef KEY_MAP_COCOA
#define KEY_MAP_COCOA(aCPPKeyName, aNativeKey) \
NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, KEY_NAME_INDEX_##aCPPKeyName)
#elif defined(MOZ_WIDGET_GTK)
#undef KEY_MAP_GTK
#define KEY_MAP_GTK(aCPPKeyName, aNativeKey) \

View file

@ -111,10 +111,6 @@ protected:
, mLocation(nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD)
, mAccessKeyForwardedToChild(false)
, mUniqueId(0)
#ifdef XP_MACOSX
, mNativeModifierFlags(0)
, mNativeKeyCode(0)
#endif // #ifdef XP_MACOSX
, mKeyNameIndex(mozilla::KEY_NAME_INDEX_Unidentified)
, mCodeNameIndex(CODE_NAME_INDEX_UNKNOWN)
, mInputMethodAppState(eNotHandled)
@ -140,10 +136,6 @@ public:
, mLocation(nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD)
, mAccessKeyForwardedToChild(false)
, mUniqueId(0)
#ifdef XP_MACOSX
, mNativeModifierFlags(0)
, mNativeKeyCode(0)
#endif // #ifdef XP_MACOSX
, mKeyNameIndex(mozilla::KEY_NAME_INDEX_Unidentified)
, mCodeNameIndex(CODE_NAME_INDEX_UNKNOWN)
, mInputMethodAppState(eNotHandled)
@ -204,15 +196,6 @@ public:
// CODE_NAME_INDEX_USE_STRING.
nsString mCodeValue;
#ifdef XP_MACOSX
// Values given by a native NSEvent, for use with Cocoa NPAPI plugins.
nsString mNativeCharacters;
nsString mNativeCharactersIgnoringModifiers;
// If this is non-empty, create a text event for plugins instead of a
// keyboard event.
nsString mPluginTextEventString;
#endif // #ifdef XP_MACOSX
// OS-specific native event can optionally be preserved
void* mNativeKeyEvent;
// A DOM keyCode value or 0. If a keypress event whose mCharCode is 0, this
@ -240,12 +223,6 @@ public:
// over long periods.
uint32_t mUniqueId;
#ifdef XP_MACOSX
// Values given by a native NSEvent, for use with Cocoa NPAPI plugins.
uint32_t mNativeModifierFlags;
uint16_t mNativeKeyCode;
#endif // #ifdef XP_MACOSX
// DOM KeyboardEvent.key
KeyNameIndex mKeyNameIndex;
// DOM KeyboardEvent.code
@ -397,14 +374,6 @@ public:
// is destroyed.
mNativeKeyEvent = nullptr;
mUniqueId = aEvent.mUniqueId;
#ifdef XP_MACOSX
mNativeKeyCode = aEvent.mNativeKeyCode;
mNativeModifierFlags = aEvent.mNativeModifierFlags;
mNativeCharacters.Assign(aEvent.mNativeCharacters);
mNativeCharactersIgnoringModifiers.
Assign(aEvent.mNativeCharactersIgnoringModifiers);
mPluginTextEventString.Assign(aEvent.mPluginTextEventString);
#endif
mInputMethodAppState = aEvent.mInputMethodAppState;
mIsSynthesizedByTIP = aEvent.mIsSynthesizedByTIP;
}

View file

@ -479,11 +479,7 @@ WidgetInputEvent::AccelModifier()
sAccelModifier = MODIFIER_CONTROL;
break;
default:
#ifdef XP_MACOSX
sAccelModifier = MODIFIER_META;
#else
sAccelModifier = MODIFIER_CONTROL;
#endif
break;
}
}

View file

@ -84,10 +84,6 @@ static void debug_RegisterPrefCallbacks();
static int32_t gNumWidgets;
#endif
#ifdef XP_MACOSX
#include "nsCocoaFeatures.h"
#endif
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
static nsRefPtrHashtable<nsVoidPtrHashKey, nsIWidget>* sPluginWidgetList;
#endif
@ -175,7 +171,7 @@ nsBaseWidget::nsBaseWidget()
, mUpdateCursor(true)
, mUseAttachedEvents(false)
, mIMEHasFocus(false)
#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
, mAccessibilityInUseFlag(false)
#endif
{
@ -645,14 +641,7 @@ void nsBaseWidget::AddChild(nsIWidget* aChild)
void nsBaseWidget::RemoveChild(nsIWidget* aChild)
{
#ifdef DEBUG
#ifdef XP_MACOSX
// nsCocoaWindow doesn't implement GetParent, so in that case parent will be
// null and we'll just have to do without this assertion.
nsIWidget* parent = aChild->GetParent();
NS_ASSERTION(!parent || parent == this, "Not one of our kids!");
#else
MOZ_RELEASE_ASSERT(aChild->GetParent() == this, "Not one of our kids!");
#endif
#endif
if (mLastChild == aChild) {
@ -1382,12 +1371,8 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
mLayerManager = lm.forget();
// Only track compositors for top-level windows, since other window types
// may use the basic compositor. Except on the OS X - see bug 1306383
#if defined(XP_MACOSX)
bool getCompositorFromThisWindow = true;
#else
// may use the basic compositor.
bool getCompositorFromThisWindow = (mWindowType == eWindowType_toplevel);
#endif
if (getCompositorFromThisWindow) {
gfxPlatform::GetPlatform()->NotifyCompositorCreated(mLayerManager->GetCompositorBackendType());
@ -1885,7 +1870,7 @@ nsBaseWidget::ZoomToRect(const uint32_t& aPresShellId,
#ifdef ACCESSIBILITY
#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
// defined in nsAppRunner.cpp
extern const char* kAccessibilityLastRunDatePref;
@ -1914,7 +1899,7 @@ nsBaseWidget::GetRootAccessible()
// make sure it's not created at unsafe times.
nsAccessibilityService* accService = GetOrCreateAccService();
if (accService) {
#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
if (!mAccessibilityInUseFlag) {
mAccessibilityInUseFlag = true;
uint32_t now = PRTimeToSeconds(PR_Now());

View file

@ -677,7 +677,7 @@ protected:
bool mUpdateCursor;
bool mUseAttachedEvents;
bool mIMEHasFocus;
#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
bool mAccessibilityInUseFlag;
#endif
static nsIRollupListener* gRollupListener;

View file

@ -431,13 +431,6 @@ struct ParamTraits<mozilla::WidgetKeyboardEvent>
WriteParam(aMsg,
static_cast<paramType::InputMethodAppStateType>
(aParam.mInputMethodAppState));
#ifdef XP_MACOSX
WriteParam(aMsg, aParam.mNativeKeyCode);
WriteParam(aMsg, aParam.mNativeModifierFlags);
WriteParam(aMsg, aParam.mNativeCharacters);
WriteParam(aMsg, aParam.mNativeCharactersIgnoringModifiers);
WriteParam(aMsg, aParam.mPluginTextEventString);
#endif
// An OS-specific native event might be attached in |mNativeKeyEvent|, but
// that cannot be copied across process boundaries.
}
@ -465,13 +458,6 @@ struct ParamTraits<mozilla::WidgetKeyboardEvent>
ReadParam(aMsg, aIter, &aResult->mUniqueId) &&
ReadParam(aMsg, aIter, &aResult->mIsSynthesizedByTIP) &&
ReadParam(aMsg, aIter, &inputMethodAppState)
#ifdef XP_MACOSX
&& ReadParam(aMsg, aIter, &aResult->mNativeKeyCode)
&& ReadParam(aMsg, aIter, &aResult->mNativeModifierFlags)
&& ReadParam(aMsg, aIter, &aResult->mNativeCharacters)
&& ReadParam(aMsg, aIter, &aResult->mNativeCharactersIgnoringModifiers)
&& ReadParam(aMsg, aIter, &aResult->mPluginTextEventString)
#endif
)
{
aResult->mKeyNameIndex = static_cast<mozilla::KeyNameIndex>(keyNameIndex);

View file

@ -115,10 +115,6 @@ typedef void* nsNativeWidget;
// IME context. Note that the result is only valid in the process. So,
// XP code should use nsIWidget::GetNativeIMEContext() instead of using this.
#define NS_RAW_NATIVE_IME_CONTEXT 14
#ifdef XP_MACOSX
#define NS_NATIVE_PLUGIN_PORT_QD 100
#define NS_NATIVE_PLUGIN_PORT_CG 101
#endif
#ifdef XP_WIN
#define NS_NATIVE_TSF_THREAD_MGR 100
#define NS_NATIVE_TSF_CATEGORY_MGR 101

View file

@ -99,25 +99,13 @@ nsNativeTheme::GetContentState(nsIFrame* aFrame, uint8_t aWidgetType)
flags |= NS_EVENT_STATE_FOCUS;
}
// On Windows and Mac, only draw focus rings if they should be shown. This
// On Windows, only draw focus rings if they should be shown. This
// means that focus rings are only shown once the keyboard has been used to
// focus something in the window.
#if defined(XP_MACOSX)
// Mac always draws focus rings for textboxes and lists.
if (aWidgetType == NS_THEME_NUMBER_INPUT ||
aWidgetType == NS_THEME_TEXTFIELD ||
aWidgetType == NS_THEME_TEXTFIELD_MULTILINE ||
aWidgetType == NS_THEME_SEARCHFIELD ||
aWidgetType == NS_THEME_LISTBOX) {
return flags;
}
#endif
#if defined(XP_WIN)
// On Windows, focused buttons are always drawn as such by the native theme.
if (aWidgetType == NS_THEME_BUTTON)
return flags;
#endif
#if defined(XP_MACOSX) || defined(XP_WIN)
nsIDocument* doc = aFrame->GetContent()->OwnerDoc();
nsPIDOMWindowOuter* window = doc->GetWindow();
if (window && !window->ShouldShowFocusRing())