mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-24 08:07:30 +09:00
Issue #1517 - Remove dom.event.highrestimestamp.enabled pref
This resolves #1517
This commit is contained in:
parent
0c44ae0a30
commit
d62f0a0dd2
6 changed files with 14 additions and 59 deletions
|
|
@ -45,9 +45,6 @@ extern bool IsCurrentThreadRunningChromeWorker();
|
||||||
|
|
||||||
static char *sPopupAllowedEvents;
|
static char *sPopupAllowedEvents;
|
||||||
|
|
||||||
static bool sReturnHighResTimeStamp = false;
|
|
||||||
static bool sReturnHighResTimeStampIsSet = false;
|
|
||||||
|
|
||||||
Event::Event(EventTarget* aOwner,
|
Event::Event(EventTarget* aOwner,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
WidgetEvent* aEvent)
|
WidgetEvent* aEvent)
|
||||||
|
|
@ -68,13 +65,6 @@ Event::ConstructorInit(EventTarget* aOwner,
|
||||||
SetOwner(aOwner);
|
SetOwner(aOwner);
|
||||||
mIsMainThreadEvent = NS_IsMainThread();
|
mIsMainThreadEvent = NS_IsMainThread();
|
||||||
|
|
||||||
if (mIsMainThreadEvent && !sReturnHighResTimeStampIsSet) {
|
|
||||||
Preferences::AddBoolVarCache(&sReturnHighResTimeStamp,
|
|
||||||
"dom.event.highrestimestamp.enabled",
|
|
||||||
sReturnHighResTimeStamp);
|
|
||||||
sReturnHighResTimeStampIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
mPrivateDataDuplicated = false;
|
mPrivateDataDuplicated = false;
|
||||||
mWantsPopupControlCheck = false;
|
mWantsPopupControlCheck = false;
|
||||||
|
|
||||||
|
|
@ -1093,10 +1083,6 @@ Event::TimeStamp() const
|
||||||
double
|
double
|
||||||
Event::TimeStampImpl() const
|
Event::TimeStampImpl() const
|
||||||
{
|
{
|
||||||
if (!sReturnHighResTimeStamp) {
|
|
||||||
return static_cast<double>(mEvent->mTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mEvent->mTimeStamp.IsNull()) {
|
if (mEvent->mTimeStamp.IsNull()) {
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,12 +35,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=77992
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
SimpleTest.requestFlakyTimeout("untriaged");
|
SimpleTest.requestFlakyTimeout("untriaged");
|
||||||
|
|
||||||
// We don't use SpecialPowers.pushPrefEnv since it can delay the test
|
|
||||||
// function until after the load event has fired which means we can't
|
|
||||||
// test the timestamp of the load event.
|
|
||||||
const kPrefName = "dom.event.highrestimestamp.enabled";
|
|
||||||
var prevPrefValue = SpecialPowers.getBoolPref(kPrefName);
|
|
||||||
SpecialPowers.setBoolPref(kPrefName, true);
|
|
||||||
testRegularEvents();
|
testRegularEvents();
|
||||||
|
|
||||||
// Event.timeStamp should be relative to the time origin which is:
|
// Event.timeStamp should be relative to the time origin which is:
|
||||||
|
|
|
||||||
|
|
@ -236,14 +236,10 @@ function sanityCheckEvent(evt)
|
||||||
is(evt.eventPhase, evt.AT_TARGET);
|
is(evt.eventPhase, evt.AT_TARGET);
|
||||||
is(evt.bubbles, false, "Event should not bubble");
|
is(evt.bubbles, false, "Event should not bubble");
|
||||||
is(evt.cancelable, false, "Event should not be cancelable");
|
is(evt.cancelable, false, "Event should not be cancelable");
|
||||||
if (SpecialPowers.getBoolPref("dom.event.highrestimestamp.enabled")) {
|
var now = window.performance.now();
|
||||||
var now = window.performance.now();
|
ok(evt.timeStamp > 0 && evt.timeStamp < now,
|
||||||
ok(evt.timeStamp > 0 && evt.timeStamp < now,
|
"Event timeStamp (" + evt.timeStamp + ") should be > 0 but " +
|
||||||
"Event timeStamp (" + evt.timeStamp + ") should be > 0 but " +
|
"before the current time (" + now + ")");
|
||||||
"before the current time (" + now + ")");
|
|
||||||
} else {
|
|
||||||
is(evt.timeStamp, 0, "Event timeStamp should be 0");
|
|
||||||
}
|
|
||||||
ok(evt.view !== null, "Event view not set");
|
ok(evt.view !== null, "Event view not set");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,21 +67,11 @@ function runTests()
|
||||||
"input event is fired on unexpected element: " + aEvent.target.tagName);
|
"input event is fired on unexpected element: " + aEvent.target.tagName);
|
||||||
ok(!aEvent.cancelable, "input event must not be cancelable");
|
ok(!aEvent.cancelable, "input event must not be cancelable");
|
||||||
ok(aEvent.bubbles, "input event must be bubbles");
|
ok(aEvent.bubbles, "input event must be bubbles");
|
||||||
if (SpecialPowers.getBoolPref("dom.event.highrestimestamp.enabled")) {
|
var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
|
||||||
var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
|
ok(duration < 30 * 1000,
|
||||||
ok(duration < 30 * 1000,
|
"perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
|
||||||
"perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
|
" (expected it to be within 30s of the current time but it " +
|
||||||
" (expected it to be within 30s of the current time but it " +
|
"differed by " + duration + "ms)");
|
||||||
"differed by " + duration + "ms)");
|
|
||||||
} else {
|
|
||||||
var eventTime = new Date(aEvent.timeStamp);
|
|
||||||
var duration = Math.abs(Date.now() - aEvent.timeStamp);
|
|
||||||
ok(duration < 30 * 1000,
|
|
||||||
"perhaps, timestamp wasn't set correctly :" +
|
|
||||||
eventTime.toLocaleString() +
|
|
||||||
" (expected it to be within 30s of the current time but it " +
|
|
||||||
"differed by " + duration + "ms)");
|
|
||||||
}
|
|
||||||
inputEvent = aEvent;
|
inputEvent = aEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,21 +41,11 @@ function runTests()
|
||||||
"input event is fired on unexpected element: " + aEvent.target.tagName);
|
"input event is fired on unexpected element: " + aEvent.target.tagName);
|
||||||
ok(!aEvent.cancelable, "input event must not be cancelable");
|
ok(!aEvent.cancelable, "input event must not be cancelable");
|
||||||
ok(aEvent.bubbles, "input event must be bubbles");
|
ok(aEvent.bubbles, "input event must be bubbles");
|
||||||
if (SpecialPowers.getBoolPref("dom.event.highrestimestamp.enabled")) {
|
var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
|
||||||
var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
|
ok(duration < 30 * 1000,
|
||||||
ok(duration < 30 * 1000,
|
"perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
|
||||||
"perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
|
" (expected it to be within 30s of the current time but it " +
|
||||||
" (expected it to be within 30s of the current time but it " +
|
"differed by " + duration + "ms)");
|
||||||
"differed by " + duration + "ms)");
|
|
||||||
} else {
|
|
||||||
var eventTime = new Date(aEvent.timeStamp);
|
|
||||||
var duration = Math.abs(Date.now() - aEvent.timeStamp);
|
|
||||||
ok(duration < 30 * 1000,
|
|
||||||
"perhaps, timestamp wasn't set correctly :" +
|
|
||||||
eventTime.toLocaleString() +
|
|
||||||
" (expected it to be within 30s of the current time but it " +
|
|
||||||
"differed by " + duration + "ms)");
|
|
||||||
}
|
|
||||||
inputEvent = aEvent;
|
inputEvent = aEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1247,7 +1247,6 @@ pref("privacy.trackingprotection.pbmode.enabled", false);
|
||||||
|
|
||||||
pref("dom.event.contextmenu.enabled", true);
|
pref("dom.event.contextmenu.enabled", true);
|
||||||
pref("dom.event.clipboardevents.enabled", true);
|
pref("dom.event.clipboardevents.enabled", true);
|
||||||
pref("dom.event.highrestimestamp.enabled", true);
|
|
||||||
|
|
||||||
pref("dom.webcomponents.enabled", false);
|
pref("dom.webcomponents.enabled", false);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue