summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-05-04 13:11:28 +0000
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-05-06 19:14:05 +0200
commit56cb90a482737ae5252ac8b7ccbc0aff0b309410 (patch)
treee0daea85a05298224d6009a8a26605436a358a1e
parent812574875b650526bae87d6eb5542eced678ca24 (diff)
downloadUXP-56cb90a482737ae5252ac8b7ccbc0aff0b309410.tar
UXP-56cb90a482737ae5252ac8b7ccbc0aff0b309410.tar.gz
UXP-56cb90a482737ae5252ac8b7ccbc0aff0b309410.tar.lz
UXP-56cb90a482737ae5252ac8b7ccbc0aff0b309410.tar.xz
UXP-56cb90a482737ae5252ac8b7ccbc0aff0b309410.zip
Issue #1517 - Remove dom.event.highrestimestamp.enabled pref
This resolves #1517
-rwxr-xr-xdom/events/Event.cpp14
-rw-r--r--dom/events/test/test_eventTimeStamp.html6
-rw-r--r--dom/smil/test/test_smilTimeEvents.xhtml12
-rw-r--r--editor/libeditor/tests/test_dom_input_event_on_htmleditor.html20
-rw-r--r--editor/libeditor/tests/test_dom_input_event_on_texteditor.html20
-rw-r--r--modules/libpref/init/all.js1
6 files changed, 14 insertions, 59 deletions
diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp
index 280e40ad5..91417499b 100755
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -44,9 +44,6 @@ extern bool IsCurrentThreadRunningChromeWorker();
static char *sPopupAllowedEvents;
-static bool sReturnHighResTimeStamp = false;
-static bool sReturnHighResTimeStampIsSet = false;
-
Event::Event(EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetEvent* aEvent)
@@ -67,13 +64,6 @@ Event::ConstructorInit(EventTarget* aOwner,
SetOwner(aOwner);
mIsMainThreadEvent = NS_IsMainThread();
- if (mIsMainThreadEvent && !sReturnHighResTimeStampIsSet) {
- Preferences::AddBoolVarCache(&sReturnHighResTimeStamp,
- "dom.event.highrestimestamp.enabled",
- sReturnHighResTimeStamp);
- sReturnHighResTimeStampIsSet = true;
- }
-
mPrivateDataDuplicated = false;
mWantsPopupControlCheck = false;
@@ -1109,10 +1099,6 @@ Event::TimeStamp() const
double
Event::TimeStampImpl() const
{
- if (!sReturnHighResTimeStamp) {
- return static_cast<double>(mEvent->mTime);
- }
-
if (mEvent->mTimeStamp.IsNull()) {
return 0.0;
}
diff --git a/dom/events/test/test_eventTimeStamp.html b/dom/events/test/test_eventTimeStamp.html
index 056203e92..5ca5cd47d 100644
--- a/dom/events/test/test_eventTimeStamp.html
+++ b/dom/events/test/test_eventTimeStamp.html
@@ -35,12 +35,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=77992
SimpleTest.waitForExplicitFinish();
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();
// Event.timeStamp should be relative to the time origin which is:
diff --git a/dom/smil/test/test_smilTimeEvents.xhtml b/dom/smil/test/test_smilTimeEvents.xhtml
index bf6924ddb..002be5539 100644
--- a/dom/smil/test/test_smilTimeEvents.xhtml
+++ b/dom/smil/test/test_smilTimeEvents.xhtml
@@ -236,14 +236,10 @@ function sanityCheckEvent(evt)
is(evt.eventPhase, evt.AT_TARGET);
is(evt.bubbles, false, "Event should not bubble");
is(evt.cancelable, false, "Event should not be cancelable");
- if (SpecialPowers.getBoolPref("dom.event.highrestimestamp.enabled")) {
- var now = window.performance.now();
- ok(evt.timeStamp > 0 && evt.timeStamp < now,
- "Event timeStamp (" + evt.timeStamp + ") should be > 0 but " +
- "before the current time (" + now + ")");
- } else {
- is(evt.timeStamp, 0, "Event timeStamp should be 0");
- }
+ var now = window.performance.now();
+ ok(evt.timeStamp > 0 && evt.timeStamp < now,
+ "Event timeStamp (" + evt.timeStamp + ") should be > 0 but " +
+ "before the current time (" + now + ")");
ok(evt.view !== null, "Event view not set");
}
diff --git a/editor/libeditor/tests/test_dom_input_event_on_htmleditor.html b/editor/libeditor/tests/test_dom_input_event_on_htmleditor.html
index d1716a228..dc8790750 100644
--- a/editor/libeditor/tests/test_dom_input_event_on_htmleditor.html
+++ b/editor/libeditor/tests/test_dom_input_event_on_htmleditor.html
@@ -67,21 +67,11 @@ function runTests()
"input event is fired on unexpected element: " + aEvent.target.tagName);
ok(!aEvent.cancelable, "input event must not be cancelable");
ok(aEvent.bubbles, "input event must be bubbles");
- if (SpecialPowers.getBoolPref("dom.event.highrestimestamp.enabled")) {
- var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
- ok(duration < 30 * 1000,
- "perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
- " (expected it to be within 30s of the current time but it " +
- "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)");
- }
+ var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
+ ok(duration < 30 * 1000,
+ "perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
+ " (expected it to be within 30s of the current time but it " +
+ "differed by " + duration + "ms)");
inputEvent = aEvent;
};
diff --git a/editor/libeditor/tests/test_dom_input_event_on_texteditor.html b/editor/libeditor/tests/test_dom_input_event_on_texteditor.html
index b1395e99c..abdd5f5d0 100644
--- a/editor/libeditor/tests/test_dom_input_event_on_texteditor.html
+++ b/editor/libeditor/tests/test_dom_input_event_on_texteditor.html
@@ -41,21 +41,11 @@ function runTests()
"input event is fired on unexpected element: " + aEvent.target.tagName);
ok(!aEvent.cancelable, "input event must not be cancelable");
ok(aEvent.bubbles, "input event must be bubbles");
- if (SpecialPowers.getBoolPref("dom.event.highrestimestamp.enabled")) {
- var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
- ok(duration < 30 * 1000,
- "perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
- " (expected it to be within 30s of the current time but it " +
- "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)");
- }
+ var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
+ ok(duration < 30 * 1000,
+ "perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
+ " (expected it to be within 30s of the current time but it " +
+ "differed by " + duration + "ms)");
inputEvent = aEvent;
};
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
index 333c30d17..0193c5ef1 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1247,7 +1247,6 @@ pref("privacy.trackingprotection.pbmode.enabled", false);
pref("dom.event.contextmenu.enabled", true);
pref("dom.event.clipboardevents.enabled", true);
-pref("dom.event.highrestimestamp.enabled", true);
pref("dom.webcomponents.enabled", false);
pref("dom.webcomponents.customelements.enabled", false);