Commit Graph
836 Commits
Author SHA1 Message Date
Butkovits Atila 1e65bfe9d0 Backed out 4 changesets (bug 1916311) for causing wpt failures at no-crash-set-exception.html. CLOSED TREE
Backed out changeset 7a2f34195c02 (bug 1916311)
Backed out changeset 09b974edc310 (bug 1916311)
Backed out changeset 91431bf2cb69 (bug 1916311)
Backed out changeset cadf4f0266df (bug 1916311)
2024-09-04 20:58:46 +03:00
Emilio Cobos Álvarez 4886de829b Bug 1916311 - [css-view-transitions] Initial pass at DOM API internals. r=boris,webidl,smaug
This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
https://github.com/w3c/csswg-drafts/issues/10822

Differential Revision: https://phabricator.services.mozilla.com/D220843
2024-09-04 11:12:47 +00:00
Florian Quèze c1d775c929 Bug 1913624 - Remove expired telemetry histogram PRESSHELL_LAYOUT_TOTAL_MS_PER_TICK, r=TravisLong.
Depends on D219468

Differential Revision: https://phabricator.services.mozilla.com/D219469
2024-08-20 20:56:48 +00:00
Emilio Cobos Álvarez 39faee19b9 Bug 1911448 - Remove DOMContentFlushed. r=smaug,perftest-reviewers,sparky
As per comments in bug 1910411's patches and others, it's not a useful
metric, specially now that we have LCP and so on.

Actually there doesn't seem to be any consumer of it since bug 1892001.

Differential Revision: https://phabricator.services.mozilla.com/D218489
2024-08-05 12:20:43 +00:00
Emilio Cobos Álvarez 9dacbe4a44 Bug 1910411 - Fix refresh driver throttling code to check all tick reasons. r=smaug
I don't think HasObservers() || HasImageRequests() is the right check in
general given we have other tick reasons like that.

Differential Revision: https://phabricator.services.mozilla.com/D218378
2024-08-02 12:44:14 +00:00
Emilio Cobos Álvarez 6e32235ef0 Bug 1800882 - Clean up rvfc a bit to match the spec closer. r=aosmond
Deal with throttled docs only once upfront, since
ShouldThrottleFrameRequests is kind of expensive (doing a full
IntersectionObserver check).

Add proper spec quotes too, while at it. This also fixes the failure
that got the previous patch backed out.

Differential Revision: https://phabricator.services.mozilla.com/D217708
2024-08-01 20:12:23 +00:00
Ashley Zebrowski a843c313da Bug 1800882 - Implement HTMLVideoElement.requestVideoFrameCallback. r=webidl,media-playback-reviewers,emilio,ErichDonGubler,padenot
See https://wicg.github.io/video-rvfc/ for standard details.

Differential Revision: https://phabricator.services.mozilla.com/D216159
2024-08-01 20:12:22 +00:00
Sandor Molnar 42c4952868 Backed out 3 changesets (bug 1800882) for causing webcodecs failures . CLOSED TREE
Backed out changeset fd02fd0205ab (bug 1800882)
Backed out changeset fa46622c4ec7 (bug 1800882)
Backed out changeset 3ac74b4d6534 (bug 1800882)
2024-07-31 20:45:09 +03:00
Emilio Cobos Álvarez 2997f99c85 Bug 1800882 - Clean up rvfc a bit to match the spec closer. r=aosmond
Deal with throttled docs only once upfront, since
ShouldThrottleFrameRequests is kind of expensive (doing a full
IntersectionObserver check).

Add proper spec quotes too, while at it. This also fixes the failure
that got the previous patch backed out.

Differential Revision: https://phabricator.services.mozilla.com/D217708
2024-07-31 16:53:55 +00:00
Ashley Zebrowski 05a02c5a88 Bug 1800882 - Implement HTMLVideoElement.requestVideoFrameCallback. r=webidl,media-playback-reviewers,emilio,ErichDonGubler,padenot
See https://wicg.github.io/video-rvfc/ for standard details.

