Commit Graph
151 Commits
Author SHA1 Message Date
Bas Schouten a7628a666b Bug 2042784: Add interaction data to pageload event. r=denispal,canova
This adds information about interactions during a pageload session to the pageload event. It adds a number of different metrics that will help us understand the distribution of interaction timings. In the longer term this is intended to help us decide what the best metric is for us to consider for the eTLD+1 pageload event.

Differential Revision: https://phabricator.services.mozilla.com/D302799
2026-06-07 06:09:10 +00:00
Emilio Cobos Álvarez 1bd0da8bf7 Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-02 22:04:17 +00:00
iulian moraru 480fc572da Revert "Bug 2036439, Bug 2033243 - Deal with ownerGlobal -> documentGlobal rename in extensions. r=robwu,home-newtab-reviewers,mconley" for causing newtab failures.
This reverts commit 4f62279d01.

Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug"

This reverts commit 91a4ece356.

Revert "Bug 2033243 - BindToOwner -> BindToGlobal. r=dom-core,smaug"

This reverts commit 5a95a889e1.

Revert "Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug"

This reverts commit 7177a68e67.

Revert "Bug 2033243 - Replace ownerGlobal with documentGlobal, and stop exposing ownerGlobal to JS. r=firefox-desktop-core-reviewers ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop"

This reverts commit 5263254690.
2026-05-02 16:43:35 +00:00
Emilio Cobos Álvarez 7177a68e67 Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-02 15:33:23 +00:00
rperta d4cc71008d Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug" on developer request
This reverts commit e58e122135.

This reverts commit 84ca206f3e.

This reverts commit a7945292ed.

This reverts commit 367d83d299.
2026-05-02 06:20:30 +00:00
Emilio Cobos Álvarez a7945292ed Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-01 11:58:14 +00:00
agoloman c814da612d Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug" for causing multiple failures.
This reverts commit c7246654bc.

Revert "Bug 2033243 - BindToOwner -> BindToGlobal. r=dom-core,smaug"

This reverts commit 8873ddf33c.

Revert "Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug"

This reverts commit 8bf999e03c.

Revert "Bug 2033243 - Replace ownerGlobal with documentGlobal, and stop exposing ownerGlobal to JS. r=firefox-desktop-core-reviewers ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop"

This reverts commit 7dea1af2e0.
2026-04-30 20:13:14 +00:00
Emilio Cobos Álvarez 8bf999e03c Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-04-30 17:47:11 +00:00
Nazım Can Altınova def2f3a549 Bug 2025357 - Refactor LCP profiler marker state into SharedLcpMarkerState r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D292725
2026-04-17 00:39:59 +00:00
pstanciu cfd7dfb33a Revert "Bug 2025357 - Refactor LCP profiler marker state into SharedLcpMarkerState r=mstange" for causing wpt failures @ handle_user_prompt.py
This reverts commit 59815dd3d4.
2026-04-14 02:57:25 +00:00
Nazım Can Altınova 59815dd3d4 Bug 2025357 - Refactor LCP profiler marker state into SharedLcpMarkerState r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D292725
2026-04-14 01:22:46 +00:00
Nazım Can Altınova 8764d4559a Bug 2023342 - Cap event timing at modal dialog appearance time r=smaug
Modal dialogs (alert, confirm, prompt, print, beforeunload) and context
menus provide visual feedback before the next paint. Record their
appearance time as a fallback so that event timing processingEnd and
duration are not inflated by time spent in the dialog.

This is again related to the spec bug: https://github.com/w3c/event-timing/issues/154

Differential Revision: https://phabricator.services.mozilla.com/D288422
2026-03-25 15:42:29 +00:00
Nazım Can Altınova fac0322d2d Bug 2023342 - Dispatch event timing entries when the refresh driver doesn't tick r=smaug
This is a spec bug currently: https://github.com/w3c/event-timing/issues/123

When no paint is pending, event timing entries would stay in the pending
queue indefinitely until unrelated activity triggered a repaint. For
example, a keydown event on a div that doesn't trigger any paint. The
following patch adds a wpt test for this specifically.

Differential Revision: https://phabricator.services.mozilla.com/D288419
2026-03-25 15:42:22 +00:00
Sylvestre Ledru 9eb1a31a98 Bug 2023419 - Remove Emacs/Vim modelines from dom/ r=emilio,media-playback-reviewers,webidl,padenot
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287843
2026-03-16 21:02:32 +00:00
Nazım Can Altınova bc732e77b5 Bug 2000426 - Convert EventTiming mDuration to an optional value r=smaug
This patch converts the mDuration of PerformanceEventTiming from
DOMHighResTimeStamp to Maybe<DOMHighResTimeStamp>. This allows us to
distinguish between:
- Duration not yet set (mDuration.isNothing())
- Duration explicitly set to 0 (mDuration.isSome() && value == 0)

