Commit Graph

1749 Commits

Author SHA1 Message Date
Florian Quèze
6afb2c9c36 Bug 1956726 - Migrate histograms to use Glean APIs for WEBFONT_*, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D242767
2025-04-03 13:42:52 +00:00
Florian Quèze
4b88e75c19 Bug 1956726 - Migrate histograms to use Glean APIs in gfx/, r=chutten,jgilbert,firefox-desktop-core-reviewers ,mconley.
Differential Revision: https://phabricator.services.mozilla.com/D242765
2025-04-03 13:42:51 +00:00
Jan-Niklas Jaeschke
94f7a92240 Bug 1724299, part 1 - Implement auto-expanding details. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D241454
2025-04-02 08:22:48 +00:00
Jan-Niklas Jaeschke
a775b0b16a Bug 1761043, part 5 - hidden=until-found: Implement fragment navigation. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D241451
2025-04-02 08:22:47 +00:00
Nicolas Silva
1cf52d3337 Bug 1955005 - Make the old state transaction render immediately and offscreen. r=emilio
The main goal of this patch is to ensure that we render the snapshots as
soon as the transaction is received on the WebRender to prevent another
transaction within the same vsync interval from replacing the old
state's transaction before it has had a chance to produce the snapshots.

In addition, we produce the snapshots by generating a frame that isn't
presented to the window. This is to avoid potential vsync issues from
trying to present multiple times in the same interval and avoids a fair
amount of wasted work.

Differential Revision: https://phabricator.services.mozilla.com/D242358
2025-03-25 12:35:46 +00:00
Emilio Cobos Álvarez
1cada22c31 Bug 1955697 - Simplify scrolled canvas background painting. r=mstange
Always paint the scrolled canvas background if it's CSS-specified.

Compute the canvas background upfront so we don't need to walk the
display list after the fact.

This removes the scrolled canvas background in a few cases where the old
code could prove that it was not needed due to blending, see the
comment:

    // To make layers work better, we want to avoid having a big non-scrolled
    // color background behind a scrolled transparent background. Instead, we'll
    // try to move the color background into the scrolled content by making
    // nsDisplayCanvasBackground paint it.

It's unclear if that matters for performance with webrender nowadays,
but removing it does cause significant fuzzy failures, so it will be
reintroduced in a more explicit way in a follow-up patch.

Differential Revision: https://phabricator.services.mozilla.com/D242017
2025-03-25 08:09:57 +00:00
Emilio Cobos Álvarez
05a02479cb Bug 1955697 - Remove useless null-check, and mark a function as static. r=mstange
We always give a non-null item.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D242626
2025-03-24 18:54:34 +00:00
Emilio Cobos Álvarez
63d58a3537 Bug 1955697 - Store whether the canvas background is css-specified for both page and viewport canvases. r=mstange
No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D242625
2025-03-24 18:54:34 +00:00
Hiroyuki Ikezoe
76a338b8c0 Bug 1955158 - Make __visual__ scroll-into-view to position:fixed frames behind a pref. r=botond
And disable the pref on desktops by default, enable it on Android by
default.

Differential Revision: https://phabricator.services.mozilla.com/D242252
2025-03-20 23:23:49 +00:00
Butkovits Atila
5eef486c85 Backed out changeset 90dbec9f0f4c (bug 1955158) for causing failures at compile-event-handler-settings-objects.html. CLOSED TREE 2025-03-21 13:11:22 +02:00
Hiroyuki Ikezoe
a1e876c36c Bug 1955158 - Make __visual__ scroll-into-view to position:fixed frames behind a pref. r=botond
And disable the pref on desktops by default, enable it on Android by
default.

Differential Revision: https://phabricator.services.mozilla.com/D242252
2025-03-20 23:23:49 +00:00
Sean Feng
d8b23c28fb Bug 1954735 - Remove the assertion in PresShell::UpdateLastSelectionForToString r=masayuki
This assertion can be hit when the pref was on and then got
flipped to off. I think this is a legit usecase to set it to null
even if the pref is off. So this assertion doesn't really make sense.

