Commit Graph
229 Commits
Author SHA1 Message Date
Keith Cirkel 2f1f3b0163 Bug 2045044 - Introduce clang plugin to check for using _FINAL macro variants for isupports r=dom-core-reviewers,firefox-static-analysis-reviewers,smaug,sergesanspaille
This change introduces a clang plugin which checks for uses of
`NS_DECL_CYCLE_COLLECTING_ISUPPORTS` in a `final` class. These should instead
use `NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL`.

Not using the `_FINAL` variant can slip in under code review, and still build,
but depending on how the unified builds work out might cause a build error. This
can result in someone making changes to e.g. moz.build having to do some wildly
unrelated follow up working cleaning these up before their build passes.

By introducing a clang plugin to catch these, we can prevent them entering into
tree, and hopefully have a happier and healthier codebase for it.

Differential Revision: https://phabricator.services.mozilla.com/D304799
2026-06-10 14:57:34 +00:00
Masayuki Nakano 7fc0e68334 Bug 2043372 - Add automated tests r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D304371
2026-06-03 23:52:45 +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
Daniel Holbert 10725540f6 Bug 2037754: Use 'MakeAndAddRef' instead of 'new' when allocating runnable for nsContentUtils::AddScriptRunner. r=dom-core,smaug
MakeAndAddRef ensures that the freshly-allocated object immediately gets a
refcount of 1 (before it's even passed to AddScriptRunner).  This avoids
several potential footguns that otherwise exist with a zero-refcount
freshly-allocated object.

It also makes the ownership-transfer semantics more clear
(via the already_AddRefed type that it produces) - AddScriptRunner is taking
ownership of the object, rather than using it temporarily while the caller
maintains ownership.

Differential Revision: https://phabricator.services.mozilla.com/D299039
2026-05-07 06:35:57 +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
Emilio Cobos Álvarez 34b249c82e Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin
This also should fix bug 1881942 (placeholder is now scrollable
alongside the textarea).

This makes nsTextControlFrame a subclass of ScrollContainerFrame (with
an inner block), and tweaks layout to match.

It lays out the inner content using block layout and align-content,
rather than bespoke reflow primitives. This makes field-sizing trivial
to implement on top.

This is a bit scary, but simpler in most ways. In particular, it needs
to teach ScrollContainerFrame of the button, because that goes outside
the scrollable area, like scrollbars. That said it needs less
special-cases added than those removed, and it should also be faster
(needs less frames to layout an input with placeholder etc), and match
other browsers better.

The general set-up is:

  <text-control-editing-root/>
  <placeholder/>
  <autofill-preview/>

text-control-editing-root is always inline-block and always displayed
(since it's what grabs the focus / shows the caret). If the
autofill-preview or placeholder are displayed, the editing-root is
zero-width and clipped (note that for placeholder that's guaranteed
because placeholder is only shown with an empty value, but
autofill-preview needs it).

placeholder and autofill-preview are hidden via `display` rather than
visibility. This doesn't make a difference with this patch but it
matters for bug 1977176.

Caret painting needs an extra hop to paint atop the placeholder (no
observable behavior change, but worth calling out).

There is one subtle behavior change, which is that single-line inputs
never report scrollable overflow in the block axis. This matches other
browsers (see the tweak in nsBlockFrame's overflow computation) and is
needed to avoid regressing scrollable-overflow-padding-input.html.

The changes in window_composition_text_querycontent.xhtml are needed
because before this patch, the height of the control editing root was
always the height of the whole textarea. The characters you're composing
might legitimately be taller than the line. Bump the line height so that
that doesn't happen in this test.

Differential Revision: https://phabricator.services.mozilla.com/D293666
2026-04-16 17:09:40 +00:00
Serban Stanca 5d4176345b Revert "Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin" for causing several failures.
This reverts commit 81ef425716.
2026-04-16 09:31:32 +00:00
Emilio Cobos Álvarez 81ef425716 Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin
This also should fix bug 1881942 (placeholder is now scrollable
alongside the textarea).

This makes nsTextControlFrame a subclass of ScrollContainerFrame (with
an inner block), and tweaks layout to match.

It lays out the inner content using block layout and align-content,
rather than bespoke reflow primitives. This makes field-sizing trivial
to implement on top.

This is a bit scary, but simpler in most ways. In particular, it needs
to teach ScrollContainerFrame of the button, because that goes outside
the scrollable area, like scrollbars. That said it needs less
special-cases added than those removed, and it should also be faster
(needs less frames to layout an input with placeholder etc), and match
other browsers better.

The general set-up is:

  <text-control-editing-root/>
  <placeholder/>
  <autofill-preview/>

text-control-editing-root is always inline-block and always displayed
(since it's what grabs the focus / shows the caret). If the
autofill-preview or placeholder are displayed, the editing-root is
zero-width and clipped (note that for placeholder that's guaranteed
because placeholder is only shown with an empty value, but
autofill-preview needs it).

placeholder and autofill-preview are hidden via `display` rather than
visibility. This doesn't make a difference with this patch but it
matters for bug 1977176.

Caret painting needs an extra hop to paint atop the placeholder (no
observable behavior change, but worth calling out).

There is one subtle behavior change, which is that single-line inputs
never report scrollable overflow in the block axis. This matches other
browsers (see the tweak in nsBlockFrame's overflow computation) and is
needed to avoid regressing scrollable-overflow-padding-input.html.

The changes in window_composition_text_querycontent.xhtml are needed
because before this patch, the height of the control editing root was
always the height of the whole textarea. The characters you're composing
might legitimately be taller than the line. Bump the line height so that
that doesn't happen in this test.

Differential Revision: https://phabricator.services.mozilla.com/D293666
2026-04-16 08:10:39 +00:00
agoloman dfead40619 Revert "Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin" for causing crashtest assertions @399262.html.
This reverts commit 51d51c3b33.
2026-04-16 00:28:13 +00:00
Emilio Cobos Álvarez 51d51c3b33 Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin
This also should fix bug 1881942 (placeholder is now scrollable
alongside the textarea).

This makes nsTextControlFrame a subclass of ScrollContainerFrame (with
an inner block), and tweaks layout to match.

It lays out the inner content using block layout and align-content,
rather than bespoke reflow primitives. This makes field-sizing trivial
to implement on top.

This is a bit scary, but simpler in most ways. In particular, it needs
to teach ScrollContainerFrame of the button, because that goes outside
the scrollable area, like scrollbars. That said it needs less
special-cases added than those removed, and it should also be faster
(needs less frames to layout an input with placeholder etc), and match
other browsers better.

The general set-up is:

  <text-control-editing-root/>
  <placeholder/>
  <autofill-preview/>

text-control-editing-root is always inline-block and always displayed
(since it's what grabs the focus / shows the caret). If the
autofill-preview or placeholder are displayed, the editing-root is
zero-width and clipped (note that for placeholder that's guaranteed
because placeholder is only shown with an empty value, but
autofill-preview needs it).

placeholder and autofill-preview are hidden via `display` rather than
visibility. This doesn't make a difference with this patch but it
matters for bug 1977176.

Caret painting needs an extra hop to paint atop the placeholder (no
observable behavior change, but worth calling out).

There is one subtle behavior change, which is that single-line inputs
never report scrollable overflow in the block axis. This matches other
browsers (see the tweak in nsBlockFrame's overflow computation) and is
needed to avoid regressing scrollable-overflow-padding-input.html.

The changes in window_composition_text_querycontent.xhtml are needed
because before this patch, the height of the control editing root was
always the height of the whole textarea. The characters you're composing
might legitimately be taller than the line. Bump the line height so that
that doesn't happen in this test.

Differential Revision: https://phabricator.services.mozilla.com/D293666
2026-04-15 23:25:11 +00:00
Masayuki Nakano ad61492d2b Bug 1826272 - Make TextControlState::mTextListener live longer r=emilio
I've not understand why the crash occurs. To reproduce the crash, we
need the following conditions:
1. `mTextListener` is `nullptr` when `SetValue()` is called [1]
2. `mEditorInitialized` is `true` when setting the value [2]

`mTextListener` is initialized when the text control frame is
initialized [3]. So, there are 2 possible scenarios:
1. `PrepareEditor()` is called before the frame is initialized
2. `PrepareEditor()` creates the editor during a call of `SetValue()`

It seems that the first scenario is impossible because `PrepareEditor()`
needs `mSelCon` and the shadow DOM which are created when the frame is
created [4].

Additionally, the second scenario should be impossible too because
`PrepareEditor()` does nothing during setting value [5].

So, to reproduce the crash, it might require to destroy the frame
temporarily and set the value. However, I haven't found the case yet.
Interestingly, the crash report has not been reported in 150. However,
the most crash reports came from the release channel. Therefore, the
reproducible website may not be used by our tests. Thus, we cannot
consider whether it's already fixed.

Additionally, `TextControlState::mTextListener` may be recreated with
complicated situation changes and once it's created, the handling things
should be handled with the latest one. However,
`AutoTextControlHandlingState` keeps storing the old one which are set
when they are created.

To avoid complicated things about `TextInputListener` instance, we
should make `TextControlState::mTextListener` (renamed to
`mTextInputListener` in this patch) live until the `TextEditor` is
completely discarded when the text control element is disconnected or
the `<input>` element type is changed to a non-singleline text control.
Then, `TextEditor` and `TextControlState` can work with the single
`TextInputListener` instance. Then, `AutoTextControlHandlingState` does
not need to store the instance because it can refer the instance via
`TextControlState`.

1. https://searchfox.org/firefox-main/rev/5ff69e076a8d8cc38707e29d5a8d7c42d5798a8b/dom/html/TextControlState.cpp#2288-2289
2. https://searchfox.org/firefox-main/rev/5ff69e076a8d8cc38707e29d5a8d7c42d5798a8b/dom/html/TextControlState.cpp#2288-2289,2407-2408
3. https://searchfox.org/firefox-main/rev/5ff69e076a8d8cc38707e29d5a8d7c42d5798a8b/layout/forms/nsTextControlFrame.cpp#413-414,427-428
4. https://searchfox.org/firefox-main/rev/5ff69e076a8d8cc38707e29d5a8d7c42d5798a8b/dom/html/TextControlState.cpp#1556-1557
5. https://searchfox.org/firefox-main/rev/5ff69e076a8d8cc38707e29d5a8d7c42d5798a8b/dom/html/TextControlState.cpp#1484-1487

Make `TextInputListener` live longer

Differential Revision: https://phabricator.services.mozilla.com/D292688
2026-04-13 02:51:14 +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
Emilio Cobos Álvarez 3f1228e02a Bug 2014481 - Fix selection dragging when reframed. r=masayuki
When reframed, our frame selection might be reinitialized, losing the
drag state. Fix that up. A bit hacky, better ideas welcome, but I think
it's ok.

Differential Revision: https://phabricator.services.mozilla.com/D292907
2026-04-09 11:23:24 +00:00
Silaghi 1d00c5108d Revert "Bug 2014481 - Fix selection dragging when reframed. r=masayuki" for causing build bustages at TextControlState
This reverts commit 6c9fd4f992.
2026-04-09 09:01:52 +00:00
Emilio Cobos Álvarez 6c9fd4f992 Bug 2014481 - Fix selection dragging when reframed. r=masayuki
When reframed, our frame selection might be reinitialized, losing the
drag state. Fix that up. A bit hacky, better ideas welcome, but I think
it's ok.

Differential Revision: https://phabricator.services.mozilla.com/D292907
2026-04-09 08:44:13 +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
Sylvestre Ledru 9eb1a31a98 Bug 2023419 - Remove Emacs/Vim modelines from dom/ r=emilio,media-playback-reviewers,webidl,padenot
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287843
2026-03-16 21:02:32 +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
Emilio Cobos Álvarez c6efbfab0d Bug 1989331 - Simplify editor teardown and init. r=masayuki,dom-core
There's no need to go through `SetValue()` etc, the value isn't supposed
to change, we're just changing where it's stored. Handle this the same
way as we handle the selection state.

The test_password_unmask_API changes restore behavior from before
bug 2020358 (I forgot to update the assert message). I don't think we
care much one way or another.

Differential Revision: https://phabricator.services.mozilla.com/D286300
2026-03-06 07:18:29 +00:00
Emilio Cobos Álvarez bdf597210e Bug 2020681 - More clean-ups after bug 2020358. r=masayuki,dom-core
Move more text editor handling to the DOM, and remove more dead layout
code.

We need to move NeedToInitializeEditorForEvent down to
TextControlElement since the eager initialization of textarea was
papering over stuff.

The change needed in test_bug300691-1.html is a progression, I think.
Plain focus() generally puts the caret at the start rather than the end.

Differential Revision: https://phabricator.services.mozilla.com/D285755
2026-03-04 13:35:53 +00:00
Andreea Silaghi 90af8fd3d4 Revert "Bug 2020681 - More clean-ups after bug 2020358. r=masayuki,dom-core" for causing mochitest failures
This reverts commit 5a2bd42ae8.
2026-03-04 10:27:55 +00:00
Emilio Cobos Álvarez 5a2bd42ae8 Bug 2020681 - More clean-ups after bug 2020358. r=masayuki,dom-core
Move more text editor handling to the DOM, and remove more dead layout
code.

We need to move NeedToInitializeEditorForEvent down to
TextControlElement since the eager initialization of textarea was
papering over stuff.

The change needed in test_bug300691-1.html is a progression, I think.
Plain focus() generally puts the caret at the start rather than the end.

Differential Revision: https://phabricator.services.mozilla.com/D285755
2026-03-04 08:32:38 +00:00
Emilio Cobos Álvarez 8654928b61 Bug 2020358 - Untangle TextEditor from nsTextControlFrame a bit. r=masayuki,dom-core
After bug 2016280, there should be no need for TextControlState to
depend so much on layout.

Differential Revision: https://phabricator.services.mozilla.com/D285510
2026-03-03 09:16:10 +00:00
Emilio Cobos Álvarez 5624defbfd Bug 2016280 - Use shadow DOM for editor. r=masayuki,dom-core,smaug,Jamie
There's still a ton of things that can be cleaned up after this, but
this setup is nicer.

For now, editor keeps getting set-up / torn down on BindToFrame. Seems
all that could be untangled, but step by step.

The preview stuff and placeholder can just be created on demand now,
rather than requiring frame reconstruction.

Also, nsSearchControlFrame and co no longer do anything of interest, so
move the still relevant bits elsewhere and remove them.

test_bug1248459.html is removed because it messes with the editor
selection using SpecialPowers, in a way such that it crosses shadow
boundaries, and messes up the selected state triggering debug asserts.

test_focus_docnav.xhtml now triggers a different code-path because of
the shadow root (rather than the frame tree traversal). Keep it working
for now by replacing it with something that isn't a shadow root.

Differential Revision: https://phabricator.services.mozilla.com/D282953
2026-02-17 09:53:01 +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
Emilio Cobos Álvarez 256e9aa1ec Bug 1998225 - Remove some unused nsView includes. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D271260
2025-11-04 19:06:23 +00:00
Kagami Sascha Rosylight dfa52bf95c Bug 1993351 - Set selection as dirty when unbinding from frame r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D268527
2025-10-16 18:14:27 +00:00
agoloman 9c5a10468e Revert "Bug 1993351 - Set selection as dirty when unbinding from frame r=masayuki" for causing wpt failures @selection-after-whitespace-change.html.
This reverts commit 11fd6a9e9e.
2025-10-15 14:28:29 +00:00
Kagami Sascha Rosylight 11fd6a9e9e Bug 1993351 - Set selection as dirty when unbinding from frame r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D268527
2025-10-15 07:59:57 +00:00
Emilio Cobos Álvarez b59df383b0 Bug 1992551 - Simplify text editor value getter. r=smaug
Textarea no longer creates newlines in the middle (it only has a
trailing newline for caret positioning purposes), so this is equivalent
but avoids going through nsDocumentEncoder, nsPlainTextSerializer and so
on...

Differential Revision: https://phabricator.services.mozilla.com/D267509
2025-10-04 19:39:53 +00:00
Emilio Cobos Álvarez 455c0b0a8d Bug 1992452 - Remove UpdateValueDisplay calls on PrepareEditor. r=smaug
PrepareEditor initializes and sets up the DOM as well so there's no need
for doing it twice.

This causes a behavior change in test_bug1785739, but I think it's a
progression, as before there were two calls to find() that ended up with
the same range.

Differential Revision: https://phabricator.services.mozilla.com/D267437
2025-10-03 21:54:46 +00:00
Emilio Cobos Álvarez 62c170d960 Bug 1568313 - Fix <textarea wrap=hard>. r=smaug
Move the handling only to form submission which is where it belongs.

Differential Revision: https://phabricator.services.mozilla.com/D267385
2025-10-03 18:17:04 +00:00
Emilio Cobos Álvarez b312b2abae Bug 1992425 - Remove unused argument to UpdateValueDisplay. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D267424
2025-10-03 16:27:43 +00:00
Emilio Cobos Álvarez a01807ac58 Bug 1987024 - Share command tables across windows / editors / etc. r=masayuki
It seemed like this was the intention from the code, but it
isn't the case?

I want to use the window command table to always return the
supported commands over IPC (in order to fix bug 1964901).

Differential Revision: https://phabricator.services.mozilla.com/D263818
2025-09-05 10:31:02 +00:00
Emilio Cobos Álvarez 4cc59a7d42 Bug 1987024 - Remove nsIControllerContext. r=masayuki
It only has one implementation, and all the context objects
support weak references.

Differential Revision: https://phabricator.services.mozilla.com/D263817
2025-09-05 10:30:58 +00:00
Ciprian Todea 69d5b0e19b Revert "Bug 1964901 - Call UpdateCommands("focus") when the window goes into the foreground / background. r=masayuki" for causing bc failures at browser_replacewithwindow_commands.js and wpt failures at append-image-using-illegal-map.html
This reverts commit 2db302bab5.
2025-08-13 11:38:49 +00:00
Emilio Cobos Álvarez 2db302bab5 Bug 1964901 - Call UpdateCommands("focus") when the window goes into the foreground / background. r=masayuki
This is basically a wallpaper that effectively restores the previous
behavior, pending deeper refactoring of how commands are enabled /
disabled on child processes.

Differential Revision: https://phabricator.services.mozilla.com/D258881
2025-08-13 09:52:49 +00:00
Jan-Niklas Jaeschke cb161a6f96 Bug 1949053, part 3 - Rename nsIContent::GetText() to GetCharacterDataBuffer(). r=masayuki,layout-reviewers,emilio
This patch renames the `nsIContent` interface that returns a `CharacterDataBuffer`
and also renames the variables its result is assigned to at the call sites.

Differential Revision: https://phabricator.services.mozilla.com/D259934
2025-08-06 08:48:05 +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 791917d8af Bug 1976665 - Sort headers in dom/. r=dom-core,media-playback-reviewers,webrtc-reviewers,dom-storage-reviewers,padenot,janv,smaug,jesup,jib
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.

Differential Revision: https://phabricator.services.mozilla.com/D256800
2025-08-05 11:47:34 +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 e46b69d89c Bug 85686 - Mimic Chromium's getSelection().toString() behaviour r=masayuki,dom-core,webidl,smaug
Basically when getSelection().toString() is called, Chromium may
return an serialization on a different content than Firefox.
This patch tries to address this webcompat issue by mimicing
the same behaviour.

We should still address the spec issues, but this seems to be
an acceptable compromise.

Differential Revision: https://phabricator.services.mozilla.com/D239657
2025-03-17 13:36:16 +00:00
Masayuki Nakano d74b5eae46 Bug 1954394 - Mark some nsFrameSelection methods which change selection r=jjaschke
Even in these days, we notify selection listeners of selection changes
**synchronously**.  Thus, we need to mark all selection change methods as
`MOZ_CAN_RUN_SCRIPT` even though they are safe in the most cases.

Depends on D241776

Differential Revision: https://phabricator.services.mozilla.com/D241778
2025-03-17 12:49:59 +00:00
Masayuki Nakano 0ef5624d51 Bug 1954020 - Rename "limiter" of nsFrameSelection to "independent selection root element" r=emilio
It's currently always set to the native anonymous `<div>` for editable content
of text control element.  So, it means that it's an independent selection root.

Depends on D241587

Differential Revision: https://phabricator.services.mozilla.com/D241775
2025-03-17 12:49:58 +00:00