Commit graph

274 commits

Author SHA1 Message Date
Ting-Yu Lin
5432f83374 Bug 1877850 Part 1 - Convert callers of ReflowInput physical size accessors to use logical ones. r=dholbert
ReflowInput's computed sizes and border&padding are stored in logical
coordinates, so accessing the physical version is slower [1]. This patch
converts as many callers as possible to use logical coordinates.

This patch doesn't change behavior.

[1] For example, accessing `ComputedWidth()` and `ComputedHeight()` needs two
`IsVertical()` check, but `GetPhysicalSize()` only needs one.

Differential Revision: https://phabricator.services.mozilla.com/D200237
2024-02-01 22:02:00 +00:00
Cathie Chen
1445599ff3 Bug 1868868 - The value of thumb position changed by reflow should be consistent to nsSliderFrame::CurrentPositionChanged, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D195815
2023-12-12 12:11:13 +00:00
Norisz Fay
537c88500c Backed out changeset 76af96bf48b4 (bug 1868868) for causing reftest failures on root-scrollbar-zoomed-in-async-scroll.html CLOSED TREE 2023-12-09 04:29:42 +02:00
Cathie Chen
de69219906 Bug 1868868 - The value of thumb position changed by reflow should be consistent to nsSliderFrame::CurrentPositionChanged, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D195815
2023-12-08 16:54:53 +00:00
Razvan Cojocaru
bdb2ba1cb0 Bug 1868099 - Re-enable middle-click dragging. r=botond
The patch we wrote for bug 1819411 made APZ handle dragging, but
the APZ code does not handle middle-click dragging. This is a
quick fix, that just bails out early from the APZ code if
dragging started from a middle click.

Differential Revision: https://phabricator.services.mozilla.com/D195592
2023-12-05 21:37:39 +00:00
Emilio Cobos Álvarez
0789b3b2fc Bug 1863620 - Use an accelerated animation for overlay scrollbar. r=hiro
This also simplifies ScrollbarActivity, and removes some attributes that
aren't looked up while at it.

Differential Revision: https://phabricator.services.mozilla.com/D193049
2023-11-20 21:47:50 +00:00
Sandor Molnar
ca527593f2 Backed out 2 changesets (bug 1863620) for causing multiple failure CLOSED TREE
Backed out changeset 298c668b4347 (bug 1863620)
Backed out changeset e34670e74c31 (bug 1863620)
2023-11-20 14:02:26 +02:00
Emilio Cobos Álvarez
b468a9fcd0 Bug 1863620 - Use an accelerated animation for overlay scrollbar. r=hiro
This also simplifies ScrollbarActivity, and removes some attributes that
aren't looked up while at it.

Differential Revision: https://phabricator.services.mozilla.com/D193049
2023-11-20 09:32:00 +00:00
Razvan Cojocaru
b2c34cc36b Bug 1819411 - Use APZ even when scrollbar dragging doesn't start over the thumb. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D190910
2023-10-31 20:47:04 +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
5fa48c881a Bug 1840025 - Use ScrollMode::Smooth in nsSliderFrame::PageScroll. r=rzvncj
This restores the scrolling physics used in PageScroll to what it was
before bug 1331390.

Differential Revision: https://phabricator.services.mozilla.com/D187363
2023-09-04 20:43:50 +00:00
Botond Ballo
39fbef2cf2 Bug 1846575 - Scroll a full page per repeat timer tick during scrollbar track click-and-hold. r=rzvncj
Differential Revision: https://phabricator.services.mozilla.com/D187152
2023-08-31 07:04:56 +00:00
Botond Ballo
816247d153 Bug 1846575 - Introduce/rename some variables in nsSliderFrame::PageScroll for clarity. r=rzvncj
Differential Revision: https://phabricator.services.mozilla.com/D187151
2023-08-31 07:04:55 +00:00
Razvan Cojocaru
065f6d2acf Bug 1850457 - Take general.smoothScroll.pages into account when scrolling by keeping the mouse pressed on the scrollbar. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D187021
2023-08-29 19:48:48 +00:00
Razvan Cojocaru
e2b2e5ebe7 Bug 1847716 - Don't scroll smoothly if smooth scrolling disabled when clicking and holding scrollbar. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D185775
2023-08-10 05:55:58 +00:00
Stanca Serban
5730c0b3fd Backed out changeset 665bcec8a2d4 (bug 1847716) for causing mochitest-plain failures in test_group_mouseevents.html. 2023-08-10 05:21:08 +03:00
Razvan Cojocaru
20169e553c Bug 1847716 - Don't scroll smoothly if smooth scrolling disabled when clicking and holding scrollbar. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D185775
2023-08-09 21:48:50 +00:00
Alex Jakobi
d2bed12b46 Bug 1794590 - Change mirror value for slider.snapMultiplier r=botond
Differential Revision: https://phabricator.services.mozilla.com/D184735
2023-08-02 17:10:38 +00:00
Botond Ballo
6fc78cda20 Bug 1842276 - Allow dynamically choosing whether scrollbar track click-and-hold has the 'Linux behavior' or the 'Windows/Mac behavior'. r=rzvncj
Differential Revision: https://phabricator.services.mozilla.com/D183038
2023-07-07 20:34:26 +00:00
Emilio Cobos Álvarez
4cc6758558 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Razvan Cojocaru
d45f60d317 Bug 1331390 - Don't over scroll when mouse down on scrollbar if smooth scroll is enabled. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D171017
2023-06-05 17:43:38 +00:00
Botond Ballo
c3eec8d47e Bug 1818721 - Invalidate the slider frame when the thumb is moved. r=tnikkel
The thumb's position is sent to the compositor in ScrollbarData::mThumbStart
stored on the OwnLayer item built by the slider frame, so we need to
invalidate the slider frame when the thumb's position changes.

