Commit Graph

878 Commits

Author SHA1 Message Date
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
Ting-Yu Lin
ecfba24b82 Bug 1901515 Part 2 - Use MOZ_ASSERT_UNREACHABLE() instead of MOZ_ASSERT(false). r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D213685
2024-06-17 16:40:17 +00:00
Ting-Yu Lin
5f335dbb1c Bug 1670151 Part 2 - Use nsIFrame::GetAspectRatio() to query aspect-ratio rather than obtaining it from style. r=dholbert
`GetAspectRatio()` considers both the `aspect-ratio` property and the intrinsic
aspect-ratio of replaced elements.

Changing just `nsIFrame::ComputeISizeValueFromAspectRatio()` fixed the intrinsic
size for replaced elements when there is a definite height. However, it doesn't
pass any tests on wpt, so I wrote intrinsic-size-017.html to
intrinsic-size-019.html to cover this.

Modifying `nsLayoutUtils::IntrinsicForAxis()` fixed the intrinsic size
contribution for replaced elements. We already have the logic to use inline size
from aspect ratio in `AddIntrinsicSizeOffset()` and `GetIntrinsicCoord()`. We
just need to compute it when sizes in the inline axis have intrinsic keywords.
intrinsic-size-020.html to intrinsic-size-025.html cover this.

grid-auto-min-sizing-min-content-min-size-{001,002}-ref.html are also modified
to reflect this new behavior. The modified subtests are:
- 001.html: Test 1, 2, 3, 6, 8, 9
- 002.html: Test 1, 2, 3, 6, 7, 9

In these modified subtests, before this patch, our rendering was all different
from Google Chrome's. After this patch, our behavior aligns with Google Chrome,
except for Test 7 and 9 in 002.html.

Differential Revision: https://phabricator.services.mozilla.com/D212716
2024-06-06 05:59:46 +00:00
Ting-Yu Lin
26977bec17 Bug 1670151 Part 1 - Rename ComputeInlineSizeFromAspectRatio() to ComputeISizeValueFromAspectRatio(). r=layout-reviewers,boris
This renaming is to match the existing `ComputeISizeValue()` and
`ComputeBSizeValue()` APIs. Also, rename the related local variables for brevity
and improve the comments.

Differential Revision: https://phabricator.services.mozilla.com/D212715
2024-06-06 05:59:45 +00:00
Ting-Yu Lin
1d2b30e892 Bug 1900522 Part 1 - Use IsIntrinsicKeyword() to implement HasIntrinsicKeywordForBSize(). r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D212504
2024-06-04 17:54:48 +00:00
Emilio Cobos Álvarez
dfa0126958 Bug 1900223 - Remove ScrollContainerFrame::IsForTextControlWithNoScrollbars. r=TYLin,layout-reviewers
We can just use CSS for these nowadays.

Differential Revision: https://phabricator.services.mozilla.com/D212372
2024-06-03 22:38:33 +00:00
Ting-Yu Lin
24fbe1d436 Bug 1866692 Part 3 - Remove <input> generated frame types that can never have oveflow:hidden. r=emilio
Emilio pointed out that some <input> types can never have `overflow:hidden`
because they are forced to have `overflow:clip` in the UA style sheet in
https://searchfox.org/mozilla-central/rev/fc76676f61ee37b4c5420649cad6677164a29405/layout/style/res/forms.css#526-529

Thus, we don't need to specify them in the switch-cases that interprets
`oveflow:hidden` as clip.

Reference: `nsCSSFrameConstructor::FindInputData()` has all the concrete frames
that can be created by <input>.

Differential Revision: https://phabricator.services.mozilla.com/D212204
2024-05-31 19:28:20 +00:00
Ting-Yu Lin
664f41193d Bug 1866692 Part 2 - Remove ReplacedContainsBlock in LayoutFrameClassFlags. r=layout-reviewers,emilio
The `IsReplacedWithBlock()` method is used only in
`ShouldApplyOverflowClipping()`, which determines the overflow clip axes. Since
we've already enumerated the frame types that need overflow clipping, we can
just add more types that had `ReplacedContainsBlock` flag to the switch-cases
and remove the flag.