This distinction is necessary to fix bug 2000426, where we need to
determine if a pointerdown event's duration has been finalized before
processing subsequent pointerup/click events.

Differential Revision: https://phabricator.services.mozilla.com/D273025
2025-11-19 14:49:36 +00:00
Nazım Can Altınova e3efe1488d Bug 1994144 - Use static atoms directly for PerformanceEntry types r=jlink,smaug
Previously we were passing strings to the constructor for
PerformanceEntry types, but we don't need that since we know them for
sure during the compile time. It makes it easier to use the static
atoms, and they should be faster than the previous code.

Differential Revision: https://phabricator.services.mozilla.com/D268543
2025-10-17 13:33:05 +00:00
Nazım Can Altınova 73746112e3 Bug 1994145 - Rename Performance::DispatchBufferFullEvent to DispatchResourceTimingBufferFullEvent r=jlink
Previously, it was called DispatchBufferFullEvent confusingly, but it
actually dispatches an event called resourcetimingbufferfull.

Differential Revision: https://phabricator.services.mozilla.com/D268520
2025-10-14 21:47:12 +00:00
Emilio Cobos Álvarez 791917d8af Bug 1976665 - Sort headers in dom/. r=dom-core,media-playback-reviewers,webrtc-reviewers,dom-storage-reviewers,padenot,janv,smaug,jesup,jib
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.

Differential Revision: https://phabricator.services.mozilla.com/D256800
2025-08-05 11:47:34 +00:00
Nazım Can Altınova 2abdbf6fd2 Bug 1964426 - Move pending keydown and pointerdown logic from finalize step to ComputeInteractionId step r=sefeng
This patch doesn't change the behavior of the keydown and pointerdown logic.
But it's needed for the next patch which I will change the keydown behavior and
make it non-lazy.

Differential Revision: https://phabricator.services.mozilla.com/D247839
2025-05-06 22:07:07 +00:00
Nazım Can Altınova cf46ee1bd7 Bug 1962362 - Preemptively queue performance entries that have known interactionId until one without interactionId is found r=sefeng
Previous implementation was waiting for all entries in the list to be queued to
have known interactionIds. But that delays dispatching some event entries when
there are a lot of events being dispatched quickly, like typing very fast or
smashing the keyboard. So this helps in those cases where there are a lot of
events being waited to be queued.

Differential Revision: https://phabricator.services.mozilla.com/D246576
2025-05-01 03:51:49 +00:00
Nazım Can Altınova 45397ae9ff Bug 1934683 - Move the first-input and event count logic to later dispatch and simplify it r=sefeng
This is not in the spec yet. I filed this spec issue for this problem:
https://github.com/w3c/event-timing/issues/146

The author has a spec PR up for review already that matches this implementation:
https://github.com/w3c/event-timing/pull/151

Differential Revision: https://phabricator.services.mozilla.com/D239190
2025-03-24 19:11:43 +00:00
Nazım Can Altınova 15cf6c006e Bug 1934683 - Changes on the performance event timing dispatch logic r=sefeng
This is not in the spec yet. I filed this spec issue for this problem:
https://github.com/w3c/event-timing/issues/145

The spec issue will be addressed soon.

Differential Revision: https://phabricator.services.mozilla.com/D239188
2025-03-24 19:11:43 +00:00
Nazım Can Altınova 37d219f93d Bug 1949814 - Implement interactionCount for Performance interface r=sefeng,webidl,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D239186
2025-03-24 19:11:43 +00:00
Nazım Can Altınova 7585367ae2 Bug 1934683 - Implement interactionId for PerformanceEventTiming directly from the spec r=sefeng,webidl,smaug
This patch tries to follow the spec as much as possible. But unfortunately this
wasn't enough to pass all the web-platform tests and there were some issues
in the spec logic.

I'm adding the fixes to various issues in the following patches, to easily see
what needs to be updated in the spec. Please see the following patches.

Spec: https://w3c.github.io/event-timing/#sec-computing-interactionid

Differential Revision: https://phabricator.services.mozilla.com/D239185
2025-03-24 19:11:42 +00:00
Nazım Can Altınova 78d124ea41 Bug 1948647 - Do not dispatch the first-input event if there is a pending pointer down r=sefeng
The spec for dispatching the first-input event can be found here:
https://w3c.github.io/event-timing/#sec-dispatch-pending

Specifically step 6.2.2 handles this part of the code change.

The old code was following the spec, but some web-platform-tests were failing
because of it. After looking at the Chromium's codebase, I noticed that it
doesn't match the spec and it has this additional check. After adding it to our
code, it passes the tests as well. So it's clear that the spec doesn't match
the web platform tests or the Chromium implementation. It's more likely that
the spec needs to be updated.