All the callers that set this to non-null have the pref check that
should be enough.

Differential Revision: https://phabricator.services.mozilla.com/D241996
2025-03-19 13:28:04 +00:00
Hiroyuki Ikezoe
6fae5b0c91 Bug 1951021 - Check whether the given frame is position:fixed inside the loop where we calculate the frame bounds. r=dlrobertson
While we are walking up the frame tree during for calculating the frame
bounds, there are cases that we reach to the top viewport frame. Thus
when we walk up the frame tree to invoke ScrollToShowRect for each
scroll container, we fail the check introduced in bug 1943865.

Just like we did in bug 1943865, this commit has also two tests, one is
a web platform test, the other is a mochitest. But unlike bug 1943865,
the mochitest in this commit doesn't use zoomToFocusedInput since
zoomToFocusedInput ends up calling another
PresShell::ScrollFrameIntoView call via Selection::ScrollIntoView [1], which
wallpapers this bug, i.e the mochitest will get pass without this proper
fix.

[1] https://searchfox.org/mozilla-central/rev/cb46268bc26b0cd9e91e625aa92aaa5a6f047b9d/dom/base/Selection.cpp#3654

Differential Revision: https://phabricator.services.mozilla.com/D240407
2025-03-19 02:30:06 +00:00
Sean Feng
e46b69d89c Bug 85686 - Mimic Chromium's getSelection().toString() behaviour r=masayuki,dom-core,webidl,smaug
Basically when getSelection().toString() is called, Chromium may
return an serialization on a different content than Firefox.
This patch tries to address this webcompat issue by mimicing
the same behaviour.

We should still address the spec issues, but this seems to be
an acceptable compromise.

Differential Revision: https://phabricator.services.mozilla.com/D239657
2025-03-17 13:36:16 +00:00
Masayuki Nakano
9add283d50 Bug 1954413 - Get rid of nsINode::GetChromeOnlyAccessSubtreeRootParent() r=smaug
It's an alias of `nsINode::GetClosestNativeAnonymousSubtreeRootParentOrHost()`
and oddly it returns `const nsIContent*` rather than `nsIContent*`.  Therefore,
some callers need to use `const_cast`.

Differential Revision: https://phabricator.services.mozilla.com/D241776
2025-03-17 12:49:58 +00:00
Alexandru Marc
2e0051d757 Backed out 2 changesets (bug 85686, bug 1954244) for causing mass failures a=backout
Backed out changeset 702bc8ef655a (bug 1954244)
Backed out changeset a3cd9e425585 (bug 85686)
2025-03-15 04:22:27 +02:00
Sean Feng
d9af41ffc2 Bug 85686 - Mimic Chromium's getSelection().toString() behaviour r=masayuki,dom-core,webidl,smaug
Basically when getSelection().toString() is called, Chromium may
return an serialization on a different content than Firefox.
This patch tries to address this webcompat issue by mimicing
the same behaviour.

We should still address the spec issues, but this seems to be
an acceptable compromise.

Differential Revision: https://phabricator.services.mozilla.com/D239657
2025-03-13 17:31:54 +00:00
Cristina Horotan
a755f2ab17 Backed out changeset c354639dff24 (bug 85686) for causing multiple dt failures. CLOSED TREE 2025-03-12 22:13:59 +02:00
Sean Feng
afba09df01 Bug 85686 - Mimic Chromium's getSelection().toString() behaviour r=masayuki,dom-core,webidl,smaug
Basically when getSelection().toString() is called, Chromium may
return an serialization on a different content than Firefox.
This patch tries to address this webcompat issue by mimicing
the same behaviour.

We should still address the spec issues, but this seems to be
an acceptable compromise.

Differential Revision: https://phabricator.services.mozilla.com/D239657
2025-03-12 15:50:43 +00:00
Jonathan Kew
958866a401 Bug 1949064 - Improve setup of AvailableISize for orthogonal flows in ReflowInput. r=layout-reviewers,emilio
The old "orthogonal limit" in ReflowInput was a rather ad hoc mechanism created
during the early implementation of writing modes, to avoid reflowing orthogonal
flows with unconstrained inline size. The spec has since been clarified to describe
the expected behavior in more detail, and we can dispense with the orthogonal-limit
concept and instead implement the constraints called for in the spec.

