Commit Graph
37 Commits
Author SHA1 Message Date
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 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
Ting-Yu Lin a024d0e616 Bug 1914661 Part 3 - Add ReflowInput::SetBResizeForPercentages(). r=dholbert
We have `SetBResize()`, so it would be useful to add a method to set
`mIsBResizeForPercentages` flag for consistency.

Differential Revision: https://phabricator.services.mozilla.com/D220023
2024-08-23 19:52:50 +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
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
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
Emilio Cobos Álvarez cf22f69bc6 Bug 1908242 - Make sure that sticky items are processed in the right order. r=TYLin
We rely on positioning ancestors before descendants to get the right
position. This was very implicitly enforced before the regressing bug,
by reframing on position changes (due to the order
StickyScrollContainer::AddFrame was called, ancestors before children).

In order to support dynamic sticky changes without reframing, we need to
handle the case of an existing ancestor switching position to sticky
dynamically.

Luckily we already have the right data-structure for that, so the change
is rather trivial.

Write a testharness test for this because APZ does get the position
right, so it's more future-proof against regressions to just test the
raw layout values.

Differential Revision: https://phabricator.services.mozilla.com/D216858
2024-07-18 20:54:13 +00:00
Emilio Cobos Álvarez 9b231b189e Bug 1788504 - Account for current dynamic toolbar state in IntersectionObserver. r=emilio
Chrome uses bimodal layout viewport for IntersectionObserver;

a) While the dynamic toolbar is visible, Chrome uses the layout viewport
   (which doesn't include the dynamic toolbar area)
b) While the dynamic toolbar is completely hidden, Chrome uses the layout
  viewport + the height that the dynamic toolbar was originally occupied.

In this change we align the behavior with Chrome's behavior.

Differential Revision: https://phabricator.services.mozilla.com/D212920
2024-07-18 07:08:16 +00:00
Hiroyuki Ikezoe 022e99a431 Bug 1905247 - Clamp scroll-snap-align: start snap points inside the scroll range. r=emilio
This change is basically equivalent with what we did for bug 1788029 but for
`scroll-snap-align: start` cases.

The test case was originally written by Daniel Holbert.

Differential Revision: https://phabricator.services.mozilla.com/D215315
2024-07-02 21:53:14 +00:00
Hiroyuki Ikezoe 44d88fd9fa Bug 1905247 - Convert logicalScrollRange into writingMode. r=emilio
`logicalScrollRange` is used to clamp each candidate snap position inside the
scroll range. If we used `aWritingModeOnScroller` for `logicalScrollRange`,
clamping will be done in a wrong axis in some cases.

With the next commit but without this change running
scroll-snap-writing-mode-000.html [1] causes a lot of
"ASSERTION: writing-mode mismatch" warnings.

[1] https://searchfox.org/mozilla-central/rev/16a5f0e868a01d3f3a4a7364206bef2a64e80735/testing/web-platform/tests/css/css-scroll-snap/snap-after-initial-layout/scroll-snap-writing-mode-000.html

Differential Revision: https://phabricator.services.mozilla.com/D215314
2024-07-02 21:53:14 +00:00
Tamas Szentpeteri 46bb293ba2 Backed out 2 changesets (bug 1905247) for causing wpt failures on unreachable-snap-positions-003.html. CLOSED TREE
Backed out changeset 9345fa484aa6 (bug 1905247)
Backed out changeset 667e49b7e734 (bug 1905247)
2024-07-02 11:44:03 +03:00
Hiroyuki Ikezoe 0d71b901ca Bug 1905247 - Clamp scroll-snap-align: start snap points inside the scroll range. r=emilio
This change is basically equivalent with what we did for bug 1788029 but for
`scroll-snap-align: start` cases.

The test case was originally written by Daniel Holbert.

Differential Revision: https://phabricator.services.mozilla.com/D215315
2024-07-02 06:58:25 +00:00
Hiroyuki Ikezoe ba2379cc52 Bug 1905247 - Convert logicalScrollRange into writingMode. r=emilio
`logicalScrollRange` is used to clamp each candidate snap position inside the
scroll range. If we used `aWritingModeOnScroller` for `logicalScrollRange`,
clamping will be done in a wrong axis in some cases.

With the next commit but without this change running
scroll-snap-writing-mode-000.html [1] causes a lot of
"ASSERTION: writing-mode mismatch" warnings.

[1] https://searchfox.org/mozilla-central/rev/16a5f0e868a01d3f3a4a7364206bef2a64e80735/testing/web-platform/tests/css/css-scroll-snap/snap-after-initial-layout/scroll-snap-writing-mode-000.html

Differential Revision: https://phabricator.services.mozilla.com/D215314
2024-07-02 06:58:25 +00:00
Emilio Cobos Álvarez 4dd10dfc9b Bug 1900223 - Remove no longer used function on android.
MANUAL PUSH: Trivial android bustage fix CLOSED TREE.
2024-06-04 01:07:09 +02: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
Gregory Pappas 43aeadda35 Bug 1898445 - Add new pref for presence of overflow/underflow events in extension documents r=extension-reviewers,emilio,willdurand
Differential Revision: https://phabricator.services.mozilla.com/D211324
2024-06-03 20:22:12 +00:00
Ting-Yu Lin c199401870 Bug 1899345 Part 2 - Rename GetOverflowState() and use PhysicalAxes as its return type. r=layout-reviewers,emilio
`OverflowState` is equivalent to `PhysicalAxes`. We really don't need a separate
type.

Differential Revision: https://phabricator.services.mozilla.com/D211942
2024-05-30 17:58:25 +00:00
Ting-Yu Lin b1f98ce7d1 Bug 1896516 Part 13 - Remove nsIScrollableFrame completely. r=layout-reviewers,emilio
This patch moves the documentation from `nsIScrollableFrame.h` to
`ScrollContainerFrame.h`. We keep methods in the original order as they were in
`nsIScrollableFrame`.