Filed a spec bug here:
https://github.com/w3c/event-timing/issues/142

Differential Revision: https://phabricator.services.mozilla.com/D238470
2025-03-24 19:11:42 +00:00
Olli Pettay b092375268 Bug 1941846, don't assert but return early if MaplikeHelpers::Get fails, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D236484
2025-02-03 09:51:25 +00:00
Andreas Farre fee00273bb Bug 1919565 - Hide the text fragment from Navigation and Resource Timing API. r=dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D222941
2024-09-30 13:17:23 +00:00
Sean Feng 0742a41fa7 Bug 1874756 - Simplify and reduce the number of hashtable lookups for LCP implementation r=emilio
Two changes are introduced:

* LCP has a hashtable called `ContentIdentifiersForLCP` to store
(element, image) pairs to avoid processing the same pair multiple
times. Instead of using weak pointers for elements, this patch changes
it to use raw pointers for better performance. Also, makes the
hashtable to use element alone as the key, so that the entry
can be quickly removed when nsINode::LastRelease is called.

* Another change to make imgRequestProxy stores the
timestamps for LCP, so we can create LCP entries when the size
is available, instead of creating one temporarily and updating it
later. This allows us to eliminate a hashtable called
`mImageLCPEntryMap` for better performance.

Differential Revision: https://phabricator.services.mozilla.com/D214315
2024-07-23 20:42:40 +00:00
Emilio Cobos Álvarez 71bf77b3fe Bug 1904442 - Rename GlobalTeardownObserver::GetOwner to GetOwnerWindow. r=smaug,media-playback-reviewers,dom-storage-reviewers,aosmond,padenot,asuth
Also HasOrHasHadOwner to HasOrHasHadOwnerWindow.

Differential Revision: https://phabricator.services.mozilla.com/D214772
2024-07-01 11:49:59 +00:00
Masayuki Nakano fb5048e05b Bug 1675847 - part 1: Rename eMouseClick and eMouseAuxClick r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D212999
2024-06-14 00:18:46 +00:00
Sean Feng e506e5cfea Bug 1877787 - Avoid doing reduced precision computation when generating LCP r=emilio,tjr
When we generate LCP entries, we store the precision-reduced
timestamps which are convenient for later usages, but not very
performant. This patch makes it instead of storing the
precision-reduced timestamps, store the raw timestamps, and only
reduce the precision when they're being used by user code.

Also, this patch changes how we compute precision-reduced timestamps for LCP.
Currently, we effectively use `ReduceTimePrecisionAsMSecsRFPOnly` to
reduce precision which only work in RFP mode. This patch changes it
to `ReduceTimePrecisionAsMSecs` to make it work in 'Normal' mode (i.e.
non-COOP/COEP pages).

Differential Revision: https://phabricator.services.mozilla.com/D200200
2024-02-01 14:30:44 +00:00
Tom Ritter 74b8900fe6 Bug 1873405: Relax an assertion about timing r=sefeng
When RFP is enabled and you're dealing with timestamps of
reduced precision, it's possible for these timestamps to
be equal. Relax the assertion to allow that.

Also, conceptually, it should be <= even without RFP because
you can't guarantee the OS timestamps are going to be reliable
(just increasing) and you can't guarantee anything about how
fast or slow computation is going to happen.

Differential Revision: https://phabricator.services.mozilla.com/D197946
2024-01-10 09:56:52 +00:00
Kagami Sascha Rosylight c1e45850a8 Bug 1862244 - Add GlobalTeardownHelper r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D193295
2023-11-23 17:17:39 +00:00
Sean Feng 6796c871a0 Bug 1864160 - Use weak pointer for LCPImageEntryKey.mImageRequestProxy to avoid keeping image loader alive for unnecessary amount of time r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D193964
2023-11-21 17:46:42 +00:00
Sean Feng 2c6ee1b669 Bug 1863491 - Use weak pointers for LargestContentfulPaint to avoid keeping the element alive for unnecessary period r=emilio,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D193135
2023-11-13 19:20:00 +00:00
Stanca Serban e473309a4d Backed out changeset cfed378ac68a (bug 1863491) for causing build bustages in PerformanceMainThread.cpp. CLOSED TREE 2023-11-13 18:10:40 +02:00
Sean Feng 62cf4d2ec1 Bug 1863491 - Use weak pointers for LargestContentfulPaint to avoid keeping the element alive for unnecessary period r=emilio,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D193135
2023-11-13 14:33:56 +00:00
Nazım Can Altınova b3e5486e5f Bug 1862937 - Add profiler markers for LCP values r=sefeng,profiler-reviewers,florian,emilio
There might be multiple LCP entries in a web page, and we only care about the
last one which is also the biggest value. That's why we need to record these
values in two different places:
- During the Document unload, so we can add markers for the closed pages.
- During the profile capture, so we can add markers for the open pages.

