Commit graph

2222 commits

Author SHA1 Message Date
David Shin
f5a42005e2 Bug 1811311 - Part 3: Refactor GetNaturalBaselineBOffset to return Maybe<nscoord>. r=layout-reviewers,emilio
Changed from returning `bool` & taking an out parameter.

Differential Revision: https://phabricator.services.mozilla.com/D168998
2023-02-23 14:53:27 +00:00
David Shin
5c7c22165f Bug 1811311 - Part 1: Unite baseline-related functions in nsIFrame into one. r=emilio
Before, there existed 3 virtual functions that calculated baselines:

- `GetLogicalBaseline`
- `GetVerticalAlignBaseline`
- `GetNaturalBaselineBOffset`

Each of them had slightly different behaviours:

- `GetLogicalBaseline` would synthesize a baseline if there is no baseline.
  Others would simply return `false`.
- `GetNaturalBaselineBOffset` requires the caller to pick which of first/last
  baseline to calculate. Others pick on on their own.
- `GetNaturalBaselineBOffset`'s result can be either offset from border box
   start/end edge, depending on the caller-supplied baseline. Others always
   return offset from border box start edge.

Now:

- `GetNaturalBaselineBOffset` is the sole virtual function.
- `GetLogicalBaseline` exists to support its use, with 2 virtual helper functions:
  - `SynthesizeFallbackBaseline` to generate a baseline for elements that
    doesn't have one.
  - `GetBaselineSharingGroup` to preserve the default baseline picking behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D167990
2023-02-23 14:53:26 +00:00
Csoregi Natalia
dd188e11f2 Backed out changeset 05981db2f726 (bug 1743045) for causing failures on test_group_scrollend.html. CLOSED TREE 2023-02-23 04:23:40 +02:00
Hiroyuki Ikezoe
98ea9b2281 Bug 1663444 - Expand the clip rect for async zoom container including the dynamic toolbar area. r=geckoview-reviewers,owlish,botond
Differential Revision: https://phabricator.services.mozilla.com/D168638
2023-02-23 00:05:09 +00:00
Dan Robertson
8ac30ce878 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-22 23:26:18 +00:00
Butkovits Atila
d434d2fc49 Backed out changeset c33204e69e49 (bug 1743045) for causing failures at scroll-behavior-3.html. CLOSED TREE 2023-02-22 01:15:14 +02:00
Dan Robertson
69572ca871 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-21 22:02:11 +00:00
Razvan Cojocaru
015878d5a9 Bug 1554795 - Support desktop scrollbar thumb sizing logic in APZ. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D161561
2023-02-06 23:16:59 +00:00
Emilio Cobos Álvarez
604d8268b2 Bug 1813046 - Simplify scrollbar sizing code. r=spohl
This removes the capability of having differently-sized vertical and
horizontal scrollbars (which is only potentially used in windows, and in
practice almost-never used). For that case, we choose the larger of
vertical/horizontal scrollbar sizes.

This is in order to be able to realistically expose the scrollbar size
to CSS, see blocked bug.

We make RecomputeScrollbarParams the central place where each scrollbar
style decides its sizes, and make GetDPIRatioForScrollbarPart handle the
cocoa special-case of scaling to 1 or 2, but nothing else.

Differential Revision: https://phabricator.services.mozilla.com/D168080
2023-01-28 21:35:51 +00:00
Emilio Cobos Álvarez
79af3ab38f Bug 1809630 - Make thin scrollbars on Windows have a reasonable minimum size. r=tnikkel,layout-reviewers
The way the code was set up before this patch ends up causing minimum
scrollbar sizes to be 0x0 for thin (non-overlay) scrollbars.

This is rather problematic, since it means that we would always try to
place the scrollbar even if it doesn't fit (think of an element with
height: 0).

This causes a lot of extra reflow, which with very complex layouts is
even worse, because the extra scrollframe reflows cause us to miss the
flex caches, causing O(n^2) performance.

Add assertions to make sure we never end up with a zero minimum
scrollbar size, and change the size computation to match for both
thin and thick scrollbars.

