423 Commits
Author SHA1 Message Date
Josh Aas 0a160f78a3 Bug 2041228 - Fix a regression on macOS in which paragraph movement does not work correctly. r=masayuki,layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D301836
2026-06-08 13:55:25 +00:00
Masayuki Nakano 52def4ebef Bug 2026022 - Make TextEditor and HTMLEditor initialize Selection before focus event is dispatched r=smaug
Currently, our editor and document viewer manage `Selection` state and
ranges within their `focus`/`blur` event listeners. However, UI Events
defines that the events should be fired after the focus move finished
[1][2]. Therefore, we need to move the handlers to
`EventTarget::PreHandleEvent` or the event listener of the event target
parent of the window (in the capturing phase of the default event group).
Otherwise, a web content's event listener runs before we maintain the
`Selection`. This patch moves the handlers to
`nsGlobalWindowInner::PreHandleEvent`.

Currently, there are 3 event listeners which maintain the `Selection`.

`nsDocViewerFocusListener`:

This maintains the active `nsFrameSelection` and the display of the
last focused selection only when the document node gets focus. This
patch removes this class and move the code into new static methods of
`nsFrameSelection`.

`HTMLEditor::OnFocus`:

This activates the document `nsFrameSelection` and collapses `Selection`
to the focused element if `Selection` ranges are not in the focused
editing host. This does it even if a text control gets focus even though
the focused `TextEditor` will handle the further user inputs.

`TextEditor::OnFocus`:

This activate the independent `nsFrameSelection`.

These handlers run in the following order:
1. `nsDocViewerFocusListener`
2. `HTMLEditor`
3. `TextEditor`

Therefore, `nsGlobalWindowInner::PreHandleEvent` handles all of them
within this order.

Note that `TextEditor::OnFocus` is now called after `HTMLInputElement`
or `HTMLTextAreaElement` prepares the further `change` event
dispatching. After applying this patch, their `PreHandleEvent` will do
that. Then, `nsGlobalWindowInner::PreHandleEvent` will run because
`PreHandleEvent`s are called in the bubbling phase order. Therefore, the
handling order shouldn't be changed.

1. https://w3c.github.io/uievents/#event-type-focus
2. https://w3c.github.io/uievents/#event-type-blur

Differential Revision: https://phabricator.services.mozilla.com/D292335
2026-05-27 03:32:07 +00:00
serge-sans-paille 57804a4fa1 Bug 2041298 - Comply with clang-tidy's modernize-use-nullptr check for layout/ r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D301770
2026-05-26 14:31:53 +00:00
Leo Tenenbaum 14e83643ee Bug 2037794 - Set properties of original caret instead of drag+drop caret where needed. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D299228
2026-05-15 17:25:28 +00:00
Atila Butkovits 6706fac649 Revert "Bug 2037794 - Set properties of original caret instead of drag+drop caret where needed. r=masayuki" for causing failures at test_drag_drop_caret.html.
This reverts commit 524b0cc22b.
2026-05-15 13:53:29 +00:00
Leo Tenenbaum 524b0cc22b Bug 2037794 - Set properties of original caret instead of drag+drop caret where needed. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D299228
2026-05-15 13:07:26 +00:00
Jan-Niklas Jaeschke 2ab73e6e95 Bug 2035083 - Fix CSS highlights not rendering on inserted text nodes. r=layout-reviewers,emilio
Allow detached ranges through the document check in highlight selection
population. Added two WPT reftests verifying highlights paint after
inserting a text node and after inserting a subtree containing a
highlighted range.

Differential Revision: https://phabricator.services.mozilla.com/D297898
2026-05-05 15:12:48 +00:00
Josh Aas 19613b5043 Bug 1425483 - Fix cmd-left, cmd-right, cmd-shift-left, cmd-shift-right in RTL text fields on macOS. r=spohl,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D296521
2026-04-29 21:13:31 +00:00
Josh Aas 6d07b772d4 Bug 103422 - Add support for paragraph movement commands on macOS, including their selection variants. r=bradwerth,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D284945
2026-04-21 13:09:47 +00:00
Jonathan Watt 017557984b Bug 2030928. Rename mozilla::ScrollAxis to mozilla::AxisScrollParams. r=credential-management-reviewers,layout-reviewers,emilio,dimi
The current mozilla::ScrollAxis struct in PresShellForwards.h isn't a simple
axis enum. It carries information about where to scroll to along a specific
axis, and under what conditions that should happen. So 'ScrollAxis' isn't the
best name.

