Commit Graph

1713 Commits

Author SHA1 Message Date
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
Jonathan Watt
c986a5098a Bug 1931736. Add missing braces around if/loop statements in layout/base/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D229245
2024-11-17 05:03:57 +00:00
Emilio Cobos Álvarez
11a8b7baf2 Bug 1914321 - Build view transition pseudo-element tree. r=view-transitions-reviewers,boris
Reuse the editor's manual NAC machinery for now, and hook it into
StyleChildrenIterator and co.

We might need to slightly tweak the setup for selector-matching, not
sure yet, but that should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D228255
2024-11-14 10:17:52 +00:00
Butkovits Atila
3616798bb1 Backed out changeset cb8acf4c8893 (bug 1914321) for causing failures at browser_markup_search_01.js. CLOSED TREE 2024-11-14 02:42:39 +02:00
Emilio Cobos Álvarez
f475361154 Bug 1914321 - Build view transition pseudo-element tree. r=view-transitions-reviewers,boris
Reuse the editor's manual NAC machinery for now, and hook it into
StyleChildrenIterator and co.

We might need to slightly tweak the setup for selector-matching, not
sure yet, but that should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D228255
2024-11-13 22:11:58 +00:00
Butkovits Atila
6ae954d86e Backed out changeset 4fc43467210b (bug 1914321) for causing failures at PresShell.cpp. CLOSED TREE 2024-11-13 21:24:29 +02:00
Emilio Cobos Álvarez
3f41e0c52d Bug 1914321 - Build view transition pseudo-element tree. r=view-transitions-reviewers,boris
Reuse the editor's manual NAC machinery for now, and hook it into
StyleChildrenIterator and co.

We might need to slightly tweak the setup for selector-matching, not
sure yet, but that should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D228255
2024-11-13 18:06:34 +00:00
Emilio Cobos Álvarez
d3fa60ccdb Bug 1930725 - Clean up a bit nsDeviceContext. r=layout-reviewers,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D228703
2024-11-13 11:04:01 +00:00
Stanca Serban
487746bf1b Backed out 2 changesets (bug 1862256) for causing mochitests failures in test_native_key_bindings_mac.html. CLOSED TREE
Backed out changeset b23e836dc19b (bug 1862256)
Backed out changeset ccb29705b1d5 (bug 1862256)
2024-11-07 14:31:58 +02:00
Laura Hausmann
a52d3dad74 Bug 1862256 - Fix textarea home/end behavior r=saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D192724
2024-11-07 10:30:46 +00:00
Edgar Chen
db01e53404 Bug 1928340 - Add some log for pointer lock; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D228090
2024-11-06 20:59:35 +00:00
serge-sans-paille
5946338a6a Bug 1920718 - Annotate all global variable with runtime initialization attributes r=glandium,application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh,geckoview-reviewers,win-reviewers,gstoll,m_kato
MOZ_RUNINIT => initialized at runtime
MOZ_CONSTINIT => initialized at compile time
MOZ_GLOBINIT => initialized either at runtime or compile time, depending on template parameter, macro parameter etc
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.

Differential Revision: https://phabricator.services.mozilla.com/D223341
2024-10-30 11:05:24 +00:00
James Teh
2ac6855a7d Bug 1926214 part 2: Fire a11y scrolling start events on a text leaf node when navigating to text fragments. r=jjaschke,morgan
Previously, scrolling start events always fired on an Accessible for an element, never a text leaf.
However, a text fragment starts in a text leaf node and there may be many other children of the parent element prior to the start of the text fragment.
We want to get a11y clients as close as possible to the fragment, so fire the event on the text leaf node instead.

Unfortunately, we can't fire the Windows event on text leaf nodes, so we have to override this to use the parent in Windows specific code.
Fortunately, we can expose the highlight on Windows via text attributes, so clients can find out exactly what is highlighted, albeit with a bit more work.
This text leaf change is of most benefit on Android, where we can't expose the highlight, but we can move accessibility focus to a text leaf.

Differential Revision: https://phabricator.services.mozilla.com/D226587
2024-10-30 04:46:41 +00:00
Jan-Niklas Jaeschke
4ea484f7f2 Bug 1907808, part 1 - Text Fragments: Use ScrollSelectionIntoView() to scroll text directive into view. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D226813
2024-10-28 08:31:37 +00:00
serge-sans-paille
262f78c07f Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Adi
392af3d795 Backed out 2 changesets (bug 1926214, bug 1926198) for causing ba failures. CLOSED TREE
Backed out changeset ada40589ff0c (bug 1926214)
Backed out changeset fbb2bce6d562 (bug 1926198)
2024-10-28 09:34:01 +02:00
James Teh
1bd980cb25 Bug 1926214: Fire a11y scrolling start events on a text leaf node when navigating to text fragments. r=jjaschke,morgan
Previously, scrolling start events always fired on an Accessible for an element, never a text leaf.
However, a text fragment starts in a text leaf node and there may be many other children of the parent element prior to the start of the text fragment.
We want to get a11y clients as close as possible to the fragment, so fire the event on the text leaf node instead.

Unfortunately, we can't fire the Windows event on text leaf nodes, so we have to override this to use the parent in Windows specific code.
Fortunately, we can expose the highlight on Windows via text attributes, so clients can find out exactly what is highlighted, albeit with a bit more work.
This text leaf change is of most benefit on Android, where we can't expose the highlight, but we can move accessibility focus to a text leaf.

Differential Revision: https://phabricator.services.mozilla.com/D226587
2024-10-28 06:42:30 +00:00
Alexandru Marc
a5eb905bf4 Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille
07101ac24d Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc
004e704b22 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille
2c916d4973 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
Emilio Cobos Álvarez
e4dbacd20c Bug 1926031 - Add a more c++-friendly nsISelectionController::ScrollSelectionIntoView. r=jjaschke,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D226390
2024-10-22 09:58:03 +00:00
Emilio Cobos Álvarez
6a6f7270d4 Bug 1926031 - Remove unused SCROLL_FOR_CARET_MOVE. r=jjaschke,masayuki
No point in keeping the code around.

Differential Revision: https://phabricator.services.mozilla.com/D226387
2024-10-22 09:34:28 +00:00