summaryrefslogtreecommitdiff
path: root/layout/xul/nsXULTooltipListener.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-10-10 23:09:26 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-01 14:47:16 +0200
commitddaee7c1be914cc28a28cbe27e5922215b3b2e6f (patch)
treecb8930a9ba1ed0ef574b7c2be9035b1a51201902 /layout/xul/nsXULTooltipListener.cpp
parentc030a50228349fa1b2c0b4fbc2e83752324dd4d7 (diff)
downloaduxp-ddaee7c1be914cc28a28cbe27e5922215b3b2e6f.tar.gz
Issue #1830 - Remove --disable-xul config and conditionals.
Diffstat (limited to 'layout/xul/nsXULTooltipListener.cpp')
-rw-r--r--layout/xul/nsXULTooltipListener.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/layout/xul/nsXULTooltipListener.cpp b/layout/xul/nsXULTooltipListener.cpp
index 110f8c0e09..eefeec3599 100644
--- a/layout/xul/nsXULTooltipListener.cpp
+++ b/layout/xul/nsXULTooltipListener.cpp
@@ -14,14 +14,10 @@
#include "nsIServiceManager.h"
#include "nsIDragService.h"
#include "nsIDragSession.h"
-#ifdef MOZ_XUL
#include "nsITreeView.h"
-#endif
#include "nsIScriptContext.h"
#include "nsPIDOMWindow.h"
-#ifdef MOZ_XUL
#include "nsXULPopupManager.h"
-#endif
#include "nsIRootBox.h"
#include "nsIBoxObject.h"
#include "mozilla/Preferences.h"
@@ -42,11 +38,9 @@ nsXULTooltipListener::nsXULTooltipListener()
: mMouseScreenX(0)
, mMouseScreenY(0)
, mTooltipShownOnce(false)
-#ifdef MOZ_XUL
, mIsSourceTree(false)
, mNeedTitletip(false)
, mLastTreeRow(-1)
-#endif
{
if (sTooltipListenerCount++ == 0) {
// register the callback so we get notified of updates
@@ -95,7 +89,6 @@ nsXULTooltipListener::MouseOut(nsIDOMEvent* aEvent)
return;
#endif
-#ifdef MOZ_XUL
// check to see if the mouse left the targetNode, and if so,
// hide the tooltip
if (currentTooltip) {
@@ -119,7 +112,6 @@ nsXULTooltipListener::MouseOut(nsIDOMEvent* aEvent)
}
}
}
-#endif
}
void
@@ -157,11 +149,9 @@ nsXULTooltipListener::MouseMove(nsIDOMEvent* aEvent)
nsCOMPtr<nsIContent> sourceContent = do_QueryInterface(
aEvent->InternalDOMEvent()->GetCurrentTarget());
mSourceNode = do_GetWeakReference(sourceContent);
-#ifdef MOZ_XUL
mIsSourceTree = sourceContent->IsXULElement(nsGkAtoms::treechildren);
if (mIsSourceTree)
CheckTreeBodyMove(mouseEvent);
-#endif
// as the mouse moves, we want to make sure we reset the timer to show it,
// so that the delay is from when the mouse stops moving, not when it enters
@@ -210,10 +200,8 @@ nsXULTooltipListener::MouseMove(nsIDOMEvent* aEvent)
return;
}
-#ifdef MOZ_XUL
if (mIsSourceTree)
return;
-#endif
HideTooltip();
// set a flag so that the tooltip is only displayed once until the mouse
@@ -319,7 +307,6 @@ nsXULTooltipListener::RemoveTooltipSupport(nsIContent* aNode)
return NS_OK;
}
-#ifdef MOZ_XUL
void
nsXULTooltipListener::CheckTreeBodyMove(nsIDOMMouseEvent* aMouseEvent)
{
@@ -376,7 +363,6 @@ nsXULTooltipListener::CheckTreeBodyMove(nsIDOMMouseEvent* aMouseEvent)
mLastTreeCol = col;
}
}
-#endif
nsresult
nsXULTooltipListener::ShowTooltip()
@@ -396,12 +382,10 @@ nsXULTooltipListener::ShowTooltip()
// Make sure the target node is still attached to some document.
// It might have been deleted.
if (sourceNode->IsInComposedDoc()) {
-#ifdef MOZ_XUL
if (!mIsSourceTree) {
mLastTreeRow = -1;
mLastTreeCol = nullptr;
}
-#endif
mCurrentTooltip = do_GetWeakReference(tooltipNode);
LaunchTooltip();
@@ -440,7 +424,6 @@ nsXULTooltipListener::ShowTooltip()
return NS_OK;
}
-#ifdef MOZ_XUL
// XXX: "This stuff inside DEBUG_crap could be used to make tree tooltips work
// in the future."
#ifdef DEBUG_crap
@@ -477,7 +460,6 @@ SetTitletipLabel(nsITreeBoxObject* aTreeBox, nsIContent* aTooltip,
aTooltip->SetAttr(kNameSpaceID_None, nsGkAtoms::label, label, true);
}
}
-#endif
void
nsXULTooltipListener::LaunchTooltip()
@@ -486,7 +468,6 @@ nsXULTooltipListener::LaunchTooltip()
if (!currentTooltip)
return;
-#ifdef MOZ_XUL
if (mIsSourceTree && mNeedTitletip) {
nsCOMPtr<nsITreeBoxObject> obx;
GetSourceTreeBoxObject(getter_AddRefs(obx));
@@ -514,21 +495,17 @@ nsXULTooltipListener::LaunchTooltip()
if (!pm->IsPopupOpen(currentTooltip))
mCurrentTooltip = nullptr;
}
-#endif
-
}
nsresult
nsXULTooltipListener::HideTooltip()
{
-#ifdef MOZ_XUL
nsCOMPtr<nsIContent> currentTooltip = do_QueryReferent(mCurrentTooltip);
if (currentTooltip) {
nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
if (pm)
pm->HidePopup(currentTooltip, false, false, false, false);
}
-#endif
DestroyTooltip();
return NS_OK;
@@ -603,22 +580,18 @@ nsXULTooltipListener::FindTooltip(nsIContent* aTarget, nsIContent** aTooltip)
nsCOMPtr<nsIContent> tooltipEl = document->GetElementById(tooltipId);
if (tooltipEl) {
-#ifdef MOZ_XUL
mNeedTitletip = false;
-#endif
tooltipEl.forget(aTooltip);
return NS_OK;
}
}
-#ifdef MOZ_XUL
// titletips should just use the default tooltip
if (mIsSourceTree && mNeedTitletip) {
nsIRootBox* rootBox = nsIRootBox::GetRootBox(document->GetShell());
NS_ENSURE_STATE(rootBox);
NS_IF_ADDREF(*aTooltip = rootBox->GetDefaultTooltip());
}
-#endif
return NS_OK;
}
@@ -634,7 +607,6 @@ nsXULTooltipListener::GetTooltipFor(nsIContent* aTarget, nsIContent** aTooltip)
return rv;
}
-#ifdef MOZ_XUL
// Submenus can't be used as tooltips, see bug 288763.
nsIContent* parent = tooltip->GetParent();
if (parent) {
@@ -644,7 +616,6 @@ nsXULTooltipListener::GetTooltipFor(nsIContent* aTarget, nsIContent** aTooltip)
return NS_ERROR_FAILURE;
}
}
-#endif
tooltip.swap(*aTooltip);
return rv;
@@ -679,9 +650,7 @@ nsXULTooltipListener::DestroyTooltip()
// kill any ongoing timers
KillTooltipTimer();
mSourceNode = nullptr;
-#ifdef MOZ_XUL
mLastTreeCol = nullptr;
-#endif
return NS_OK;
}
@@ -704,7 +673,6 @@ nsXULTooltipListener::sTooltipCallback(nsITimer *aTimer, void *aListener)
instance->ShowTooltip();
}
-#ifdef MOZ_XUL
nsresult
nsXULTooltipListener::GetSourceTreeBoxObject(nsITreeBoxObject** aBoxObject)
{
@@ -726,4 +694,3 @@ nsXULTooltipListener::GetSourceTreeBoxObject(nsITreeBoxObject** aBoxObject)
}
return NS_ERROR_FAILURE;
}
-#endif