Now we're introducing WebIDL 'ScrollAxis' in bug 1350457:

https://drafts.csswg.org/scroll-animations-1/#scrolltimeline-interface

The extensive use of PresShellForwards.h's ScrollAxis in DOM code makes it
conflict with this new DOM enum. Rather than try to fix this through lots of
explitic namespacing, this patch renames PresShellForwards.h's ScrollAxis.

Differential Revision: https://phabricator.services.mozilla.com/D293485
2026-04-14 12:59:21 +00:00
rperta c39bffe05c Revert "Bug 103422 - Add support for paragraph movement commands on macOS, including their selection variants. r=bradwerth,masayuki" for causing chrome failures at test_native_key_bindings_mac.html
This reverts commit af9bcc8b73.
2026-04-12 19:57:14 +00:00
Josh Aas af9bcc8b73 Bug 103422 - Add support for paragraph movement commands on macOS, including their selection variants. r=bradwerth,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D284945
2026-04-12 03:46:37 +00:00
Jan-Niklas Jaeschke 0b2d030087 Bug 2030660 - Remove dom.shadowdom.selection_across_boundary.enabled pref. r=masayuki,webidl
Differential Revision: https://phabricator.services.mozilla.com/D293086
2026-04-10 08:02:43 +00:00
Olli Pettay 0260e4ed4d Bug 2029708 - avoid unexpected selection handling with table cells, r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D292229
2026-04-08 00:53:15 +00:00
rperta 00f45b10a1 Revert "Bug 103422 - Add support for paragraph movement commands on macOS, including their selection variants. r=bradwerth,masayuki" for causing chrome failures at test_native_key_bindings_mac.html
This reverts commit a0be1de7fe.
2026-04-01 18:32:15 +00:00
Josh Aas a0be1de7fe Bug 103422 - Add support for paragraph movement commands on macOS, including their selection variants. r=bradwerth,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D284945
2026-04-01 16:27:08 +00:00
Silaghi ad6d40e1c0 Revert "Bug 103422 - Add support for paragraph movement commands on macOS, including their selection variants. r=bradwerth,masayuki" for causing mochitest failures at browser_reservedkey.js
This reverts commit f786295c08.
2026-03-27 10:17:53 +00:00
Josh Aas f786295c08 Bug 103422 - Add support for paragraph movement commands on macOS, including their selection variants. r=bradwerth,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D284945
2026-03-27 02:58:13 +00:00
Masayuki Nakano 1075a2f638 Bug 2022026 - Make nsFrameSelection::PageMove check whether the scrollable frame is available r=smaug
Before using the method, the method should check whether it's available first.

Differential Revision: https://phabricator.services.mozilla.com/D287286
2026-03-24 10:08:21 +00:00
Sylvestre Ledru 55481ac4b5 Bug 2023419 - Remove Emacs/Vim modelines from layout/ r=emilio,firefox-style-system-reviewers,layout-reviewers
replaced by .editorconfig

Differential Revision: https://phabricator.services.mozilla.com/D287852
2026-03-17 12:05:43 +00:00
Norisz Fay a86d829321 Revert "Bug 2012637 - part 9: Add a Firefox Source Docs documentation page for TreeKind and notable issues r=smaug,dom-core" as requested by dev
This reverts commit 88008cd8ca.

Revert "Bug 2012637 - part 8: Make `nsContentUtils::ComparePoints` handle `TreeKind::Flat` and `TreeKind::FlatForSelection` correctly r=smaug,dom-core"

This reverts commit 73e6f6587b.

Revert "Bug 2012637 - part 7: Make `RangeUtils::CompareNodeToRangeBoundaries()` use `nsContentUtils::ComparePoints` with valid point in the tree r=smaug"

This reverts commit 6985d5e80f.

Revert "Bug 2012637 - part 6: Make `nsRange::CutContents()` convert the range boundaries to the ones in the DOM before comparing r=smaug"

This reverts commit 73b585af3d.

Revert "Bug 2012637 - part 5: Delete the default template parameter of `nsContentUtils::ComparePoints` and relatives r=smaug,dom-core"

This reverts commit 1a7f24e5b5.

Revert "Bug 2012637 - part 4: Make `nsContentUtils` use `nsIContent` for taking a child node as a parameter r=smaug"

This reverts commit a6ea8d6824.

Revert "Bug 2012637 - part 3: Add template `nsINode` API which can switch to call API from `TreeKind` r=smaug,dom-core,webidl"

This reverts commit a4211e9df0.

