Commit Graph

1735 Commits

Author SHA1 Message Date
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
Hiroyuki Ikezoe
5b51ae9cf1 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-21 06:49:56 +00:00
Hiroyuki Ikezoe
c1967e39f8 Bug 1937785 - Make PresShell::GetMobileViewportManager return a raw pointer. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D234261
2025-01-21 06:49:56 +00:00
David Shin
6b9f17e7ff 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-20 23:54:50 +00:00
Emilio Cobos Álvarez
e2b1d953d0 Bug 1940688 - Add a pref to make top level pages always active for the purpose of refresh driver throttling and such. r=layout-reviewers,tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D233937
2025-01-15 20:43:02 +00:00
Emilio Cobos Álvarez
3c1b64acfe Bug 1940412 - Add batch removal information to nsIMutationObserver::ContentWillBeRemoved, and use it in some trivial-ish places. r=dom-core,credential-management-reviewers,sefeng
The idea is to use it on the style (via PresShell->RestyleManager) to do
invalidation faster in cases like bug 1940405.

Differential Revision: https://phabricator.services.mozilla.com/D233547
2025-01-15 20:39:40 +00:00
Dan Robertson
06cfd5a140 Bug 1860414 - Ensure a paint is scheduled for every focusstate update. r=botond
Ensure that at least an empty paint transaction is schedule for
any keyboard event that updates the focusstate.

Differential Revision: https://phabricator.services.mozilla.com/D227090
2024-12-26 16:53:53 +00:00
Jan-Niklas Jaeschke
32b0a740b7 Bug 1933738, part 2 - Change all calls to nsFrameSelection::GetSelection(eNormal) to nsFrameSelection::NormalSelection(). r=emilio
`nsFrameSelection::NormalSelection()` returns a `Selection&`, which eliminates the need for nullptr check at call sites.
This simplifies the code in some places and removes unnecessarily indented blocks.

Differential Revision: https://phabricator.services.mozilla.com/D230583
2024-11-29 07:31:58 +00:00
serge-sans-paille
89246c2a13 Bug 1929265 - Use std::clamp instead of min/max chain in layout/ r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D227977
2024-11-28 13:48:27 +00:00
Stanca Serban
834845c4d9 Backed out changeset f56fcf02db2f (bug 1929265) for causing android crashes. 2024-11-27 19:27:22 +02:00
serge-sans-paille
4f47112828 Bug 1929265 - Use std::clamp instead of min/max chain in layout/ r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D227977
2024-11-27 16:24:21 +00:00
Emilio Cobos Álvarez
539611ead9 Bug 1931301 - Notify of removals on a stable state, not mid-remove. r=smaug,masayuki,dshin
This simplifies some observers, and makes others a bit more subtle, but I think
over-all it is an improvement.

Differential Revision: https://phabricator.services.mozilla.com/D229008
2024-11-26 09:39:52 +00:00
Sandor Molnar
4edbb82211 Backed out changeset 3d4472548fb9 (bug 1931301) for causing assertion failures @ Document.cpp 2024-11-25 23:06:55 +02:00
Emilio Cobos Álvarez
0651582f86 Bug 1931301 - Notify of removals on a stable state, not mid-remove. r=smaug,masayuki,dshin
This simplifies some observers, and makes others a bit more subtle, but I think
over-all it is an improvement.

Differential Revision: https://phabricator.services.mozilla.com/D229008
2024-11-25 17:58:40 +00:00
Jonathan Watt
e71e134e6a Bug 1931739. Switch RAII classes in layout code from MOZ_STACK_CLASS to MOZ_RAII. r=longsonr
Differential Revision: https://phabricator.services.mozilla.com/D229258
2024-11-17 14:39:22 +00:00