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

@ -40,9 +40,6 @@
#include "nsIScriptObjectPrincipal.h"
#include "nsIURI.h"
#include "nsIDocument.h"
#if defined(XP_MACOSX)
#include "nsThreadUtils.h"
#endif
#include "mozilla/Preferences.h"
#include "mozilla/dom/Element.h"
@ -906,28 +903,6 @@ nsContentTreeOwner::ProvideWindow(mozIDOMWindowProxy* aParent,
// nsContentTreeOwner: Accessors
//*****************************************************************************
#if defined(XP_MACOSX)
class nsContentTitleSettingEvent : public Runnable
{
public:
nsContentTitleSettingEvent(dom::Element* dse, const nsAString& wtm)
: mElement(dse),
mTitleDefault(wtm) {}
NS_IMETHOD Run() override
{
ErrorResult rv;
mElement->SetAttribute(NS_LITERAL_STRING("titledefault"), mTitleDefault, rv);
mElement->RemoveAttribute(NS_LITERAL_STRING("titlemodifier"), rv);
return NS_OK;
}
private:
nsCOMPtr<dom::Element> mElement;
nsString mTitleDefault;
};
#endif
void nsContentTreeOwner::XULWindow(nsXULWindow* aXULWindow)
{
mXULWindow = aXULWindow;
@ -946,18 +921,6 @@ void nsContentTreeOwner::XULWindow(nsXULWindow* aXULWindow)
docShellElement->GetAttribute(NS_LITERAL_STRING("titledefault"), mTitleDefault);
docShellElement->GetAttribute(NS_LITERAL_STRING("titlemodifier"), mWindowTitleModifier);
docShellElement->GetAttribute(NS_LITERAL_STRING("titlepreface"), mTitlePreface);
#if defined(XP_MACOSX)
// On OS X, treat the titlemodifier like it's the titledefault, and don't ever append
// the separator + appname.
if (mTitleDefault.IsEmpty()) {
NS_DispatchToCurrentThread(
new nsContentTitleSettingEvent(docShellElement,
mWindowTitleModifier));
mTitleDefault = mWindowTitleModifier;
mWindowTitleModifier.Truncate();
}
#endif
docShellElement->GetAttribute(NS_LITERAL_STRING("titlemenuseparator"), mTitleSeparator);
}
}