Revert "Bug 2012637 - part 2: Add `TreeKind::FlatForSelection` and change the template parameter of `ChildIteratorBase` to `TreeKind` r=smaug,dom-core"

This reverts commit 0241749ee7.

Revert "Bug 2012637 - part 1: Make `ChildIterBase` template class to re-implement `FlattenedChildIterator` for DOM, Flat and FlatForSelection TreeKind r=smaug,dom-core,layout-reviewers,emilio"

This reverts commit 9e71cb77fb.
2026-03-13 02:52:45 +00:00
Masayuki Nakano 1a7f24e5b5 Bug 2012637 - part 5: Delete the default template parameter of nsContentUtils::ComparePoints and relatives r=smaug,dom-core
They accept any kind of points even if it does not match with the
template parameter's `TreeKind` because the caller wants to check the
relation in different kind of tree.  Therefore, any callers need to
consider the `TreeKind` more carefully and clarify the `TreeKind` makes
developers easier to find a bug.

Differential Revision: https://phabricator.services.mozilla.com/D281308
2026-03-12 03:01:54 +00:00
Jan-Niklas Jaeschke 600dce7d68 Bug 1987618, part 1 - CSS Highlight API: Create and store highlight selection before adding ranges. r=emilio,layout-reviewers
This is a subtle bug where the initial paint of a highlight was wrong.
Before this patch, a highlight `Selection` was created, the highlight `Range`s were added,
and then the `Selection` was added to `nsFrameSelection::mHighlightSelections`.
However, adding the range triggers a paint, which then tried to access the selection
in `mHighlightSelections`, where it wasn't added to yet.

Differential Revision: https://phabricator.services.mozilla.com/D283659
2026-02-25 08:05:19 +00:00
Atila Butkovits d199cb6e80 Revert "Bug 1987618, part 8 - CSS Highlight API: Add new test case. r=emilio" for causing failures related to ElementData.
This reverts commit 67a72ced59.

Revert "Bug 1987618, part 7 - CSS Highlight API: Update test expectations. r=emilio"

This reverts commit a8ef71263a.

Revert "Bug 1987618, part 6 - CSS Highlight API: Diff cached highlight pseudo styles during restyle. r=emilio,firefox-style-system-reviewers,layout-reviewers"

This reverts commit be94746926.

Revert "Bug 1987618, part 5 - CSS Highlight API: Set primary frame's style as parent when probing highlight styles. r=emilio,layout-reviewers"

This reverts commit 47bf5d2fee.

Revert "Bug 1987618, part 4 - CSS Highlight API: Fix text-decoration positioning for vertical writing mode. r=jfkthame,layout-reviewers"

This reverts commit 73cc6f91b9.

Revert "Bug 1987618, part 3 - CSS Highlight API: Compute decoration overflow bounds correctly. r=jfkthame,layout-reviewers"

This reverts commit 7d4afe8234.

Revert "Bug 1987618, part 2 - CSS Highlight API: Use correct line thickness for strikeout decorations. r=jfkthame,layout-reviewers"

This reverts commit 8e1d7e02a9.

Revert "Bug 1987618, part 1 - CSS Highlight API: Create and store highlight selection before adding ranges. r=emilio,layout-reviewers"

This reverts commit b585a9be3e.
2026-02-24 15:57:35 +00:00
Jan-Niklas Jaeschke b585a9be3e Bug 1987618, part 1 - CSS Highlight API: Create and store highlight selection before adding ranges. r=emilio,layout-reviewers
This is a subtle bug where the initial paint of a highlight was wrong.
Before this patch, a highlight `Selection` was created, the highlight `Range`s were added,
and then the `Selection` was added to `nsFrameSelection::mHighlightSelections`.
However, adding the range triggers a paint, which then tried to access the selection
in `mHighlightSelections`, where it wasn't added to yet.

Differential Revision: https://phabricator.services.mozilla.com/D283659
2026-02-24 15:12:59 +00:00
Emilio Cobos Álvarez 30b7a3d89a Bug 2014922 - Untangle pseudo-element and anon box definitions. r=firefox-style-system-reviewers,xpcom-reviewers,layout-reviewers,dshin,nika
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.

This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.

But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.

Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.

Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.

This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.

Differential Revision: https://phabricator.services.mozilla.com/D282076
2026-02-06 07:39:54 +00:00
Norisz Fay 27f4694604 Revert "Bug 2014922 - Untangle pseudo-element and anon box definitions. r=firefox-style-system-reviewers,xpcom-reviewers,layout-reviewers,dshin,nika" for causing bustage @ ElementAnimationData.h
This reverts commit c70290c619.
2026-02-06 05:34:42 +00:00
Emilio Cobos Álvarez c70290c619 Bug 2014922 - Untangle pseudo-element and anon box definitions. r=firefox-style-system-reviewers,xpcom-reviewers,layout-reviewers,dshin,nika
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.

