Commit Graph
801 Commits
Author SHA1 Message Date
Ting-Yu Lin 0a5e62e315 Bug 1909761 Part 4 - Construct a percentage basis when computing children's intrinsic inline size contributions. r=dholbert
A percentage basis is needed to resolve percentage block size when computing
children's intrinsic inline size contributions. This is necessary for a child or
descendants with a preferred aspect-ratio so that the block size can transfer
through the aspect-ratio to become an intrinsic inline size.

The change in `nsFlexContainerFrame::ComputeIntrinsicISize()` is necessary to
keep us passing
`testing/web-platform/tests/css/css-flexbox/image-nested-within-definite-column-flexbox.html`.

The change in `nsPlaceholderFrame::AddFloatToIntrinsicISizeData()` is necessary
to keep us passing
`testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-010.html`.

`GetISizeInfo()` in BasicTableLayoutStrategy.cpp is modified to pass table cell
frame's bsize as percentage basis. Otherwise,
`layout/reftests/bugs/522632-1.html` fails. This is our current behavior, but it
is bug 1461852.

Differential Revision: https://phabricator.services.mozilla.com/D219523
2024-09-03 04:25:42 +00:00
Ting-Yu Lin 116ca76700 Bug 1909761 Part 3 - Use IntrinsicSizeInput for AddInlineMinISize() and AddInlinePrefISize(). r=dholbert
Another preparation patch in order to pass down a percentage basis when
computing intrinsic size.

Differential Revision: https://phabricator.services.mozilla.com/D219522
2024-09-03 04:25:42 +00:00
Ting-Yu Lin 6af05a0977 Bug 1909761 Part 2 - Create a helper struct IntrinsicSizeInput to aggregate needed data when computing intrinsic inline size. r=dholbert
This patch changes the signature to `GetMinISize()`, `GetPrefISize()`,
`IntrinsicISize` by adding a helper struct as a preparation. Then we can just
add more data such as a percentage basis to the struct without altering the
signature in the future.

When passing `IntrinsicSizeInput` struct down to another helper method, we
generally just pass the original one if the method is computing the intrinsic
size of our own or our anonymous children. If the method is computing our
children's intrinsic contribution, we'll need to create a brand new
`IntrinsicSizeInput` for our children.

Differential Revision: https://phabricator.services.mozilla.com/D219521
2024-09-03 04:25:41 +00:00
Butkovits Atila 4d06404349 Backed out 6 changesets (bug 1909761) for causing failures at test_contextmenu_rtl.xhtml. CLOSED TREE
Backed out changeset 1e9f47784a54 (bug 1909761)
Backed out changeset d2dcf159185b (bug 1909761)
Backed out changeset 3f48c106bff9 (bug 1909761)
Backed out changeset 38d1e5eda09d (bug 1909761)
Backed out changeset 8de556490289 (bug 1909761)
Backed out changeset 4e7f22f43bb4 (bug 1909761)
2024-08-28 10:44:09 +03:00
Ting-Yu Lin 3ac03672b0 Bug 1909761 Part 4 - Construct a percentage basis when computing children's intrinsic inline size contributions. r=dholbert
A percentage basis is needed to resolve percentage block size when computing
children's intrinsic inline size contributions. This is necessary for a child or
descendants with a preferred aspect-ratio so that the block size can transfer
through the aspect-ratio to become an intrinsic inline size.

The change in `nsFlexContainerFrame::ComputeIntrinsicISize()` is necessary to
keep us passing
`testing/web-platform/tests/css/css-flexbox/image-nested-within-definite-column-flexbox.html`.

The change in `nsPlaceholderFrame::AddFloatToIntrinsicISizeData()` is necessary
to keep us passing
`testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-010.html`.

`GetISizeInfo()` in BasicTableLayoutStrategy.cpp is modified to pass table cell
frame's bsize as percentage basis. Otherwise,
`layout/reftests/bugs/522632-1.html` fails. This is our current behavior, but it
is bug 1461852.

Differential Revision: https://phabricator.services.mozilla.com/D219523
2024-08-28 06:18:45 +00:00
Ting-Yu Lin caac17bc1b Bug 1909761 Part 3 - Use IntrinsicSizeInput for AddInlineMinISize() and AddInlinePrefISize(). r=dholbert
Another preparation patch in order to pass down a percentage basis when
computing intrinsic size.