With this, we pass all the css-writing-modes/available-size-* tests (as well as
fixing a couple of other testcases that are dependent on this behavior).

Differential Revision: https://phabricator.services.mozilla.com/D241117
2025-03-12 11:17:29 +00:00
Masayuki Nakano
02dbe80552 Bug 1952461 - Get rid of dom.events.mouse-pointer-boundary.keep-enter-targets-after-over-target-removed pref r=smaug
It's enabled in bug 1938528 and shipped in 135 5 weeks ago.

The pref makes the complicated code harder to read.  Therefore, it's helpful
to get rid of this pref for the further work.

Differential Revision: https://phabricator.services.mozilla.com/D240815
2025-03-10 13:26:10 +00:00
Jonathan Kew
6ab1148377 Bug 1789464 - Resolve logical axes in PresShell::ScrollFrameIntoView according to the target's writing mode. r=emilio,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D239516
2025-02-26 07:35:33 +00:00
Cristina Horotan
02ec389420 Backed out changeset 68a1543cecb8 (bug 1789464) for causing Wr failures at massive-element-left-of-viewport-partially-onscreen-new.html 2025-02-26 06:17:58 +02:00
Jonathan Kew
b56aae5bc5 Bug 1789464 - Resolve logical axes in PresShell::ScrollFrameIntoView according to the target's writing mode. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D239516
2025-02-25 17:12:58 +00:00
Sean Feng
d8ecdd8d22 Bug 1930931 - Make the dragging interaction still happens when the event target frame is moved/destroyed upon mousedown r=masayuki,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D238318
2025-02-21 18:25:06 +00:00
Hiroyuki Ikezoe
2393f2b2c1 Bug 1891165 - Handle focus sequence number separately from the PresShell for popup. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D236824
2025-02-20 10:15:34 +00:00
Hiroyuki Ikezoe
b74be41f38 Bug 1947223 - Bail out from ScrollFrameIntoVisualViewport if the given position:fixed element is outside of the viewport. r=dlrobertson
Differential Revision: https://phabricator.services.mozilla.com/D237853
2025-02-19 01:20:15 +00:00
Sandor Molnar
aba088ec66 Backed out changeset 0da86f337189 (bug 1947223) for causing wpt failures @ scrollIntoView-fixed-outside-of-viewport.html CLOSED TREE 2025-02-19 01:51:23 +02:00
Hiroyuki Ikezoe
d8f76711cf Bug 1947223 - Bail out from ScrollFrameIntoVisualViewport if the given position:fixed element is outside of the viewport. r=dlrobertson
Differential Revision: https://phabricator.services.mozilla.com/D237853
2025-02-18 21:25:50 +00:00
David Shin
4dc4e2d920 Bug 1942715: Part 4 - Switch to using a more transparent wrapper. r=firefox-style-system-reviewers,emilio
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.

Differential Revision: https://phabricator.services.mozilla.com/D237097
2025-02-12 01:31:30 +00:00
Butkovits Atila
e51ff081c6 Backed out 6 changesets (bug 1942715) for causing build bustages. CLOSED TREE
Backed out changeset 1433202bd2f3 (bug 1942715)
Backed out changeset d9ce2be09cd0 (bug 1942715)
Backed out changeset 9789581a42a3 (bug 1942715)
Backed out changeset 9a18f1aca5d5 (bug 1942715)
Backed out changeset 46bd0cb031f4 (bug 1942715)
Backed out changeset 73fec8bae045 (bug 1942715)
2025-02-12 01:45:46 +02:00
David Shin
c536f3deb5 Bug 1942715: Part 4 - Switch to using a more transparent wrapper. r=firefox-style-system-reviewers,emilio
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.

