Commit Graph

91 Commits

Author SHA1 Message Date
Botond Ballo
fad0b21b7e Bug 1965424 - Do not activate scroll frames inside view transition captured content. r=botond
This is needed because we don't want to create useless APZ scroll info
for view transitions (D248043), but that relies on these scrollframes
not being active.

Note that contents inside a view transition capture can't scroll.

Differential Revision: https://phabricator.services.mozilla.com/D248041
2025-05-09 08:47:21 +00:00
Emilio Cobos Álvarez
77a7f4183d Bug 1965060 - Remove unused ClipState::AutoSaveRestore from root backdrop-filter. r=dholbert
Spotted while going through this code for view transitions.

Differential Revision: https://phabricator.services.mozilla.com/D248314
2025-05-08 01:22:08 +00:00
Botond Ballo
db66870a98 Bug 1964701 - Track in the display list builder whether we're inside a view transition capture. r=nical
No behavior change from this patch on its own, but this will be useful
for bug 1961140.

Co-authored-by: Botond Ballo <botond@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D248017
2025-05-07 15:06:58 +00:00
Emilio Cobos Álvarez
0cf9cfd569 Bug 1963368 - Avoid sending two snapshots for the root. r=view-transitions-reviewers,boris
We should handle the root only in ScrollContainerFrame. We don't hit
this code-path more often because the root primary frame is usually not
a stacking context.