Differential Revision: https://phabricator.services.mozilla.com/D219522
2024-08-28 06:18:44 +00:00
Ting-Yu Lin f0ff97db90 Bug 1909761 Part 2 - Create a helper struct IntrinsicSizeInput to aggregate needed data when computing intrinsic inline size. r=dholbert
This patch changes the signature to `GetMinISize()`, `GetPrefISize()`,
`IntrinsicISize` by adding a helper struct as a preparation. Then we can just
add more data such as a percentage basis to the struct without altering the
signature in the future.

When passing `IntrinsicSizeInput` struct down to another helper method, we
generally just pass the original one if the method is computing the intrinsic
size of our own or our anonymous children. If the method is computing our
children's intrinsic contribution, we'll need to create a brand new
`IntrinsicSizeInput` for our children.

Differential Revision: https://phabricator.services.mozilla.com/D219521
2024-08-28 06:18:44 +00:00
Emilio Cobos Álvarez 521050f6c0 Bug 1915206 - Simplify SVG transforms a bit more. r=longsonr
We no longer need the concept of "local" transforms after bug 878346.

Local transforms that we'd need in the future could be represented via
attribute mapping.

We still need the viewbox transform shenanigans which applies to
children only, tho.

Differential Revision: https://phabricator.services.mozilla.com/D220290
2024-08-27 21:14:28 +00:00
Masayuki Nakano 87b520e2b3 Bug 1872300 - Make nsFocusManager::ContentRemoved() call HTMLEditor::FinalizeSelection() after the removal ends r=emilio
`HTMLEditor::FinalizeSelection()` resets the caret and `nsCaret` schedules to
paint itself with the new state.  If editing host is being removed, it's already
been removed from the child chain of its parent but it still knows the parent.
Additionally, `nsCaret` may still keep storing the removing editing host as the
content.  In such case, we try to look for the line edge from the removing
editing host and fails to compute the index in its parent node for considering
the caret geometry.  For avoiding to compute it in the unstable period,
`nsFocusManager::ContentRemoved()` should call `HTMLEditor::FinalizeSelection()`
after the removal ends.

Differential Revision: https://phabricator.services.mozilla.com/D219845
2024-08-24 10:14:30 +00:00
Timothy Nikkel c3c641a6cb Bug 1914682. Downgrade old diagnostic asserts in nsIFrame::SetParent and Init. r=dholbert
There were added in bug 1436505. Nowadays they show up large in profiles, eg bug 1466704.

I checked crash stats, we aren't hitting these.

Differential Revision: https://phabricator.services.mozilla.com/D220052
2024-08-23 22:08:08 +00:00
Ting-Yu Lin cac8ac479b Bug 1914661 Part 1 - Rename NS_CSS_MINMAX, and move it into mozilla namespace. r=dholbert
`NS_CSS_MINMAX` looks like a macro, but it is a function. Let's name it like a
function.

Differential Revision: https://phabricator.services.mozilla.com/D220021
2024-08-23 19:52:49 +00:00
Emilio Cobos Álvarez a012cd6770 Bug 1906475 - Improve scroll{Width,Height} implementation for overflow: visible frames. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D218782
2024-08-15 15:02:00 +00:00
Timothy Nikkel fa03d74299 Bug 1910492. Make ViewportUtils use Matrix4x4Flagged. r=layout-reviewers,emilio
Generally we want to move to more flagged matrices because the transforms are usually simple, just offsets, or simple 2d transforms and the operations do show up in profiles if we do them in the "dumb" way of assuming a full 3d transform.

This specific code isn't necessarily performance critical, but it simplifies nsIFrame::GetTransformMatrix (which is performance critical) so that everything there is Matrix4x4Flagged except the one conversion for GetResultingTransformMatrix.

Matrix4x4TypedFlagged::ToUnknownMatrix gets its first user with this change and we need to make some fixes so that it actually works. We need to friend all template instantiations of this class so that it can access the private constructor of the class with different units. We also need to move the MatrixType enum outside of the class so it doesn't get the templated units imprinted on its type. Maybe there is a better way to do this.

Differential Revision: https://phabricator.services.mozilla.com/D218018
2024-08-10 10:31:18 +00:00
Timothy Nikkel b48f48d3c1 Bug 1910297. Handle repaint propagation to the root if the root is a table. r=layout-reviewers,emilio
The background image is associate to the table frame, but the table wrapper frame is the primary frame, thus IsPrimaryFrameOfRootOrBodyElement returns false and we don't propagate to the root when we should. So I changed IsPrimaryFrameOfRootOrBodyElement to handle this case and renamed it. I checked the other root element frame types, only table frames had this issue.

