Bug 1881488 - Use a static pref for tooltip delay. r=masayuki,dom-core

It's 500 everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D202419
This commit is contained in:
Emilio Cobos Álvarez
2024-02-22 12:59:41 +00:00
parent ef26d8afff
commit cbb5a52d47
16 changed files with 17 additions and 41 deletions

View File

@@ -18,7 +18,7 @@
#include "nsAtom.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "mozilla/LookAndFeel.h"
#include "mozilla/StaticPrefs_ui.h"
// Interfaces needed to be included
#include "nsPresContext.h"
@@ -1184,9 +1184,8 @@ nsresult ChromeTooltipListener::MouseMove(Event* aMouseEvent) {
if (mPossibleTooltipNode) {
nsresult rv = NS_NewTimerWithFuncCallback(
getter_AddRefs(mTooltipTimer), sTooltipCallback, this,
LookAndFeel::GetInt(LookAndFeel::IntID::TooltipDelay, 500),
nsITimer::TYPE_ONE_SHOT, "ChromeTooltipListener::MouseMove",
GetMainThreadSerialEventTarget());
StaticPrefs::ui_tooltip_delay_ms(), nsITimer::TYPE_ONE_SHOT,
"ChromeTooltipListener::MouseMove", GetMainThreadSerialEventTarget());
if (NS_FAILED(rv)) {
mPossibleTooltipNode = nullptr;
NS_WARNING("Could not create a timer for tooltip tracking");