Commit Graph
930 Commits
Author SHA1 Message Date
Eugeniusz Lewandowski fc8097fcc3 Bug 1650944 - Remove ReflowInput.h include from nsIFrame.h r=firefox-style-system-reviewers,layout-reviewers,emilio
Removed the Reflow Input in nsIFrame. Added includes for ReflowInput as
necessary in cpp files. Also Forward Declared nsLineLayout in 3 header
files.

Differential Revision: https://phabricator.services.mozilla.com/D298203
2026-05-04 12:06:23 +00:00
Emilio Cobos Álvarez 078e3b6871 Bug 2032987 - Apply min/max block size to field control's fixed size. r=layout-reviewers,dshin
Matches ComputedSizeWithBSizeFallback (and common sense).

Differential Revision: https://phabricator.services.mozilla.com/D295035
2026-04-17 18:50:00 +00:00
Emilio Cobos Álvarez eaf0d03637 Bug 1977176 - Implement field-sizing for <input> / <textarea>. r=keithamus,layout-reviewers,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D294135
2026-04-17 08:32:03 +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
serge-sans-paille d58c18b09a Bug 2030235 - Decouple ServoStyleConsts from nsGkAtoms.h r=emilio,necko-reviewers,geckoview-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,kershaw,m_kato
And remove unused includes of nsGkAtoms.h in the process. The few
dependencies have been moved to ServoStyleConstsInlines.h

The used command to remove the now unused dependency was:

git grep -l nsGkAtoms.h | while read line; do grep -v nsGkAtoms.h $line | grep -q -E '\<nsGkAtoms\>' || sed -i -e '/nsGkAtoms.h/d' $line  ; done

Differential Revision: https://phabricator.services.mozilla.com/D292697
2026-04-09 10:05:25 +00:00
Silaghi 81930b22ee Revert "Bug 2030235 - Decouple ServoStyleConsts from nsGkAtoms.h r=emilio,necko-reviewers,geckoview-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,kershaw,m_kato" for causing build bustages at style/nsStyleUtil
This reverts commit b97e69b590.
2026-04-09 08:09:15 +00:00
serge-sans-paille b97e69b590 Bug 2030235 - Decouple ServoStyleConsts from nsGkAtoms.h r=emilio,necko-reviewers,geckoview-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,kershaw,m_kato
And remove unused includes of nsGkAtoms.h in the process. The few
dependencies have been moved to ServoStyleConstsInlines.h

The used command to remove the now unused dependency was:

git grep -l nsGkAtoms.h | while read line; do grep -v nsGkAtoms.h $line | grep -q -E '\<nsGkAtoms\>' || sed -i -e '/nsGkAtoms.h/d' $line  ; done

Differential Revision: https://phabricator.services.mozilla.com/D292697
2026-04-09 06:41:33 +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
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
Emilio Cobos Álvarez 11fe7131f6 Bug 2017011 - Less pointer chasing to get to a NodeInfoManager. r=dom-core,smaug
Noticed from the previous patch.

