935 Commits

Author SHA1 Message Date
David Shin
4dc4e2d920 Bug 1942715: Part 4 - Switch to using a more transparent wrapper. r=firefox-style-system-reviewers,emilio
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.

Differential Revision: https://phabricator.services.mozilla.com/D237097
2025-02-12 01:31:30 +00:00
Butkovits Atila
e51ff081c6 Backed out 6 changesets (bug 1942715) for causing build bustages. CLOSED TREE
Backed out changeset 1433202bd2f3 (bug 1942715)
Backed out changeset d9ce2be09cd0 (bug 1942715)
Backed out changeset 9789581a42a3 (bug 1942715)
Backed out changeset 9a18f1aca5d5 (bug 1942715)
Backed out changeset 46bd0cb031f4 (bug 1942715)
Backed out changeset 73fec8bae045 (bug 1942715)
2025-02-12 01:45:46 +02:00
David Shin
c536f3deb5 Bug 1942715: Part 4 - Switch to using a more transparent wrapper. r=firefox-style-system-reviewers,emilio
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.

Differential Revision: https://phabricator.services.mozilla.com/D237097
2025-02-11 21:06:24 +00:00
Butkovits Atila
fd3125f8e5 Backed out 6 changesets (bug 1942715) for causing build bustages. CLOSED TREE
Backed out changeset 7c5cfe6bbaeb (bug 1942715)
Backed out changeset cc5530b02046 (bug 1942715)
Backed out changeset 5a534f455cc3 (bug 1942715)
Backed out changeset ecdd7307c9f1 (bug 1942715)
Backed out changeset 05a62c484807 (bug 1942715)
Backed out changeset a9825ee69550 (bug 1942715)
2025-02-11 22:17:26 +02:00
David Shin
96712d3db0 Bug 1942715: Part 4 - Switch to using a more transparent wrapper. r=firefox-style-system-reviewers,emilio
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.

Differential Revision: https://phabricator.services.mozilla.com/D237097
2025-02-11 18:19:56 +00:00
Otto Länd
601b7c4b76 Bug 1945944: apply code formatting via Lando
# ignore-this-changeset
2025-02-06 15:52:02 +00:00
David Shin
61d5b05704 Bug 1945944: Add flag to dump frame tree with only deterministic information for diffing. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D236797
2025-02-06 15:34:27 +00:00
David Shin
3d615cb7f6 Bug 1923763: Part 5 - Replace inset evaluations with anchor-resolved inset evaluations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231259
2025-01-21 15:11:25 +00:00
Stanca Serban
4a35296e0c Backed out 7 changesets (bug 1923763) for causing build bustages in nsStyleStruct.cpp. CLOSED TREE
Backed out changeset d55070e64ced (bug 1923763)
Backed out changeset a92a0bc6047f (bug 1923763)
Backed out changeset 2203e2c5268e (bug 1923763)
Backed out changeset 0cc5e744c01a (bug 1923763)
Backed out changeset d2139afa933b (bug 1923763)
Backed out changeset 93e59980eac1 (bug 1923763)
Backed out changeset 8018734b5491 (bug 1923763)
2025-01-21 11:10:22 +02:00
David Shin
6b9f17e7ff Bug 1923763: Part 5 - Replace inset evaluations with anchor-resolved inset evaluations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231259
2025-01-20 23:54:50 +00:00
David Shin
7b3846c45d Bug 1941075: Let -moz-available in abs-positioned element block-size behave as stretch-fit. r=dholbert,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D234057
2025-01-15 18:17:25 +00:00
Stanca Serban
e00a8a6c89 Backed out changeset 17664755d23f (bug 1941075) for causing multiple wpt failures. 2025-01-14 02:23:01 +02:00
David Shin
b2967d0178 Bug 1941075: Let -moz-available in abs-positioned element block-size behave as auto. r=dholbert,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D234057
2025-01-13 21:26:02 +00:00
David Shin
f48b3b8c8b Bug 1940084: Print whether a frame's content has a display port to debug frame dump. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D233262
2025-01-07 18:32:33 +00:00
Daniel Holbert
d153465dd3 Bug 1933408 part 1: Implement layout support for 'stretch' as a block-axis size (with '-webkit-fill-available' as an alias). r=TYLin
Note that both keywords are disabled in the CSS parser for now, behind
these about:config prefs:
layout.css.stretch-size-keyword.enabled
layout.css.webkit-fill-available.enabled

Prior to this patch, we handled both keywords as pure aliases for
'-moz-available' (which has the correct 'stretch' behavior in the inline axis
but which just behaves like the initial value in the block axis).

