Bug 1949814 - Implement interactionCount for Performance interface r=sefeng,webidl,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D239186
This commit is contained in:
@@ -149,6 +149,8 @@ class Performance : public DOMEventTargetHelper {
|
||||
|
||||
virtual class EventCounts* EventCounts() = 0;
|
||||
|
||||
virtual uint64_t InteractionCount() = 0;
|
||||
|
||||
virtual void QueueNavigationTimingEntry() = 0;
|
||||
|
||||
virtual void UpdateNavigationTimingEntry() = 0;
|
||||
|
||||
@@ -30,6 +30,8 @@ class PerformanceInteractionMetrics final {
|
||||
return mPendingPointerDowns;
|
||||
}
|
||||
|
||||
uint64_t InteractionCount() { return mInteractionCount; }
|
||||
|
||||
uint64_t IncreaseInteractionValueAndCount();
|
||||
|
||||
virtual ~PerformanceInteractionMetrics() = default;
|
||||
|
||||
@@ -559,6 +559,11 @@ EventCounts* PerformanceMainThread::EventCounts() {
|
||||
return mEventCounts;
|
||||
}
|
||||
|
||||
uint64_t PerformanceMainThread::InteractionCount() {
|
||||
MOZ_ASSERT(StaticPrefs::dom_performance_event_timing_enable_interactionid());
|
||||
return mInteractionMetrics.InteractionCount();
|
||||
}
|
||||
|
||||
void PerformanceMainThread::GetEntries(
|
||||
nsTArray<RefPtr<PerformanceEntry>>& aRetval) {
|
||||
aRetval = mResourceEntries.Clone();
|
||||
|
||||
@@ -114,6 +114,8 @@ class PerformanceMainThread final : public Performance,
|
||||
|
||||
class EventCounts* EventCounts() override;
|
||||
|
||||
uint64_t InteractionCount() override;
|
||||
|
||||
bool IsGlobalObjectWindow() const override { return true; };
|
||||
|
||||
bool HasDispatchedInputEvent() const { return mHasDispatchedInputEvent; }
|
||||
|
||||
@@ -90,6 +90,10 @@ class PerformanceWorker final : public Performance {
|
||||
MOZ_CRASH("This should not be called on workers");
|
||||
}
|
||||
|
||||
uint64_t InteractionCount() override {
|
||||
MOZ_CRASH("This should not be called on workers");
|
||||
}
|
||||
|
||||
protected:
|
||||
~PerformanceWorker();
|
||||
|
||||
|
||||
@@ -94,4 +94,7 @@ partial interface Performance {
|
||||
partial interface Performance {
|
||||
[Pref="dom.enable_event_timing", SameObject]
|
||||
readonly attribute EventCounts eventCounts;
|
||||
|
||||
[Pref="dom.performance.event_timing.enable_interactionid"]
|
||||
readonly attribute unsigned long long interactionCount;
|
||||
};
|
||||
|
||||
@@ -4,12 +4,6 @@
|
||||
if os == "win": [OK, TIMEOUT]
|
||||
|
||||
[idlharness.any.html]
|
||||
[Performance interface: attribute interactionCount]
|
||||
expected: FAIL
|
||||
|
||||
[Performance interface: performance must inherit property "interactionCount" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[idlharness.any.sharedworker.html]
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
[idlharness.window.html]
|
||||
[Performance interface: attribute interactionCount]
|
||||
expected: FAIL
|
||||
|
||||
[Performance interface: performance must inherit property "interactionCount" with the proper type]
|
||||
expected: FAIL
|
||||
@@ -1,8 +0,0 @@
|
||||
[interaction-count-click.html]
|
||||
expected:
|
||||
if debug and (os == "win") and (processor == "x86_64"): CRASH
|
||||
if debug and (os == "linux") and fission: CRASH
|
||||
if debug and (os == "android"): CRASH
|
||||
if not debug and (os == "android"): [OK, CRASH]
|
||||
[EventTiming: verify interactionCount for click interaction]
|
||||
expected: FAIL
|
||||
@@ -1,3 +0,0 @@
|
||||
[interaction-count-tap.html]
|
||||
[EventTiming: verify interactionCount for tap interaction]
|
||||
expected: FAIL
|
||||
Reference in New Issue
Block a user