Differential Revision: https://phabricator.services.mozilla.com/D237097
2025-02-11 21:06:24 +00:00
Butkovits Atila
fd3125f8e5 Backed out 6 changesets (bug 1942715) for causing build bustages. CLOSED TREE
Backed out changeset 7c5cfe6bbaeb (bug 1942715)
Backed out changeset cc5530b02046 (bug 1942715)
Backed out changeset 5a534f455cc3 (bug 1942715)
Backed out changeset ecdd7307c9f1 (bug 1942715)
Backed out changeset 05a62c484807 (bug 1942715)
Backed out changeset a9825ee69550 (bug 1942715)
2025-02-11 22:17:26 +02:00
David Shin
96712d3db0 Bug 1942715: Part 4 - Switch to using a more transparent wrapper. r=firefox-style-system-reviewers,emilio
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.

Differential Revision: https://phabricator.services.mozilla.com/D237097
2025-02-11 18:19:56 +00:00
Masayuki Nakano
8eb94e6791 Bug 1945988 - Make PresShell::HandleEvent notify editor of mouse button events before handling them r=m_kato,smaug
Chrome dispatches `compositionend` before `mousedown` when there is a
composition and user clicks somewhere.  However, we commit composition when
`EventStateManager::PostHandleEvent` moves/clears focus after `eMouseDown`
dispatching.  Therefore, our `compositionend` event is fired after `mousedown`.

The Chrome's behavior is simpler than us from mouse button event handlers point
of view because it guarantees that there is no composition when handling mouse
button events.  We should follow this behavior for better compatibility and
making the things simpler.

Differential Revision: https://phabricator.services.mozilla.com/D236827
2025-02-07 22:07:16 +00:00
Hiroyuki Ikezoe
0d404c544d Bug 1943865 - Scroll visually to position:fixed element in ScrollFrameIntoView if necessary. r=dlrobertson
In the case of position:fixed frame, walking up the frame tree doesn't
reach to the root scroll container, thus we need to invoke
ScrollToVisual outside the walking up the tree loop.

This commit has two independent tests, a web platform test and a
mochitest. Unfortunately the web platform test doesn't work on Firefox,
since WebDriver (GeckoDriver) doesn't support touch action yet. It works
on Chrome. What the mochitest does is mostly equivalent with the web
platform test, but with nsIDOMWindowUtils.setResolutionAndScaleTo and
zoomToFocusedInput.

Differential Revision: https://phabricator.services.mozilla.com/D236061
2025-02-04 03:41:15 +00:00
Masayuki Nakano
ca5d4cc88e Bug 1944735 - Make PresShell stop using RefPtr<nsFrameSelection> if it's safe r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D236094
2025-01-31 07:12:21 +00:00
Cosmin Sabou
bed5ff7b19 Backed out changeset 5b3ba2adbb7e (bug 1944735) for causing base toolchains bustages on gecko/Cargo.lock. 2025-01-31 04:59:52 +02:00
Masayuki Nakano
d568858ca2 Bug 1944735 - Make PresShell stop using RefPtr<nsFrameSelection> if it's safe r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D236094
2025-01-30 23:10:17 +00:00
Masayuki Nakano
52459a3609 Bug 1944191 - Make PresShell::EventHandler::DispatchEvent retarget mousemove event if preceding boundary events removed the target r=smaug
Chrome dispatches `mousemove` event on the preceding `mouseover` target even if
the target is removed from the DOM tree.  However, once the
"Boundary Event Dispatch Tracks Node Removal" feature is enabled, Chrome Canary
dispatches `mousemove` on the last deepest `mouseenter` event target which is
still connected.  Therefore, we should follow their new behavior if it's simply
possible.

Note that if `pointeover` target is removed, Chrome does not dispatch
`pointermove` on the last deepest `pointerenter` target. Therefore, this patch
limits the behavior change only for `eMouseMove`.

Differential Revision: https://phabricator.services.mozilla.com/D235807
2025-01-28 16:18:31 +00:00
Edgar Chen
62078904ac Bug 1942661 - Remove assertion for checking capturing content's document; r=masayuki,smaug
This assertion was added in a fairly old commit,
https://hg.mozilla.org/mozilla-central/rev/8b6f32659aa66634e8417d15952b8f2d6c9299f9#l4.193,
and it worked at the time because of we forwarded the event to correct PresShell
prior to the check in
https://hg.mozilla.org/mozilla-central/file/8b6f32659aa66634e8417d15952b8f2d6c9299f9/layout/base/nsPresShell.cpp#l6038.