Differential Revision: https://phabricator.services.mozilla.com/D217923
2024-08-09 10:25:21 +00:00
Jan-Niklas Jaeschke c19b2f2de2 Bug 1904796 - Text Fragments: Override ::target-text colors with mark/marktext in High-Contrast mode. r=morgan,emilio
Differential Revision: https://phabricator.services.mozilla.com/D218653
2024-08-09 06:52:57 +00:00
Jan-Niklas Jaeschke 84c20db1cd Bug 1908856 - Text Fragments: Allow to start a selection over a target-text selection. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D218337
2024-08-02 09:28:11 +00:00
Norisz Fay 2e237fec8a Backed out changeset 968450206e7e (bug 1908856) for causing lint failure on drag-selection-over-target-text.html CLOSED TREE 2024-08-02 11:51:48 +03:00
Jan-Niklas Jaeschke fab8b26c92 Bug 1908856 - Text Fragments: Allow to start a selection over a target-text selection. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D218337
2024-08-02 08:14:34 +00:00
Ting-Yu Lin 9aba34e1fd Bug 1911027 Part 2 - Drop unnecessary nsIFrame:: for InlineMinISizeData and InlinePrefISizeData usages. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D218283
2024-08-01 17:47:07 +00:00
Glenn Watson 5dc3381df0 Bug 1909933 - Fix backdrop-filter on a transformed + complex clip r=tnikkel
Ensure that when we construct a wrapping surface for a transform
due to a complex clip, we mark it as wrapping a backdrop-filter
when that is required.

Differential Revision: https://phabricator.services.mozilla.com/D217922
2024-07-29 22:57:16 +00:00
Gregory Pappas 4933b3d826 Bug 1910248 - Remove nsIFrame::LayerIsPrerenderedDataKey r=layout-reviewers,TYLin
Not used since bug 1726291

Differential Revision: https://phabricator.services.mozilla.com/D217901
2024-07-27 18:03:41 +00:00
Ting-Yu Lin 2969a5e0cb Bug 1909995 Part 2 - Add IntrinsicISize() as a helper to implement GetMinISize() and GetPrefISize(). r=layout-reviewers,emilio
Most frame types have identical or very similar implementation for GetMinISize()
and GetPrefISize(), and many of them already have `IntrinsicISize()` to unify
the implementation. This patch introduces nsIFrame::IntrinsicISize() so that
derived classes only need to override one method.

`nsBlockFrame`, `ColumnSetWrapperFrame`, and `nsColumnSetFrame` are the only
three classes where their `GetMinISize()` and `GetPrefISize()` have significant
differences. Therefore, we rename `GetMinISize()` and `GetPrefISize()` to
`MinISize()` and `PrefISize`, respectively, and use them as helpers to implement
their `IntrinsicISize()`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D217790
2024-07-26 20:54:56 +00:00
Ting-Yu Lin e67b56ee4c Bug 1909995 Part 1 - Unify MinISizeFromInline and PrefISizeFromInline in nsLayoutUtils, and move it into nsIFrame. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D217789
2024-07-26 20:54:56 +00:00
Ting-Yu Lin 13d91b6576 Bug 1909786 Part 2 - Clean up for InlineIntrinsicISizeData::FloatInfo. r=layout-reviewers,jfkthame
This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D217678
2024-07-25 18:26:47 +00:00
Daniel Holbert 6bdbaba6b7 Bug 1909773 part 3: Add off-by-default support for the CSS 'stretch' sizing keyword, just matching the behavior of '-moz-available' for now. r=emilio
This patch is intended to be mechanical, just adding the new keyword as an
alias for the existing behavior, basically.

In a later bug, 'stretch' will gain additional capabilities before we enable
the pref.  After that, I intend to ultimately make '-moz-available' an alias of
'stretch', assuming that doing so is web-compatible.

