Commit Graph
917 Commits
Author SHA1 Message Date
Leo Tenenbaum 404ff20a36 Bug 2040958 - Composed text input for EditContext. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D304908
2026-06-11 13:48:04 +00:00
Sandor Molnar cf650a4d4d Revert "Bug 2040958 - Composed text input for EditContext. r=masayuki" for causing build bustages @ EditContext.cpp
This reverts commit 96dc5eded0.
2026-06-11 13:17:11 +00:00
Leo Tenenbaum 96dc5eded0 Bug 2040958 - Composed text input for EditContext. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D304908
2026-06-11 13:02:35 +00:00
Leo Tenenbaum c1581027a1 Bug 2040956 - Implement EditContext text deletion. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D302361
2026-06-02 14:16:23 +00:00
Masayuki Nakano 8e83f7d6a3 Bug 2031894 - part 2: Make TextEditor and HTMLEditor put off to start working with IMEContentObserver and the spellchecker after eFocus event propagation end r=m_kato,smaug
A `focus` event listener may change focus from the `focus` event target
and it's not good thing to run content script before dispatching
`eFocus` event via `OnFocus` of the editor classes. Therefore, let's
make `EditorEventListener` restart listening to `eFocus` event and
handle the things which are not referred by web content script after
the `focus` event propagation in the web content.

Unfortunately, this cannot drop `MOZ_CAN_RUN_SCRIPT` from
`TextEditor::OnFocus` nor `HTMLEditor::OnFocus` because selection
listeners may run. However, they should not run web content script.
So, the preprocessing of `eFocus` or `eBlur` event becomes much safer
by this change.

Differential Revision: https://phabricator.services.mozilla.com/D294361
2026-05-27 04:34:10 +00:00
Masayuki Nakano d7faad651b Bug 2041140 - AutoBlockElementsJoiner::ComputeRangeToDeleteAtOtherBlockBoundary should stop calling HTMLEditor::CollapseSelectionTo r=m_kato,jjaschke
Previously, `Compute*()` methods temporarily updated `Selection` for
emulating the corresponding `Handle*()` method behavior. However,
they have already been fixed as not using `Selection`. Therefore,
we can make
`AutoBlockElementsJoiner::ComputeRangeToDeleteAtOtherBlockBoundary` stop
updating `Selection` only for
initializing `AutoClonedSelectionRangeArray` instance.

Differential Revision: https://phabricator.services.mozilla.com/D301693
2026-05-24 08:47:22 +00:00
Leo Tenenbaum 6fd98b6963 Bug 2039944 - EditContext non-composed text insertion. r=masayuki,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D300797
2026-05-20 20:15:19 +00:00
agoloman 38b46ea44d Revert "Bug 2039944 - EditContext non-composed text insertion. r=masayuki,webidl,smaug" for causing build bustages @HTMLEditSubActionHandler.cpp.
This reverts commit bb35dbdb26.
2026-05-20 17:32:07 +00:00
Leo Tenenbaum bb35dbdb26 Bug 2039944 - EditContext non-composed text insertion. r=masayuki,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D300797
2026-05-20 17:03:15 +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
Leo Tenenbaum 850c5fdbea Bug 2032191 - Return false in EditorBase::CanKeepHandlingFocusEvent if focused element is not editable. r=masayuki
Depends on D290638