Differential Revision: https://phabricator.services.mozilla.com/D176384
2023-05-15 05:24:38 +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
Botond Ballo
6e20a2a104 Bug 1815372 - Introduce OuterCSSPixel to represent quantities in CSS pixels of content surrounding a scroll frame. r=dlrobertson
This is currently used mostly for calculations related to scrollbars,
which are an example of content outside the scroll frame (and in
particular not subject to the zoom of a zoomable scroll frame).

As part of this change, FrameMetrics::
CalculateCompositionBoundsInCssPixelsOfSurroundingContent() is
renamed to CalculateCompositionBoundsInOuterCSSPixels() for brevity.

Differential Revision: https://phabricator.services.mozilla.com/D171142
2023-03-03 23:57:14 +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
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
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
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
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
Glenn Watson
cebe610723 Bug 1768983 - Add prim flag for checkerboarding backgrounds r=gfx-reviewers,lsalzman
Although not needed right now (checkerboarding backgrounds get
a slice anyway due to being a different scroll root), this will
be important for the upcoming work to make backdrop filter
roots implicit. This allows WR to know when slicing up a content
slice if the prim is relevant to the backdrop root.

Differential Revision: https://phabricator.services.mozilla.com/D146145
2022-05-15 21:54:25 +00:00
Hiroyuki Ikezoe
a457a5cfbb Bug 1766805 - Introduce intended direction and intended end position concepts. r=botond
The scroll snap spec defines the concepts [1]. There are three type of scroll
operations. 1) intended end position, 2) intended direction and end position
and 3) intended direction.

Basically our existing ScrollUnits types correspond;

1) DEVICE_PIXELS, WHOLE => intended end position
2) PAGES => intended direction and end position
3) LINES => intended direction

There are two exceptions in the `intended direction and end position` case,
scrollBy() and fling gestures (on Linux). They were defined as scroll operations
with DEVICE_PIXELS unit, but the spec cleary says they are `intended direction
and end position` operations.

Note that we will also use this information for scroll-snap-stop property since
the properly will only have effects on both 2) and 3) cases.

[1] https://drafts.csswg.org/css-scroll-snap/#scroll-types

Depends on D145190

Differential Revision: https://phabricator.services.mozilla.com/D145191
2022-05-12 12:25:15 +00:00
Norisz Fay
ce587cb281 Backed out 3 changesets (bug 1766805) for causing build bustage on AsyncPanZoomController.cpp CLOSED TREE
Backed out changeset e35a130f2bce (bug 1766805)
Backed out changeset 9f9e2030fbc1 (bug 1766805)
Backed out changeset 898bd12a5da8 (bug 1766805)
2022-05-12 13:42:36 +03:00
Hiroyuki Ikezoe
098b8bc1a5 Bug 1766805 - Introduce intended direction and intended end position concepts. r=botond
The scroll snap spec defines the concepts [1]. There are three type of scroll
operations. 1) intended end position, 2) intended direction and end position
and 3) intended direction.

Basically our existing ScrollUnits types correspond;

1) DEVICE_PIXELS, WHOLE => intended end position
2) PAGES => intended direction and end position
3) LINES => intended direction

There are two exceptions in the `intended direction and end position` case,
scrollBy() and fling gestures (on Linux). They were defined as scroll operations
with DEVICE_PIXELS unit, but the spec cleary says they are `intended direction
and end position` operations.

Note that we will also use this information for scroll-snap-stop property since
the properly will only have effects on both 2) and 3) cases.

[1] https://drafts.csswg.org/css-scroll-snap/#scroll-types

Depends on D145190

Differential Revision: https://phabricator.services.mozilla.com/D145191
2022-05-12 07:45:59 +00:00
Hector Zhao
777803423b Bug 1757800 - Calculate scrollbar marks' positions with explicit window.scrollMin{X,Y}. r=jfkthame,emilio
In `vertical-rl` & `sideways-rl` writing modes, `window.scrollMinX` is not 0.

Differential Revision: https://phabricator.services.mozilla.com/D140485
2022-03-08 05:27:42 +00:00
Hector Zhao
1efb3c674c Bug 1700292 - Draw scroll marks on horizontal scrollbar as well. r=emilio,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D139001
2022-03-01 13:19:00 +00:00
Nicolas Silva
50ca258be2 Bug 1755747 - Add support for antialiased non-snapped rectangles. r=gfx-reviewers,aosmond
We need them for SVG primitives.

This patch adds a bit of plumbing to disable snapping some of the primitives and forcing the antialiasing shader feature where needed, and uses it for SVG solid rectangles and images.

Differential Revision: https://phabricator.services.mozilla.com/D139024
2022-02-23 13:37:39 +00:00
Miko Mynttinen
ddec6eef59 Bug 1714584 - Part 1: Decouple nsDisplayList internal list from nsDisplayItems r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138152
2022-02-22 23:42:18 +00:00
Norisz Fay
2121660ce9 Backed out 2 changesets (bug 1714584) per devs request for causing crashes a=backout
Backed out changeset 3baead3e079b (bug 1714584)
Backed out changeset a2da895a58ce (bug 1714584)
2022-02-22 16:41:57 +02:00
Miko Mynttinen
28474c7ad2 Bug 1714584 - Part 1: Decouple nsDisplayList internal list from nsDisplayItems r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138152
2022-02-22 00:44:25 +00:00
Edgar Chen
e88b81fa72 Bug 367028 - Prevent drag-and-drop operation while dragging a scrollbar; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D131736
2021-12-17 12:10:58 +00:00