Differential Revision: https://phabricator.services.mozilla.com/D212199
2024-05-31 19:28:19 +00:00
Ting-Yu Lin
8d546a2fd5 Bug 1899345 Part 1 - Convert PhysicalAxes to an EnumSet<PhysicalAxis>. r=layout-reviewers,emilio
This also makes `PhysicalAxis::{Horizontal,Vertical}` more useful when we
previous needed `PhysicalAxes::{Horizontal,Vertical}`.

Differential Revision: https://phabricator.services.mozilla.com/D211941
2024-05-30 17:58:25 +00:00
Ting-Yu Lin
5cdee429ce Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211498
2024-05-30 06:32:22 +00:00
Ting-Yu Lin
c63ad7787d Bug 1896516 Part 10 - Remove nsIScrollableFrame usages under gfx/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211497
2024-05-30 06:32:21 +00:00
Ting-Yu Lin
9ff564d485 Bug 1896516 Part 7 - Remove PresShell::GetRootScrollFrameAsScrollable(). r=layout-reviewers,emilio
`PresShell::GetRootScrollFrameAsScrollable()` is equivalent to
`PresShell::GetRootScrollContainerFrame()`.

In ScrollContainerFrame.h, `DecideScrollableLayer()` has two versions, one has
four parameters, and the other has five parameters with the fifth parameter
`aDirtyRectHasBeenOverriden` having a default value `nullptr`. When we switch
the caller from `nsIScrollableFrame` to `ScrollContainerFrame`, we need to
remove the default value for the fifth parameter to avoid ambiguity.

Differential Revision: https://phabricator.services.mozilla.com/D211494
2024-05-30 06:32:20 +00:00
Ting-Yu Lin
76523f97b1 Bug 1896516 Part 6 - Remove nsIScrollableFrame usages in nsLayoutUtils. r=layout-reviewers,emilio
Convert `nsIScrollableFrame` to `ScrollContainerFrame` for all the APIs in
nsLayoutUtils, and then adapt other callers until everything compiles.

In `nsLayoutUtils::CalculateBasicFrameMetrics()`'s documentation,
s/ComputeFrameMetrics/ComputeScrollMetadata/ because the method was renamed in
https://hg.mozilla.org/mozilla-central/rev/cb2023f50288

Differential Revision: https://phabricator.services.mozilla.com/D211493
2024-05-30 06:32:20 +00:00
Ting-Yu Lin
14aebc5bf9 Bug 1896516 Part 1 - Rename PresShell::GetRootScrollFrame(), and make it return ScrollContainerFrame. r=layout-reviewers,emilio
In theory, changing the return type from `nsIFrame*` to `ScrollContainerFrame*`
exposes `ScrollContainerFrame` to the callers who might not needed, but almost
all of the callers in cpp files are already exposed to `nsIScrollableFrame`, as
demonstrated in this patch via replacing the #include from
"nsIScrollableFrame.h" to "ScrollContainerFrame.h", so this is OK.

Some callers can be simplified since we no longer need `do_QueryFrame` to
`nsIScrollableFrame`.

Differential Revision: https://phabricator.services.mozilla.com/D211488
2024-05-30 06:32:17 +00:00
Sebastian Hengst
bf4dfe53f8 Backed out 15 changesets (bug 1896516) for causing scrolling crashes on macOS. a=backout
Backed out changeset fd6904338812 (bug 1896516)
Backed out changeset 2977ff81a23e (bug 1896516)
Backed out changeset c8a6b0e526d6 (bug 1896516)
Backed out changeset 3c06f22da72b (bug 1896516)
Backed out changeset f63b0c4335fe (bug 1896516)
Backed out changeset 6f7ab8adfa6e (bug 1896516)
Backed out changeset 997c9249dbed (bug 1896516)
Backed out changeset c964fccd5180 (bug 1896516)
Backed out changeset 7b481b747b7a (bug 1896516)
Backed out changeset 42e1bbe0ecb6 (bug 1896516)
Backed out changeset 717dac08b607 (bug 1896516)
Backed out changeset 2f0817331dbe (bug 1896516)
Backed out changeset b765169a7a8f (bug 1896516)
Backed out changeset a2d37b98273c (bug 1896516)
Backed out changeset ea9ecb543e66 (bug 1896516)
2024-05-29 11:22:52 +02:00
Sebastian Hengst
18041c50bb Backed out 2 changesets (bug 1899345) for conflicting with backout of bug 1896516
Backed out changeset b96c165e9ab4 (bug 1899345)
Backed out changeset 01a540f73690 (bug 1899345)
2024-05-29 11:21:39 +02:00
Ting-Yu Lin
5644682c09 Bug 1899345 Part 1 - Convert PhysicalAxes to an EnumSet<PhysicalAxis>. r=layout-reviewers,emilio
This also makes `PhysicalAxis::{Horizontal,Vertical}` more useful when we
previous needed `PhysicalAxes::{Horizontal,Vertical}`.

