Граф коммитов

787 Коммитов

Автор SHA1 Сообщение Дата
Ting-Yu Lin f6c15bd66a Bug 1875600 - Remove unused gfxContext parameter for IntrinsicScrollbarGutterSizeAtInlineEdges(). r=hiro
Also, remove a legacy comment. It was for `nsBoxLayoutState`, but the code has
been removed in https://hg.mozilla.org/mozilla-central/rev/5ab63cda14e8

Differential Revision: https://phabricator.services.mozilla.com/D199288
2024-01-23 00:30:54 +00:00
Ting-Yu Lin ac1fd45c39 Bug 1875199 - Move documentation of two methods in nsHTMLScrollFrame to nsIScrollableFrame. r=layout-reviewers,emilio DONTBUILD
The documentation for GetScrolledRect() and GetLogicalScrollPosition() in
nsHTMLScrollFrame are clearer and up-to-date [1], but they implements the
nsIScrollableFrame's interface. We should move the documentation to
nsIScrollableFrame.

[1] For example, nsXULScrollFrame has been removed in bug 1600542.

Differential Revision: https://phabricator.services.mozilla.com/D198909
2024-01-18 16:54:38 +00:00
Hiroyuki Ikezoe d6384b20c1 Bug 1875011 - Use non-rounded scroll position behind layout.scroll.disable-pixel-alignment in nsHTMLScrollFrame::ScrollByCSSPixelsInternal. r=botond
Depends on D198766

Differential Revision: https://phabricator.services.mozilla.com/D198767
2024-01-17 06:27:05 +00:00
Hiroyuki Ikezoe 0fcc48906c Bug 1875011 - Rename GetScrollPositionCSSPixels to GetRoundedScrollPositionCSSPixels. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D198766
2024-01-17 06:27:05 +00:00
Ting-Yu Lin 9ad6043849 Bug 1839401 - Add a helper to get non-overlay scrollbar size. r=emilio
`GetNondisappearingScrollbarWidth()` is not used. Its last caller has been
removed in bug 1762873. So I transform it into a helper getting non-overlay
scrollbar width from theme.

Differential Revision: https://phabricator.services.mozilla.com/D191708
2023-10-24 18:25:48 +00:00
Hiroyuki Ikezoe 2c18e7014d Bug 1768393 - Rename mozilla::SnapTarget to mozilla::SnapDestination. r=botond
It was confusing with ScrollSnapInfo::SnapTarget.

Differential Revision: https://phabricator.services.mozilla.com/D184334
2023-09-12 01:33:18 +00:00
Hiroyuki Ikezoe 3b13152733 Bug 1768393 - Split out ScrollSnapInfo. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D184333
2023-09-12 01:33:17 +00:00
Emilio Cobos Álvarez aefd1ddb30 Bug 1851787 - Plumb a DestroyContext through all functions that can destroy frames. r=dholbert
This prevents anonymous content getting destroyed at weird times
during frame destruction.

