Commit Graph

3140 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
d0329c1324 Bug 306344 - Use transform animations to implement marquee. r=smaug,firefox-animation-reviewers,boris
This matches what chromium does, and is both simpler and prettier.

The overflow: hidden enforcement also matches chromium / WebKit via:

  https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/css/resolver/style_adjuster.cc;l=482;drc=88c8510c16d44e0dc8c07426db31aa5bb3c90a2b
  https://searchfox.org/wubkat/rev/473ca5f8512b88edd7e82c8783e7e09158f17ba1/Source/WebCore/style/StyleAdjuster.cpp#581-596

See also https://github.com/whatwg/html/pull/10243 and the resets.html
change.

Adding white-space: nowrap isn't strictly necessary, but also matches
other implementations:

  https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_marquee_element.cc;l=66;drc=4aba604f0aae6fb93eab830b68765604e9a2cca0
  (and same link as above on WebKit)

Differential Revision: https://phabricator.services.mozilla.com/D206357
2024-04-09 09:41:40 +00:00
Emilio Cobos Álvarez
b6a99bbbea Bug 1888583 - Keep papering over caret invalidation issues. r=sefeng
We used to do this before bug 1860328 (see also bug 1547802, which
introduced this wallpaper).

Keep doing it, but teach it to deal with multiple carets. I don't want
to keep chasing caret invalidation issues, and it's probably not worth
the time given we almost always paint 0 or 1 caret.

Differential Revision: https://phabricator.services.mozilla.com/D206257
2024-04-02 09:37:42 +00:00
Emilio Cobos Álvarez
716b863fb4 Bug 1888203 - Remove appearance: {toolbar,toolbox}. r=mac-reviewers,desktop-theme-reviewers,mstange,dao
* Linux doesn't support them already.
 * macOS doesn't draw anything either.
 * Windows doesn't have dark-color-scheme support so the relevant
   windows that have them need to set appearance none already.

Remove them and simplify the relevant code.

Differential Revision: https://phabricator.services.mozilla.com/D205872
2024-03-30 12:17:57 +00:00
Norisz Fay
d8ad6641ae Backed out changeset 2f7b9a6f09ca (bug 1888203) for causing file conflict while backing out Bug 1887063 2024-03-28 00:30:13 +02:00
Emilio Cobos Álvarez
b36264e372 Bug 1888203 - Remove appearance: {toolbar,toolbox}. r=mac-reviewers,desktop-theme-reviewers,mstange,dao
* Linux doesn't support them already.
 * macOS doesn't draw anything either.
 * Windows doesn't have dark-color-scheme support so the relevant
   windows that have them need to set appearance none already.

Remove them and simplify the relevant code.

Differential Revision: https://phabricator.services.mozilla.com/D205872
2024-03-27 18:00:07 +00:00
Jens Stutte
191adb0eb4 Bug 1848765 - Use nsTArray<>::StableSort for nsDisplayList::Sort. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D205605
2024-03-26 09:43:46 +00:00
Emilio Cobos Álvarez
169a5d539e Bug 1886506 - Fix caret paint invalidation issues. r=sefeng
The caret position is in the DOM, and sometimes can get out of sync.

While that is an issue, it's not new: The code before the regressing bug
papered over it on a pre-pass before entering DL building.

Instead, deal with it using MarkFramesForDisplay (just like we mark the
caret frame itself, which has the same issue), and invalidate the old
frame more precisely by tracking it in nsCaret directly.

Also, add missing invalidation in PresShell::SetCaret, where the caret
might change and the old caret might not be invalidated properly.

Differential Revision: https://phabricator.services.mozilla.com/D205369
2024-03-22 12:20:14 +00:00
Emilio Cobos Álvarez
e7f43ecf6f Bug 1860328 - Track nsCaret position at the DOM level. r=sefeng,masayuki
This should avoid a bunch of paint invalidation issues with our caret
code (and seems simpler anyways).

Differential Revision: https://phabricator.services.mozilla.com/D204434
2024-03-18 09:12:57 +00:00
Sean Feng
f46ae61b87 Bug 1860328 - Fix a bug where caret misses when dragging and dropping r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D192377
2024-03-18 09:12:57 +00:00
Emilio Cobos Álvarez
8b096597b4 Bug 1882752 - Remove nsButtonFrameRenderer. r=dholbert
The only useful thing it does is to draw the inner focus ring (which is
windows-and-chrome-only, for what is worth).