This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.

But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.

Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.

Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.

This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.

Differential Revision: https://phabricator.services.mozilla.com/D282076
2026-02-06 03:42:45 +00:00
Masayuki Nakano 49e78c50f6 Bug 2012638 - Make nsFrameSelection::RepaintSelection() run UpdateSelectionCacheOnRepaintSelection() in any desktop debug builds r=edgar
The method serializes the selection ranges to update the selection cache
for the OS only on macOS.  So, there are a lot of cases to run
`nsHTMLCopyEncoder` only on macOS because repainting selection occurs
immediately after moving focus.

Therefore, we may see assertion failures around `RangeBoundaryBase` and
`nsHTMLCopyEncoder` itself only of debug builds on macOS.  However,
the macOS machines in trysever are always busy and we need to wait at
least one day and the developers may not run the tests on macOS before
landing their patches due to the slowness.

For solving these issues, this patch makes it run on any debug builds
on any desktop platforms. So, basically, we don't need to run tests on
macOS on tryserver after landing this in the most cases.

Differential Revision: https://phabricator.services.mozilla.com/D280905
2026-01-30 03:23:40 +00:00
Cristina Horotan ceded7b8d7 Revert "Bug 2012638 - Make nsFrameSelection::RepaintSelection() run UpdateSelectionCacheOnRepaintSelection() in any desktop debug builds r=edgar" for causing bc failures on browser_bug1261299.js
This reverts commit 6a059306a5.
2026-01-29 14:33:45 +00:00
Masayuki Nakano 6a059306a5 Bug 2012638 - Make nsFrameSelection::RepaintSelection() run UpdateSelectionCacheOnRepaintSelection() in any desktop debug builds r=edgar
The method serializes the selection ranges to update the selection cache
for the OS only on macOS.  So, there are a lot of cases to run
`nsHTMLCopyEncoder` only on macOS because repainting selection occurs
immediately after moving focus.

Therefore, we may see assertion failures around `RangeBoundaryBase` and
`nsHTMLCopyEncoder` itself only of debug builds on macOS.  However,
the macOS machines in trysever are always busy and we need to wait at
least one day and the developers may not run the tests on macOS before
landing their patches due to the slowness.

For solving these issues, this patch makes it run on any debug builds
on any desktop platforms. So, basically, we don't need to run tests on
macOS on tryserver after landing this in the most cases.

Differential Revision: https://phabricator.services.mozilla.com/D280905
2026-01-29 12:31:57 +00:00
Masayuki Nakano 5c705dd826 Bug 2009095 - Make RangeBoundaryBase store whether it points to child node or offset instead of whether the owner observes mutations r=jjaschke,dom-core
I'm often confused at `RangeBoundaryIsMutationObserved` and
`RangeBoundaryBase::mIsMutationObserved` due to their names. They are
default to `Yes` or `true`. However, `RangeBoundaryBase` may be used for
temporary objects too without mutation observer. Therefore, they may
lie.

On the other hand, the most usage of
`RangeBoundaryBase::mIsMutationObserved` is, to check whether the
instance points to child node or offset. So, I think they can be changed
to `enum class RangeBoundaryPointsTo { Offset, ChildNode }` and
`mPointingToChildNode`.

Differential Revision: https://phabricator.services.mozilla.com/D279300
2026-01-23 04:46:00 +00:00
Jan-Niklas Jaeschke 39176767d1 Bug 2011011, part 2: Small refactorings around the changed StyledRangeCollection data structure. r=dom-core,smaug
This patch does small refactorings like modernizing loops.
In addition, the `StyledRange` struct is moved into the `mozilla::dom`
namespace.

There are no functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D279475
2026-01-21 08:02:43 +00:00
Jan-Niklas Jaeschke cfdc5c4ec3 Bug 2011011, part 1: Implement fast lookup for styled range data in Selection. r=dom-core,smaug
The `StyledRange`s in `Selection` need to be stored sorted by start
position in the DOM. At the same time, the style data needs to be
queried during paint, using a range pointer as key.

Before this patch, the data was stored in an `nsTArray`, which led to
linear lookup times during paint. This could lead to noticeable jank
in situations with many ranges (e.g. CSS Highlight API).