Differential Revision: https://phabricator.services.mozilla.com/D294734
2026-05-05 21:38:43 +00:00
Alexandru Marc 97bc836507 Revert "Bug 2032191 - Return false in EditorBase::CanKeepHandlingFocusEvent if focused element is not editable. r=masayuki" for causing mochitest failures @ test_named_deck
This reverts commit 77b32373c4.
2026-05-04 17:20:56 +00:00
Leo Tenenbaum 77b32373c4 Bug 2032191 - Return false in EditorBase::CanKeepHandlingFocusEvent if focused element is not editable. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D294734
2026-05-04 13:12:10 +00:00
Alexandru Marc 527e77160d Revert "Bug 2032191 - Return false in EditorBase::CanKeepHandlingFocusEvent if focused element is not editable. r=masayuki" for causing ba failures @ browser_text_selection
This reverts commit 5a8dadf613.
2026-05-01 18:04:24 +00:00
Leo Tenenbaum 5a8dadf613 Bug 2032191 - Return false in EditorBase::CanKeepHandlingFocusEvent if focused element is not editable. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D294734
2026-05-01 16:33:02 +00:00
agoloman 8db98c5af2 Revert "Bug 2032191 - Return false in EditorBase::CanKeepHandlingFocusEvent if focused element is not editable. r=masayuki" for causing wr failures @nsINode.cpp.
This reverts commit 3e98c374c4.
2026-04-28 14:07:42 +00:00
Leo Tenenbaum 3e98c374c4 Bug 2032191 - Return false in EditorBase::CanKeepHandlingFocusEvent if focused element is not editable. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D294734
2026-04-28 12:56:15 +00:00
Cosmin Sabou 6ecc579ec5 Revert "Bug 2032191 - Return false in EditorBase::CanKeepHandlingFocusEvent if focused element is not editable. r=masayuki" for causing caret related failures.
This reverts commit 4af36fb850.
2026-04-20 18:12:10 +00:00
Leo Tenenbaum 4af36fb850 Bug 2032191 - Return false in EditorBase::CanKeepHandlingFocusEvent if focused element is not editable. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D294734
2026-04-20 16:36:57 +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
Sylvestre Ledru 9f5cc05eee Bug 2023419 - Remove Emacs/Vim modelines from editor/ r=masayuki
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287844
2026-03-16 12:52:41 +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
tushar sariyaandEmilio Cobos Álvarez 4429f242e5 Bug 928224 - When HandlingTypeChanges from/to Text to Password re-use input state and set or unset the NS_MAYBE_MASKED flag. r=masayuki,layout-reviewers
Co-authored-by: Emilio Cobos Álvarez <[email protected]>

Differential Revision: https://phabricator.services.mozilla.com/D285372
2026-03-06 09:54:36 +00:00
Masayuki Nakano 3e713ed0cd Bug 2011114 - Make EditorBase stop dispatching input event immediately before or after compositionend in domains specified by prefs r=m_kato
We're intentionally dispatching `input` events before and after
`compositionend` for the compatibility with the spec and the other
browsers which are based on WebKit (i.e., including Blink) and for
the backward compatibility and better behavior for web apps.

The hacky behavior works in the most web apps. However, we got a bug
report in bug 2006599. Therefore, we need to disable either `input`
event for specific website.

Differential Revision: https://phabricator.services.mozilla.com/D279488
2026-01-21 01:40:16 +00:00
Masayuki Nakano 91fa81075a Bug 1998077 - part 7: Reimplement HTMLEditUtils::GetInclusiveDeepestFirstChildWhichHasOneChild with LeafNodeOptions r=m_kato
Similarly, we can implement it with `LeafNodeOptions` to ignore
unnecessary nodes.  Then, we can get rid of `WalkTreeOption` and
`WalkTreeOptions` completely.

Differential Revision: https://phabricator.services.mozilla.com/D277524
2026-01-13 05:27:53 +00:00
Masayuki Nakano b289a47a35 Bug 1998077 - part 5: Replace the remaining HTMLEditUtils::Get(Next|Previous)Content() with new ones based on Get(Next|Previous)LeafNodeOr(Next|Previous)BlockElement() r=m_kato
`HTMLEditUtils::GetNextContent()` and
`HTMLEditUtils::GetPreviousContent()` are wrappers of
`HTMLEditUtils::GetAdjacentContent()` and
`HTMLEditUtils::GetAdjacentLeafContent()`.  The behavior is similar to
`HTMLEditUtils::GetNextLeafContentOrNextBlockElement()` or
`HTMLEditUtils::GetPreviousLeafContentOrPreviousBlockElement()` but
they won't stop at block inclusive ancestor or a block sibling of an
inclusive ancestor.  Therefore, we can get rid of them and use the new
and better implementation.