The rest can be covered by more generic code-paths. In particular
shadows / backgrounds already work properly even with themed frames via
DisplayBorderBackgroundOutline.

Differential Revision: https://phabricator.services.mozilla.com/D203114
2024-03-12 18:47:09 +00:00
Natalia Csoregi
9c8ce9aee8 Backed out 2 changesets (bug 1860328) for causing crashes on MarkNeedsDisplayItemRebuild. CLOSED TREE
Backed out changeset b32811ea1c61 (bug 1860328)
Backed out changeset caab023e5d2d (bug 1860328)
2024-03-11 17:18:37 +02:00
Sean Feng
934318896e Bug 1860328 - Fix a crash which a caret frame misses a MarkNeedsDisplayItemRebuild() call r=emilio
Generally, we mark a caret frame for display first, and then
nsCaret tracks this frame in nsCaret::SchedulePaint to call
MarkNeedsDisplayItemRebuild() accordingly. However, it's possible
for nsCaret::SchedulePaint fails to find the caret frame (i.e, selection changes),
so we end up not calling MarkNeedsDisplayItemRebuild() on this frame.

This patch improves this case by manually setting this caret frame
to nsCaret, so that it's always tracked.

Differential Revision: https://phabricator.services.mozilla.com/D200880
2024-03-11 13:41:28 +00:00
Sean Feng
0d644aac47 Bug 1860328 - Fix a bug where caret misses when dragging and dropping r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D192377
2024-03-11 13:41:27 +00:00
Timothy Nikkel
64e0a7e0fd Bug 1872487. Create less WebRenderLayerScrollData. r=botond
In order to create less WebRenderLayerScrollData currently we use a deferred transform item

https://searchfox.org/mozilla-central/rev/593c49fa812ceb4be45fcea7c9e90d15f59edb70/gfx/layers/wr/StackingContextHelper.h#82

We don't need a WebRenderLayerScrollData for every transform because a lot of transforms don't contain any ASRs, so the created WebRenderLayerScrollData would be useless.

However this optimization can lead to us creating a lot more WebRenderLayerScrollData later if the transform does contain ASRs. For example, if there is a transform, and then inside that is a ASR, and inside the ASR is a lot of small transforms, we end up having to create a WebRenderLayerScrollData for every little transform which don't contain any ASRs. This is doing the opposite of what the optimization intended.

WebRenderLayerScrollData creation happens during the CreateWebRenderCommands phase, so the display list build phase is complete, and we can tell cheaply if a transform contains any ASRs during display list building. So we just record that and use that to inform our decision about when to defer the transform item or not.

This optimization drastically reduces the total number of WebRenderLayerScrollData that we create during a full run of speedometer3 (summing the number created each paint over every paint). In my testing it went from 12-13k to 2-3k. Mostly subtests fell into two buckets: a single digit number of WebRenderLayerScrollData to begin with and this patch didn't change that, and 100 WebRenderLayerScrollData down to single digits after this patch. So the savings are concentrated in a few subtests that hit the described behaviour above.

I compared a profile before and after this patch of 10 runs of speedometer3, this patch saved 100 samples/ms serializing WebRenderLayerScrollData, which was what I expected based on how long serialization took before the patch combined with how many WebRenderLayerScrollData we were avoiding. The whole run took about 100,000 samples/ms, so this should hopefully be good for about 0.1% improvment. There is also potential savings in other areas outside of serialization step but that was a little harder to measure.

Differential Revision: https://phabricator.services.mozilla.com/D197446
2024-02-29 06:46:45 +00:00
Timothy Nikkel
cca7ff4dbc Bug 1878294. Teach the scale tracking in ActiveLayerTracker to understand svg transforms. r=longsonr
The bug comes about because the svg transform is changed, so IncrementScaleRestyleCountIfNeeded gets called. It determines that there is no transform because it doesn't check svg transforms, so it incorrectly concludes that there was a transform but now it was removed, and so marks the scale as having been changed. Then in ChooseScale in StackingContextHelper, because we think the scale is being animated, we clamp the allowed scale factor based on the ratio of the viewport and the size of the svg. So avoiding marking this as incorrectly having an animating scale fixes the bug.