Differential Revision: https://phabricator.services.mozilla.com/D187693
2023-09-08 15:11:17 +00:00
Emilio Cobos Álvarez 52d097c513 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-07 11:46:30 +00:00
Narcis Beleuzu 77ba6cde90 Backed out changeset 55052ae7d067 (bug 1851868) for reftest failure on 1153695.html . CLOSED TREE 2023-09-07 02:42:25 +03:00
Emilio Cobos Álvarez 59766eeba4 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-06 22:34:35 +00:00
Botond Ballo bf6116ce93 Bug 1835600 - Hand off absolute non-MSD smooth scrolls to APZ. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D181419
2023-06-23 07:30:23 +00:00
David Shin 267a479339 Bug 1809568 - Part 2: Provide `GetNaturalBaselineBOffset` with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-17 12:56:54 +00:00
Sandor Molnar 71c2b3db49 Backed out 3 changesets (bug 1809568) for causing build bustages in layout/generic/nsLineLayout.cpp CLOSED TREE
Backed out changeset 6c5bbcbafce9 (bug 1809568)
Backed out changeset b518133a5c34 (bug 1809568)
Backed out changeset 2407088e9b49 (bug 1809568)
2023-05-17 01:34:42 +03:00
David Shin 1eefa9a516 Bug 1809568 - Part 2: Provide `GetNaturalBaselineBOffset` with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-16 20:48:18 +00:00
Sandor Molnar a50a2052fe Backed out 3 changesets (bug 1809568) for causing node devtools failures in devtools/client/debugger/src/components/test/QuickOpenModal.spec.js CLOSED TREE
Backed out changeset 56ce741da8f5 (bug 1809568)
Backed out changeset 5a91ce4870e4 (bug 1809568)
Backed out changeset cc00422f050a (bug 1809568)
2023-05-16 22:22:31 +03:00
David Shin 30a10fdbc6 Bug 1809568 - Part 2: Provide `GetNaturalBaselineBOffset` with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-16 19:02:11 +00:00
Cristian Tuns 4d57ea669d Backed out 3 changesets (bug 1809568) for causing build bustages on nsLineLayout.cpp CLOSED TREE
Backed out changeset e862b1560caa (bug 1809568)
Backed out changeset 0a20b91de67b (bug 1809568)
Backed out changeset 6060fc7d49d4 (bug 1809568)
2023-05-15 13:03:03 -04:00
David Shin c4f2c2237b Bug 1809568 - Part 2: Provide `GetNaturalBaselineBOffset` with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-15 14:34:26 +00:00
Cosmin Sabou 543905e105 Backed out 3 changesets (bug 1809568) for causing build bustages on nsBlockFrame.cpp. CLOSED TREE
Backed out changeset eaa7fe280317 (bug 1809568)
Backed out changeset ab0f2bcb2d9b (bug 1809568)
Backed out changeset a481bf06452b (bug 1809568)
2023-05-01 21:42:14 +03:00
David Shin d2ebe93a83 Bug 1809568 - Part 2: Provide `GetNaturalBaselineBOffset` with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-01 17:04:27 +00:00
Iulian Moraru c9ffb3ffa8 Backed out 3 changesets (bug 1809568) for causing build bustages on nsLineLayout.cpp. CLOSED TREE
Backed out changeset 573dc0bd9554 (bug 1809568)
Backed out changeset b8401947aea0 (bug 1809568)
Backed out changeset 7ecabe895121 (bug 1809568)
2023-05-01 17:59:21 +03:00
David Shin 8ff73f5fcc Bug 1809568 - Part 2: Provide `GetNaturalBaselineBOffset` with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-01 13:44:43 +00:00
Dan Robertson a887a52ab3 Bug 1753565 - Default disable smooth scrolls if prefers-reduced-motion. r=botond
If the user has the prefers-reduced-motion system setting enabled, do
not enable smooth scrolls by default.

Differential Revision: https://phabricator.services.mozilla.com/D172446
2023-04-25 19:00:08 +00:00
Narcis Beleuzu f8f8179943 Backed out 2 changesets (bug 1753565) for GTest failure on MultipleSmoothScrollsSmooth . CLOSED TREE
Backed out changeset d454667254ed (bug 1753565)
Backed out changeset 1c5305d4d10a (bug 1753565)
2023-04-24 20:58:57 +03:00
Dan Robertson 1ee623fb13 Bug 1753565 - Default disable smooth scrolls if prefers-reduced-motion. r=botond
If the user has the prefers-reduced-motion system setting enabled, do
not enable smooth scrolls by default.

Differential Revision: https://phabricator.services.mozilla.com/D172446
2023-04-24 16:21:31 +00:00
Cristian Tuns f65f34399a Backed out 2 changesets (bug 1753565) for causing bc failures in browser_proton_moreTools_panel.js CLOSED TREE
Backed out changeset 817b0cf1e4e0 (bug 1753565)
Backed out changeset 947534ff1319 (bug 1753565)
2023-04-18 02:03:20 -04:00
Dan Robertson e4776501d3 Bug 1753565 - Disable smooth scrolls if prefers-reduced-motion. r=botond
If the user has the prefers-reduced-motion system setting enabled, do
not enable smooth scrolls.

Differential Revision: https://phabricator.services.mozilla.com/D172446
2023-04-18 04:11:10 +00:00
Emilio Cobos Álvarez 2d0e69f4a1 Bug 1824957 - Remove a bunch of now completely dead XUL layout code. r=layout-reviewers,desktop-theme-reviewers,devtools-reviewers,dao,TYLin
And some related tests.