Differential Revision: https://phabricator.services.mozilla.com/D277522
2026-01-13 05:27:47 +00:00
Masayuki Nakano 1afcba4cc6 Bug 1998077 - part 3: Add new options to ignore empty/invisible leaf nodes r=m_kato
This adds some options which ignore some types of inline elements.

For example, `IgnoreAnyEmptyInlineContainers` is useful to scan previous
or next editable point because Chrome ignores empty inline elements when
deleting from next to an inline element.

`IgnoreInvisibleInlineVoidElements` is useful to scan invisible line
break from end of a block or checking a line break is invisible because
visible inline element makes a line after the last line break. E.g.,
```html
<div>ABC<br><span></span></div>
```
This shows only one line. However,
```html
<div>ABC<br><span style="border:1px solid"></span></div>
```
This shows 2 lines in the `<div>`.

Additionally, renaming the existing `LeafNodeType` values for making
them easier to understand.

Differential Revision: https://phabricator.services.mozilla.com/D277520
2026-01-13 05:27:41 +00:00
Sandor Molnar b77ea8700f Revert "Bug 1998077 - part 7: Reimplement HTMLEditUtils::GetInclusiveDeepestFirstChildWhichHasOneChild with LeafNodeOptions r=m_kato" for causing build bustages @ WSRunScanner.cpp
This reverts commit 5ccf392dce.

Revert "Bug 1998077 - part 6: Reimplement `HTMLEditUtils::Get(First|Last)Child()` and `HTMLEditUtils::Get(Next|Previous)Sibling()` with `LeafNodeOptions` r=m_kato"

This reverts commit 12eb928cb5.

Revert "Bug 1998077 - part 5: Replace the remaining `HTMLEditUtils::Get(Next|Previous)Content()` with new ones based on `Get(Next|Previous)LeafNodeOr(Next|Previous)BlockElement()` r=m_kato"

This reverts commit 58b4243d10.

Revert "Bug 1998077 - part 4: Replace some callers of `HTMLEditUtils::Get(Next|Previous)Content()` with `HTMLEditUtils::Get(Next|Previous)LeafContentOr(Next|Previous)BlockElement()` r=m_kato"

This reverts commit dd46967eb4.

Revert "Bug 1998077 - part 3: Add new options to ignore empty/invisible leaf nodes r=m_kato"

This reverts commit ca50a4a628.

Revert "Bug 1998077 - part 2: Add `WSType::EmptyInlineContainerElement` r=m_kato"

This reverts commit 4a5d93d631.

Revert "Bug 1998077 - part 1: Make `HTMLEditUtils::IsVisibleElementEvenIfLeafNode` work better if primary frame is available r=m_kato"

This reverts commit b42dc9d35f.
2026-01-07 06:15:59 +00:00
Masayuki Nakano 5ccf392dce Bug 1998077 - part 7: Reimplement HTMLEditUtils::GetInclusiveDeepestFirstChildWhichHasOneChild with LeafNodeOptions r=m_kato
Similarly, we can implement it with `LeafNodeOptions` to ignore
unnecessary nodes.  Then, we can get rid of `WalkTreeOption` and
`WalkTreeOptions` completely.

Differential Revision: https://phabricator.services.mozilla.com/D277524
2026-01-07 01:12:57 +00:00
Masayuki Nakano 58b4243d10 Bug 1998077 - part 5: Replace the remaining HTMLEditUtils::Get(Next|Previous)Content() with new ones based on Get(Next|Previous)LeafNodeOr(Next|Previous)BlockElement() r=m_kato
`HTMLEditUtils::GetNextContent()` and
`HTMLEditUtils::GetPreviousContent()` are wrappers of
`HTMLEditUtils::GetAdjacentContent()` and
`HTMLEditUtils::GetAdjacentLeafContent()`.  The behavior is similar to
`HTMLEditUtils::GetNextLeafContentOrNextBlockElement()` or
`HTMLEditUtils::GetPreviousLeafContentOrPreviousBlockElement()` but
they won't stop at block inclusive ancestor or a block sibling of an
inclusive ancestor.  Therefore, we can get rid of them and use the new
and better implementation.