Differential Revision: https://phabricator.services.mozilla.com/D216159
2024-07-31 16:53:55 +00:00
Butkovits Atila e422067dc8 Backed out 3 changesets (bug 1800882) for causing webgpu failures. CLOSED TREE
Backed out changeset 8acda0361e97 (bug 1800882)
Backed out changeset 1e76fd470d00 (bug 1800882)
Backed out changeset 548a1763e689 (bug 1800882)
2024-07-26 01:14:08 +03:00
Emilio Cobos Álvarez e07fd0d57e Bug 1800882 - Clean up rvfc a bit to match the spec closer. r=aosmond
Deal with throttled docs only once upfront, since
ShouldThrottleFrameRequests is kind of expensive (doing a full
IntersectionObserver check).

Add proper spec quotes too, while at it. This also fixes the failure
that got the previous patch backed out.

Differential Revision: https://phabricator.services.mozilla.com/D217708
2024-07-25 17:08:38 +00:00
Ashley Zebrowski c781cc475c Bug 1800882 - Implement HTMLVideoElement.requestVideoFrameCallback. r=webidl,media-playback-reviewers,emilio,ErichDonGubler,padenot
See https://wicg.github.io/video-rvfc/ for standard details.

Differential Revision: https://phabricator.services.mozilla.com/D216159
2024-07-25 17:08:38 +00:00
Tamas Szentpeteri c944152723 Backed out changeset e2de2a86795f (bug 1800882) 2024-07-25 00:05:30 +03:00
Ashley Zebrowski 189b0b8e40 Bug 1800882 - Implement HTMLVideoElement.requestVideoFrameCallback. r=webidl,media-playback-reviewers,emilio,ErichDonGubler,padenot
See https://wicg.github.io/video-rvfc/ for standard details.

Differential Revision: https://phabricator.services.mozilla.com/D216159
2024-07-24 18:30:35 +00:00
Emilio Cobos Álvarez 6714cf6d55 Bug 1909048 - Simplify document frame callback scheduling. r=smaug
This matches the spec better, and is generally simpler.