Differential Revision: https://phabricator.services.mozilla.com/D166756
2023-01-13 20:42:27 +00:00
Cristian Tuns
3d3df76b69 Backed out changeset 51619d94e92d (bug 1809630) for causing reftest failures on percent-height-overflowing-image-1.html CLOSED TREE 2023-01-13 01:11:46 -05:00
Emilio Cobos Álvarez
aaa4049b01 Bug 1809630 - Make thin scrollbars on Windows have a reasonable minimum size. r=tnikkel,layout-reviewers
The way the code was set up before this patch ends up causing minimum
scrollbar sizes to be 0x0 for thin (non-overlay) scrollbars.

This is rather problematic, since it means that we would always try to
place the scrollbar even if it doesn't fit (think of an element with
height: 0).

This causes a lot of extra reflow, which with very complex layouts is
even worse, because the extra scrollframe reflows cause us to miss the
flex caches, causing O(n^2) performance.

Add assertions to make sure we never end up with a zero minimum
scrollbar size, and change the size computation to match for both
thin and thick scrollbars.

Differential Revision: https://phabricator.services.mozilla.com/D166756
2023-01-13 04:49:55 +00:00
Boris Chiou
38556e307d Bug 1807685 - Rename scroll-linked (animations) to scroll-driven (excluding WPT tests). r=dholbert
The spec is still using `Scroll-linked`, so we exclude the change of WPT tests.
I believe WPT will get updates once the spec doc is renamed.

Differential Revision: https://phabricator.services.mozilla.com/D165914
2023-01-04 00:50:45 +00:00
Dan Robertson
8b358b41b7 Bug 1379458 - The ScrollParentId should match the ASR tree. r=botond,tnikkel,mstange
Make the ScrollMetadata's mScrollParentId match what is found in the active
scroll root tree.

Depends on D148662

Differential Revision: https://phabricator.services.mozilla.com/D149925
2022-12-27 14:08:51 +00:00
Botond Ballo
3290b1740f Bug 1519339 - Clamp the pending visual scroll offset if using it as the main-thread's visual viewport offset. r=tnikkel
Depends on D163532

Differential Revision: https://phabricator.services.mozilla.com/D163533
2022-12-09 09:01:43 +00:00
Botond Ballo
283c0a23b7 Bug 1519339 - Do not hand off smooth scrolls in an overflow:hidden direction to APZ. r=dlrobertson
APZ cannot currently scroll in directions which are overflow:hidden
(it does not know the full scroll range bounds in those directions).

Therefore, main-thread scrolling in these directions should not be
handed off to APZ.

Differential Revision: https://phabricator.services.mozilla.com/D161351
2022-12-09 09:01:42 +00:00
Dan Robertson
877e8b332d Bug 1803455 - Fire scrollend for a main thread smooth scroll. r=botond
Use the original start position of main thread smooth scrolls to determine
if the scroll position changed on scroll complete, and fire a scrollend
event if it did.

Differential Revision: https://phabricator.services.mozilla.com/D163550
2022-12-02 22:26:55 +00:00
Martin Robinson
abb5044ca7 Bug 1803377 - Rename the values of the IntrinsicDirty enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163607
2022-12-02 12:27:31 +00:00
Botond Ballo
68c71a503c Bug 1802225 - Remove Layers.{h,cpp}. r=tnikkel,geckoview-reviewers,jgilbert,media-playback-reviewers,padenot,m_kato
Where appropriate, `#include "Layers.h"` is replaced with
more specific inclusions.

Differential Revision: https://phabricator.services.mozilla.com/D162934
2022-11-29 01:52:03 +00:00
Ben Freist
a0881d2bec Bug 1801458 - [refactor] Migrate NS_STYLE_UNICODE_BIDI_* defines r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D162487
2022-11-22 18:37:02 +00:00
Emilio Cobos Álvarez
d38d7fc847 Bug 1801517 - Remove nsPresContext::IsRootContentDocument(). r=hiro
The Element caller only cares about avoiding a flush and can use the
observable parent layout stuff.

The scrollframe one clearly wants the cross-process version according to
the comment.

Differential Revision: https://phabricator.services.mozilla.com/D162477
2022-11-21 08:04:58 +00:00
Dan Robertson
7cac973684 Bug 1796690 - Fire scrollend for scroll that updates scroll position. r=hiro
Do not fire a scrollend event for a instant scroll that does not change the
scroll position.

Depends on D161265