A simpler fix for this bug would be to check if the mPreviousTransformScale was Nothing() and only marked as mutated if it was Some.

This fix is a bit more complicated but it allows us to detect svg transform scales changing.

Differential Revision: https://phabricator.services.mozilla.com/D200579
2024-02-28 13:37:38 +00:00
Timothy Nikkel
fb8edf128f Bug 1878772. Adjust assert about deleting a retained display list to take into account partial updates that were aborted mid way through due to complexity. r=mstange
We call RetainedDisplayListBuilder::PreProcessDisplayList, the list has four items (from bottom to top), a solid color item, a hit test item, an async zoom item, and a own layer item for a scrollbar frame. We process the first three and put them in mOldItems. We descend into the 3rd item because it has child items, we then hit this early return

https://searchfox.org/mozilla-central/rev/896042a1a71066254ceb5291f016ca3dbca21cb7/layout/painting/RetainedDisplayListBuilder.cpp#169

detecting if the merging process is getting too complicated and we return false indicating that we should give up on the partial update and do a full display list rebuild. Back up to the first level PreProcessDisplayList we hit his early return

https://searchfox.org/mozilla-central/rev/896042a1a71066254ceb5291f016ca3dbca21cb7/layout/painting/RetainedDisplayListBuilder.cpp#284

and we never process the fourth item so it's still in the list and we haven't moved it to mOldItems. We immdiately delete the list and return in AttemptPartialUpdate

https://searchfox.org/mozilla-central/rev/896042a1a71066254ceb5291f016ca3dbca21cb7/layout/painting/RetainedDisplayListBuilder.cpp#1592

The delete finds those 3 items in mOldItems and the one remaining item in the main list.

This seems okay to me, I think the assert should be adjusted to ignore this case.

Differential Revision: https://phabricator.services.mozilla.com/D200777
2024-02-21 12:07:19 +00:00
Emilio Cobos Álvarez
a4d842c063 Bug 1879579 - Clean up CompareTreePosition and related code. r=smaug
Make TreeOrderedArray support what the form controls stuff needs, and
use it instead of custom nsContentUtils stuff.

Differential Revision: https://phabricator.services.mozilla.com/D201261
2024-02-12 20:01:36 +00:00
Noemi Erli
f92d721721 Backed out changeset 1acc95286189 (bug 1879579) for causing mass failures CLOSED TREE 2024-02-12 17:25:21 +02:00
Noemi Erli
7254ff172d Backed out 2 changesets (bug 1878805, bug 1860328) for causing crash spike in bug 1870380
Backed out changeset 0f0872e0fffb (bug 1878805)
Backed out changeset 1d600b2ed81f (bug 1860328)
2024-02-12 17:22:00 +02:00
Emilio Cobos Álvarez
068080982b Bug 1879579 - Clean up CompareTreePosition and related code. r=smaug
Make TreeOrderedArray support what the form controls stuff needs, and
use it instead of custom nsContentUtils stuff.

Differential Revision: https://phabricator.services.mozilla.com/D201261
2024-02-12 00:01:23 +00:00
Sean Feng
db1369b5d8 Bug 1878805 - Fix a crash which a caret frame misses a MarkNeedsDisplayItemRebuild() call r=emilio
Generally, we mark a caret frame for display first, and then
nsCaret tracks this frame in nsCaret::SchedulePaint to call
MarkNeedsDisplayItemRebuild() accordingly. However, it's possible
for nsCaret::SchedulePaint fails to find the caret frame (i.e, selection changes),
so we end up not calling MarkNeedsDisplayItemRebuild() on this frame.

This patch improves this case by manually setting this caret frame
to nsCaret, so that it's always tracked.