This allows us to capture all the LCP values. Note that this is not the case
for other metrics like FCP, TTFB, DOMContentLoaded etc. that fires only once.

Differential Revision: https://phabricator.services.mozilla.com/D192828
2023-11-13 08:59:17 +00:00
Stanca Serban 7620aae61b Backed out changeset 24b44cfac27e (bug 1863491) for @ nsIGlobalObject::GetAsInnerWindow related crashes. CLOSED TREE 2023-11-10 23:35:01 +02:00
Sean Feng 76b0d0e964 Bug 1863491 - Use weak pointers for LargestContentfulPaint to avoid keeping the element alive for unnecessary period r=emilio,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D193135
2023-11-10 20:44:31 +00:00
Cristian Tuns 4913b0b284 Backed out changeset e2c6fa08aa82 (bug 1863491) for causing multiple crashes @ nsIGlobalObject::GetAsInnerWindow CLOSED TREE 2023-11-10 10:27:42 -05:00
Sean Feng 4913064b56 Bug 1863491 - Use weak pointers for LargestContentfulPaint to avoid keeping the element alive for unnecessary period r=emilio,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D193135
2023-11-10 14:15:25 +00:00
Cosmin Sabou 5e145e6c18 Backed out changeset 4100364d528c (bug 1862937) for causing build bustages. CLOSED TREE 2023-11-09 19:34:15 +02:00
Nazım Can Altınova 439c72d640 Bug 1862937 - Add profiler markers for LCP values r=sefeng,profiler-reviewers,florian
There might be multiple LCP entries in a web page, and we only care about the
last one which is also the biggest value. That's why we need to record these
values in two different places:
- During the Document unload, so we can add markers for the closed pages.
- During the profile capture, so we can add markers for the open pages.

This allows us to capture all the LCP values. Note that this is not the case
for other metrics like FCP, TTFB, DOMContentLoaded etc. that fires only once.

Differential Revision: https://phabricator.services.mozilla.com/D192828
2023-11-09 16:59:05 +00:00
Stanca Serban 86c5c0bcea Backed out changeset 31f667310dfe (bug 1862937) for causing multiple failures in WeakPtr.h. CLOSED TREE 2023-11-08 16:52:51 +02:00
Nazım Can Altınova f766a094c3 Bug 1862937 - Add profiler markers for LCP values r=sefeng,profiler-reviewers,florian
There might be multiple LCP entries in a web page, and we only care about the
last one which is also the biggest value. That's why we need to record these
values in two different places:
- During the Document unload, so we can add markers for the closed pages.
- During the profile capture, so we can add markers for the open pages.

This allows us to capture all the LCP values. Note that this is not the case
for other metrics like FCP, TTFB, DOMContentLoaded etc. that fires only once.

Differential Revision: https://phabricator.services.mozilla.com/D192828
2023-11-08 13:29:41 +00:00
Sean Feng 2d6e584e05 Bug 1722322 - Implement LargestContentfulPaint r=emilio
Spec: https://w3c.github.io/largest-contentful-paint

Differential Revision: https://phabricator.services.mozilla.com/D151079
2023-11-02 20:53:36 +00:00
Sandor Molnar d23e2827b7 Backed out 7 changesets (bug 1722322) for causing bp-nu bustages
Backed out changeset 0ebd32e273b8 (bug 1722322)
Backed out changeset 7a75717f127c (bug 1722322)
Backed out changeset c2a6440a83d7 (bug 1722322)
Backed out changeset 9955756855bd (bug 1722322)
Backed out changeset 37fccb407777 (bug 1722322)
Backed out changeset f52b1f28f753 (bug 1722322)
Backed out changeset 0121c8cf5d2f (bug 1722322)
2023-11-02 21:27:24 +02:00
Sean Feng cacfa492a8 Bug 1722322 - Implement LargestContentfulPaint r=emilio
Spec: https://w3c.github.io/largest-contentful-paint

Differential Revision: https://phabricator.services.mozilla.com/D151079
2023-11-02 17:04:47 +00:00
Markus Stange 755a0de1c3 Bug 1851263 - Rename nsIGlobalObject::AsInnerWindow to GetAsInnerWindow because it can return null. r=smaug
This is also the name that was originally suggested in https://bugzilla.mozilla.org/show_bug.cgi?id=218415#c53 .

Differential Revision: https://phabricator.services.mozilla.com/D187340
2023-09-04 04:06:30 +00:00