A bunch of -moz-box* properties are web exposed, so I'll file a
follow-up for hiding them.

Differential Revision: https://phabricator.services.mozilla.com/D173819
2023-03-29 21:23:55 +00:00
Emilio Cobos Álvarez b9d1536d46 Bug 1824489 - Remove nsBoxFrame, nsBoxLayout and related code. r=jwatt
We still have some remnants of XUL layout due to nsBox / nsLeafBoxFrame
which XUL trees / nsTextBoxFrame still use.

However all this code can go away before we get rid of those.
nsSplitterFrame was the last thing inheriting from nsBoxFrame.

Differential Revision: https://phabricator.services.mozilla.com/D173601
2023-03-27 23:25:42 +00:00
Emilio Cobos Álvarez 38b10eafda Bug 1824236 - Stop using XUL layout for scrollbars. r=jwatt
This rewrites scrollbar layout to work with regular reflow rather than
box layout.

Overall it's about the same amount of code (mostly because
nsScrollbarFrame::Reflow is sorta hand-rolled), but it cleans up a bit
and it is progress towards removing XUL layout altogether, without
getting into much deeper refactoring.

This also blocks some other performance improvements and refactorings I
want to make in this code.

We make some assumptions to simplify the code that to some extent were
made already before, both explicitly and by virtue of using XUL layout.

In particular, we assume that scrollbar / slider / thumb has no border or
padding and that the writing-mode is horizontal ltr.

Differential Revision: https://phabricator.services.mozilla.com/D173489
2023-03-27 20:54:53 +00:00
Sandor Molnar fcbacc6d6c Backed out changeset 7da2469ac949 (bug 1824236) for causing assertion failures in layout/generic/crashtests/369038-1.xhtml CLOSED TREE 2023-03-27 23:20:35 +03:00
Emilio Cobos Álvarez 914393e83e Bug 1824236 - Stop using XUL layout for scrollbars. r=jwatt
This rewrites scrollbar layout to work with regular reflow rather than
box layout.

Overall it's about the same amount of code (mostly because
nsScrollbarFrame::Reflow is sorta hand-rolled), but it cleans up a bit
and it is progress towards removing XUL layout altogether, without
getting into much deeper refactoring.

This also blocks some other performance improvements and refactorings I
want to make in this code.

We make some assumptions to simplify the code that to some extent were
made already before, both explicitly and by virtue of using XUL layout.

In particular, we assume that scrollbar / slider / thumb has no border or
padding and that the writing-mode is horizontal ltr.

Differential Revision: https://phabricator.services.mozilla.com/D173489
2023-03-27 19:12:52 +00:00
David Shin a47e766d75 Bug 1812679 - Handle central baseline calculation in `GetNaturalBaselineBOffset`. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-24 16:23:16 +00:00
Hiroyuki Ikezoe 937d8566f7 Bug 1817126 - Revert bug 1745969 mainly. r=tnikkel
I didn't revert some tweaks for tests (e.g. allowing small fractional scroll
position differences) since we will end up allowing the differences until
we fixed all rounding/snapping scroll related metrics issue, bug 1774315 for
example.

Differential Revision: https://phabricator.services.mozilla.com/D170465
2023-03-24 01:42:15 +00:00
Norisz Fay 97050950be Backed out changeset 11ba57726279 (bug 1812679) for causing Wr failures on text-combine-upright-value-all-002.html 2023-03-24 01:51:06 +02:00
David Shin 6cb3b01af3 Bug 1812679 - Handle central baseline calculation in `GetNaturalBaselineBOffset`. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-23 17:36:49 +00:00
Stanca Serban 7c4f609327 Backed out changeset 49646b0d59aa (bug 1812679) for causing mochitests failures in layout/style/test/test_revert.html. CLOSED TREE 2023-03-23 17:39:13 +02:00
David Shin 2f94be9968 Bug 1812679 - Handle central baseline calculation in `GetNaturalBaselineBOffset`. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-23 14:35:12 +00:00
Emilio Cobos Álvarez cb2a32d8af Bug 1823455 - Merge ScrollFrameHelper and nsHTMLScrollFrame. r=layout-reviewers,TYLin
Now that we've removed nsXULScrollFrame, ScrollFrameHelper can be
subsumed under nsHTMLScrollFrame.

