Commit graph

2251 commits

Author SHA1 Message Date
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
641fa20731 Bug 1825825 - Simplify NAC setup. r=smaug
Make all UA widgets also NAC.

Keep the UA widget flag but break at anonymous subtree boundaries, so
that only nodes inside the UA widget directly (and not NAC from those)
get the flag.

This is important because two callers depend on this difference:

 * The style system, since we still want to match content rules from
   stylesheets in the UA widget. We also match user rules, which is a
   bit sketchy, but that was the previous behavior, will file a
   follow-up for that.

 * The reflector code, since we want the scope for UA widgets to not
   include the NAC nodes inside that UA widget. nsINode::IsInUAWidget
   got it wrong.

After this patch, ChromeOnlyAccess is equivalent to
IsInNativeAnonymousSubtree, so we should probably unify the naming.
That's left for a follow-up patch because I don't have a strong
preference.

Differential Revision: https://phabricator.services.mozilla.com/D174310
2023-04-05 09:19:15 +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
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
Boris Chiou
c2fa109db0 Bug 1821416 - Drop the element property usage from ScrollTimelineSet. r=emilio
We are doing the following things here:
1. Rename ScrollTimelineSet to ProgressTimelineScheduler because this
   class is used to schedule animations with progress timelines, including
   scroll timelines and view timelines.
2. Drop the element property usage and let ElementAnimationData store
   ProgressTimelineScheduler.
3. We avoid using the generated content in ScrollTimeline::Scroller.
   Instead, we use a pair of Element and PseudoStyleType to represent
   ScrollTimeline::Scroller.

We hit the assertion because the generatd content may change and so we
shouldn't use it as the ScrollTimeline::Scroller.

Differential Revision: https://phabricator.services.mozilla.com/D172610
2023-03-16 20:00:00 +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
Ting-Yu Lin
0293650697 Bug 1819239 - Add script blocker to places where we assert no layout flush. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171607
2023-03-15 17:57:38 +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
Emilio Cobos Álvarez
2aa048e90f Bug 1818927 - Remove XUL clickthrough attribute. r=dholbert
It only has an effect on macOS, and it's only used for
scrollbars/resizers/trees. We already hard-coded <browser>
to behave as never so do the same consistently, see bug 1519905.

This reduces noise when inspecting scrollbars (and it's simpler).

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D171011
2023-02-27 10:03:51 +00:00
Norisz Fay
feb7ac30db Backed out 6 changesets (bug 1818927) for causing bc failurs on browser_parsable_css.js CLOSED TREE
Backed out changeset 02c5f8c116b5 (bug 1818927)
Backed out changeset 6cf817fdd398 (bug 1818927)
Backed out changeset 0f0342ee4149 (bug 1818927)
Backed out changeset 4f944842cde4 (bug 1818927)
Backed out changeset 08ad4bea30d6 (bug 1818927)
Backed out changeset f50bb20ae41d (bug 1818927)
2023-02-27 02:49:46 +02:00
Emilio Cobos Álvarez
8d3a1d6473 Bug 1818927 - Remove XUL clickthrough attribute. r=dholbert
It only has an effect on macOS, and it's only used for
scrollbars/resizers/trees. We already hard-coded <browser>
to behave as never so do the same consistently, see bug 1519905.

This reduces noise when inspecting scrollbars (and it's simpler).

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D171011
2023-02-26 23:09:20 +00:00
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