Differential Revision: https://phabricator.services.mozilla.com/D217198
2024-07-24 14:39:04 +00:00
Emilio Cobos Álvarez a30fcc50ca Bug 1909048 - Clean-up document frame callback handling. r=aosmond
This will make bug 1800882 simpler. Ideally we'd follow the spec a lot
more closely to the letter (e.g. per spec we should deal with a document
frame request callback calling something like
window.frames[0].contentWindow.requestAnimationFrame() and running that
in the same tick, but for now this doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D217197
2024-07-21 13:58:31 +00:00
Emilio Cobos Álvarez d4cd5b3261 Bug 1897752 - Clean up layout telemetry. r=smaug
This telemetry was trying to measure three things:

 * The time spent during style / layout in a tick. This is useful.
 * The times SetNeed{Style,Layout} flush have been called. This is not a
   particularly useful metric, there's not much to learn or change from
   it. Any call is basically free as long as they're consecutive /
   there's no flush in between.
 * The number of times layout / style has been flushed during a tick.
   This is more useful than the above but, similarly, there's not too
   much to be learned here. Number of flushes can be completely
   orthogonal to how expensive it has been.

It also had a number of flaws:

 * It is recorded per-PresShell, so we get multiple pings per tick.
 * Similarly, if a sub-frame dies before the tick, we just never report
   that time.

Instead, refactor it to make it simpler, and just record the first
metric reliably. This simplifies the code substantially, and I don't
think we're losing much.

The histograms are also expired. We might want to renew this, I'll file
a follow-up to either properly renew this if we plan to look at it, or
remove the code entirely from the tree.

Differential Revision: https://phabricator.services.mozilla.com/D210907
2024-05-20 14:30:08 +00:00
Emilio Cobos Álvarez fc159ff851 Bug 1896762 - Make animation timing match the spec. r=smaug,firefox-animation-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D210658
2024-05-17 16:33:06 +00:00
Natalia Csoregi 2646ae722f Backed out changeset afcc70a5e871 (bug 1896762) for causing failures on css-transition-cross-document.html CLOSED TREE 2024-05-17 18:50:54 +03:00
Emilio Cobos Álvarez d554a723e9 Bug 1897322 - More consistently deal with pres shell style observers. r=smaug
Much like we deal with resize events.

Differential Revision: https://phabricator.services.mozilla.com/D210776
2024-05-17 11:56:36 +00:00
Stanca Serban 4edbdf3b0d Backed out changeset 0328321272d7 (bug 1897322) for causing multiple failures. CLOSED TREE 2024-05-17 14:09:21 +03:00
Emilio Cobos Álvarez 9bae74fae2 Bug 1897322 - More consistently deal with pres shell style observers. r=smaug
Much like we deal with resize events.

Differential Revision: https://phabricator.services.mozilla.com/D210776
2024-05-17 10:25:31 +00:00
Emilio Cobos Álvarez c54d301d5e Bug 1896762 - Make animation timing match the spec. r=smaug,firefox-animation-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D210658
2024-05-17 08:33:36 +00:00
Emilio Cobos Álvarez 2844cddbc3 Bug 1896760 - Make resize event timing match the spec. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D210383
2024-05-15 16:22:13 +00:00
Jamie Nicol 16b72880b4 Bug 1896024 - Ensure PerformanceHintSession is valid before reporting work duration. r=jesup,smaug
Differential Revision: https://phabricator.services.mozilla.com/D210042
2024-05-15 14:11:57 +00:00
Emilio Cobos Álvarez 1b4fb09397 Bug 1896593 - Fix a devtools frequent intermittent.
We should be more consistent about what stuff runs and what doesn't when
the pres context is getting torn down...

MANUAL PUSH: Trivialish orange fix CLOSED TREE
2024-05-15 18:05:11 +02:00
Tamas Szentpeteri 898fdb920e Backed out changeset 2894ff06108e (bug 1896024) for causing almost perma crashes on browser_webconsole_filter_buttons_overflow.js. 2024-05-15 15:09:05 +03:00
Emilio Cobos Álvarez c4b2292488 Bug 1896763 - Make display observer timing happen after all layout changes are possibly done. r=smaug,Jamie
Not sure how testable this is, for a11y purposes. The other consumer is
some XRSession stuff which doesn't seem to care too much about the
timing of this.

Differential Revision: https://phabricator.services.mozilla.com/D210384
2024-05-15 09:36:52 +00:00
Jamie Nicol 821133c3a8 Bug 1896024 - Ensure PerformanceHintSession is valid before reporting work duration. r=jesup,smaug
Differential Revision: https://phabricator.services.mozilla.com/D210042
2024-05-15 08:38:27 +00:00
Emilio Cobos Álvarez 85204e6099 Bug 1896593 - Make our refresh driver tick match the HTML spec more closely. r=smaug
This doesn't change behavior intentionally, though it annotates places
where our code doesn't match the spec right now, and adds comments and
quotes the HTML spec in the relevant places.

Some things that this highlights:

 * Resize steps are fired at the wrong time.
 * Some of our animation stuff seems sketchy / out of place too to me
   (AnimationTimeline observes the refresh driver at the style phase).
 * Focus fix-up is out of order (that's known, bug 1788741 for tests).
 * Our layout flush stuff should probably be better integrated / closer
   to the resize observer loop.
 * Display observers are run before stuff like ResizeObserver runs. That
   might be a problem for accessibility's NotificationController?

Again, these are intentionally not addressed in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D210279
2024-05-14 21:55:33 +00:00
Emilio Cobos Álvarez 0a1d2b49ff Bug 1895870 - Simplify refresh driver observer set-up. r=smaug
There's no call to AddRefreshObserver(FlushType::Layout), so we don't
need to track layout flushes. The only reason we need
mLayoutFlushObservers is so that reflows triggered from the style flush
get processed. But at that point, we can just flush layout directly.

There's no really good distinction between style flushes and layout
flushes with container queries anyways, so this makes the code simpler
to reason about.

Differential Revision: https://phabricator.services.mozilla.com/D209924
2024-05-14 08:12:03 +00:00
Emilio Cobos Álvarez 46a31e3de5 Bug 1891597 - Simplify IntersectionObserver notifications. r=smaug
DOMIntersectionObserver::Update doesn't run script, so we can write this
code in a more straight-forward way.

Differential Revision: https://phabricator.services.mozilla.com/D207478
2024-04-16 02:58:10 +00:00
Dan Robertson fc1137ebcc Bug 1881974 - RefreshDriver fires scroll events before scrollend events. r=hiro
Ensure that the RefreshDriver fires all queued scroll events before
firing scrollend events.

Differential Revision: https://phabricator.services.mozilla.com/D204385
2024-04-01 18:01:40 +00:00
Frédéric Wang ea8819b5ee Bug 1880928 - Remove last remembered size observer, handle it in Document::DetermineProximityToViewportAndNotifyResizeObservers. r=emilio,layout-reviewers
The CSS Box Sizing specification indicates that last remembered sizes
are recorded "at the time that ResizeObserver events are determined and
delivered" [1].

In bug 1807253, we changed the implementation of when proximity to the
viewport of `content-visibility: auto` nodes are determined and of when
resize observations are broadcast, in order to align with the latest
version of the HTML specification [2]. We continue to use an internal
`Document::mLastRememberedSizeObserver` to update last remembered sizes
but it has been causing issues (e.g. bug 1867090 and bug 1880928) and
could be replaced by a direct update before broadcasting resize
observations.

This is what the current patch is doing. The elements currently observed
by `Document::mLastRememberedSizeObserver` are now stored on a
`Document::mElementsWithLastRememberedSize` hashset and a new function
`Document::UpdateLastRememberedSizes` is called before broadcasting
resize observations, and peforms the work of `LastRememberedSizeCallback`
and of `CalculateBoxSize` (with `aBox=Content_box`).

The only behavior change is in the `while(true)` loop from
`DetermineProximityToViewportAndNotifyResizeObservers`: at each step
we update the last remember sizes for elements of arbitrary depth, and
don't use these depths for calculating `shallowestTargetDepth`. This is
fine, since our `LastRememberedSizeCallback` only records current box
sizes without causing significant side effects (e.g. execution of
JavaScript code) that may require a relayout.

[1] https://drafts.csswg.org/css-sizing-4/#last-remembered
[2] https://html.spec.whatwg.org/#update-the-rendering

Differential Revision: https://phabricator.services.mozilla.com/D202571
2024-02-29 08:50:55 +00:00
Chris H-C 1c0270168b Bug 1877842 - Migrate performance GVST probes r=perry.mcmanis,denispal
Most are brought over straightforwardly, their Telemetry callsites reworded
to use Glean, with mirroring to the Telemetry probes taken care of by the Glean
Interface For Firefox Telemetry (see the telemetry_mirror property).

There were two special cases: PERF_DOM_CONTENT_LOADED_FROM_RESPONSESTART_MS,
and PERF_DOM_CONTENT_LOADED_MS. Both were removed as they were unused.

Differential Revision: https://phabricator.services.mozilla.com/D200867
2024-02-09 21:11:05 +00:00
Olli Pettay ba689444ea Bug 1870008 - make high rate mode handling dynamic, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D196591
2023-12-18 15:40:09 +00:00
Emilio Cobos Álvarez 0d34e41b89 Bug 1867042 - Don't force PresShell initialization from ResizeObserver handling. r=fredw
This is unfortunately somewhat hard to test, because paint suppression
is not really quite observable by the page.

This makes sure that we don't report resize observations etc until the
page has been laid out for other reasons.

Differential Revision: https://phabricator.services.mozilla.com/D194910
2023-11-28 22:27:59 +00:00
Frederic Wang ddfb81b48e Bug 1807253 - unreliable timing for content-visibility:auto, r=emilio
Rewrite implementation of content-visibility: auto as defined in
https://github.com/w3c/csswg-drafts/issues/8542

Differential Revision: https://phabricator.services.mozilla.com/D170394
2023-11-27 08:26:46 +00:00
Natalia Csoregi 9e23519bf8 Backed out changeset 20a5c1f3b35e (bug 1807253) for causing failures on content-visibility-continuations-crash.html. CLOSED TREE 2023-11-22 16:12:27 +02:00
Frederic Wang 28dfc50a7f Bug 1807253 - unreliable timing for content-visibility:auto, r=emilio
Rewrite implementation of content-visibility: auto as defined in
https://github.com/w3c/csswg-drafts/issues/8542

Differential Revision: https://phabricator.services.mozilla.com/D170394
2023-11-22 13:00:36 +00:00
Olli Pettay c43dc7f002 Bug 1857618 - Ensure normal tasks get enough time to run, r=mstange
The basic idea is to check if there are pending tasks also right after RefreshDriver tick has been handled, not only before tick.
But in this new case we can't predict how much time is needed for other tasks, so just a bit of time is given.

The patch tweaks also other things: CanDoCatchUpTick (which is used by catch-up ticks and FinishedWaitingForTransaction) should
return false if the active timer is blocked because of mSuspendVsyncPriorityTicksUntil.
And to make it easier to check whether driver is blocked, mSuspendVsyncPriorityTicksUntil is changed to rely on local time, not the time stamp
from vsync.

The low priority notify is changed so that it uses member variables from the driver and in case it does trigger a tick, it uses the most recent skipped
values.

Differential Revision: https://phabricator.services.mozilla.com/D193409
2023-11-20 10:20:30 +00:00
Emilio Cobos Álvarez 9fb7a17630 Bug 1864425 - Remove PendingAnimationTracker. r=birtles
Instead of starting transitions and animations as a result of a paint,
use the refresh driver tick to do this.

This sets the transition-ready time to the current time during the next
refresh driver tick that it was started on (see mSawTickWhilePending).

This is similar to what's described in the bugs comments, and seems to
work nicely in practice.

We could easily change that (current time) by a paint-based time if
needed (when available), which would be more similar to what we were
doing. But I'd rather do the simple thing for now, and land this shortly
after the soft freeze is over so that we have time to watch out for
regressions.

There's one regression on a test that birtles wrote (using an XHR doc
and switching the timeline to a rendered doc's timeline).

We use the timeline's document rather than the target document to
determine whether to trigger animations now. That's one of the cases
where we'd keep vsync perma-running without this patch, and Chrome also
fails that test. Maybe the test should be removed / the spec should be
tweaked to allow this behavior?

This causes some progression in some CSS transitions tests too, and I
added an extra test for the vsync behavior.

Over-all this is much simpler to reason about and I think we should try
to do this.

Differential Revision: https://phabricator.services.mozilla.com/D193583
2023-11-20 09:31:41 +00:00
Stanca Serban 64050fac35 Backed out changeset 4683ed11f2cd (bug 1857618) for causing multiple assertion failures in nsRefreshDriver.cpp. CLOSED TREE 2023-11-16 01:55:07 +02:00
Olli Pettay 3a3c9824fc Bug 1857618 - Ensure normal tasks get enough time to run, r=mstange
The basic idea is to check if there are pending tasks also right after RefreshDriver tick has been handled, not only before tick.
But in this new case we can't predict how much time is needed for other tasks, so just a bit of time is given.

The patch tweaks also other things: CanDoCatchUpTick (which is used by catch-up ticks and FinishedWaitingForTransaction) should
return false if the active timer is blocked because of mSuspendVsyncPriorityTicksUntil.
And to make it easier to check whether driver is blocked, mSuspendVsyncPriorityTicksUntil is changed to rely on local time, not the time stamp
from vsync.

The low priority notify is changed so that it uses member variables from the driver and in case it does trigger a tick, it uses the most recent skipped
values.

Differential Revision: https://phabricator.services.mozilla.com/D193409
2023-11-15 21:06:20 +00:00
Cristian Tuns d8831f9284 Backed out changeset 4953e7db7d08 (bug 1857618) because of some performance regressions CLOSED TREE 2023-11-06 17:46:51 -05: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
Daniel Holbert aeca752232 Bug 1861259 part 3: Coalesce redundant array-index checks in nsRefreshDriver. r=tnikkel
This patch doesn't change behavior; it just removes some redundant checks.

(Note that the tight-scoping around nsAutoMicroTask/ReduceAnimations is
important for the RAII object to be torn down at the intended time; but it
doesn't need its own if-check.)

Depends on D191909

Differential Revision: https://phabricator.services.mozilla.com/D191911
2023-10-25 23:50:05 +00:00