Differential Revision: https://phabricator.services.mozilla.com/D211941
2024-05-29 05:10:38 +00:00
Stanca Serban
60109eeb45 Backed out 2 changesets (bug 1899345) for causing android build bustages in ScrollContainerFrame.cpp. CLOSED TREE
Backed out changeset ccb2ccbef46e (bug 1899345)
Backed out changeset 6f66d112b450 (bug 1899345)
2024-05-29 03:49:38 +03:00
Ting-Yu Lin
940c33226a Bug 1899345 Part 1 - Convert PhysicalAxes to an EnumSet<PhysicalAxis>. r=layout-reviewers,emilio
This also makes `PhysicalAxis::{Horizontal,Vertical}` more useful when we
previous needed `PhysicalAxes::{Horizontal,Vertical}`.

Differential Revision: https://phabricator.services.mozilla.com/D211941
2024-05-29 00:17:58 +00:00
Ting-Yu Lin
37e9b779f9 Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211498
2024-05-28 04:46:20 +00:00
Ting-Yu Lin
7b3a408955 Bug 1896516 Part 10 - Remove nsIScrollableFrame usages under gfx/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211497
2024-05-28 04:46:20 +00:00
Ting-Yu Lin
5ac7609fac Bug 1896516 Part 7 - Remove PresShell::GetRootScrollFrameAsScrollable(). r=layout-reviewers,emilio
`PresShell::GetRootScrollFrameAsScrollable()` is equivalent to
`PresShell::GetRootScrollContainerFrame()`.

In ScrollContainerFrame.h, `DecideScrollableLayer()` has two versions, one has
four parameters, and the other has five parameters with the fifth parameter
`aDirtyRectHasBeenOverriden` having a default value `nullptr`. When we switch
the caller from `nsIScrollableFrame` to `ScrollContainerFrame`, we need to
remove the default value for the fifth parameter to avoid ambiguity.

Differential Revision: https://phabricator.services.mozilla.com/D211494
2024-05-28 04:46:19 +00:00
Ting-Yu Lin
16b24f6c41 Bug 1896516 Part 6 - Remove nsIScrollableFrame usages in nsLayoutUtils. r=layout-reviewers,emilio
Convert `nsIScrollableFrame` to `ScrollContainerFrame` for all the APIs in
nsLayoutUtils, and then adapt other callers until everything compiles.

In `nsLayoutUtils::CalculateBasicFrameMetrics()`'s documentation,
s/ComputeFrameMetrics/ComputeScrollMetadata/ because the method was renamed in
https://hg.mozilla.org/mozilla-central/rev/cb2023f50288

Differential Revision: https://phabricator.services.mozilla.com/D211493
2024-05-28 04:46:18 +00:00
Ting-Yu Lin
6f6e711315 Bug 1896516 Part 1 - Rename PresShell::GetRootScrollFrame(), and make it return ScrollContainerFrame. r=layout-reviewers,emilio
In theory, changing the return type from `nsIFrame*` to `ScrollContainerFrame*`
exposes `ScrollContainerFrame` to the callers who might not needed, but almost
all of the callers in cpp files are already exposed to `nsIScrollableFrame`, as
demonstrated in this patch via replacing the #include from
"nsIScrollableFrame.h" to "ScrollContainerFrame.h", so this is OK.

Some callers can be simplified since we no longer need `do_QueryFrame` to
`nsIScrollableFrame`.

Differential Revision: https://phabricator.services.mozilla.com/D211488
2024-05-28 04:46:16 +00:00