I want to do this before making scrollbars non-XUL.

Renaming to mozilla::ScrollFrame is left for a follow-up bug.

Differential Revision: https://phabricator.services.mozilla.com/D173063
2023-03-22 13:06:40 +00:00
Emilio Cobos Álvarez 82623a74ae Bug 1600542 - Remove nsXULScrollFrame. r=dshin
We no longer have any use of it.

Differential Revision: https://phabricator.services.mozilla.com/D172876
2023-03-20 17:19:29 +00:00
Emilio Cobos Álvarez da7fa43d4a Bug 1809084 - Stop using XUL layout for menu popups. r=desktop-theme-reviewers,dao,dshin
The underlying issue here is an invalidation bug with XUL layout. When a
popup opens, we try to lay it out at full size, then post a reflow
callback to constrain it.

There's an intermediate step there where the popup might remain at full
size, and the constraining operates directly on mRect, which isn't quite
sound and doesn't update the scrollport of descendants.

Make nsMenuPopupFrame inherit from nsBlockFrame instead, doing
potentially two layout passes when constrained.

This fixes the issue at hand, and removes XUL layout from menu popups,
so it's a win-win.

To make reasoning about it a bit easier, factor out a bunch of the XUL
positioning code to be const. The mutation of mRect etc which was going
on otherwise was pretty hard to reason about.

Differential Revision: https://phabricator.services.mozilla.com/D170368
2023-03-16 19:09:14 +00:00
Dan Robertson 85fd59cea3 Bug 1758760 - Do not expire first scrollable frame displayport. r=tnikkel,botond
Do not allow the displayport for the first scrollable frame to expire.

Differential Revision: https://phabricator.services.mozilla.com/D169861
2023-03-08 18:39:04 +00:00
Ryan VanderMeulen fdeae6aef2 Backed out changesets 38a4e166571c and 88798511f9ec (bug 1817126) for causing bug 1819724. 2023-03-01 17:52:33 -05:00
Hiroyuki Ikezoe e458d4423f Bug 1817126 - Implement GetUnsnappedLayoutScrollRange and use it in WantAsyncScroll. r=tnikkel
Depends on D170465

Differential Revision: https://phabricator.services.mozilla.com/D170466
2023-03-01 03:11:37 +00:00
Hiroyuki Ikezoe c99ede580d Bug 1817126 - Revert bug 1745969 mainly. r=tnikkel
I didn't revert some tweaks for tests (e.g. allowing small fractional scroll
position differences) since we will end up allowing the differences until
we fixed all rounding/snapping scroll related metrics issue, bug 1774315 for
example.

Differential Revision: https://phabricator.services.mozilla.com/D170465
2023-03-01 03:11:37 +00:00
Marian-Vasile Laza 6c1f72e279 Backed out 2 changesets (bug 1817126) for wpt failures on scrollable-overflow-zero-one-axis.html. CLOSED TREE
Backed out changeset 1a1fa9a635b8 (bug 1817126)
Backed out changeset 0a1f7b5bed45 (bug 1817126)
2023-03-01 04:51:48 +02:00
Hiroyuki Ikezoe bf9d5b4f09 Bug 1817126 - Implement GetUnsnappedLayoutScrollRange and use it in WantAsyncScroll. r=tnikkel
Depends on D170465

Differential Revision: https://phabricator.services.mozilla.com/D170466
2023-02-28 22:19:24 +00:00
Hiroyuki Ikezoe bf04fe1d36 Bug 1817126 - Revert bug 1745969 mainly. r=tnikkel
I didn't revert some tweaks for tests (e.g. allowing small fractional scroll
position differences) since we will end up allowing the differences until
we fixed all rounding/snapping scroll related metrics issue, bug 1774315 for
example.

Differential Revision: https://phabricator.services.mozilla.com/D170465
2023-02-28 22:19:24 +00:00
Dan Robertson 73fa554e54 Bug 1743045 - Respect general.smoothScroll for programmatic scrolls. r=hiro
For programmatic scrolls, we should respect a users general.smoothScroll
preference. If smooth scrolls are disabled, programmatic scrolls with
behavior: "smooth" should be treated as instant programmatic scrolls.

Differential Revision: https://phabricator.services.mozilla.com/D170110
2023-02-27 21:09:06 +00:00