Differential Revision: https://phabricator.services.mozilla.com/D277522
2026-01-07 01:12:52 +00:00
Masayuki Nakano ca50a4a628 Bug 1998077 - part 3: Add new options to ignore empty/invisible leaf nodes r=m_kato
This adds some options which ignore some types of inline elements.

For example, `IgnoreAnyEmptyInlineContainers` is useful to scan previous
or next editable point because Chrome ignores empty inline elements when
deleting from next to an inline element.

`IgnoreInvisibleInlineVoidElements` is useful to scan invisible line
break from end of a block or checking a line break is invisible because
visible inline element makes a line after the last line break. E.g.,
```html
<div>ABC<br><span></span></div>
```
This shows only one line. However,
```html
<div>ABC<br><span style="border:1px solid"></span></div>
```
This shows 2 lines in the `<div>`.

Additionally, renaming the existing `LeafNodeType` values for making
them easier to understand.

Differential Revision: https://phabricator.services.mozilla.com/D277520
2026-01-07 01:12:46 +00:00
Masayuki Nakano ced0b032f2 Bug 2006520 - Make TextInputListener::OnEditActionHandled independent from mFrame r=emilio
It's called by `TextEditor` after (maybe) modifying the value before
dispatching `input` event.

First, it updates the enabled state of the undo/redo commands.  However,
it's managed by the window.  Therefore, it does not make sense to depend
on the frame.

Then, it updates the various state of the related objects. For making
them work with destroyed `TextEditor`, this patch makes `TextEditor`
keep storing the latest value with caching the `Text` while it's
handling something.

Differential Revision: https://phabricator.services.mozilla.com/D276790
2025-12-18 02:12:34 +00:00
Masayuki Nakano 29812c5278 Bug 2006229 - Make AutoEditActionDataSetter log the HTML and Selection when it's created r=m_kato
When we get a bug report from the fuzzing team, which edit action is
performed within what `innerHTML` of the editing host and `Selection`
ranges are important and help us to minimize the testcase.  Therefore,
let's make `AutoEditActionDataSetter` log them when it's created for an
`HTMLEditor`.

Differential Revision: https://phabricator.services.mozilla.com/D276585
2025-12-17 00:34:27 +00:00
Edgar Chen dc97c63653 Bug 1998195 - Expose execCommand("paste") with a pop-up menu to web content; r=smaug,masayuki
This patch exposes the execCommand("paste") to web content with the same security
model as async Clipboard API. That is, a paste contextmenu will be shown to request
user confirmation if the clipboard data originated from cross-origin content.

Differential Revision: https://phabricator.services.mozilla.com/D274490
2025-12-13 00:10:46 +00:00
pstanciu bd4fd98495 Revert "Bug 1998195 - Expose execCommand("paste") with a pop-up menu to web content; r=smaug,masayuki" for causing build bustage @nsGlobalWindowCommands.cpp
This reverts commit 57912b1d82.
2025-12-12 11:39:05 +00:00
Edgar Chen 57912b1d82 Bug 1998195 - Expose execCommand("paste") with a pop-up menu to web content; r=smaug,masayuki
This patch exposes the execCommand("paste") to web content with the same security
model as async Clipboard API. That is, a paste contextmenu will be shown to request
user confirmation if the clipboard data originated from cross-origin content.

Differential Revision: https://phabricator.services.mozilla.com/D274490
2025-12-12 10:16:07 +00:00
Masayuki Nakano bd3adf2837 Bug 2003973 - Make HTMLEditor check whether selection is in a replaced or a void element stricter r=m_kato
Currently, we do something special only for `<select>`, `<option>`
and `<optgroup>`.  However, we should treat replaced elements and
void elements more consistently.