Since the data is key-value-ish, the data structure is changed
to use a sorted array of `AbstractRange`s in addition to a lookup table
for the `TextRangeStyle`s.

This patch tries to keep refactorings to a minimum
and should not change any behavior.

Differential Revision: https://phabricator.services.mozilla.com/D279474
2026-01-21 08:02:40 +00:00
Masayuki Nakano 6eed70821e Bug 2000978 - Make SelectionMovementUtils::GetFrameForNodeOffset() return FrameAndOffset instead of using aReturnOffset r=emilio,layout-reviewers
Additionally, this adds some shortcut operators to `FrameAndOffset`.
Therefore, some users of derived structs of `FrameAndOffset` become
simpler.

Differential Revision: https://phabricator.services.mozilla.com/D273716
2025-12-15 07:53:05 +00:00
Masayuki Nakano 82a139a8f0 Bug 1998858 - part 2: Make Selection stop splitting user selected range to exclude non-selectable nodes r=smaug,emilio,edgar,TYLin,layout-reviewers
The other browsers do not support multiple selection ranges.  Therefore,
they never split selection ranges to exclude non-selectable nodes.
To align the behavior, we should do so.  However, to keep current
look of `Selection` which is similar to Chrome's behavior, we should
make the selection painters ignore normal selections if their content
is not selectable.

Note that this patch allows painting selected text when there are some
IME selections even if `user-select` is `none` because the normal
selection is also a part of IME selections.  Although our widget
currently do not use non-collapsed normal selection during a
composition, it may be changed to support new IME in the future.

Differential Revision: https://phabricator.services.mozilla.com/D272187
2025-11-21 00:16:55 +00:00
Emilio Cobos Álvarez 49a62d866d Bug 1999621 - Remove nsIFrame::GetOffsetFromView. r=tnikkel,layout-reviewers
Now that only root frames have views, we can just use the root frame directly.

This is only used to have a common reference frame for caret position (this
should probably be simpler).

Differential Revision: https://phabricator.services.mozilla.com/D272206
2025-11-12 08:01:32 +00:00
serge-sans-paille 7662b3abdc Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 19:36:01 +00:00
Cristina Horotan 8a1b1970b7 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing Gtest failures on AlreadyAddRefed.h
This reverts commit e98adca292.
2025-10-21 16:16:29 +00:00
serge-sans-paille e98adca292 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 15:05:17 +00:00
Cristina Horotan aab924e90d Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing build bustage at nsBrowserApp.cpp
This reverts commit fd0ffa193c.
2025-10-21 10:44:13 +00:00
serge-sans-paille fd0ffa193c Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 09:44:11 +00:00
Narcis Beleuzu e1e6bbb1c9 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing bustages on Document.cpp
This reverts commit b23c15e927.
2025-10-21 06:34:58 +00:00
serge-sans-paille b23c15e927 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 06:01:36 +00:00
Andrew McCreight 1f5a942935 Bug 1992524 - Remove warning from nsFrameSelection::RepaintSelection(). r=smaug
This warning is in the top 10 on all 3 desktop platforms and doesn't look very useful.

Differential Revision: https://phabricator.services.mozilla.com/D267683
2025-10-06 21:39:56 +00:00
Jan-Niklas Jaeschke 0151e67615 Bug 1949053, part 2 - Rename nsTextFragment to mozilla::dom::CharacterDataBuffer. r=masayuki
This patch updates all occurrences of the type `nsTextFragment` into its new name, `mozilla::dom::CharacterDataBuffer`.
It also updates the includes, including sorting.

Differential Revision: https://phabricator.services.mozilla.com/D259867
2025-08-06 08:48:01 +00:00
Emilio Cobos Álvarez a8a2311474 Bug 1976457 - Sort includes in layout/. r=janv,dshin
Interesting bit is layout/.clang-format, the rest is all automated.

Differential Revision: https://phabricator.services.mozilla.com/D256616
2025-07-09 13:24:00 +00:00
Jan-Niklas Jaeschke 162cdb86f5 Bug 1968981 - CSS Highlight API: Repaint Highlight selections after changing its priority or type. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D251615
2025-05-29 15:18:52 +00:00
Florian Quèze 9885783942 Bug 1956726 - remove leftover Telemetry.h includes in .cpp files, r=chutten,geckoview-reviewers,cookie-reviewers,win-reviewers,dom-storage-reviewers,gstoll,valentin,m_kato,janv.
Differential Revision: https://phabricator.services.mozilla.com/D244351
2025-04-08 13:03:02 +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