Commit Graph

1691 Commits

Author SHA1 Message Date
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
Emilio Cobos Álvarez
a8ce0ec5f9 Bug 1926031 - Use a cenum for selection controller scroll flags. r=jjaschke,masayuki
Note that the casts are ugly but they will go away sooner rather than
later.

Differential Revision: https://phabricator.services.mozilla.com/D226386
2024-10-22 09:34:27 +00:00
Hiroyuki Ikezoe
5453167f89 Bug 1813213 - Factor the dynamic toolbar bimodal height into position sticky elements stuck to the root scroll container. r=botond,geckoview-reviewers,m_kato
And kick a reflow for the sticky elements when the dynamic toolbar is hidden so that
the sticky elements' position laid out on the main-thread is properly updated there.

These stuffs are basically same as we've done for position:fixed elements.

Differential Revision: https://phabricator.services.mozilla.com/D223906
2024-10-16 04:46:20 +00:00
Emilio Cobos Álvarez
8d6c25f7a5 Bug 1829006 - Remove unnecessary restriction about opaque scrollable windows. r=dholbert
This comment doesn't make sense any more:

 * Scrollers don't use native anything.
 * Extensions can't openDialog themselves anymore.

This would allow user CSS to e.g. make PiP windows transparent. An
alternative would be to use scrolling="false" on the PiP window, but
since the restriction doesn't really seem necessary seems worth
removing.

Differential Revision: https://phabricator.services.mozilla.com/D175952
2024-10-11 11:24:09 +00:00
Emilio Cobos Álvarez
ddc243b63d Bug 1923334 - Sync window properties when root element style changes. r=jwatt
We sync window properties every time we reflow the viewport frame:

 * https://searchfox.org/mozilla-central/rev/7db217e3832e9a884be0c2300779e098f92be3fe/layout/base/PresShell.cpp#9978-9980

However that's not enough because some things that do affect the window
properties (like border-radius / background-color / color-scheme) don't
necessarily trigger reflow.

Do it whenever we set the root style, which is easier and catches all
those.

Bail out earlier in content processes because we can, puppet widgets
don't do any of that.

Differential Revision: https://phabricator.services.mozilla.com/D225153
2024-10-10 11:55:38 +00:00
Butkovits Atila
e6792fd3b6 Backed out changeset 4d3b1b385478 (bug 1829006) for causing failures at browser_startup_syncIPC.js. CLOSED TREE 2024-10-10 04:29:18 +03:00
Emilio Cobos Álvarez
8360f1778a Bug 1829006 - Remove unnecessary restriction about opaque scrollable windows. r=dholbert
This comment doesn't make sense any more:

 * Scrollers don't use native anything.
 * Extensions can't openDialog themselves anymore.

This would allow user CSS to e.g. make PiP windows transparent. An
alternative would be to use scrolling="false" on the PiP window, but
since the restriction doesn't really seem necessary seems worth
removing.

Differential Revision: https://phabricator.services.mozilla.com/D175952
2024-10-09 23:13:49 +00:00
Tamas Szentpeteri
8285dfaab8 Backed out changeset 4b1409597101 (bug 1920718) for causing bp bustages on rapl.cpp. 2024-10-08 23:27:18 +03:00
serge-sans-paille
1966f9a43c Bug 1920718 - Annotate all global variable with runtime initialization as MOZ_RUNINIT r=application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh
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-08 16:49:51 +00:00
Emilio Cobos Álvarez
7e3778ba99 Bug 1922956 - Further clean-up widget creation code-paths. r=win-reviewers,mac-reviewers,geckoview-reviewers,mstange,rkraesig,m_kato
This is all super-hacky (see a lot of the XXXcjones comments).

Simplify it... We never create widgets with a bare native parent but no
nsIWidget parent. Pass nsIWidgets and deal with things correctly.

There were also things that were dealing with stuff that can't happen,
like top level popups, children of PuppetWidgets, or such.