This patch adds new `HTMLEditUtils` methods to check them easier and
stricter and get the root node of them because DOM API can make invalid
tree even in a void element.

Then, we should handle insertions before the replaced or the void
element if selection range is collapsed in it. However, deletion should
not be handled for that if the range is completely in such element.
Additionally, if range boundary is in such element, we should adjust
the range not to include such element since it's not fully selected
so that shouldn't be deleted nor replaced.  These rules are basically
compatible with Chrome.

Finally, if such element is completely hidden, such elements should be
deleted silently with deleting surrounding content if collapsed next to
one.  However, this does not work well with a `Backspace` key press even
after applying this patch.

Finally, some tests of `editing-around-select-element.tentative.html`
start failing.  The reason is, this patch makes the surrounding block
boundary of `<select>` with adjusting the selection range and that makes
`<select>` moved into another parent.  At this time, the `<select>`
gets `style="white-space: nowrap"`.  I'm not sure where did this but
not a critical failures.  Therefore, this patch contains this
regression.

Differential Revision: https://phabricator.services.mozilla.com/D275170
2025-12-12 07:08:20 +00:00
Masayuki Nakano a49dc3702d Bug 2001825 - Make EditorBase::GetPreferredIMEState() return Result<IMEState, nsresult> r=m_kato
For making the implementation is for which editor, the method should be
a pure virtual function and `TextEditor` and `HTMLEditor` implement it
as they needed.

Additionally, it should return `Result` to avoid the caller to use
fallback IME state even temporarily.

Differential Revision: https://phabricator.services.mozilla.com/D274386
2025-12-01 23:05:25 +00:00
Edgar Chen 2ced0045c3 Bug 2000323 - Get rid of nsIDocumentEncoder::NativeInit(); r=smaug
`nsIDocumentEncoder::NativeInit()` was introduced in bug 574089. It took a
`nsIDocument` directly, whereas `::Init()` took a `nsIDOMDocument` instead.
But now they both take `Document` as an argument. So `NativeInt()` can be
removed and the call sites can use `Init()` instead.

Differential Revision: https://phabricator.services.mozilla.com/D272720
2025-11-15 23:10:55 +00:00
Masayuki Nakano 71a528f921 Bug 1998288 - Make HTMLWithContextInserter::InsertContents stop touching Selection r=m_kato
The method touches `Selection` in its `for` loops and that appear in
the reported profile in bug 1997834.  Therefore, it should stop touching
the `Selection`, and its only caller should update `Selection` instead.

Additionally, this rewrites entire the method to make it simpler and
not use variables in the wide scopes.  That makes it easier to
understand.  However, except in some edge cases, this does not change
the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D271362
2025-11-15 00:30:29 +00:00
Masayuki Nakano 5a9aae988c Bug 1992288 - Make AutoEditActionDataSetter manage whether the destroyed editor was reinitialized r=m_kato
Once the editor is destroyed while dispatching `beforeinput` event,
e.g., by a reframe of the text control frame, `AutoEditActionDataSetter`
marks "the editor has destroyed during my lifetime".  Then, nested
`EditAction`s always fail because the parent `AutoEditActionDataSetter`
thinks the editor is not available.

However, the editor can be reinitialized immediately.  Then, the nested
`EditAction`s should work (note that it does not mean that another user
input is handled, `AutoEditActionDataSetter` is used by some query
methods too). Therefore, this patch adds a new `bool` member to store
whether the editor is initialized again.

I think we could reset `mEditorWasDestroyedDuringHandlingEditAction`,
but I'm afraid to do that because it forgets the destroyed thing
completely and some features may need to abort handling something even
if the editor is restored since the editable nodes are recreated.
Therefore, this patch adds a new `bool` member for making this change
safer and anybody can access the details of the state.

Differential Revision: https://phabricator.services.mozilla.com/D271559
2025-11-12 22:54:20 +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