Differential Revision: https://phabricator.services.mozilla.com/D217686
2024-07-25 18:18:24 +00:00
Emilio Cobos Álvarez 82e629c688 Bug 1909311 - Fix for test_selection_tripleclick.html.
MANUAL PUSH: Orange fix CLOSED TREE
2024-07-23 18:43:23 +02:00
Emilio Cobos Álvarez d25d53b6fc Bug 1909311 - Remove nsIFormControlFrame and nsITextControlFrame. r=masayuki,layout-reviewers,dholbert
It's a rather useless interface:

 * nsITextControlFrame is only implemented by nsTextControlFrame, so we
   can just use that.
 * nsIFormControlFrame had very few actual functionality, mostly
   scattered around:
    * SetFormProperty(select) was only useful for nsTextControlFrame.
    * SetFormProperty(value) was only called on file controls.
    * SetFocus() did mostly nothing, or things that can be done in
      ElementStateChanged instead.

There are some do_QueryFrame calls that I replaced for better checks in
font inflation and nsIFrame, but I'll adjust to preserve behavior if you
insist (it just such a somewhat-random check).

Differential Revision: https://phabricator.services.mozilla.com/D217322
2024-07-23 16:16:18 +00:00
Timothy Nikkel 50cb9f0a44 Bug 1909075. Remove a useless 4x4 matrix multiply in nsIFrame::GetTransformMatrix. r=longsonr
|result| is just initialized to the identity matrix so this does nothing and does take time.

Differential Revision: https://phabricator.services.mozilla.com/D217208
2024-07-22 08:27:48 +00:00
Timothy Nikkel 8ebd83be9f Bug 1909074. Don't pass OFFSET_BY_ORIGIN to GetResultingTransformMatrix when it's useless. r=longsonr
The OFFSET_BY_ORIGIN flag just makes GetResultingTransformMatrix PostTranslate the result by the nsPoint we pass to it, which is (0,0), so this is useless and does take time.

Differential Revision: https://phabricator.services.mozilla.com/D217207
2024-07-21 11:36:57 +00:00
Emilio Cobos Álvarez 1513819c21 Bug 1789166 - Use content-visibility rather than display: none to hide <details> content. r=smaug
This matches the current shipping version of Chromium, and the last
version of the spec, except for the <slot> display when open, which per
spec ought to be `block`, but it's still `contents`.

animation-canceled-by-parent-details-element-being-closed.html is
invalid because content-visibility doesn't cancel animations, just
pauses them. It also times out in Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D217192
2024-07-20 17:49:39 +00:00
Stanca Serban fd5b1ecdad Backed out changeset 48baafc34055 (bug 1789166) for causing mochitests failures. CLOSED TREE 2024-07-20 18:43:13 +03:00
Emilio Cobos Álvarez 79779b8643 Bug 1789166 - Use content-visibility rather than display: none to hide <details> content. r=smaug
This matches the current shipping version of Chromium, and the last
version of the spec, except for the <slot> display when open, which per
spec ought to be `block`, but it's still `contents`.

animation-canceled-by-parent-details-element-being-closed.html is
invalid because content-visibility doesn't cancel animations, just
pauses them. It also times out in Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D217192
2024-07-20 14:17:31 +00:00
Timothy Nikkel dceb14a573 Bug 1909042. Don't call GetOffsetToCrossDoc in nsIFrame::GetTransformMatrix in the transform case either. r=layout-reviewers,emilio
Like bug 1907871 (which covered the non transformed case) but for the transformed case where we are just getting the offset to the parent frame. Should be a little faster.

Differential Revision: https://phabricator.services.mozilla.com/D217195
2024-07-20 12:19:18 +00:00
Masayuki Nakano 6822b4fba8 Bug 1897255 - Make nsIFrame::PeekOffsetForLine won't cross editing host boundary unless the callers allows that r=emilio
The problems in the testcase are, `nsIFrame::PeekOffsetForLine` returns a frame
for any content node outside the editing host and `nsIFrame::GetLastLeaf`
returns a native anonymous subtree node if the frame is for the native
anonymous subtree root like `<input>` or `<textarea>`.

For fixing the former, the methods need to check whether found frame's editable
state **and** whether the editable node is an inclusive descendant of the
editing host.  However, there are complicated cases with inline editing hosts
and elements whose `contenteditable` is set to `false` and this is a new
regression for ESR 128.  Therefore, we need to fix this without any behavior
changes as far as possible.  Therefore, this patch basically checks only whether
the editing state of found one is editable and/or whether the one is an
inclusive descendant of the editing host to avoid `Selection` moves outside the
editing host.  The reaming complicated cases should be handled in new bugs which
blocks bug 1873155.

For fixing the latter, `nsIFrame::GetLastLeaf` needs to check the given frame's
content is a native anonymous subtree root or not.