Instead of overriding Create(), let's just teach nsBaseWidget about
non-native (headless/puppet) widgets.

Remove lots of old APIs for the native window stuff that are unused
and/or unimplemented.

Differential Revision: https://phabricator.services.mozilla.com/D224613
2024-10-07 16:43:53 +00:00
Emilio Cobos Álvarez
f8a42a3842 Bug 1921903 - Ensure we don't create hidden widgets in non-macOS platforms. r=rkraesig,geckoview-reviewers,win-reviewers,m_kato
Pretty sure that we can't hit that case right now, and try with MOZ_ASSERT
agrees with me at least.

Popups don't get there. For puppet widgets, mParentWidget is provided
explicitly.

This code is all super messy and can be cleaned-up significantly.
See following patch.

Differential Revision: https://phabricator.services.mozilla.com/D224612
2024-10-07 10:15:16 +00:00
keithamus
a155da2430 Bug 1888728 - Use CloseWatcher machinery for Dialogs & Popovers r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D206170
2024-09-24 16:48:09 +00:00
David Shin
e52d21fa25 Bug 1900232: Part 5 - Add anchor-size() to sizing properties. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D222534
2024-09-23 13:58:38 +00:00
David Shin
41f83d368b Bug 1900232: Part 2 - Create one place to shim inset getters. r=firefox-style-system-reviewers,emilio
... Instead of handling `anchor()` function at each site manually.

Differential Revision: https://phabricator.services.mozilla.com/D222531
2024-09-23 13:58:37 +00:00
Masayuki Nakano
136939d338 Bug 1916141 - Make AutoPointerEventTargetUpdater guarantee that the target is an element if the event target should be so r=smaug
According to test result on tryserver, the constructor may receive text frame,
although I couldn't reproduce it with writing tests.  Then, it'll return
the text node as the mouse event target after dispatching a pointer event.
However, mouse events need to be targeted to element node.  Therefore, it's
wrong to use the frame when `aTargetContent` is specified.

Additionally, for the last resort, it should refer an inclusive ancestor element
of the target frame content if `aTargetContent` is not specified and the event
should be targeted to an element.

Finally, there is another path to set non-element node in
`PresShell::EventHandler::DispatchEventToDOM`.  The path is not the cause of
the reported case, but we should fix it too.

Differential Revision: https://phabricator.services.mozilla.com/D222091
2024-09-15 21:57:51 +00:00
Emilio Cobos Álvarez
5867a73edc Bug 1917867 - Simplify PresShell event dispatching asserts. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D221843
2024-09-12 16:50:26 +00:00
Emilio Cobos Álvarez
0b3521ccca Bug 1891335 - Compute EffectInfo updates at IntersectionObserver time. r=smaug,hiro
What goes on here is that there's a couple of unfortunate style change
sequences which end up making us not do the EffectsInfo dance correctly.