Differential Revision: https://phabricator.services.mozilla.com/D247590
2025-05-05 05:45:58 +00:00
Emilio Cobos Álvarez
4c0adc7d53 Bug 1958965 - Change scroll event setup to match the spec better. r=smaug
This matches the spec (plus resolution at
https://github.com/w3c/csswg-drafts/issues/11164) better, by running the
events per document.

Same comments as D244655 regarding the delayed event stuff that's going
away.

Differential Revision: https://phabricator.services.mozilla.com/D244666
2025-04-10 01:07:15 +00:00
Gregory Pappas
2c1c232662 Bug 1959061 - Remove overflow/underflow event prefs r=extension-reviewers,emilio,robwu
And use counters

Differential Revision: https://phabricator.services.mozilla.com/D244718
2025-04-08 23:48:03 +00:00
Goloman Adrian
dbfe2fbd57 Backed out changeset 8df80a696c61 (bug 1959061) for causing multiple failures. CLOSED TREE 2025-04-08 17:20:57 +03:00
Gregory Pappas
822da8e785 Bug 1959061 - Remove overflow/underflow event prefs r=extension-reviewers,emilio,robwu
And use counters

Differential Revision: https://phabricator.services.mozilla.com/D244718
2025-04-08 13:22:30 +00:00
Cosmin Sabou
51285c4191 Backed out changeset 65d8bcd98b49 (bug 1959061) for causing build bustages on ScrollContainerFrame. CLOSED TREE 2025-04-08 16:11:10 +03:00
Gregory Pappas
da085e844a Bug 1959061 - Remove overflow/underflow event prefs r=extension-reviewers,emilio,robwu
And use counters

Differential Revision: https://phabricator.services.mozilla.com/D244718
2025-04-08 12:22:39 +00:00
Cristian Tuns
5f65588990 Backed out changeset 756680c06b2b (bug 1488953) for causing bc failures in /browser_tabdetach.js and browser_tabstrip_overflow_underflow.js CLOSED TREE 2025-04-08 00:00:53 -04:00
Emilio Cobos Álvarez
fa2ca93142 Bug 1488953 - Use script runner for scrollport events. r=mats
Since last time we tried this:

 * A lot of internal usage has gone away.
 * They have been successfully been unshipped from content and
   extensions.

So we should try this again.

Differential Revision: https://phabricator.services.mozilla.com/D5271
2025-04-08 01:05:15 +00:00
Emilio Cobos Álvarez
ec0102d276 Bug 1954803 - Pass current ASR to avoid debug-only asserts.
MANUAL PUSH: Orange fix CLOSED TREE
2025-03-25 17:08:10 +01:00
Emilio Cobos Álvarez
d025ded17c Bug 1953823 - When the root is snapshotted, snapshot the root contents but not top layer(s). r=view-transitions-reviewers,boris
For fallback snapshots, for now just snapshot the canvas frame.

Differential Revision: https://phabricator.services.mozilla.com/D242016
2025-03-25 14:03:19 +00:00
Hiroyuki Ikezoe
a7c329ac82 Bug 1946375 - Update scroll snap target ids when re-using an AsyncSmoothMSDScroll or an AsyncScroll instance. r=dlrobertson
In the case of `overflow:hidden` scroll container, async scroll
operations are handled on the main-thread. And the scroll snap target ids
are also maintained on the main-thread either by mAsyncSmoothMSDScroll
or mAsyncScroll. But when re-using an existing mAsyncSmoothMSDScroll
instance (or mAsyncScroll), the first scroll snap target ids had persisted
in the instance, that resulted unexpected re-snapping.

Differential Revision: https://phabricator.services.mozilla.com/D238731
2025-03-18 06:02:16 +00:00
Tom Schuster
b8d11d463f Bug 1951893 - Remove unneeded StaticAtom suffixes. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D240598
2025-03-11 11:36:09 +00:00
Otto Länd
300de5ac42 Bug 1950560: apply code formatting via Lando
# ignore-this-changeset
2025-02-27 06:21:08 +00:00
Hiroyuki Ikezoe
602f35e441 Bug 1950560 - Do not clobber restoring the scroll position on re-snap. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D239677
2025-02-27 02:34:52 +00:00
Hiroyuki Ikezoe
b2b048a314 Bug 1950560 - Clear mSnapTargets just before trying to resnap instead of inside ScrollContainerFrame::GetSnapPointForResnap. r=botond
Though there's no problem even if we clear mSnapTargets in
ScrollContainerFrame::GetSnapPointForResnap, the main purpose of this change
is to avoid multiple call sites of ScrollSnapUtils::GetSnapPointForResnap
so that in the next change we only need to tweak the single call site.

Differential Revision: https://phabricator.services.mozilla.com/D239685
2025-02-27 02:34:52 +00:00
Hiroyuki Ikezoe
1e2838636c Bug 1948522 - Use the display root frame as the root frame for popup in RestrictToRootDisplayPort. r=botond
This change is similar to the previous change, but for displayport.

Differential Revision: https://phabricator.services.mozilla.com/D238555
2025-02-20 03:29:39 +00:00
Boris Chiou
01822d4c20 Bug 1944977 - Unregister the scroll timelines after scheduling all timelines. r=hiro
It's possible to unregister the timelines in Tick() if the
content-visibility changed. I'd like to avoid this to make things
simpler. Therefore, we add an extra flag and set it if we would like to
unregister this timeline while scheduling, and then we remove these
timelines after scheduling.

Differential Revision: https://phabricator.services.mozilla.com/D236642
2025-02-04 05:33:58 +00:00
Hiroyuki Ikezoe
56ff79d442 Bug 1941175 - Use nsIFrame::GetNearestWidget rather than nsPresContext::GetNearestWidget for paint skipping. r=botond
helper_paint_skip_in_popup.html was originally written by Mayank Bansal.

Differential Revision: https://phabricator.services.mozilla.com/D234229
2025-01-16 01:59:19 +00:00
Alexandru Marc
3678a3f430 Backed out 5 changesets (bug 1941175) for causing reftest failures @ details-display-inline.html CLOSED TREE
Backed out changeset e908e40ae014 (bug 1941175)
Backed out changeset f0ddddc22390 (bug 1941175)
Backed out changeset 7e16ac152467 (bug 1941175)
Backed out changeset e5ff999da3c5 (bug 1941175)
Backed out changeset 1509d43843a0 (bug 1941175)
2025-01-16 07:56:47 +02:00
Hiroyuki Ikezoe
4aaf965b0d Bug 1941175 - Use nsIFrame::GetNearestWidget rather than nsPresContext::GetNearestWidget for paint skipping. r=botond
helper_paint_skip_in_popup.html was originally written by Mayank Bansal.

Differential Revision: https://phabricator.services.mozilla.com/D234229
2025-01-16 01:59:19 +00:00
Timothy Nikkel
a5ec118f77 Bug 1936288. Avoid getting the display port another time in ScrollContainerFrame::BuildDisplayList. r=hiro
This sometimes shows up in profiles, so avoid getting the displayport when we have that info already.

Differential Revision: https://phabricator.services.mozilla.com/D231686
2024-12-12 08:11:14 +00:00
Timothy Nikkel
954d9f6331 Bug 1934164. Remove unused scroll grab code. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D230635
2024-12-05 12:05:38 +00:00
Timothy Nikkel
f717b3a781 Bug 1933882. We don't need a scroll target id for scroll bar display items if we aren't building compositor hit test info. r=layout-reviewers,jfkthame,jwatt
The scroll target id is only used when we are actually painting to the window.

This avoids the significant time taken for IsScrollingActive and FindOrCreateIDFor during event handling display list builds.

Differential Revision: https://phabricator.services.mozilla.com/D230479
2024-12-01 12:16:07 +00:00
Timothy Nikkel
969638cc84 Bug 1933882. Re-arrange condition to avoid calling relatively slow IsAbsPosContainingBlock. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D230478
2024-12-01 12:16:07 +00:00
Boris Chiou
2cacb75b9a Bug 1921553 - Use PseudoStyleRequest in AnimationCollection and TimelineCollection. r=view-transitions-reviewers,layout-reviewers,emilio
Just like what we do for EffectSet. Also, we will update
ElementAnimationData later, so for now only change the APIs of
AnimationCollection and TimelineCollection (and their callers).

Differential Revision: https://phabricator.services.mozilla.com/D228227
2024-11-25 23:46:33 +00:00
Boris Chiou
30af2312c9 Bug 1921553 - Use PseudoStyleRequest in AnimationUtils and EffectCompositor. r=view-transitions-reviewers,layout-reviewers,emilio
Basically, we'd like to separate the originating element and its pseudo
element request in Animation code (for better compatibility with Web
Animations APIs and other pseudo types), and store the animations and
keyframe effects in the origninating element as well.

In this patch, we reuse `Element::GetPseudoElement()`, and update the
function signatures in EffectCompositor and RestyleManager.

All the following patches will replace more places with
`PseudoStyleRequest`.

Differential Revision: https://phabricator.services.mozilla.com/D228223
2024-11-25 23:46:31 +00:00
Jonathan Watt
7532be254f Bug 1931736. Add missing braces around if/loop statements in layout/generic/. r=layout-reviewers,emilio
Depends on D229247

Differential Revision: https://phabricator.services.mozilla.com/D229248
2024-11-17 05:03:58 +00:00
Stanca Serban
deedaaf8c2 Backed out changeset 41ffc2364844 (bug 1913951) for causing reftests failures in 1133905-1-vh-rtl.html. CLOSED TREE 2024-11-15 02:15:05 +02:00
Hiroyuki Ikezoe
184ff7c2d4 Bug 1913951 - Ignore __underflow__ area for the minimum scale size calculation. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D228270
2024-11-14 22:42:42 +00:00
Alexandru Marc
e5fac45584 Backed out changeset c1acf137ed79 (bug 1913951) for causing reftest failures @ 1166147.html . CLOSED TREE 2024-11-14 11:15:01 +02:00
Hiroyuki Ikezoe
9473e2d395 Bug 1913951 - Ignore __underflow__ area for the minimum scale size calculation. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D228270
2024-11-14 06:23:00 +00:00
David Shin
c35c146cbd Bug 1768921 - Ensure that padding inflated bounds of in-flow children are included in the scrollable element's overflow area. r=dholbert
This means that when users scroll to the inline-end of a scroller, they will
see that the inline-end padding of that scroller is added in.

This is achieved by unioning an additional rect into the scrollable element's
overflow area (Which is an accumulation of the recursive overflow-area
contributions from its subtree).

This additional rect is calculated as follows:
- In-flow children and float's margin boxes are unioned (including zero-size boxes)
- The unioned rect is then inflated by the scrollable element's padding

Note: The bounds of zero-area in-flow-child rects are included in this rect,
in both block- and inline- directions. This is a change in behavior; Divs of
huge inline size and zero block size used to not affect the scrollable overflow,
where divs with huge block size and zero inline size did, as a side effect of now
removed `nsBlockFrame::ConsiderBlockEndEdgeOfChildren`.

Note on WPT change sizing-orthog-(vlr|vrl)-in-htb-(008|020)-ref.xht - the padding existed
to force empty space below `p#sentence-after`. However, this only applies to previous
Firefox. Any combination of browser + default font (+ its default size) causing a scroll
would cause the test to fail as false positive (According to wpt.fyi, this is what happens
with sizing-orthog-(vlr|vrl)-008.xht tests). This change brings Firefox's scroll behaviour
inline with other browsers.

Differential Revision: https://phabricator.services.mozilla.com/D151310
2024-11-13 20:29:13 +00:00
Jonathan Kew
d76851fee6 Bug 1929445 - Use CSSMinMax rather than std::clamp to avoid assertion & undefined behavior on bad arguments. r=dholbert
This is just a band-aid to avoid the undefined behavior of std::clamp;
our CSSMinMax handles the case in a predictable way.

The real issue here must be that the frame has reported a "negative"
block-size, presumably due to integer overflow during nscoord arithmetic.
If we get a pernosco trace of the assertion, perhaps we can identify the
source of the overflow and correct/clamp it earlier to avoid this.

Differential Revision: https://phabricator.services.mozilla.com/D228595
2024-11-12 11:10:58 +00:00
Norisz Fay
07ccada8ce Backed out changeset 1445e1cfc71f (bug 1768921) for causing multiple failures CLOSED TREE 2024-11-08 00:09:56 +02:00
David Shin
361dd30414 Bug 1768921 - Ensure that padding inflated bounds of in-flow children are included in the scrollable element's overflow area. r=dholbert
This means that when users scroll to the inline-end of a scroller, they will
see that the inline-end padding of that scroller is added in.

This is achieved by unioning an additional rect into the scrollable element's
overflow area (Which is an accumulation of the recursive overflow-area
contributions from its subtree).

This additional rect is calculated as follows:
- In-flow children and float's margin boxes are unioned (including zero-size boxes)
- The unioned rect is then inflated by the scrollable element's padding

Note: The bounds of zero-area in-flow-child rects are included in this rect,
in both block- and inline- directions. This is a change in behavior; Divs of
huge inline size and zero block size used to not affect the scrollable overflow,
where divs with huge block size and zero inline size did, as a side effect of now
removed `nsBlockFrame::ConsiderBlockEndEdgeOfChildren`.

Note on WPT change sizing-orthog-(vlr|vrl)-in-htb-(008|020)-ref.xht - the padding existed
to force empty space below `p#sentence-after`. However, this only applies to previous
Firefox. Any combination of browser + default font (+ its default size) causing a scroll
would cause the test to fail as false positive (According to wpt.fyi, this is what happens
with sizing-orthog-(vlr|vrl)-008.xht tests). This change brings Firefox's scroll behaviour
inline with other browsers.

Differential Revision: https://phabricator.services.mozilla.com/D151310
2024-11-07 21:03:05 +00:00
longsonr
843d861ed7 Bug 1929338 - convert more mozilla:clamped to std:clamp r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D228069
2024-11-05 18:52:41 +00:00
Hiroyuki Ikezoe
e38ad9d39d Bug 1922904 - Fix bug 1780701 in a different approach. r=botond
In bug 1780701, we changed ScrollSnapUtils::GetSnapPointForDestination not to
return a valid SnapDestination if the snap position is equal to the original
scroll destination. But it has a bad side-effect on wheel scrolling.

While wheel scrolling, there are multiple wheel inputs comming from OS, in every
wheel input we do use the destination of the animation running at that moment
[1].  So if in the first wheel input we created a smooth animation for snapping
to the SnapDestination, and then in the second wheel input
GetSnapPointForDestination doesn't return any valid SnapDestination so that the
smooth animation is clobbered [2].

To avoid this bad side-effect, we do skip scroll snapping in the call site,
ScrollContainerFrame::ScrollSnap, if the snap position equals to the original
scroll destination.

[1] https://searchfox.org/mozilla-central/rev/53e8dfd81c32f1ab275516406ec06a68136aaef0/gfx/layers/apz/src/AsyncPanZoomController.cpp#2585-2586
[2] https://searchfox.org/mozilla-central/rev/53e8dfd81c32f1ab275516406ec06a68136aaef0/gfx/layers/apz/src/AsyncPanZoomController.cpp#2603

Differential Revision: https://phabricator.services.mozilla.com/D227409
2024-11-02 06:37:14 +00:00
Goloman Adrian
9d883be990 Backed out changeset 5b6fb5d517d3 (bug 1922904) for causing wpt failures at prefer-targeted-element-positioned.html. CLOSED TREE 2024-11-02 06:23:09 +02:00
Hiroyuki Ikezoe
7ba69c6d21 Bug 1922904 - Fix bug 1780701 in a different approach. r=botond
In bug 1780701, we changed ScrollSnapUtils::GetSnapPointForDestination not to
return a valid SnapDestination if the snap position is equal to the original
scroll destination. But it has a bad side-effect on wheel scrolling.

While wheel scrolling, there are multiple wheel inputs comming from OS, in every
wheel input we do use the destination of the animation running at that moment
[1].  So if in the first wheel input we created a smooth animation for snapping
to the SnapDestination, and then in the second wheel input
GetSnapPointForDestination doesn't return any valid SnapDestination so that the
smooth animation is clobbered [2].

To avoid this bad side-effect, we do skip scroll snapping in the call site,
ScrollContainerFrame::ScrollSnap, if the snap position equals to the original
scroll destination.

[1] https://searchfox.org/mozilla-central/rev/53e8dfd81c32f1ab275516406ec06a68136aaef0/gfx/layers/apz/src/AsyncPanZoomController.cpp#2585-2586
[2] https://searchfox.org/mozilla-central/rev/53e8dfd81c32f1ab275516406ec06a68136aaef0/gfx/layers/apz/src/AsyncPanZoomController.cpp#2603

Differential Revision: https://phabricator.services.mozilla.com/D227409
2024-11-01 22:23:07 +00:00
Hiroyuki Ikezoe
f49f73072b Bug 1858798 - Ignore any target snap points in the case of empty snapport. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D226574
2024-10-25 21:13:34 +00:00
Hiroyuki Ikezoe
0f8e5e370e Bug 1911457 - Do a reflow on the root scroll container when the horizontal overflow area is changed to recompute minimum-scale size. r=layout-reviewers,emilio
On mobile environments, the `minimum-scale` size, which allows users to zoom
out to scales less than 1.0, should include the ICB's overflow, even when
`overflow-x:hidden` is specified on the root element.

This change ensures that we update the `minimum-scale` size when the overflow
of the ICB changes.

Differential Revision: https://phabricator.services.mozilla.com/D226416
2024-10-23 07:01:27 +00:00
Tamas Szentpeteri
e1227b3ba7 Backed out changeset 3033cffb3c50 (bug 1911457) for causing Wr failures on transform-3d-scales-different-x-y-dynamic-002.html. CLOSED TREE 2024-10-23 09:42:33 +03:00
Hiroyuki Ikezoe
3687fc5869 Bug 1911457 - Do a reflow on the root scroll container when the horizontal overflow area is changed to recompute minimum-scale size. r=layout-reviewers,emilio
On mobile environments, the `minimum-scale` size, which allows users to zoom
out to scales less than 1.0, should include the ICB's overflow, even when
`overflow-x:hidden` is specified on the root element.

This change ensures that we update the `minimum-scale` size when the overflow
of the ICB changes.

Differential Revision: https://phabricator.services.mozilla.com/D226416
2024-10-23 02:22:02 +00:00
Alexandru Marc
9d18bfafd9 Backed out changeset e88ac6f27379 (bug 1925476) as requested by Emilio for causing wpt failures. CLOSED TREE 2024-10-18 16:32:55 +03:00
Emilio Cobos Álvarez
9b80f0fb36 Bug 1925476 - Remove ScrollContainerFrame::DidReflow. r=jwatt
It's not needed, ReflowFinished runs less often but still
unconditionally for scroll containers when we reflow, so it's a fine
place to post async work.

Differential Revision: https://phabricator.services.mozilla.com/D226116
2024-10-18 12:09:37 +00:00
Florian Quèze
d15ab35ea1 Bug 1921237 - Remove the FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS telemetry histogram, r=botond.
Differential Revision: https://phabricator.services.mozilla.com/D223750
2024-10-10 18:40:00 +00:00