Differential Revision: https://phabricator.services.mozilla.com/D200880
2024-02-09 00:58:54 +00:00
Stanca Serban
2a6981433b Backed out changeset cd7ea27c5cf5 (bug 1878805) for causing reftests failures in 1878805.html. CLOSED TREE 2024-02-08 21:17:52 +02:00
Sean Feng
e4f25caa82 Bug 1878805 - Fix a crash which a caret frame misses a MarkNeedsDisplayItemRebuild() call r=emilio
Generally, we mark a caret frame for display first, and then
nsCaret tracks this frame in nsCaret::SchedulePaint to call
MarkNeedsDisplayItemRebuild() accordingly. However, it's possible
for nsCaret::SchedulePaint fails to find the caret frame (i.e, selection changes),
so we end up not calling MarkNeedsDisplayItemRebuild() on this frame.

This patch improves this case by manually setting this caret frame
to nsCaret, so that it's always tracked.

Differential Revision: https://phabricator.services.mozilla.com/D200880
2024-02-08 14:45:24 +00:00
Perry McManis
4a0a5a0c84 Bug 1875170 - Migrate metrics in the gfx namespace collected via GeckoView Streaming to pure glean r=chutten,gfx-reviewers,jnicol
GVST is how these probes sent data in Fenix and is now unnecessary (and doesn't send data in Fenix release) since Firefox Desktop has direct access to Glean. We therefore need to clean them up in some capacity.

Following the recommendations from the GeckoView Streaming (GVST) validation effort, this is a pure Glean api implementation of the metrics that fell under gfx and its subcategories in geckoview streaming.

Each metric retains its previous name, and gains a Glean Interface for FireFox Telemetry (GIFFT) version, such that downstream data analyses will not be impacted.

Differential Revision: https://phabricator.services.mozilla.com/D198872
2024-02-02 13:36:35 +00:00
Sean Feng
7bc4fa2b14 Bug 1860328 - Fix a bug where caret misses when dragging and dropping r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D192377
2024-02-01 18:09:39 +00:00
Timothy Nikkel
d287c2d6ff Bug 1876712. Don't clear cached ActiveScrolledRoot::msViewId unnecessarily. r=botond
It will get initialized to nothing if we do create a new object here, but if we use a cached asr we shouldn't clear the view id because the view id for a frame can't change.

Differential Revision: https://phabricator.services.mozilla.com/D199712
2024-01-29 07:36:21 +00:00
Emilio Cobos Álvarez
9826d96e5b Bug 1865955 - Simplify a bit AnimationInfo. r=birtles
Start pending animations as we add them, and do other minor clean-ups.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D199613
2024-01-26 13:39:41 +00:00
Ting-Yu Lin
1055b1302e Bug 1875600 - Use nsIFrame::PresShell() to simply some callers. r=layout-reviewers,emilio
Those callers who using the pointer immediately after getting from
`GetPresShell()` can be replaced with `PresShell()`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D199164
2024-01-23 00:30:53 +00:00
Cristian Tuns
649cd5a87f Backed out changeset a7a2744670a7 (bug 1860328) for causing bc failures in nsDisplayList.cpp CLOSED TREE 2024-01-10 14:50:34 -05:00
Sean Feng
702206b12c Bug 1860328 - Fix a bug where caret misses when dragging and dropping r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D192377
2024-01-10 17:03:38 +00:00
Timothy Nikkel
488989b2d9 Bug 1872563. Change WebRenderLayerScrollData::mVisibleRegion from a region to a rect. r=botond
It's only ever set to a rect. This should save a little bit of time serializing this struct.

Differential Revision: https://phabricator.services.mozilla.com/D197469
2024-01-06 00:58:32 +00:00
Dan Robertson
85c013b504 Bug 1854010 - Restrict fixed/sticky hit test info to items fixed to the root. r=hiro,botond
Fixed and Sticky position side bits should only be necessary for fixed
or sticky position items that are fixed or stuck to the root content. As
a result, there is no need to add the fixed or sticky position hit test
info to items that are not.

Differential Revision: https://phabricator.services.mozilla.com/D192272
2023-12-28 01:33:59 +00:00
Timothy Nikkel
75de5ccd62 Bug 1871893. Use known count of modified frames to init array we are placing them into. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D197277
2023-12-26 03:28:31 +00:00
Robert Longson
a23007ad30 Bug 298281 - implement color-interpolation: linearRGB for gradients r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D196294
2023-12-18 21:41:50 +00:00
Cristina Horotan
a249c3e2e4 Backed out changeset 1cb2802bb09b (bug 298281) for causing build bustage at nsCSSRenderingGradients.h CLOSED TREE 2023-12-18 19:38:05 +02:00
Robert Longson
26f7df57f7 Bug 298281 - implement color-interpolation: linearRGB for gradients r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D196294
2023-12-18 16:45:25 +00:00
Robert Longson
2b71f9d87e Bug 1868479 - Fix backdrop-filter with SVG filters r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D195671
2023-12-07 14:35:13 +00:00
Cristian Tuns
95afdf2e8f Backed out changeset a69c40accbf0 (bug 1860328) for causing mochitest failures in nsDisplayList.cpp CLOSED TREE 2023-12-06 13:05:13 -05:00
Sean Feng
c52c227f53 Bug 1860328 - Fix a bug where caret misses when dragging and dropping r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D192377
2023-12-06 16:29:18 +00:00
Timothy Nikkel
68b1b0041a Bug 1862277. Call InvalidateRenderingObservers in nsIFrame::Init for frames that won't get a reflow. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D194067
2023-12-03 05:02:16 +00:00
Sandor Molnar
20988b76cb Backed out 2 changesets (bug 1854010) for causing mochitest plain / reftest failures
Backed out changeset 8e3a29705587 (bug 1854010)
Backed out changeset dd7c79692c64 (bug 1854010)
2023-11-30 09:11:49 +02:00
Dan Robertson
3b1a3d58f7 Bug 1854010 - Restrict fixed/sticky hit test info to items fixed to the root. r=hiro
Fixed and Sticky position side bits should only be necessary for fixed
or sticky position items that are fixed or stuck to the root content. As
a result, there is no need to add the fixed or sticky position hit test
info to items that are not.

Differential Revision: https://phabricator.services.mozilla.com/D192272
2023-11-29 22:45:20 +00:00
Norisz Fay
90470cd386 Backed out changeset b72b6773b514 (bug 1860328) for causing reftest failure on zoom-to-focus-input-oopif.html CLOSED TREE 2023-11-28 21:40:15 +02:00
Sean Feng
334ba43c9b Bug 1860328 - Fix a bug where caret misses when dragging and dropping r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D192377
2023-11-28 14:26:02 +00:00
Emilio Cobos Álvarez
5730ee0ca5 Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. r=jwatt
Extend the per-frame-class bit we have to devirtualize IsLeaf to also
devirtualize IsFrameOfType. That is, move this data to FrameClasses.py.

This was done by going through all the frame classes, trying to preserve
behavior.

The only quirky thing is that I had to add two more trivial frame
classes, `nsAudioFrame` for audio elements, and
`nsFloatingFirstLetterFrame`. That's because these frame classes were
returning different answers at runtime, but they do this only on
conditions that trigger frame reconstruction (floating, and being an
audio element, respectively).

Differential Revision: https://phabricator.services.mozilla.com/D194703
2023-11-26 22:17:28 +00:00
Emilio Cobos Álvarez
ec7a1d06ff 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
Butkovits Atila
4b45d43306 Backed out 2 changesets (bug 1854010) for causing crashes at mochitest.toml.
Backed out changeset 262f7894aa0d (bug 1854010)
Backed out changeset 767972bb0fc3 (bug 1854010)
2023-11-14 02:55:35 +02:00
Dan Robertson
8c0603e133 Bug 1854010 - Restrict fixed/sticky hit test info to items fixed to the root. r=hiro
Fixed and Sticky position side bits should only be necessary for fixed
or sticky position items that are fixed or stuck to the root content. As
a result, there is no need to add the fixed or sticky position hit test
info to items that are not.

Differential Revision: https://phabricator.services.mozilla.com/D192272
2023-11-13 22:45:34 +00:00
Ashley Hale
8a480d93d9 Bug 1852513 - Use more gradient color stops for interpolation r=tlouw,emilio
Differential Revision: https://phabricator.services.mozilla.com/D190903
2023-11-09 21:14:33 +00:00
Stanca Serban
9065361f47 Backed out changeset 269afd5c7d29 (bug 1852513) for causing wr failures in oklab-gradient.html. CLOSED TREE 2023-11-08 08:36:19 +02:00