However, many changes have been made since then, and it's no longer suitable for
the current code, as now we forward the event to correct PresShell later in
https://searchfox.org/mozilla-central/rev/5b061cdc4d40d44988dc61aa941cfbd98e31791f/layout/base/PresShell.cpp#7386-7398
instead.

Differential Revision: https://phabricator.services.mozilla.com/D235351
2025-01-24 10:04:54 +00:00
Masayuki Nakano
2b503ca56d Bug 1943226 - Make nsFrameSelection treat limiters are elements r=jjaschke,dom-core
`nsFrameSelection::GetLimiter()` is not `nullptr` only when it's an instance for
an independent selection of a text control.  In the case, it's set to the editor
root anonymous `<div>` of the text control.  Despite the name, this is already
optimized only for this purpose in `nsFrameSelection::NodeIsInLimiters()`.
Thus, we don't have any problems to make this clearer for the other developers
with renaming some parameter names.

`nsFrameSelection::GetAncestorLimiter()` is also always an `Element`.  So,
we can change this to `Element` too.

Differential Revision: https://phabricator.services.mozilla.com/D235254
2025-01-24 02:53:07 +00:00
Dan Robertson
9723d38b74 Bug 1942969 - Do not schedule a paint for all focus changing events. r=smaug
Do not schedule a paint for all focus changing events.

Differential Revision: https://phabricator.services.mozilla.com/D235153
2025-01-23 03:34:06 +00:00
Otto Länd
ece523b51a Bug 1937785: apply code formatting via Lando
# ignore-this-changeset
2025-01-22 20:53:14 +00:00
Hiroyuki Ikezoe
00782a4f37 Bug 1937785 - Remove nsPresContext::mKeyboardHeight and introduce MobileViewportManager::mPendingKeyboardHeight. r=botond
There's a race condition where the keyboard height change notification
has arrived but nsDocumentViewer size change hasn't yet arrived.

MobileViewportManager::mPendingKeyboardHeight is introduced to fix the race.

Differential Revision: https://phabricator.services.mozilla.com/D234262
2025-01-22 20:49:57 +00:00
Hiroyuki Ikezoe
afc3d02460 Bug 1937785 - Make PresShell::GetMobileViewportManager return a raw pointer. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D234261
2025-01-22 20:49:56 +00:00
David Shin
3d615cb7f6 Bug 1923763: Part 5 - Replace inset evaluations with anchor-resolved inset evaluations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231259
2025-01-21 15:11:25 +00:00
Stanca Serban
7203de77bc Backed out 6 changesets (bug 1937785) for causing Android reftests failures in retained-dl-async-scrolled-1.html. CLOSED TREE
Backed out changeset ca4ff44a38f3 (bug 1937785)
Backed out changeset 9ea29b89cbf5 (bug 1937785)
Backed out changeset 0e95190b1c76 (bug 1937785)
Backed out changeset 7f3f99057dbe (bug 1937785)
Backed out changeset cb38950d4787 (bug 1937785)
Backed out changeset 9e61d106beb8 (bug 1937785)
2025-01-21 14:28:05 +02:00
Stanca Serban
4a35296e0c Backed out 7 changesets (bug 1923763) for causing build bustages in nsStyleStruct.cpp. CLOSED TREE
Backed out changeset d55070e64ced (bug 1923763)
Backed out changeset a92a0bc6047f (bug 1923763)
Backed out changeset 2203e2c5268e (bug 1923763)
Backed out changeset 0cc5e744c01a (bug 1923763)
Backed out changeset d2139afa933b (bug 1923763)
Backed out changeset 93e59980eac1 (bug 1923763)
Backed out changeset 8018734b5491 (bug 1923763)
2025-01-21 11:10:22 +02:00
Otto Länd
92768a27aa Bug 1937785: apply code formatting via Lando
# ignore-this-changeset
2025-01-21 06:53:01 +00:00