This patch changes that so that 'stretch' and '-webkit-fill-available' will now
actually do the right thing in the block axis (if they're enabled at all, via
their aforementioned about:config prefs).

The relevant spec text here is:
https://drafts.csswg.org/css-sizing-4/#valdef-width-stretch
https://drafts.csswg.org/css-sizing-4/#stretch-fit-sizing

Differential Revision: https://phabricator.services.mozilla.com/D217688
2024-12-14 06:35:06 +00:00
David Shin
339508eeab Bug 1936450: Change abspos fit-content sizing so as not to provide a basis for percent resolution in its children. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231996
2024-12-13 14:00:02 +00:00
Timothy Nikkel
1e6ed2fe24 Bug 1935988. Don't bother trying to remove a frame property in InvalidateDirectRenderingObservers if the frame is being destroyed. r=layout-reviewers,emilio
The frame destroy will tear down all the properties, no need to search for one specific property and maybe remove it before that.

This shows up in profiles.

Differential Revision: https://phabricator.services.mozilla.com/D231531
2024-12-11 13:12:53 +00:00
Alexandru Marc
a090fc9187 Backed out changeset 5f819082a015 (bug 1936189) for causing reftest failures @ native-theme/470711-1.xhtml CLOSED TREE 2024-12-11 14:59:54 +02:00
Timothy Nikkel
8c283349ba Bug 1936189. Only do -moz-subtree-hidden-only-visually checks in the parent process. r=layout-reviewers,emilio
This is a chrome only css property (so it could still be used in a UA sheet that is applied to a content document) that was created solely to tabs/xul decks in a fashion that is more like the rest of css/html. And it still only has that single use in our tree. A UA sheet applying this property to content it doesn't control doesn't seem like it could be very useful.

Even those these checks are simple they are relatively costly because we check them on every frame and when we are traversing the frame tree (for display list building or setting a displayport) we are often memory bound, so pulling in another bit of otherwise cold memory for a rare style struct makes us wait for loading more memory and pushes more useful stuff out of caches. The parent process check remains very quick as verified by profiling.

Differential Revision: https://phabricator.services.mozilla.com/D231648
2024-12-11 09:35:37 +00:00
Timothy Nikkel
342427dbca Bug 1933423. Only create nsDisplayFixedPosition if painting to the window. r=botond
The only thing that useFixedPosition controls is whether we create a nsDisplayFixedPosition item. The only things that nsDisplayFixedPosition does different are things that only affect painting to the window (CreateWebRenderCommands, UpdateScrollData, ShouldGetFixedAnimationId).

I don't think this causes any behaviour difference, but we only need a nsDisplayFixedPosition item if we are painting to the window.

Differential Revision: https://phabricator.services.mozilla.com/D230243
2024-12-07 11:26:11 +00:00
Daniel Holbert
bec95b2ab5 Bug 1935547 part 2: Introduce a "ComputeStretchContentBoxSize" helper to use in places where we're resolving something like the 'stretch' keyword. r=layout-reviewers,emilio
This patch doesn't change behavior[1]; it's just a refactor.

[1] Minor caveat: the "availBased" variables in this patch are now floored-to-0
whereas previously they were not.  In cases where these variables weren't
getting seprately-clamped, this is a bit of a behavior-change, but it's a step
towards correctness to floor this size-measurement to be nonnegative.

Differential Revision: https://phabricator.services.mozilla.com/D230228
2024-12-06 08:03:15 +00:00
Daniel Holbert
1072365adc Bug 1935547 part 1: Rename several "bool stretch" vars to clarify that they're about the alignment keyword and not the sizing keyword. r=layout-reviewers,emilio
This is just a variable rename to help avoid ambiguity when we add support for
the 'stretch' size keyword. This has no functional change.

Differential Revision: https://phabricator.services.mozilla.com/D230227
2024-12-06 08:03:15 +00:00
Jan-Niklas Jaeschke
32b0a740b7 Bug 1933738, part 2 - Change all calls to nsFrameSelection::GetSelection(eNormal) to nsFrameSelection::NormalSelection(). r=emilio
`nsFrameSelection::NormalSelection()` returns a `Selection&`, which eliminates the need for nullptr check at call sites.
This simplifies the code in some places and removes unnecessarily indented blocks.

Differential Revision: https://phabricator.services.mozilla.com/D230583
2024-11-29 07:31:58 +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
Jonathan Kew
55066c9ce0 Bug 1887465 - Introduce UsedFloat and UsedClear types in layout, for the used values of CSS float and clear properties after resolving logical values. r=layout-reviewers,emilio
No change in behavior, just makes it clearer when we're working with used values
where the inline-* logical values have been resolved.