Differential Revision: https://phabricator.services.mozilla.com/D160156
2022-11-18 15:12:10 +00:00
Cristian Tuns
ef7f87bef7 Backed out 3 changesets (bug 1796690) for causing mochitest failures on browser_primaryUI.js CLOSED TREE
Backed out changeset 28f9e04d3500 (bug 1796690)
Backed out changeset 70903d77e4f0 (bug 1796690)
Backed out changeset 66ddf8488393 (bug 1796690)
2022-11-16 18:22:14 -05:00
Dan Robertson
9baee76621 Bug 1796690 - Fire scrollend for scroll that updates scroll position. r=hiro
Do not fire a scrollend event for a instant scroll that does not change the
scroll position.

Depends on D161265

Differential Revision: https://phabricator.services.mozilla.com/D160156
2022-11-16 16:52:24 +00:00
Csoregi Natalia
fc5a2ea215 Backed out changeset 56bc7d891bd3 (bug 1519339) for failures on helper_overflowhidden_zoom.html. CLOSED TREE 2022-11-15 03:10:25 +02:00
Botond Ballo
239e18e404 Bug 1519339 - Do not hand off smooth scrolls in an overflow:hidden direction to APZ. r=dlrobertson
APZ cannot currently scroll in directions which are overflow:hidden
(it does not know the full scroll range bounds in those directions).

Therefore, main-thread scrolling in these directions should not be
handed off to APZ.

Differential Revision: https://phabricator.services.mozilla.com/D161351
2022-11-14 22:50:21 +00:00
Hiroyuki Ikezoe
9954b93ca8 Bug 1745969 - Stop doing SnapCoord. r=tnikkel
With doing SnapCoord we mis-consider non-scrollable frames as scrollable in APZ,
thus it causes unexpected overscroll gutters.

Depends on D161417

Differential Revision: https://phabricator.services.mozilla.com/D161419
2022-11-14 21:08:55 +00:00
Ting-Yu Lin
514d412f9b Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-12 04:38:53 +00:00
Ting-Yu Lin
c565d29604 Bug 1799732 Part 2 - Flatten the namespace for FrameChildList and co. by removing namespace layout. r=emilio
After moving FrameChildListID into mozilla namespace, `kPrincipalList` etc. are
also exposed in the mozilla namespace. In the next part, I'll convert
FrameChildListID enum into an enum class, so the naming pollution shouldn't be
an issue.

This patch has a nice side effect that it is now easier to remove all the
aliases of FrameChildListID (`kPrincipalList` etc.) defined in multiple places
since it is confusion to have the same thing written in different ways, e.g.
`nsIFrame::kPrincipalList`, `mozilla::layout::kPrincipalList`,
`FrameChildListID::kPrincipalList`, `kPrincipalList`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D161863
2022-11-12 04:38:53 +00:00
Noemi Erli
7c40c0e983 Backed out 3 changesets (bug 1799732) for causing build bustages in nsIFrame.cpp CLOSED TREE
Backed out changeset e559f9dbc76f (bug 1799732)
Backed out changeset c40fda7a8b0b (bug 1799732)
Backed out changeset 1f84bfb41ab8 (bug 1799732)
2022-11-12 02:16:45 +02:00
Ting-Yu Lin
192956df1b Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-11 23:44:17 +00:00
Ting-Yu Lin
75940b1777 Bug 1799732 Part 2 - Flatten the namespace for FrameChildList and co. by removing namespace layout. r=emilio
After moving FrameChildListID into mozilla namespace, `kPrincipalList` etc. are
also exposed in the mozilla namespace. In the next part, I'll convert
FrameChildListID enum into an enum class, so the naming pollution shouldn't be
an issue.

