diff options
author | Moonchild <moonchild@palemoon.org> | 2021-04-30 21:22:08 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-04-30 21:22:08 +0000 |
commit | 0dd3424f774954627d6f53df9fb47379d9b5c871 (patch) | |
tree | d8c303bac59a5bbbbc6c6f5e541a01dec1a5ae49 /dom/base | |
parent | 5e705bd5059da5b7a39e3a096b7c7f59cb466730 (diff) | |
download | uxp-0dd3424f774954627d6f53df9fb47379d9b5c871.tar.gz |
Issue #1751 -- Remove XP_MACOSX conditionals from /dom
Diffstat (limited to 'dom/base')
-rw-r--r-- | dom/base/Navigator.cpp | 6 | ||||
-rw-r--r-- | dom/base/nsContentUtils.cpp | 5 | ||||
-rw-r--r-- | dom/base/nsFocusManager.cpp | 13 | ||||
-rw-r--r-- | dom/base/nsGlobalWindow.cpp | 21 | ||||
-rw-r--r-- | dom/base/nsJSEnvironment.cpp | 4 | ||||
-rw-r--r-- | dom/base/nsObjectLoadingContent.cpp | 19 | ||||
-rw-r--r-- | dom/base/nsWindowRoot.cpp | 6 |
7 files changed, 4 insertions, 70 deletions
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index c0580c3590..e15e32d328 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -1407,12 +1407,6 @@ Navigator::GetPlatform(nsAString& aPlatform, bool aUsePrefOverriddenValue) aPlatform.AssignLiteral("Win64"); #elif defined(WIN32) aPlatform.AssignLiteral("Win32"); -#elif defined(XP_MACOSX) && defined(__ppc__) - aPlatform.AssignLiteral("MacPPC"); -#elif defined(XP_MACOSX) && defined(__i386__) - aPlatform.AssignLiteral("MacIntel"); -#elif defined(XP_MACOSX) && defined(__x86_64__) - aPlatform.AssignLiteral("MacIntel"); #else // XXX Communicator uses compiled-in build-time string defines // to indicate the platform it was compiled *for*, not what it is diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 7dc6ccb990..95f176ca8f 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -6842,10 +6842,6 @@ nsContentUtils::HaveEqualPrincipals(nsIDocument* aDoc1, nsIDocument* aDoc2) bool nsContentUtils::HasPluginWithUncontrolledEventDispatch(nsIContent* aContent) { -#ifdef XP_MACOSX - // We control dispatch to all mac plugins. - return false; -#else if (!aContent || !aContent->IsInUncomposedDoc()) { return false; } @@ -6868,7 +6864,6 @@ nsContentUtils::HasPluginWithUncontrolledEventDispatch(nsIContent* aContent) } return !isWindowless; -#endif } /* static */ diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp index 637e3954e1..bfd2e334ea 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp @@ -66,9 +66,7 @@ #include "nsAccessibilityService.h" #endif -#ifndef XP_MACOSX #include "nsIScriptError.h" -#endif using namespace mozilla; using namespace mozilla::dom; @@ -1270,12 +1268,10 @@ nsFocusManager::SetFocusInner(nsIContent* aNewContent, int32_t aFlags, } } - // Exit fullscreen if we're focusing a windowed plugin on a non-MacOSX - // system. We don't control event dispatch to windowed plugins on non-MacOSX, - // so we can't display the "Press ESC to leave fullscreen mode" warning on - // key input if a windowed plugin is focused, so just exit fullscreen - // to guard against phishing. -#ifndef XP_MACOSX + // Exit fullscreen if we're focusing a windowed plugin. We don't control + // event dispatch to windowed plugins, so we can't display the <Press ESC + // to leave fullscreen mode> warning on key input if a windowed plugin is + // focused, so just exit fullscreen to guard against phishing. if (contentToFocus && nsContentUtils:: GetRootDocument(contentToFocus->OwnerDoc())->GetFullscreenElement() && @@ -1287,7 +1283,6 @@ nsFocusManager::SetFocusInner(nsIContent* aNewContent, int32_t aFlags, "FocusedWindowedPluginWhileFullscreen"); nsIDocument::AsyncExitFullscreen(contentToFocus->OwnerDoc()); } -#endif // if the FLAG_NOSWITCHFRAME flag is used, only allow the focus to be // shifted away from the current element if the new shell to focus is diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index a09847820b..293a522efe 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -6254,18 +6254,7 @@ nsGlobalWindow::CheckSecurityLeftAndTop(int32_t* aLeft, int32_t* aTop, bool aCal screen->GetAvailLeft(&screenLeft); screen->GetAvailWidth(&screenWidth); screen->GetAvailHeight(&screenHeight); -#if defined(XP_MACOSX) - /* The mac's coordinate system is different from the assumed Windows' - system. It offsets by the height of the menubar so that a window - placed at (0,0) will be entirely visible. Unfortunately that - correction is made elsewhere (in Widget) and the meaning of - the Avail... coordinates is overloaded. Here we allow a window - to be placed at (0,0) because it does make sense to do so. - */ - screen->GetTop(&screenTop); -#else screen->GetAvailTop(&screenTop); -#endif if (aLeft) { if (screenLeft+screenWidth < *aLeft+winWidth) @@ -7103,16 +7092,6 @@ nsGlobalWindow::Dump(const nsAString& aStr) char *cstr = ToNewUTF8String(aStr); -#if defined(XP_MACOSX) - // have to convert \r to \n so that printing to the console works - char *c = cstr, *cEnd = cstr + strlen(cstr); - while (c < cEnd) { - if (*c == '\r') - *c = '\n'; - c++; - } -#endif - if (cstr) { MOZ_LOG(nsContentUtils::DOMDumpLog(), LogLevel::Debug, ("[Window.Dump] %s", cstr)); #ifdef XP_WIN diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 5382f4494f..3b2a1cb19f 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -60,10 +60,6 @@ #include "nsJSPrincipals.h" -#ifdef XP_MACOSX -// AssertMacros.h defines 'check' and conflicts with AccessCheck.h -#undef check -#endif #include "AccessCheck.h" #include "mozilla/Logging.h" diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index e508a22f3e..27e4e7b7e9 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -95,13 +95,6 @@ #endif #endif // XP_WIN -#ifdef XP_MACOSX -// HandlePluginCrashed() and HandlePluginInstantiated() needed from here to -// fix bug 1147521. Should later be replaced by proper interface methods, -// maybe on nsIObjectLoadingContext. -#include "mozilla/dom/HTMLObjectElement.h" -#endif - static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID); static const char *kPrefJavaMIME = "plugin.java.mime"; @@ -916,10 +909,6 @@ nsObjectLoadingContent::InstantiatePluginInstance(bool aIsLoading) NS_LITERAL_STRING("PluginInstantiated")); NS_DispatchToCurrentThread(ev); -#ifdef XP_MACOSX - HTMLObjectElement::HandlePluginInstantiated(thisContent->AsElement()); -#endif - return NS_OK; } @@ -2948,10 +2937,6 @@ nsObjectLoadingContent::PluginCrashed(nsIPluginTag* aPluginTag, nsCOMPtr<nsIContent> thisContent = do_QueryInterface(static_cast<nsIImageLoadingContent*>(this)); -#ifdef XP_MACOSX - HTMLObjectElement::HandlePluginCrashed(thisContent->AsElement()); -#endif - PluginDestroyed(); // Switch to fallback/crashed state, notify @@ -3190,10 +3175,6 @@ nsObjectLoadingContent::DoStopPlugin(nsPluginInstanceOwner* aInstanceOwner, return; } -#if defined(XP_MACOSX) - aInstanceOwner->HidePluginWindow(); -#endif - RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst(); NS_ASSERTION(pluginHost, "No plugin host?"); pluginHost->StopPluginInstance(inst); diff --git a/dom/base/nsWindowRoot.cpp b/dom/base/nsWindowRoot.cpp index 8175877148..30360eb1f4 100644 --- a/dom/base/nsWindowRoot.cpp +++ b/dom/base/nsWindowRoot.cpp @@ -37,14 +37,8 @@ nsWindowRoot::nsWindowRoot(nsPIDOMWindowOuter* aWindow) mWindow = aWindow; MOZ_ASSERT(mWindow->IsOuterWindow()); - // Keyboard indicators are not shown on Mac by default. -#if defined(XP_MACOSX) - mShowAccelerators = false; - mShowFocusRings = false; -#else mShowAccelerators = true; mShowFocusRings = true; -#endif } nsWindowRoot::~nsWindowRoot() |