Differential Revision: https://phabricator.services.mozilla.com/D230029
2024-11-25 22:58:47 +00:00
Jonathan Kew
0813b3e111 Bug 1887465 - Use the containing block's writing mode to resolve logical values for CSS float and clear properties. r=layout-reviewers,emilio
And don't resolve them prematurely; the computed value should remain
logical, and only be mapped to physical sides at use time.

Differential Revision: https://phabricator.services.mozilla.com/D229998
2024-11-25 22:58:46 +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
a9411f45b2 Bug 1933230 - Remove unused -moz-window-transform-origin property. r=devtools-reviewers,jwatt
The only transforms we use are translation transforms which don't
change, so we can just remove it.

Differential Revision: https://phabricator.services.mozilla.com/D230128
2024-11-25 19:44:02 +00: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
Alexandru Marc
ed1511635d Backed out 2 changesets (bug 1887465) for causing build bustages @ WritingModes.h . CLOSED TREE
Backed out changeset 5203c09eceb4 (bug 1887465)
Backed out changeset 0507fcccf575 (bug 1887465)
2024-11-25 18:47:23 +02:00
Jonathan Kew
4d1ec66bf7 Bug 1887465 - Introduce UsedFloat and UsedClear types in layout, for the used values of CSS float and clear properties after resolving logical values. r=layout-reviewers,emilio
No change in behavior, just makes it clearer when we're working with used values
where the inline-* logical values have been resolved.

Differential Revision: https://phabricator.services.mozilla.com/D230029
2024-11-25 14:02:27 +00:00
Jonathan Kew
64fa9b6bb6 Bug 1887465 - Use the containing block's writing mode to resolve logical values for CSS float and clear properties. r=layout-reviewers,emilio
And don't resolve them prematurely; the computed value should remain
logical, and only be mapped to physical sides at use time.

Differential Revision: https://phabricator.services.mozilla.com/D229998
2024-11-25 14:02:26 +00:00
Emilio Cobos Álvarez
96b969dae6 Bug 1933094 - Remove nsIFrame::GetAncestorWithView. r=dholbert
It's unused.

Differential Revision: https://phabricator.services.mozilla.com/D230052
2024-11-25 00:09:12 +00:00
Emilio Cobos Álvarez
a74d10350e Bug 1933094 - Move CreateView to nsSubDocumentFrame. r=dholbert
It's the only caller and we don't want to introduce more.

Differential Revision: https://phabricator.services.mozilla.com/D230051
2024-11-25 00:09:12 +00:00
Emilio Cobos Álvarez
9b7c8b2581 Bug 1933094 - Update an assertion to reflect that nsListControlFrame can no longer have views. r=dholbert
No behavior change, just update the assertion to match reality.

Differential Revision: https://phabricator.services.mozilla.com/D230050
2024-11-25 00:09:11 +00:00
Emilio Cobos Álvarez
074210e88e Bug 1932800 - Use ShouldHaveLineIfEmpty() to guarantee buttons have at least one line of height. r=dshin
This is similar to how we treat <div contenteditable>, and allows us to
remove the specialness about anon boxes.

Differential Revision: https://phabricator.services.mozilla.com/D229939
2024-11-24 14:46:16 +00:00
Emilio Cobos Álvarez
b1269ccea6 Bug 1932800 - Fix caret baseline of empty inline and text frames. r=dshin
Added Gecko reftests because I don't know what the best place to put
them in WPT is, and caret rendering is kind of undefined, but...

Differential Revision: https://phabricator.services.mozilla.com/D229926
2024-11-24 14:46:16 +00:00
Goloman Adrian
caa559759f Backed out 3 changesets (bug 1932800) for causing marionette failures @test_accessiblecaret_cursor_mode.py. CLOSED TREE
Backed out changeset f40a44add850 (bug 1932800)
Backed out changeset 7cda61151052 (bug 1932800)
Backed out changeset 4974ccf274fa (bug 1932800)
2024-11-24 15:16:48 +02:00
Emilio Cobos Álvarez
33d4e05e42 Bug 1932800 - Use ShouldHaveLineIfEmpty() to guarantee buttons have at least one line of height. r=dshin
This is similar to how we treat <div contenteditable>, and allows us to
remove the specialness about anon boxes.

Differential Revision: https://phabricator.services.mozilla.com/D229939
2024-11-23 12:46:49 +00:00
Emilio Cobos Álvarez
b121dde1da Bug 1932800 - Fix caret baseline of empty inline and text frames. r=dshin
Added Gecko reftests because I don't know what the best place to put
them in WPT is, and caret rendering is kind of undefined, but...