This patch has a nice side effect that it is now easier to remove all the
aliases of FrameChildListID (`kPrincipalList` etc.) defined in multiple places
since it is confusion to have the same thing written in different ways, e.g.
`nsIFrame::kPrincipalList`, `mozilla::layout::kPrincipalList`,
`FrameChildListID::kPrincipalList`, `kPrincipalList`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D161863
2022-11-11 23:44:16 +00:00
David Shin
460a4fd6d9 Bug 1791069 - Clamp scrollable element's first/last baseline position to border box. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D161068
2022-11-10 17:49:00 +00:00
Cosmin Sabou
dd216c1307 Backed out changeset d55e22227807 (bug 1791069) for wpt failures on negative-overflow-002.html. CLOSED TREE 2022-11-10 07:59:42 +02:00
David Shin
71aa402ce9 Bug 1791069 - Clamp scrollable element's first/last baseline position to border box. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D161068
2022-11-09 21:46:03 +00:00
Noemi Erli
5589527051 Backed out changeset 27903633c625 (bug 1791069) for causing web-platform failures CLOSED TREE 2022-11-09 19:36:35 +02:00
David Shin
247d54c98b Bug 1791069 - Clamp scrollable element's first/last baseline position to border box. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D161068
2022-11-09 16:25:46 +00:00
Stanca Serban
edb43a2039 Backed out 2 changesets (bug 1745969) for causing mochitests failures on test_bug842853-2.html.CLOSED TREE
Backed out changeset 11b84155f96e (bug 1745969)
Backed out changeset 6fd4ba66ac87 (bug 1745969)
2022-11-09 03:20:35 +02:00
Butkovits Atila
670b9fcab3 Backed out changeset 33ba5e2e97b1 (bug 1791069) for causing failures at grid-align-baseline-line-clamp-002.tentative.html. CLOSED TREE 2022-11-09 01:06:06 +02:00
David Shin
a8a89e8507 Bug 1791069 - Clamp scrollable element's first/last baseline position to border box. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D161068
2022-11-08 21:32:44 +00:00
Hiroyuki Ikezoe
a9fdcf76cc Bug 1745969 - Stop doing SnapCoord. r=tnikkel
With doing SnapCoord we mis-consider non-scrollable frames as scrollable in APZ,
thus it causes unexpected overscroll gutters.

Depends on D161417

Differential Revision: https://phabricator.services.mozilla.com/D161419
2022-11-08 21:08:35 +00:00
Sandor Molnar
1ae11a4732 Backed out 2 changesets (bug 1745969) for causing wpt/mochitest failures.
Backed out changeset a23bb92cb6fe (bug 1745969)
Backed out changeset aec681965be3 (bug 1745969)
2022-11-08 05:51:09 +02:00
Hiroyuki Ikezoe
23cced6f2f Bug 1745969 - Stop doing SnapCoord. r=tnikkel
With doing SnapCoord we mis-consider non-scrollable frames as scrollable in APZ,
thus it causes unexpected overscroll gutters.

Differential Revision: https://phabricator.services.mozilla.com/D161419
2022-11-08 02:56:03 +00:00
Sandor Molnar
dd9e307496 Backed out 3 changesets (bug 1796690) for causing mochitest failures in browser/components/urlbar/tests/browser/browser_UrlbarInput_overflow.js CLOSED TREE
Backed out changeset 5040c6736ee7 (bug 1796690)
Backed out changeset d86f25e5b636 (bug 1796690)
Backed out changeset 887104a60dc4 (bug 1796690)
2022-11-08 01:20:27 +02:00
Dan Robertson
4fa4081971 Bug 1796690 - Fire scrollend for scroll that updates scroll position. r=hiro
Do not fire a scrollend event for a instant scroll that does not change the
scroll position.

Depends on D161265

Differential Revision: https://phabricator.services.mozilla.com/D160156
2022-11-07 20:05:20 +00:00
Ting-Yu Lin
040feb02dd Bug 1798373 Part 7 - Change nsContainerFrame::InsertFrames() to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160843
2022-11-01 21:15:55 +00:00
Ting-Yu Lin
c99b45fa14 Bug 1798373 Part 6 - Change nsContainerFrame::AppendFrames() to take rvalue reference of nsFrameList. r=emilio
Change nsBlockFrame::AppendFrames() helper, too.

Differential Revision: https://phabricator.services.mozilla.com/D160842
2022-11-01 21:15:54 +00:00
Ting-Yu Lin
4787078c5c Bug 1798373 Part 5 - Change nsContainerFrame::SetInitialChildList() to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160841
2022-11-01 21:15:54 +00:00
Ting-Yu Lin
adf4fab73c Bug 1798373 Part 2 - Change nsFrameList::AppendFrames to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160838
2022-11-01 21:15:52 +00:00
Ting-Yu Lin
569c5f244b Bug 1798373 Part 1 - Change nsFrameList::InsertFrames to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160837
2022-11-01 21:15:52 +00:00