Twitter uses (maybe didn't use to, which would explain the regression) a
visibility: hidden, out-of-flow iframe for a bit (which we correctly
throttle). But then they switch to an in-flow, visible, zero-height
iframe. That we should _not_ throttle. However, we end up not getting to
the display list code at all, because nsBlockFrame decides that we don't
need to descend into an empty line[1].

It seems less error prone to re-use the IntersectionObserver timing and
computation to determine whether the iframe is visible. That completely
matches in-process iframes, too.

Removing the empty frame border and putting them on an empty line in
dom/base/test/test_bug1639328.html is enough to reproduce the issue
without this patch.

[1]: https://searchfox.org/mozilla-central/rev/fe2743c6c5c708061c7f6504b26958fcc815bb4a/layout/generic/nsBlockFrame.cpp#7569-7579

Differential Revision: https://phabricator.services.mozilla.com/D207479
2024-09-06 16:04:57 +00:00
Stanca Serban
d05e0c1dd0 Backed out changeset 80db8b7ff2af (bug 1891335) for causing mochitests failures in test_bug1639328.html. 2024-09-06 00:22:51 +03:00
Emilio Cobos Álvarez
f20aebf2fc Bug 1891335 - Compute EffectInfo updates at IntersectionObserver time. r=smaug,hiro
What goes on here is that there's a couple of unfortunate style change
sequences which end up making us not do the EffectsInfo dance correctly.

Twitter uses (maybe didn't use to, which would explain the regression) a
visibility: hidden, out-of-flow iframe for a bit (which we correctly
throttle). But then they switch to an in-flow, visible, zero-height
iframe. That we should _not_ throttle. However, we end up not getting to
the display list code at all, because nsBlockFrame decides that we don't
need to descend into an empty line[1].

It seems less error prone to re-use the IntersectionObserver timing and
computation to determine whether the iframe is visible. That completely
matches in-process iframes, too.

Removing the empty frame border and putting them on an empty line in
dom/base/test/test_bug1639328.html is enough to reproduce the issue
without this patch.

[1]: https://searchfox.org/mozilla-central/rev/fe2743c6c5c708061c7f6504b26958fcc815bb4a/layout/generic/nsBlockFrame.cpp#7569-7579

Differential Revision: https://phabricator.services.mozilla.com/D207479
2024-09-05 17:16:12 +00:00
Masayuki Nakano
d9ceb68c92 Bug 1915057 - Make HTMLEditor::NotifyRootChanged() notifies IMEStateManager of the editor root change r=smaug,m_kato
When `HTMLEditor` handles the design mode, `IMEContentObserver` observes the
`<body>` if there is.  However, web apps may remove it.  Then, we need to
recreate `IMEContentObserver` with emulating a focus move because it's difficult
to compute the difference between the old root and the new root (IME focus
notification sends all content to the parent, it's faster in most cases in this
situation). This was fixed in bug 1911010.  However, there are remaining issues
after that.

When new `<body>` or the original `<body>` is connected again,
`IMEContentObserver` does not restart to observe the new `<body>`.  So,
`IMEContentObserver` working differently after the `<body>` is even temporarily
removed.  This make it harder to reproduce reported bugs.

Additionally, if the document element is removed, `IMEContentObserver` won't
be recreated until the document gets focus again even after new root and/or
`<body>` element is connected.  This makes IME users inconvenient with such
tricky editors.

This patch makes `HTMLEditor::NotifyRootChanged` notifies `IMEStateManager`
of the editor root element change.  Then, the new method of `IMEStateManager`
updates IME enabled state and recreate `IMEContentObserver` with emulating
a focus move.

Differential Revision: https://phabricator.services.mozilla.com/D220362
2024-09-05 00:35:50 +00:00
Sean Feng
c6e6d73a26 Bug 1900426 - Implement DnD for shadow-crossing selection r=jjaschke,smaug,dom-core
This patches allows
  1. when the selection is shadow-crossing, dragging it will have the
  correct the drag image correctly displayed. It's hard to test, so
  no tests for this.

  2. The selection can now be serialized and dropped.
  `test_drag_drop_shadow_crossing_selection.html` is the test for
  this.

Differential Revision: https://phabricator.services.mozilla.com/D217318
2024-09-03 15:42:58 +00:00
Noemi Erli
9f28e0b5e5 Backed out changeset 5c6272143175 (bug 1900426) for causing bug 1915027, bug 1915620, bug 1915816 2024-08-30 16:31:30 +03:00
Sean Feng
7bd0868c67 Bug 1900426 - Implement DnD for shadow-crossing selection r=jjaschke,smaug,dom-core
This patches allows
  1. when the selection is shadow-crossing, dragging it will have the
  correct the drag image correctly displayed. It's hard to test, so
  no tests for this.

  2. The selection can now be serialized and dropped.
  `test_drag_drop_shadow_crossing_selection.html` is the test for
  this.

Differential Revision: https://phabricator.services.mozilla.com/D217318
2024-08-28 15:03:17 +00:00