Differential Revision: https://phabricator.services.mozilla.com/D229926
2024-11-23 12:46:48 +00:00
Sandor Molnar
e7348a5625 Backed out 3 changesets (bug 1932800) for causing reftest failures. CLOSED TREE
Backed out changeset c06b939ca2f2 (bug 1932800)
Backed out changeset 048956318eb0 (bug 1932800)
Backed out changeset 333442d03d1a (bug 1932800)
2024-11-23 12:40:11 +02:00
Emilio Cobos Álvarez
775a22ff40 Bug 1932800 - Use ShouldHaveLineIfEmpty() to guarantee buttons have at least one line of height. r=dshin
This is similar to how we treat <div contenteditable>, and allows us to
remove the specialness about anon boxes.

Differential Revision: https://phabricator.services.mozilla.com/D229939
2024-11-23 09:00:29 +00:00
Emilio Cobos Álvarez
8121200d6a Bug 1932800 - Fix caret baseline of empty inline and text frames. r=dshin
Added Gecko reftests because I don't know what the best place to put
them in WPT is, and caret rendering is kind of undefined, but...

Differential Revision: https://phabricator.services.mozilla.com/D229926
2024-11-23 09:00:29 +00:00
Emilio Cobos Álvarez
4647f93559 Bug 1932800 - Add a check to SelfIsSelectable to preserve editor drag and drop behavior. r=masayuki
We were relying on editable text frames not being empty. We fixed that
on the previous patches but this caused editor d&d to break.

For now this preserves the selection behavior. In the future we should
look into removing the IsEmpty() condition or so, probably, or make it
more subtle.

Differential Revision: https://phabricator.services.mozilla.com/D229996
2024-11-23 08:58:14 +00:00
Emilio Cobos Álvarez
fb7777f241 Bug 1932800 - Fold IsEmpty check into SelfIsSelectable(). r=dshin
All the callers check both conditions, so no behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D229995
2024-11-22 22:10:48 +00:00
Ting-Yu Lin
8af89b0f89 Bug 1926015 Part 2 - Construct a percentage basis when calling MinISize() in nsIFrame::ComputeSize(). r=dholbert
We should construct a percentage basis like we did in
nsIFrame::ComputeISizeValue().
https://searchfox.org/mozilla-central/rev/75de397838825ba741820fec27225342ba15fd5b/layout/generic/nsIFrame.cpp#7076-7082

This is necessary to pass `intrinsic-percent-replaced-027.html` (added in the
next part).

Differential Revision: https://phabricator.services.mozilla.com/D229750
2024-11-21 19:55:32 +00:00
Adi
b34823b0fe Backed out 5 changesets (bug 1926015) for causing crashtest failures @1730506.html. CLOSED TREE
Backed out changeset 7df628ab162c (bug 1926015)
Backed out changeset a3524c96da73 (bug 1926015)
Backed out changeset cfbf0fa7bf8d (bug 1926015)
Backed out changeset 2c2f56268bd7 (bug 1926015)
Backed out changeset 55175ed82058 (bug 1926015)
2024-11-21 21:28:08 +02:00
Ting-Yu Lin
674908a2e6 Bug 1926015 Part 2 - Construct a percentage basis when calling MinISize() in nsIFrame::ComputeSize(). r=dholbert
We should construct a percentage basis like we did in
nsIFrame::ComputeISizeValue().
https://searchfox.org/mozilla-central/rev/75de397838825ba741820fec27225342ba15fd5b/layout/generic/nsIFrame.cpp#7076-7082

This is necessary to pass `intrinsic-percent-replaced-027.html` (added in the
next part).

Differential Revision: https://phabricator.services.mozilla.com/D229750
2024-11-21 17:04:15 +00:00
Timothy Nikkel
199fbc82e1 Bug 1931791. Optimize nsIFrame::HasAnimationOfTransform. r=layout-reviewers,emilio
nsCSSPropertyIDSet::IsSubsetOf shows up as a significant chunk of painting. Turns out we can avoid that cost if MayHaveTransformAnimation is false, but its a little awkward because it's a bit seperated, so I included some asserts to make sure things stay in sync.

Differential Revision: https://phabricator.services.mozilla.com/D229284
2024-11-19 07:34:46 +00:00
Jonathan Watt
7532be254f Bug 1931736. Add missing braces around if/loop statements in layout/generic/. r=layout-reviewers,emilio
Depends on D229247

Differential Revision: https://phabricator.services.mozilla.com/D229248
2024-11-17 05:03:58 +00:00