Differential Revision: https://phabricator.services.mozilla.com/D211500
2024-05-30 06:32:23 +00:00
Ting-Yu Lin a9397b0f0a Bug 1896516 Part 12 - Tidy up ScrollContainerFrame's interface. r=layout-reviewers,emilio
The motivation of this patch is that we've now switched all the callers from
`nsIScrollableFrame` to `ScrollContainerFrame`, and it is better to audit the
access control of `ScrollContainerFrame`'s interface, and I notice almost all
the member variables are public!

This patch shuffle the interface so that there are only one public, protected,
and private section, and all the member variables are moved to the private
section.

`AutoMinimumScaleSizeChangeDetector` and `RemoveDisplayPortCallback` need to
access member variables, so by declaring them under `ScrollContainerFrame`, they
have the privilege to do so.

Ideally, the caller only need to access what are already in
`nsIScrollableFrame`, so currently we might expose more methods than necessary.
We can audit that in a later part.

Differential Revision: https://phabricator.services.mozilla.com/D211499
2024-05-30 06:32:22 +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 f59e487e79 Bug 1896516 Part 5 - Fix build errors after including ScrollContainerFrame.h under dom/animation/. r=layout-reviewers,boris
This is a preparation to remove `#include "nsIScrollableFrame.h"` for
ScrollTimeline.cpp and ViewTimeline.cpp.

Move the implementation of `nsListControlFrame::GetMultiple()` to cpp. Keeping
it inline requires adding `#include "mozilla/dom/Element.h"` in the header, and
I don't feel the method is hot enough to be inlined.

Differential Revision: https://phabricator.services.mozilla.com/D211492
2024-05-30 06:32:19 +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 a05644f95e Bug 1899345 Part 2 - Rename GetOverflowState() and use PhysicalAxes as its return type. r=layout-reviewers,emilio
`OverflowState` is equivalent to `PhysicalAxes`. We really don't need a separate
type.

Differential Revision: https://phabricator.services.mozilla.com/D211942
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 5d94f880a4 Bug 1899345 Part 2 - Rename GetOverflowState() and use PhysicalAxes as its return type. r=layout-reviewers,emilio
`OverflowState` is equivalent to `PhysicalAxes`. We really don't need a separate
type.

Differential Revision: https://phabricator.services.mozilla.com/D211942
2024-05-29 00:17:59 +00:00
Ting-Yu Lin 8e6306eda3 Bug 1896516 Part 13 - Remove nsIScrollableFrame completely. r=layout-reviewers,emilio
This patch moves the documentation from `nsIScrollableFrame.h` to
`ScrollContainerFrame.h`. We keep methods in the original order as they were in
`nsIScrollableFrame`.

Differential Revision: https://phabricator.services.mozilla.com/D211500
2024-05-28 04:46:21 +00:00
Ting-Yu Lin d0eed162ec Bug 1896516 Part 12 - Tidy up ScrollContainerFrame's interface. r=layout-reviewers,emilio
The motivation of this patch is that we've now switched all the callers from
`nsIScrollableFrame` to `ScrollContainerFrame`, and it is better to audit the
access control of `ScrollContainerFrame`'s interface, and I notice almost all
the member variables are public!

This patch shuffle the interface so that there are only one public, protected,
and private section, and all the member variables are moved to the private
section.

`AutoMinimumScaleSizeChangeDetector` and `RemoveDisplayPortCallback` need to
access member variables, so by declaring them under `ScrollContainerFrame`, they
have the privilege to do so.

Ideally, the caller only need to access what are already in
`nsIScrollableFrame`, so currently we might expose more methods than necessary.
We can audit that in a later part.

Differential Revision: https://phabricator.services.mozilla.com/D211499
2024-05-28 04:46:21 +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 2ac683bd57 Bug 1896516 Part 5 - Fix build errors after including ScrollContainerFrame.h under dom/animation/. r=layout-reviewers,boris
This is a preparation to remove `#include "nsIScrollableFrame.h"` for
ScrollTimeline.cpp and ViewTimeline.cpp.

Move the implementation of `nsListControlFrame::GetMultiple()` to cpp. Keeping
it inline requires adding `#include "mozilla/dom/Element.h"` in the header, and
I don't feel the method is hot enough to be inlined.

Differential Revision: https://phabricator.services.mozilla.com/D211492
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
Emilio Cobos Álvarez f0909e022f Bug 1897827 - Remove FrameChildListID::Popup. r=dholbert
It's no longer used. I made popups regular absolutely-positioned frames
a long time ago.

Differential Revision: https://phabricator.services.mozilla.com/D210949
2024-05-20 22:00:08 +00:00
Gregory Pappas 16e75323f7 Bug 1888737 - Disable overflow/underflow events in early beta r=smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206175
2024-05-16 09:06:12 +00:00
Ting-Yu Lin 27bb908f13 Bug 1824877 Part 2 - Rename nsHTMLScrollFrame to mozilla::ScrollContainerFrame. r=dholbert
Also, change the ScrollContainerFrame::GetFrameName() to return
"ScrollContainer" instead of "HTMLScroll".

Differential Revision: https://phabricator.services.mozilla.com/D210233
2024-05-15 17:50:48 +00:00
Ting-Yu Lin 53837706d6 Bug 1824877 Part 1 - Rename nsGfxScrollFrame.{h,cpp} to ScrollContainerFrame.{h,cpp}. r=dholbert
Remove the #include from `nsFrameState.cpp` because it is not used.

Differential Revision: https://phabricator.services.mozilla.com/D210232
2024-05-15 17:50:48 +00:00