Differential Revision: https://phabricator.services.mozilla.com/D216371
2024-07-19 08:13:10 +00:00
Emilio Cobos Álvarez efe881929b Bug 1907868 - Optimize nsQueryFrame for all final frame types and ScrollContainerFrame. r=tnikkel,layout-reviewers,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D216682
2024-07-18 11:51:13 +00:00
Stanca Serban 20161e50a8 Backed out changeset c635f67339a5 (bug 1907868) for causing build bustages in nsQueryFrame.h. CLOSED TREE 2024-07-18 05:10:29 +03:00
Emilio Cobos Álvarez f7d89ea24a Bug 1907868 - Optimize nsQueryFrame for all final frame types and ScrollContainerFrame. r=tnikkel,layout-reviewers,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D216682
2024-07-17 21:51:45 +00:00
Timothy Nikkel d08726471e Bug 1907871. Compute the offset in GetTransformMatrix so we don't have to call GetOffsetToCrossDoc to walk the same parent chain twice. r=layout-reviewers,emilio
Profiling shows this to be about a 5% win on the testcase in bug 1905377 on my machine.

Differential Revision: https://phabricator.services.mozilla.com/D216552
2024-07-17 09:15:24 +00:00
Timothy Nikkel 8c3be8bb3a Bug 1907869. Don't check that frames are in the same document hierarchy in GetOffsetToCrossDoc in release builds. r=layout-reviewers,emilio
I checked crash stats to see if we ever hit this MOZ_CRASH: it's very rare, and the handful of crashes I found came from callsites where that was impossible (ie the two frames we are getting offsets between were derived by calling GetCrossDocParentFrame). The crashes did however have the feel of those layout crashes that seem like bad hardware etc (ie some crashes have non-zero bitflip chance, other weird things).

Differential Revision: https://phabricator.services.mozilla.com/D216550
2024-07-16 11:53:05 +00:00
Timothy Nikkel ba6c1015de Bug 1906562. Don't call IsZoomedContentRoot in nsIFrame::GetTransformMatrix unless we need to. r=botond,layout-reviewers,emilio
The call is relatively heavy, and it avoids extra function calls. We only stop at zoomed content roots if the viewport type is visual. This code was added in bug 1556556; that context tells us why the code was added so we can be sure this stop is not needed.

Differential Revision: https://phabricator.services.mozilla.com/D215864
2024-07-14 12:58:13 +00:00
Timothy Nikkel 39fa95b71c Bug 1906562. Remove useless IsPopup check in nsIFrame::GetTransformMatrix. r=layout-reviewers,emilio
Bug 1801025 removed any special handling for popups in this function, but we didn't remove popups from the stopping conditions. Skipping the call saves some time, and also avoids extra function calls.

Differential Revision: https://phabricator.services.mozilla.com/D215863
2024-07-13 08:13:34 +00:00
Timothy Nikkel 4b91b40cf2 Bug 1906581. In nsIFrame::GetTransformMatrix construct a Matrix4x4Flagged directly instead of converting from Matrix4x4. r=layout-reviewers,emilio
nsIFrame::GetTransformMatrix returns a Matrix4x4Flagged (a matrix with a type field signifying if it is identity, simple 2d matrix, or full 3d matrix so operations can be simplified) but we construct simple Matrix4x4 and return them, which forces us to construct a Matrix4x4Flagged and Analyze() it to determine what type it is. We should just construct a flagged matrix directly. This shows up in profiles.

GetTransformMatrix got converted from Matrix4x4 to Matrix4x4Flagged for perf reasons in the past, so that explains how we ended up in this situation.

We still use Matrix4x4 in the more complicated actually transformed case.

Differential Revision: https://phabricator.services.mozilla.com/D215867
2024-07-12 10:09:47 +00:00
Ting-Yu Lin 4ef20f0ad7 Bug 1906792 Part 1 - Let nsLeafFrame and subclasses override GetIntrinsicSize(). r=layout-reviewers,emilio
`nsIFrame` already provides `GetIntrinsicSize()` for subclasses to override.
Therefore, `nsLeafFrame` doesn't need to introduce another version for its
subclasses.

This patch (hopefully) shouldn't change the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D215998
2024-07-09 18:49:32 +00:00
Ting-Yu Lin 21d81e2fbe Bug 1905463 - Cap aspect-ratio's automatic minimum size by the maximum size. r=layout-reviewers,emilio
See https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum

The flex container and grid container have already considered max sizes clamping
when computing their sizes. Therefore, `flex-aspect-ratio-043.html`,
`flex-aspect-ratio-044.html`, and `grid-aspect-ratio-042.html` already pass on
the current Nightly without this patch.

- `flex-aspect-ratio-043.html` and `flex-aspect-ratio-044.html` are adapted from
  `flex-aspect-ratio-040.html` and `flex-aspect-ratio-041.html`.
- `grid-aspect-ratio-042.html` is adapted from `grid-aspect-ratio-039.html`.
- `fieldset-element-002.html` is adapted from `fieldset-element-001.html`.

Differential Revision: https://phabricator.services.mozilla.com/D215296
2024-07-01 21:26:25 +00:00
Ting-Yu Lin ad3a7fd625 Bug 1905462 Part 3 - Adapt more code to use ComputeISizeValueFromAspectRatio(). r=layout-reviewers,emilio
This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D215295
2024-07-01 21:26:02 +00:00
Ting-Yu Lin 0f3a5513f5 Bug 1905462 Part 2 - Pass a style block size and aspect-ratio into ComputeISizeValue(). r=layout-reviewers,emilio
`ComputeISizeValue()` used to take `StyleSizeOverrides`, but

This patch reflects the fact that intrinsic inline size value such as
'min-content', 'max-content', etc. can be resolved via a definite block size and
a preferred aspect-ratio.

For the callers in `nsIFrame::ComputeSize()` and
`nsContainerFrame::ComputeSizeWithIntrinsicDimensions()`, we can pass the
`styleBSize` and `aspectRatio` that have considered the size overrides.

Also, simplify `ComputeISizeValueFromAspectRatio()` so that it can be reused in
other places. We'll adapt more callers in the next part. Note that the `aFlags`
parameter is unused, so it is removed.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D215294
2024-07-01 21:26:01 +00:00
Ting-Yu Lin 95fbf6ff4d Bug 1905462 Part 1 - Minor clean up for ComputeISizeValue. r=layout-reviewers,emilio
Rename `aContainingBlockSize` to `aCBSize` for brevity, which also matches the
parameter naming in `ComputeSize()` and `ComputeAutoSize`.

Add a helper lambda `GetAvailableISize()` to compute the available inline size.

Mark the `ComputeISizeValue()` resolving `LengthPercentage` as `const`.

Differential Revision: https://phabricator.services.mozilla.com/D215293
2024-07-01 21:26:01 +00:00
Ting-Yu Lin 415f61e85f Bug 1903652 Part 1 - Revert Bug 1901515 Part 3 to rework the performance issue. r=dholbert
This patch is a revert of
https://hg.mozilla.org/mozilla-central/rev/8ea9b9da6922 because the correctness
assumption described in the commit message was wrong. Note that this patch does
not revert the documentation improvement for
`nsSplittableFrame::RemoveFromFlow()` because it is worth keeping.

During frame destruction, `nsBlockFrame::MarkIntrinsicISizesDirty()` can be
called and it accesses `FirstContinuation()`. Thus, it is not acceptable to
allow a stale first-continuation cache during frame destruction.

Differential Revision: https://phabricator.services.mozilla.com/D214658
2024-06-23 04:31:36 +00:00
Emilio Cobos Álvarez ecd7cb88d8 Bug 1902325 - Remove zIndex concept from views. r=tnikkel,layout-reviewers
This comes back to ~since forever, since absolutely positioned elements
used to have views. But now is basically only plumbed from
nsMenuPopupFrame to nsIWidget.

The main issue is that that concept is basically fiction nowadays:

 * Wayland can't reorder popups.
 * macOS doesn't implement it because SetZIndex calls PlaceBehind which
   only has a windows impl.
 * Unclear whether it works properly on Windows as well.

Also, the front-end never sets it anyways.

So remove this fiction to simplify relevant code. We might want to
provide a z-ordering of popups somehow else, but it should probably live
in nsXULPopupManager etc rather than nsView.

Differential Revision: https://phabricator.services.mozilla.com/D213598
2024-06-18 14:56:11 +00:00
Ting-Yu Lin b533834cfd Bug 1901515 Part 3 - Add methods to set previous continuation without updating first continuation cache. r=layout-reviewers,dholbert
The correctness assumption for this patch is that we destroy all frame
continuations when removing an element, so any stale first continuation cache
during frame destruction is acceptable.

Differential Revision: https://phabricator.services.mozilla.com/D213686
2024-06-17 16:40:18 +00:00