Differential Revision: https://phabricator.services.mozilla.com/D283481
2026-02-16 11:05:58 +00:00
Emilio Cobos Álvarez 6f9253d99a Bug 2015488 - Add ::backdrop support for text controls. r=layout-reviewers,dshin
Differential Revision: https://phabricator.services.mozilla.com/D282499
2026-02-10 11:40:36 +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
serge-sans-paille c3b06ff4b4 Bug 1997165 - Remove unused mfbt inclusion in layout/** r=emilio,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,dshin,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D270577
2025-10-29 22:18:06 +00:00
serge-sans-paille 2680f1aa2a Bug 1995938 - Remove unused inclusion of DebugOnly.h r=emilio,necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,toolkit-telemetry-reviewers,firefox-svg-reviewers,layout-reviewers,dom-worker-reviewers,bytesized,gstoll,mstange,TYLin,chunmin,jesup,asuth
Differential Revision: https://phabricator.services.mozilla.com/D269780
2025-10-27 10:48:42 +00:00
Cristian Tuns 6f66cdf3c7 Revert "Bug 1995938 - Remove unused inclusion of DebugOnly.h r=emilio,necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,toolkit-telemetry-reviewers,firefox-svg-reviewers,layout-reviewers,dom-worker-reviewers,bytesized,gstoll,mstange,TYLin,chunmin,jesup,asuth" for causing build bustages in TargetFunction.h
This reverts commit 10e5184168.
2025-10-27 08:58:03 +00:00
serge-sans-paille 10e5184168 Bug 1995938 - Remove unused inclusion of DebugOnly.h r=emilio,necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,toolkit-telemetry-reviewers,firefox-svg-reviewers,layout-reviewers,dom-worker-reviewers,bytesized,gstoll,mstange,TYLin,chunmin,jesup,asuth
Differential Revision: https://phabricator.services.mozilla.com/D269780
2025-10-27 08:00:43 +00:00
Emilio Cobos Álvarez 1a9bdcf11b Bug 1993353 - Remove NS_FRAME_INDEPENDENT_SELECTION. r=layout-reviewers,dshin
It's only used to check the closest text control. We can abuse the fact
that nsTextControlFrame only has anonymous kids instead to make checking
for a containing text control fast in the common case.

Differential Revision: https://phabricator.services.mozilla.com/D268110
2025-10-09 11:56:06 +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 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 d5bae296c2 Bug 1787062 - Remove unneeded check. r=masayuki,layout-reviewers,dshin
The comment just isn't true, the anonymous content is created by
UpdateValueDisplay unconditionally now.

Differential Revision: https://phabricator.services.mozilla.com/D267254
2025-10-03 09:17:39 +00:00
Emilio Cobos Álvarez f4ee9ffe08 Bug 1787062 - Unify how <input> and <textarea> get initialized a bit. r=masayuki,smaug
Make the anonymous content creation synchronously so that we don't need
to update layout after-the-fact, and make editor creation lazy like we
do for <input>.

I think we should try to remove the trailing <br> for <textarea> after
this (just so that editor doesn't insert it). But this is green on try
and fixes the issue so worth landing incrementally.

Differential Revision: https://phabricator.services.mozilla.com/D267252
2025-10-03 09:17:12 +00:00
Emilio Cobos Álvarez 7ce636a5d6 Bug 1991643 - Don't use overflow-clip-margin to implement single-line <input> special-case. r=tnikkel,layout-reviewers
Instead, just don't propagate inline padding to single-line <input>
scrollers.

This causes one web-observable behavior change which is that the
scroll{Width,Left} of the <input> changes. However this seems the
right thing to do API-wise, the client area doesn't include the
inline padding.

If this causes compat issues, it should be easy to special-case in
Element::GetClientAreaRect (but I'm hoping that's not the case, given
only one test is affected, and is a test I wrote).

Differential Revision: https://phabricator.services.mozilla.com/D266788
2025-09-30 10:51:06 +00:00
Emilio Cobos Álvarez 67ec7b59e0 Bug 1990448 - Do content-visibility checks on the container. r=layout-reviewers,dshin
No behavior change, but this saves some per-child work and conceptually
is the right thing to do. HidesContent() is non-trivial.

Add an assertion to make sure we don't enter BuildDisplayListForChild
at all if content is hidden.

I audited all the callers, and the ones I didn't touch can't have
content-visibility (things like the viewport / pages / etc).

Differential Revision: https://phabricator.services.mozilla.com/D265956
2025-09-24 15:11:22 +00:00
Masayuki Nakano 784537b41e Bug 769207 - part 2: Make nsIFrame use new enum class to receive the type of attribute change r=smaug,dom-core,dshin
`MutationEvent_Bindings::MODIFICATION`,
`MutationEvent_Bindings::ADDITION` and `MutationEvent_Bindings::REMOVAL`
will be removed.  Therefore, we need alternative `enum class` for that.
This patch makes `nsIFrame` and subclasses use the new one.

Differential Revision: https://phabricator.services.mozilla.com/D263053
2025-09-08 00:27:36 +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
Frédéric Wang 4cca1cbaa3 Bug 1928932 - Part 1 - Add an mIsTrusted flag on script elements. r=smaug,credential-management-reviewers,dimi
This flag can be modified when notifying for character data change,
content appending, content insertion and content removal by specifying
a MutationEffectOnScript flag. By default callers other than the HTML5
parsers always specify "drop trustworthiness" but mIsTrusted flag is not
used anyway, so there is no behavior change.

Spec: https://w3c.github.io/trusted-types/dist/spec/#enforcement-in-scripts
PR: https://github.com/w3c/trusted-types/pull/579/

Differential Revision: https://phabricator.services.mozilla.com/D252020
2025-06-27 15:23:24 +00:00
Cosmin Sabou a15f457eb6 Revert "Bug 1928932 - Part 1 - Add an mIsTrusted flag on script elements. r=smaug,credential-management-reviewers,dimi" for causing macOS build bustages on nsMenuGroupOwnerX.mm
This reverts commit ce2493cdd4.
2025-06-27 12:30:03 +00:00
Frédéric Wang ce2493cdd4 Bug 1928932 - Part 1 - Add an mIsTrusted flag on script elements. r=smaug,credential-management-reviewers,dimi
This flag can be modified when notifying for character data change,
content appending, content insertion and content removal by specifying
a MutationEffectOnScript flag. By default callers other than the HTML5
parsers always specify "drop trustworthiness" but mIsTrusted flag is not
used anyway, so there is no behavior change.

Spec: https://w3c.github.io/trusted-types/dist/spec/#enforcement-in-scripts
PR: https://github.com/w3c/trusted-types/pull/579/

Differential Revision: https://phabricator.services.mozilla.com/D252020
2025-06-27 11:18:48 +00:00
Masayuki Nakano 80089dd884 Bug 1946001 - Rename methods which return an independent nsFrameSelection to GetIndependentFrameSelection() r=emilio
The methods are now, `GetConstFrameSelection()` etc, but does not return
`const nsFrameSelection*`.  I believe that `GetIndependentFrameSelection()` is
clearer than the old names.

And also this patch adds `IsIndependentSelection()` and
`GetIndependentSelectionRootParentElement()` to make some callers of
`GetLimiter()` easier to read.

For the consistency, `GetLimiter()` should be renamed too, but I already have
a patch doing it in bug 1954020 and it's bigger.  Therefore, I leave it as-is
for now.

Differential Revision: https://phabricator.services.mozilla.com/D241774
2025-03-17 12:49:57 +00:00
Ting-Yu Lin 7a62bd35b7 Bug 421436 - Remove the hack that forces all <br> frames to be 1 app unit wide. r=emilio
That is, after this patch, the BRFrame's inline-size becomes zero.

This patch is based on the previous attempt [1] in this bug, and removes the
code added in Bug 1242781.

The test_bug1216483.html change is worth an explanation. Each sub-test verifies
the blinking cursor (caret) position after pressing down arrow key in an
contenteditable container. The expected position is to the right of the letter
"a". Before this patch, the `(anchorNode, anchorOffset)` was
`("element with '.second' style", 1)`. After this patch, it becomes
`("a", 1)`, which is a valid representation of the caret position and
matches Google Chrome's behavior.

[1] https://hg.mozilla.org/mozilla-central/rev/c3f1ab75ea51

Differential Revision: https://phabricator.services.mozilla.com/D238162
2025-02-22 04:43:30 +00:00
Narcis Beleuzu 6afaa70c13 Backed out 2 changesets (bug 421436) for mochitest failure on test_accessiblecaret_cursor_mode.py . CLOSED TREE
Backed out changeset 202dc9cb8c22 (bug 421436)
Backed out changeset 1d7a534b3e86 (bug 421436)
2025-02-17 23:24:36 +02:00
Ting-Yu Lin 224bcf2be2 Bug 421436 - Remove the hack that forces all <br> frames to be 1 app unit wide. r=emilio
That is, after this patch, the BRFrame's inline-size becomes zero.

This patch is based on the previous attempt [1] in this bug, and removes the
code added in Bug 1242781.

The test_bug1216483.html change is worth an explanation. Each sub-test verifies
the blinking cursor (caret) position after pressing down arrow key in an
contenteditable container. The expected position is to the right of the letter
"a". Before this patch, the `(anchorNode, anchorOffset)` was
`("element with '.second' style", 1)`. After this patch, it becomes
`("a", 1)`, which is a valid representation of the caret position and
matches Google Chrome's behavior.

[1] https://hg.mozilla.org/mozilla-central/rev/c3f1ab75ea51

Differential Revision: https://phabricator.services.mozilla.com/D238162
2025-02-17 17:38:15 +00:00
Goloman Adrian 1c84d56c0f Backed out changeset b58abcb2d3d7 (bug 421436) for causing multiple failures. CLOSED TREE 2025-02-14 22:52:57 +02:00
Ting-Yu Lin 6654a60cc7 Bug 421436 - Remove the hack that forces all <br> frames to be 1 app unit wide. r=emilio
This patch is based on the previous attempt [1] in this bug, and removes the
code added in Bug 1242781.

The test_bug1216483.html change is worth an explanation. Each sub-test verifies
the blinking cursor (caret) position after pressing down arrow key in an
contenteditable container. The expected position is to the right of the letter
"a". Before this patch, the `(anchorNode, anchorOffset)` was
`("element with '.second' style", 1)`. After this patch, it becomes
`("a", 1)`, which is a valid representation of the caret position and
matches Google Chrome's behavior.

[1] https://hg.mozilla.org/mozilla-central/rev/c3f1ab75ea51

Differential Revision: https://phabricator.services.mozilla.com/D238162
2025-02-14 19:27:43 +00:00
Masayuki Nakano 4e6fcb1183 Bug 1943228 - Rename methods GetSomethingWithoutCreation() to GetExtantSomething() r=edgar,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D235256
2025-01-23 23:47:28 +00:00
Emilio Cobos Álvarez 3c1b64acfe Bug 1940412 - Add batch removal information to nsIMutationObserver::ContentWillBeRemoved, and use it in some trivial-ish places. r=dom-core,credential-management-reviewers,sefeng
The idea is to use it on the style (via PresShell->RestyleManager) to do
invalidation faster in cases like bug 1940405.

Differential Revision: https://phabricator.services.mozilla.com/D233547
2025-01-15 20:39:40 +00:00
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