Commit graph

1964 commits

Author SHA1 Message Date
Botond Ballo
9be0302277 Bug 1661356 - Change nsLayoutUtils::ComputeScrollMetadata() to take a scrollport size instead of a scrollport rect. r=kats
No one meaningfully uses the scrollport rect's origin, so there's no
point in having callers compute it.

Differential Revision: https://phabricator.services.mozilla.com/D88337
2020-08-27 01:40:19 +00:00
Kartikaya Gupta
d046d2b406 Bug 1660933 - Respect wheel migration value. r=botond
This introduces a linear interpolation when computing the wheel animation
durations, based on the migration percentage of the user. Initially the
migration percentage defaults to 100 (fully migrated) for new users and for
existing users who have customized these prefs. The migration percentage
defaults to zero for existing users without customizations, so they will
still get the old default values of min=200,max=400. Over time we can adjust
the migration pref clamping to move that percentage up and migrate those
users to get the new values.

Differential Revision: https://phabricator.services.mozilla.com/D88163
2020-08-26 20:31:20 +00:00
Botond Ballo
a621152a3c Bug 1543485 - Also update the code in ScrollToImpl() that proactively updates the callback transform and main thread visual viewport offset. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D87692
2020-08-21 01:24:59 +00:00
Botond Ballo
27cd351633 Bug 1543485 - Back out the hacky fix for bug 1549625. r=kats
Now that main thread scroll updates preserve the relative scroll offset
in APZ, this hacky fix is no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D87687
2020-08-20 23:30:13 +00:00
Timothy Nikkel
2de46c6ff5 Bug 1656802. Make visual viewport only layout scrollbars affect the composition bounds/visual viewport. r=emilio,kats
AFAICT the spec says that these layout scrollbars that take up no layout space that scroll the visual viewport do affect the size of the visual viewport. (Double check this)

Most other users don't care about the size of these special scrollbars.

I left nsIDOMWindowUtils::getScrollbarSize unchanged (NB different from nsIDOMWindowUtils::getScrollbarSizes which is modified by this patch) because I'm less sure. I will file a followup about it.

Differential Revision: https://phabricator.services.mozilla.com/D85708
2020-08-07 11:40:52 +00:00
Timothy Nikkel
345de90fa2 Bug 1656802. If both scrollbars are layout and present and only for the visual viewport they need to be adjusted to not overlap. r=emilio
The existing calculation will make them overlap. The AdjustOverlappingScrollbars code was written with overlay scrollbars in mind but it looks like it will work just fine for this case.

Differential Revision: https://phabricator.services.mozilla.com/D85707
2020-08-07 11:40:55 +00:00
Timothy Nikkel
a5c2284d8d Bug 1656802. Position the scrollcorner if we have both layout scrollbars and they are both for the visual viewport only. r=emilio
Otherwise the calculation above would lead to an empty rect for the scroll corner.

The scrollbar rects as computed now still overlap each other and the scroll corner, the next patch fixes that.

Differential Revision: https://phabricator.services.mozilla.com/D85706
2020-08-07 11:40:57 +00:00
Timothy Nikkel
415340d3d5 Bug 1656802. In LayoutScrollbars move the calculation of the scrollbar rects to the first thing in the function. r=emilio
There is no dependency in this code as far as I can tell.

The next patch needs the scrollbar rects for the scroll corner calculation.

Differential Revision: https://phabricator.services.mozilla.com/D85705
2020-08-08 07:07:46 +00:00
Timothy Nikkel
36e43673c3 Bug 1656802. Shift back in layout scrollbars that are only for the visual viewport so they are visible. r=emilio
Layout scrollbars that were only created for the visual viewport had no space reserved for them, so we need to shift them back in like overlay scrollbars. Otherwise they sit just outside of the scroll port and are not visible.

Differential Revision: https://phabricator.services.mozilla.com/D85704
2020-08-08 07:07:57 +00:00
Timothy Nikkel
a7100c9def Bug 1656802. Add a comment explaining how overlay scrollbars work with their negative margin. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D85703
2020-08-08 07:07:57 +00:00
Timothy Nikkel
0a37053b5b Bug 1656802. Add state variables to the scroll frame to track when scrollbars are only created to scroll the visual viewport within the layout viewport. r=emilio,kats
We need to distinguish these special scrollbars for several different reasons in upcoming patches.

Differential Revision: https://phabricator.services.mozilla.com/D85702
2020-08-07 11:40:47 +00:00
Timothy Nikkel
bdf314cb67 Bug 1656802. Calculate if we need scrollbars to scroll the visual viewport. r=emilio,kats
This fixes the regression we created with the first patch.

Differential Revision: https://phabricator.services.mozilla.com/D85701
2020-08-07 11:40:46 +00:00
Timothy Nikkel
54832c7143 Bug 1656802. Add flags that let us differentiate not showing scrollbars because something is overflow hidden from not showing scrollbars for other reasons. r=emilio
For the former we are still allowed to show scrollbars if we need to scroll the visual viewport inside the layout viewport (as long as they take up no layout space). For the latter we still do not want to show scrollbars.

The ShowScrollbar enum is now only from layouts perspective and doesn't take into account anything about the visual viewport.

Differential Revision: https://phabricator.services.mozilla.com/D85700
2020-08-07 11:40:47 +00:00
Timothy Nikkel
c389e0f6e6 Bug 1656802. When deciding if we want a scrollbar we need to consider only if the scrolled rect overflows the scrollport (not the visual viewport). r=emilio,kats
This will actually regress behaviour when overflow is auto and pinch zooming creates scrollable overflow (scrolling the visual viewport inside the layout viewport). We will fix that in later patches.

The reason that this is necessary is that the code as-is is incorrect if we have layout scrollbars (scrollbars that take up space). If we have layout scrollbars and we pinch zoom and we go from not needing a scrollbar to needing a scrollbar then that scrollbar cannot take up layout space (even though it is a layout scrollbar). The scrollbar cannot change the size of the layout viewport (it does, however, change the size of the visual viewport).

In later patches we fix this situation as well as the situation with an overflow hidden document (which also needs to create scrollbars when pinch zoomed).

Differential Revision: https://phabricator.services.mozilla.com/D85699
2020-08-07 11:40:50 +00:00
Kartikaya Gupta
cbcdeefeb3 Bug 1657627 - Refine condition used in temporary workaround code. r=botond
This restricts the workaround to mobile a bit better, since the
GetIsViewportOverridden() check returns true on desktop as of bug 1644271.

Differential Revision: https://phabricator.services.mozilla.com/D86414
2020-08-07 18:16:59 +00:00
Bogdan Tara
06a9a6d13f Backed out 11 changesets (bug 1656802) for async-scrolling reftests failures CLOSED TREE
Backed out changeset 941ee8aa9735 (bug 1656802)
Backed out changeset c5b1b38d1d35 (bug 1656802)
Backed out changeset fe2dd5de83ef (bug 1656802)
Backed out changeset 8e217fc1c6d4 (bug 1656802)
Backed out changeset 21f574f6acb4 (bug 1656802)
Backed out changeset 753f93dffe07 (bug 1656802)
Backed out changeset 386554110008 (bug 1656802)
Backed out changeset 2d3576ace2f1 (bug 1656802)
Backed out changeset 06a47c35c531 (bug 1656802)
Backed out changeset 57fa48542435 (bug 1656802)
Backed out changeset b1517bc33eff (bug 1656802)
2020-08-07 14:36:21 +03:00
Timothy Nikkel
2f60aa099a Bug 1656802. Make visual viewport only layout scrollbars affect the composition bounds/visual viewport. r=emilio,kats
AFAICT the spec says that these layout scrollbars that take up no layout space that scroll the visual viewport do affect the size of the visual viewport. (Double check this)

Most other users don't care about the size of these special scrollbars.

I left nsIDOMWindowUtils::getScrollbarSize unchanged (NB different from nsIDOMWindowUtils::getScrollbarSizes which is modified by this patch) because I'm less sure. I will file a followup about it.

Differential Revision: https://phabricator.services.mozilla.com/D85708
2020-08-07 10:05:10 +00:00
Timothy Nikkel
0f0f71e5bc Bug 1656802. If both scrollbars are layout and present and only for the visual viewport they need to be adjusted to not overlap. r=emilio
The existing calculation will make them overlap. The AdjustOverlappingScrollbars code was written with overlay scrollbars in mind but it looks like it will work just fine for this case.

Differential Revision: https://phabricator.services.mozilla.com/D85707
2020-08-07 10:04:50 +00:00
Timothy Nikkel
ee280dd6eb Bug 1656802. Position the scrollcorner if we have both layout scrollbars and they are both for the visual viewport only. r=emilio
Otherwise the calculation above would lead to an empty rect for the scroll corner.

The scrollbar rects as computed now still overlap each other and the scroll corner, the next patch fixes that.

Differential Revision: https://phabricator.services.mozilla.com/D85706
2020-08-07 10:04:37 +00:00
Timothy Nikkel
51578a321e Bug 1656802. In LayoutScrollbars move the calculation of the scrollbar rects to the first thing in the function. r=emilio
There is no dependency in this code as far as I can tell.

The next patch needs the scrollbar rects for the scroll corner calculation.

Differential Revision: https://phabricator.services.mozilla.com/D85705
2020-08-07 10:08:14 +00:00
Timothy Nikkel
3f4285b053 Bug 1656802. Shift back in layout scrollbars that are only for the visual viewport so they are visible. r=emilio
Layout scrollbars that were only created for the visual viewport had no space reserved for them, so we need to shift them back in like overlay scrollbars. Otherwise they sit just outside of the scroll port and are not visible.

Depends on D85703

Differential Revision: https://phabricator.services.mozilla.com/D86332
2020-08-07 10:08:14 +00:00
Timothy Nikkel
0275351ad7 Bug 1656802. Add a comment explaining how overlay scrollbars work with their negative margin. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D85703
2020-08-07 10:07:25 +00:00
Timothy Nikkel
ba33b7857b Bug 1656802. Add state variables to the scroll frame to track when scrollbars are only created to scroll the visual viewport within the layout viewport. r=emilio,kats
We need to distinguish these special scrollbars for several different reasons in upcoming patches.

Differential Revision: https://phabricator.services.mozilla.com/D85702
2020-08-07 10:03:33 +00:00
Timothy Nikkel
738ce628b6 Bug 1656802. Calculate if we need scrollbars to scroll the visual viewport. r=emilio,kats
This fixes the regression we created with the first patch.

Differential Revision: https://phabricator.services.mozilla.com/D85701
2020-08-07 10:03:26 +00:00
Timothy Nikkel
519c4bdc9e Bug 1656802. Add flags that let us differentiate not showing scrollbars because something is overflow hidden from not showing scrollbars for other reasons. r=emilio
For the former we are still allowed to show scrollbars if we need to scroll the visual viewport inside the layout viewport (as long as they take up no layout space). For the latter we still do not want to show scrollbars.

The ShowScrollbar enum is now only from layouts perspective and doesn't take into account anything about the visual viewport.

Differential Revision: https://phabricator.services.mozilla.com/D85700
2020-08-07 10:03:13 +00:00
Timothy Nikkel
9e2292aea1 Bug 1656802. When deciding if we want a scrollbar we need to consider only if the scrolled rect overflows the scrollport (not the visual viewport). r=emilio,kats
This will actually regress behaviour when overflow is auto and pinch zooming creates scrollable overflow (scrolling the visual viewport inside the layout viewport). We will fix that in later patches.

The reason that this is necessary is that the code as-is is incorrect if we have layout scrollbars (scrollbars that take up space). If we have layout scrollbars and we pinch zoom and we go from not needing a scrollbar to needing a scrollbar then that scrollbar cannot take up layout space (even though it is a layout scrollbar). The scrollbar cannot change the size of the layout viewport (it does, however, change the size of the visual viewport).

In later patches we fix this situation as well as the situation with an overflow hidden document (which also needs to create scrollbars when pinch zoomed).

Differential Revision: https://phabricator.services.mozilla.com/D85699
2020-08-07 10:06:14 +00:00
Timothy Nikkel
501012a976 Bug 1654933. Make ScrollFrameHelper::GetScrollRangeForUserInputEvents return a range that encompasses the visual viewport offset even if we are overflow: hidden. r=kats
Depends on D85983

Differential Revision: https://phabricator.services.mozilla.com/D85984
2020-08-05 17:55:29 +00:00
Timothy Nikkel
87a1cf6b13 Bug 1654933. ScrollFrameHelper::CurPosAttributeChanged should be using the scroll range not the scroll rect. r=kats
UpdateScrollbarPosition and ReflowFinished both use the scroll range for this. It usually doesn't matter, but the next patch will make it important.

Differential Revision: https://phabricator.services.mozilla.com/D85983
2020-08-05 17:56:12 +00:00
Emilio Cobos Álvarez
f08a5f293b Bug 1650502 - Plumb whether an async APZ animation is in progress via RepaintRequest. r=botond
And store that information in the scroll frame for the purposes of
avoiding scroll anchoring and scroll restoration.

Differential Revision: https://phabricator.services.mozilla.com/D85157
2020-08-02 16:58:29 +00:00
Cosmin Sabou
8aa0a2fcff Backed out 2 changesets (bug 1650502) for mochitest failures on test_frame_reconstruction.html. CLOSED TREE
Backed out changeset 1a4ce811fcab (bug 1650502)
Backed out changeset b21e76dcb485 (bug 1650502)
2020-08-02 19:50:05 +03:00
Emilio Cobos Álvarez
964bac7f10 Bug 1650502 - Plumb whether an async APZ animation is in progress via RepaintRequest. r=botond
And store that information in the scroll frame for the purposes of
avoiding scroll anchoring and scroll restoration.

Differential Revision: https://phabricator.services.mozilla.com/D85157
2020-08-02 15:20:55 +00:00
Mats Palmgren
910e11aa99 Bug 1531609 part 2 - Implement overflow:clip/visible combinations. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D73717
2020-08-01 01:57:41 +00:00
Jeremy Ir
20235b390f Bug 1531609 part 1 - Rename overflow:-moz-hidden-unscrollable to overflow:clip. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D73716
2020-08-01 01:56:58 +00:00
Andreea Pavel
cae88d4491 Backed out 2 changesets (bug 1650502) for failing android at test_frame_reconstruction.html on a CLOSED TREE
Backed out changeset 9b300d20df23 (bug 1650502)
Backed out changeset 1e87d4186672 (bug 1650502)
2020-08-01 02:54:36 +03:00
Emilio Cobos Álvarez
1ade3ecd63 Bug 1650502 - Plumb whether an async APZ animation is in progress via RepaintRequest. r=botond
And store that information in the scroll frame for the purposes of
avoiding scroll anchoring and scroll restoration.

Differential Revision: https://phabricator.services.mozilla.com/D85157
2020-07-31 20:33:01 +00:00
Butkovits Atila
cc95b93cba Backed out 3 changesets (bug 1635473, bug 1531609) for reftest failures. CLOSED TREE
Backed out changeset 1e7b32808be8 (bug 1531609)
Backed out changeset e64a61869cdb (bug 1531609)
Backed out changeset 6da37d7f6dd3 (bug 1635473)
2020-07-31 23:56:54 +03:00
Mats Palmgren
c875610606 Bug 1531609 part 2 - Implement overflow:clip/visible combinations. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D73717
2020-07-31 15:31:36 +00:00
Jeremy Ir
92b8f0f77a Bug 1531609 part 1 - Rename overflow:-moz-hidden-unscrollable to overflow:clip. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D73716
2020-07-31 16:40:48 +00:00
Timothy Nikkel
227f22acef Bug 1651332. Use purely relative scroll offset updates for many scrollbar initiated scrolls. r=kats
This patch basically attempts to make clicking in the scrollbar track outside of the scrollthumb "work". Clicking in the scrollbar track usually does a page scroll via nsSliderFrame::PageScroll. This eventually ends up in ScrollFrameHelper::ScrollBy where we turn the request from a relative one ("scroll by a page") into an absolute one ("scroll to this position").

This page scroll is typically a smooth scroll and is currently done on the main thread/layout side. Once we start scrolling the visual viewport offset with the scrollbars we can no longer do this purely on the layout side, we at least need the help of the compositor side. I think the simplest way to do this is to hand the scroll request off to the compositor and have it handle the whole thing.

Now we need to consider the following situation: user clicks scrollbar track to page scroll, smooth scroll gets partway complete on the compositor, user clicks again on scrollbar track for a further page scroll. The main thread can't send an absolute scroll offset update request to the compositor at this point because it has outdated information (it needs a 'starting position' to add the page scroll offset amount) so it'll end up scrolling to the wrong place. It has to send a relative scroll offset update.

We already have a mechanism to send relative scroll offset updates. It is implemented by sending a base scroll offset and the desired scroll offset, and then on the compositor send the difference between those two is computed and then added to the scroll offset.

This patch creates a new mechanism (so called "pure relative") that just sends a relative offset update without any absolute scroll positions. The reason I did this is because the existing relative scroll offset update mechanism is not aware of visual viewport offsets, but rather only layout scroll position. For example, here

https://searchfox.org/mozilla-central/rev/8d55e18875b89cdf2a22a7cba60dc40999c18356/layout/generic/nsGfxScrollFrame.h#446

the value we use for the base scroll offset (mApzScrollPos) is set to the layout scroll position. It may be entirely reasonable to make this existing mechanism vv offset aware, but I wanted to implement something to get it working with a smaller chance of regressions to things that already exist and work. Ideally these two mechanims would be merged.

Differential Revision: https://phabricator.services.mozilla.com/D82688
2020-07-19 14:56:24 +00:00
Timothy Nikkel
8fd54dce2c Bug 1651332. Update scrollbar attrs to use visual viewport offset. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D82685
2020-07-19 10:04:17 +00:00
Ting-Yu Lin
fdc00547f6 Bug 1637130 - Rename visual overflow to ink overflow. r=dbaron
This patch is generated by:

```
# Rename the nsOverflowType enum.
rg -l "eVisualOverflow" layout/ gfx/ | xargs sed -i "s/eVisualOverflow/eInkOverflow/g"

# Rename and drop the "Get" prefix from various functions.
rg -l "GetVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowRect/InkOverflowRect/g"
rg -l "GetPreEffectsVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetPreEffectsVisualOverflowRect/PreEffectsInkOverflowRect/g"
rg -l "GetVisualOverflowFromDeltas" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowFromDeltas/InkOverflowFromDeltas/g"
rg -l "GetScrollableOverflowRect" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowRect/ScrollableOverflowRect/g"

# Rename, drop the "Get" prefix, and change the suffix "Area" to "Rect"
# (because they return nsRect) for the two methods in nsLineBox.
rg -l "GetVisualOverflowArea" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowArea/InkOverflowRect/g"
rg -l "GetScrollableOverflowArea" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowArea/ScrollableOverflowRect/g"

# Rename rest of the functions and variables.
rg -l "VisualOverflow" layout/ gfx/ | xargs sed -i "s/VisualOverflow/InkOverflow/g"
rg -l "visual overflow" layout/ gfx/ | xargs sed -i "s/visual overflow/ink overflow/g"
rg -l "visualOverflow" layout/ gfx/ | xargs sed -i "s/visualOverflow/inkOverflow/g"
rg -l "visOverflow" layout/ gfx/ | xargs sed -i "s/visOverflow/inkOverflow/g"
rg -l "vis-overflow" layout/ gfx/ python/ | xargs sed -i "s/vis-overflow/ink-overflow/g"

./mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D84231
2020-07-20 20:17:36 +00:00
Kartikaya Gupta
e81aec49dc Bug 1650102 - Wrap the async zoom container around a blend container if needed. r=mstange
If there are mix-blend-mode items inside the async zoom container, the
BlendContainer can end up outside the async zoom container, at the top-level
stacking context. But this causes the blend mode to fail with WebRender.
Instead, if we are creating an async zoom container, we check to see if there
was a mix-blend-mode inside it, and create the blend container just inside
the async zoom container.

Differential Revision: https://phabricator.services.mozilla.com/D82186
2020-07-14 20:58:26 +00:00
longsonr
875f5e88ac Bug 1259861 - Move everything else into the mozilla namespace in layout/svg r=dholbert
Also: adjust include paths to be consistent for usages of various SVG headers,
and remove unused SVG includes (mostly for "utils" classes),
and drop stray "ns" from already-renamed SVG classes in various code comments.

Differential Revision: https://phabricator.services.mozilla.com/D83140
2020-07-11 02:20:20 +00:00
Ting-Yu Lin
ffcfb6dcec Bug 1651171 - Convert NS_SUBTREE_DIRTY to an inline method of nsIFrame. r=jfkthame
This is a straightforward conversion except that
`NS_SUBTREE_DIRTY(this)` can be written terser as `IsSubtreeDirty()`.

Differential Revision: https://phabricator.services.mozilla.com/D82811
2020-07-09 18:29:15 +00:00
Kartikaya Gupta
0cf65adf2b Bug 1651050 - Add a logging module for code that sets displayports. r=tnikkel
This is useful for debugging purposes.

Depends on D82778

Differential Revision: https://phabricator.services.mozilla.com/D82779
2020-07-09 10:10:28 +00:00
Kartikaya Gupta
aa7d787c6e Bug 1651050 - Change how the zoomable flag is used in scrollframes. r=tnikkel
If the root scrollframe has the zoomable flag set, it automatically returns
true from WantAsyncScroll which makes it the "primary" scrollframe, and
automatically gets a displayport. However, this can be undesirable in cases
where the root scrollframe is not actually scrollable (i.e. document content
doesn't overflow) because we don't actually need that displayport on the root
scrollframe and instead want it on a scrollframe that is actually scrollable.

This patch removes the behaviour of WantAsyncScroll returning true for such
scrollframes, but maintains the layerization changes needed to support zooming.
This reduces the set of differences between running with apz.allow_zooming on
and off, which in turn eliminates a bunch of test failures when that pref is
enabled.

Depends on D82777

Differential Revision: https://phabricator.services.mozilla.com/D82778
2020-07-09 10:39:59 +00:00
Hiroyuki Ikezoe
2e4ceac41e Bug 1525561 - Rename nsPresContext::GetToplevelContentDocumentPresContext to GetInProcessRootContentDocumentPresContext. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D82812
2020-07-09 01:58:59 +00:00
longsonr
6f5803e27f Bug 1651289 - Move remaining SVG concrete frame classes to the mozilla namespace r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D82650
2020-07-09 01:33:33 +00:00
Hiroyuki Ikezoe
d32459e2c0 Bug 1650686 - Drop layout.viewport_contains_no_contents_area. r=botond
I suppose it's been well tested on Fenix.

Differential Revision: https://phabricator.services.mozilla.com/D82305
2020-07-06 09:53:34 +00:00
Kartikaya Gupta
77b4f9fdf9 Bug 1644567 - Use a more appropriate check when reading the visual viewport offset. r=botond
Instead of checking for the visual viewport *size* being set, we check for
the *offset* being set. This makes more sense becuase we're going to be
reading the offset, not the size.

Depends on D81740

Differential Revision: https://phabricator.services.mozilla.com/D81741
2020-07-03 15:55:56 +00:00
Kartikaya Gupta
c9225cd3ec Bug 1644567 - Move towards setting the visual viewport offset on all presShells. r=botond
Depends on D81739

Differential Revision: https://phabricator.services.mozilla.com/D81740
2020-07-03 15:55:23 +00:00
Simon Giesecke
cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Kartikaya Gupta
40a788d924 Bug 1647034 - Change how the visual viewport is updated to eliminate spurious reflows. r=tnikkel
There's two code changes in this patch:

- The update to the visual viewport that was happening just before positioning
  the fixed items gets moved to happen after determining the scrollbars for
  the root scrollframe. This moves it a little bit earlier, to basically the
  earliest point at which the visual viewport can actually be computed, since
  it depends on the presence of the root scrollframe's scrollbars.

  More importantly, this change sets the visual viewport without checking to
  see if one was already set, as the old code did. This means every reflow
  of the root scrollframe on a presShell with an MVM will now have a visual
  viewport set. Previously the visual viewport would only get set for the first
  time when the MVM got a load or first-paint event, and then would get updated
  for subsequent reflows. The net effect here is that the visual viewport is
  set earlier, and this can sometimes eliminate extra reflows from after the
  load event, because everything is already in a consistent state.

- The NotifyResizeReflow call to MVM is replaced by a NotifyReflow call that
  runs before every reflow, instead of just on resizes. Note that the
  NotifyReflow also doesn't update the visual viewport like NotifyResizeReflow
  used to do, because that is taken care of by the above-mentioned code change
  to set the visual viewport.

  This is desirable because there are things that run during reflow that attempt
  to read the display size from the MVM, and they were getting a zero size
  for reflows that happened before the first resize or load/first-paint events.
  Now they get a valid display size on every reflow, and so again this allows
  fewer overall reflows as the code converges to a stable state faster.

Together these changes ensure that every reflow has access to up-to-date
properties (display size, mobile viewport size, visual viewport size) from the
MVM. This eliminates unnecessary reflows because of out-of-order computations
based on stale values and such. Therefore the number of reflows goes down,
which is reflected by the changes to the crashtest assertion counts.

Differential Revision: https://phabricator.services.mozilla.com/D81375
2020-06-29 18:39:57 +00:00
Kartikaya Gupta
a3752f3581 Bug 1648500 - Use the composition size when positioning scrollbars. r=tnikkel
When positioning overlay scrollbars, the code was previously taking the
visual viewport size and scaling it back up to the composition size using
the resolution. This works because overlay scrollbars don't take up any
space, and so the visual viewport size is exactly equal to the composition
size divided by the resolution. However, it's simpler to just use the
composition size because we can get that easily enough. And this fixes the
scrollbar positioning on the very first reflow, before the visual viewport
has been set on the presShell.

Eventually this might make it easier to do this for non-overlay scrollbars
as well, since those do take up layout space, and can't be positioned using
the "VV size multiplied by resolution" quantity, as that doesn't exactly
equal the composition size.

Differential Revision: https://phabricator.services.mozilla.com/D81277
2020-06-29 18:38:58 +00:00
Kartikaya Gupta
9768f4f2ba Bug 1648500 - Don't check for the VV size in TryLayout. r=tnikkel
The TryLayout code uses the composition size to figure out if the
scrollbar is needed or not. It computes something similar to the visual
viewport size (but assuming no scrollbars are taking up space) to do this.
There's no reason this code should be depending on whether or not the
visual viewport size is set in the presShell, so we can just remove the
condition. That way even on the very first reflow, when the visual viewport
will definitely not be set, we can correctly determine if the scrollbars
need to be laid out or not.

Differential Revision: https://phabricator.services.mozilla.com/D81276
2020-06-29 03:33:59 +00:00
Kagami Sascha Rosylight
93819231cb Bug 1647525 - Use HasAnyStateBits() in nsGfxScrollFrame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81202
2020-06-27 13:16:56 +00:00
Kartikaya Gupta
4549c23502 Bug 1648193 - Stop passing things to MVM that it already knows how to compute. r=hiro
This removes the two parameters to ShrinkToDisplaySizeIfNeeded and corresponding
parameters passed to UpdateResolution. The call site in nsGfxScrollFrame
gets the arguments from the MVM itself, so it seems silly to be getting things
from the MVM just to pass it back in. The other call sites are already in theMVM.
This change might be slightly less efficient because it re-computes the viewport
info when the caller might already have it but this isn't a hot code path so
I'm not too concerned.

Differential Revision: https://phabricator.services.mozilla.com/D80937
2020-06-24 22:22:17 +00:00
Kartikaya Gupta
1d44fcb849 Bug 1644271 - Add some MOZ_LOG for scrollbar layout attempts. r=tnikkel
I found this useful while debugging. It might be overkill to land it.

Depends on D80085

Differential Revision: https://phabricator.services.mozilla.com/D80086
2020-06-21 20:48:35 +00:00
Razvan Maries
c60adf564e Backed out 6 changesets (bug 1644271) for perma failures on browser_bug1170531.js.
Backed out changeset 9d4e746c732d (bug 1644271)
Backed out changeset 681a48643a84 (bug 1644271)
Backed out changeset 3cf3176c45d4 (bug 1644271)
Backed out changeset efaddcd67a33 (bug 1644271)
Backed out changeset 03aaac05c759 (bug 1644271)
Backed out changeset a780f5111efa (bug 1644271)
2020-06-21 23:44:04 +03:00
Kartikaya Gupta
2d3c0385a1 Bug 1644271 - Add some MOZ_LOG for scrollbar layout attempts. r=tnikkel
I found this useful while debugging. It might be overkill to land it.

Depends on D80085

Differential Revision: https://phabricator.services.mozilla.com/D80086
2020-06-17 22:40:28 +00:00
Kartikaya Gupta
6540b81148 Bug 1646385 - Ensure we recompute the visual viewport size when the root scrollframe's scrollbars get added or removed. r=tnikkel
There are two parts here. One is the "backstop" in the scrollframe's
ReflowFinished callback, that recomputes the visual viewport size if layout
scrollbars are being used in the root scrollframe. This ensures that the
visual viewport gets resized properly after a reflow, possibly at the expense
of a second reflow to reposition fixed-pos items.

There is also an update to the visual viewport during the reflow itself, after
we have reflowed the in-flow contents (including the root scrollframe) but
before we reflow the fixed-pos items. This allows us to avoid the second reflow
by using the new visual viewport for positioning the fixed-pos items correctly.
This early reflow also skips marking things for a second reflow.

This patch fixes a problem described in bug 1644271 comment 2, among other
things. Specifically, it ensures that when the scrollbar properties (e.g.
maxpos, minpos) are computed, they are computed using an up-to-date visual
viewport size. The up-to-date visual viewport size correctly excludes the space
taken up by non-overlay scrollbars, which wasn't happening without this patch.

Depends on D80039

Differential Revision: https://phabricator.services.mozilla.com/D80040
2020-06-18 22:30:00 +00:00
Kartikaya Gupta
68e22e8674 Bug 1646374 - Ensure mLastPos is properly updated during scroll restoration. r=tnikkel
mLastPos is supposed to be updated by querying the visual viewport offset from
the presShell. However because of the way the visual viewport offset is updated,
this doesn't return a nonzero value until after APZ sends back a repaint request.
So this patch modifies the query to also check if there's any pending visual
viewport offset update being sent from the main thread, and use that. It also
modifies the scroll restoration code to request a properly clamped visual
scroll offset, so that the value stored as "pending" is not just the unclamped
restore destination.

Depends on D80038

Differential Revision: https://phabricator.services.mozilla.com/D80039
2020-06-18 11:06:17 +00:00
Kartikaya Gupta
2592c4b45f Bug 1646374 - Add a new log module for scroll restoration. r=tnikkel
Depends on D79885

Differential Revision: https://phabricator.services.mozilla.com/D80038
2020-06-17 23:56:31 +00:00
Timothy Nikkel
8349c27e4a Bug 1645954. Don't use a stale value of mScrollPort during scrollframe reflow while still determining the new value of mScrollPort. r=tnikkel
Also, adjust for scrollbars and resolution correctly.

Differential Revision: https://phabricator.services.mozilla.com/D79778
2020-06-18 09:25:02 +00:00
Kartikaya Gupta
afa70400fc Bug 1645937 - Adjust when the root scrollframe gets a clip. r=tnikkel
With containerless scrolling we generally always want this clip on the layer,
since there is no container. However on Android apparently we don't want this,
because it seems to break the setVerticalClipping API used by the dynamic
toolbar.

Differential Revision: https://phabricator.services.mozilla.com/D80054
2020-06-18 22:47:13 +00:00
Butkovits Atila
34722d7f3a Backed out 2 changesets (bug 1645937) for gv-junit failures on VerticalClippingTest. CLOSED TREE
Backed out changeset e0f3090a46a4 (bug 1645937)
Backed out changeset c1021d851157 (bug 1645937)
2020-06-18 14:59:18 +03:00
Kartikaya Gupta
2def21e66e Bug 1645937 - With containerless scrolling we always want this clip on the layer. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D80054
2020-06-18 10:51:03 +00:00
Timothy Nikkel
af9202b6b8 Bug 1644638. ScrollFrameHelper::ReflowFinished should use GetVisualScrollRange instead of trying to calculate it itself. r=kats
This avoids a bug where the scroll range can be negative.

Differential Revision: https://phabricator.services.mozilla.com/D79029
2020-06-12 08:12:30 +00:00
Emilio Cobos Álvarez
ef3d21048d Bug 1640623 - Use enum classes for LookAndFeel int and float IDs. r=jmathies,geckoview-reviewers,esawin
Differential Revision: https://phabricator.services.mozilla.com/D76694
2020-06-11 11:27:43 +00:00
Kartikaya Gupta
fe2e3901bb Bug 1644180 - Don't make an async zoom container of a layer that isn't async scrollable. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D78840
2020-06-09 04:35:45 +00:00
Hiroyuki Ikezoe
dc8db2c291 Bug 1619169 - Duplicate ExpandHeightForViewportUnits to ExpandHeightForDynamicToolbar. r=botond
And use the duplicated one at the places where we need the expanded size for
interactions with the dynamic toolbar on the compositor. The new function will
be modified in the next commit.

Note that the only one remaining call site of ExpandHeightForViewportUnits is
for window.inner{Width,Height}. For window.inner{Width,Height} we don't yet
return the layout viewport (which might be expanded by the minimum-scale), it's
going to be fixed in bug 1598487 [1], but it's not ready to fix because there
also need fixes in comm-central (see dependencies in the bug).  So for now, we
should keep the current behavior for window.inner{Width,Height}.

Also note that it's not yet clear whether we will eventually replace the last
call site of ExpandHeightForViewportUnits with ExpandHeightForDynamicToolbar
since the value corresponding to the dynamic toolbar might _NOT_ be affected by
the minimum-scale in some cases.  See bug 1641166 for details.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1598487
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1641166

Differential Revision: https://phabricator.services.mozilla.com/D78440
2020-06-06 04:44:54 +00:00
Kartikaya Gupta
c06eb6ae82 Bug 1643042 - Switch mLastSmoothScrollOrigin to using None as well. r=tnikkel
This uses "None" instead of "NotSpecified" as the value for
mLastSmoothScrollOrigin when there is no smooth scroll in progress.

Depends on D78439

Differential Revision: https://phabricator.services.mozilla.com/D78469
2020-06-05 09:41:07 +00:00
Kartikaya Gupta
445d9cf0b8 Bug 1643042 - Introduce an None scroll origin. r=tnikkel
This adds a new scroll origin, None, which is used as the initial value for
mLastScrollOrigin. Unlike Other, this scroll origin can be clobbered by any
other scroll origin, including notably Relative. This means that on a
brand-new scrollframe, if the first scroll call comes in with an origin of
Relative, it will be preserved as a relative scroll instead of getting
converted to a non-relative scroll.

This in turn fixes a latent bug in the code that was exposed by the
test_relative_update.html APZ mochitest when run with apz.allow_zooming=true.

Note also that we should never be passing eNone to functions like ScrollToImpl;
for those scenarios we continue using Unknown if we don't have a more specific
scroll origin to use. In other words, None is a sort of sentinel value to be
used for class fields, and is not to be used for actual scrollto-type calls.

Differential Revision: https://phabricator.services.mozilla.com/D78439
2020-06-05 09:44:10 +00:00
Kartikaya Gupta
7ac36807b1 Bug 1643042 - Turn the scroll origin parameter into a strongly-typed enum. r=tnikkel
This patch is a fairly mechanical conversion. The old `nullptr` gets converted
to ScrollOrigin::NotSpecified, and all the other possible values get corresponding
values in the new ScrollOrigin enum. A few switch statements are introduced to
clean up big if statements, but other than that, additional cleanups will happen
in later patches.

Differential Revision: https://phabricator.services.mozilla.com/D78438
2020-06-05 09:37:51 +00:00
Ting-Yu Lin
1022daa063 Bug 1643173 Part 1 - Convert enum nsIFrame::DISPLAY_CHILD_* to enum class. r=dholbert
The modifications are all straightforward conversion except the one in
nsMathMLContainerFrame, where it is simplified by calling the equivalent
BuildDisplayListForInline() helper.

Differential Revision: https://phabricator.services.mozilla.com/D78166
2020-06-05 02:52:05 +00:00
Botond Ballo
97b30c6183 Bug 1643212 - Use the expanded scroll port to constrain the dirty rect in ScrollFrameHelper::BuildDisplayList(). r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D78220
2020-06-04 22:46:43 +00:00
Timothy Nikkel
3d8f182b50 Bug 1642869. Check if the visual viewport differs from the layout viewport in ScrollFrameHelper::GetPageScrollAmount. r=kats
So we can preserve the scrolling behaviour that takes into account fixed "headers" and "footers".

Differential Revision: https://phabricator.services.mozilla.com/D77985
2020-06-04 02:01:06 +00:00
Timothy Nikkel
918a7c4207 Bug 1641752. Don't access dead frame in AutoScrollbarRepaintSuppression. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D77403
2020-05-29 11:19:59 +00:00
Emilio Cobos Álvarez
89958b377a Bug 1640605 - Remove IsInAnonymousSubtree / IsRootOfAnonymousSubtree. r=edgar
In favor of the NativeAnonymous versions which they forward to.

Done automatically with:

  rg -l 'IsInAnonymousSubtree' | xargs sed -i 's/IsInAnonymousSubtree/IsInNativeAnonymousSubtree/g'

And removing the function definitions afterwards.

Differential Revision: https://phabricator.services.mozilla.com/D76681
2020-05-25 11:43:51 +00:00
Emilio Cobos Álvarez
4773883d7b Bug 1640262 - Don't call nsPresContext::ThemeChanged from nsGfxScrollFrame. r=mstange
nsChildView.mm already does this via systemMetricsChanged.

There used to be a bug in which pref changes to the ui.* prefs didn't
trigger ThemeChanged, but it was fixed a while ago.

Differential Revision: https://phabricator.services.mozilla.com/D76530
2020-05-22 19:57:50 +00:00
Timothy Nikkel
df4c90d4b8 Bug 1639448. When a visual viewport is set the page scroll amount for a scroll frame is incorrect. r=kats
We want to use a page scroll amount based on the visual viewport size.

The extra complications we have for not scrolling too far if there are fixed/sticky position things are quite hard to do properly with a visual viewport (I tried). I think there is far less user expectation of it working if a visual viewport is set. If we get complaints we can look into it.

Differential Revision: https://phabricator.services.mozilla.com/D76091
2020-05-20 13:35:13 +00:00
Ting-Yu Lin
162c8d3a67 Bug 1638928 Part 2 - Rename nsIFrame's GetChildLists() to ChildLists(). r=mats
This patch is generated by using my editor's rename functionality.

In the next patch, `nsIFrame::` prefix is going to be removed manually
from all the ChildLists() calls.

Differential Revision: https://phabricator.services.mozilla.com/D75893
2020-05-19 12:37:37 +00:00
Timothy Nikkel
c910c877a9 Bug 1636911. In ScrollFrameHelper::RestrictToRootDisplayPort don't adjust the root display port by the root scroll frame apz callback transform because it already factors that in. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D75526
2020-05-18 10:26:16 +00:00
Noemi Erli
5e76ba7334 Backed out 2 changesets (bug 1636911) for mochitest failures in test_group_checkerboarding.html CLOSED TREE
Backed out changeset 37e68bff6c62 (bug 1636911)
Backed out changeset 74a83c249231 (bug 1636911)
2020-05-18 11:03:18 +03:00
Botond Ballo
c66f677427 Bug 1638655 - When hit testing in layout coordinates, transform the composition bounds clip to layout coordinates. r=tnikkel
Previously, we were only performing part of this transform
(scaling by the resolution) and not the other part
(translating by the offset between the two viewports).

Differential Revision: https://phabricator.services.mozilla.com/D75739
2020-05-18 06:53:35 +00:00
Timothy Nikkel
f4338779c4 Bug 1636911. In ScrollFrameHelper::RestrictToRootDisplayPort don't adjust the root display port by the root scroll frame apz callback transform because it already factors that in. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D75526
2020-05-18 06:32:34 +00:00
Ting-Yu Lin
07b47bf217 Bug 1635319 Part 1 - Add nsIFrame::GetChildLists(), and use range-based for loops instead of ChildListIterator in layout/generic/. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D75652
2020-05-18 01:09:34 +00:00
Emilio Cobos Álvarez
f75e7ddf47 Bug 1637511 - Keep suppressing scrollbars than don't fit in the scrollport for overflow: auto. r=dholbert
Given there's content depending on it. This brings back the check from
before the regression.

I had to tweak percent-height-overflowing-image-1.html so that it
doesn't hit scrollbar size limits on GTK (which are a bit ridiculous
IMHO, but oh well).

Differential Revision: https://phabricator.services.mozilla.com/D75171
2020-05-15 21:24:15 +00:00
Coroiu Cristina
7738900e5b Backed out 2 changesets (bug 1634763) for mochitest failures at gfx/layers/apz/test/mochitest/test_layerization.html on a CLOSED TREE
Backed out changeset f6a104ccde95 (bug 1634763)
Backed out changeset 985344b9f115 (bug 1634763)
2020-05-12 13:42:22 +03:00
Kartikaya Gupta
c9c76fff5a Bug 1634763 - Tweak hit-test info for inactive scrollframes to make WR and non-WR more consistent. r=tnikkel
The user-observed behaviour should be unchanged, but for testing purposes
this produces more consistent results between WR and non-WR. It also seems
conceptually more correct so I think it's worth doing.

Depends on D74789

Differential Revision: https://phabricator.services.mozilla.com/D74790
2020-05-12 02:06:17 +00:00
Kartikaya Gupta
6c5adadaad Bug 1634763 - Ensure APZ knows about inactive scrollframes that may have active scrollbars. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D74789
2020-05-12 02:02:51 +00:00
Miko Mynttinen
2a08d4f7e3 Bug 1554499 - Part 13: Remove index from nsDisplayWrapList r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D74092
2020-05-11 16:58:46 +00:00
Miko Mynttinen
1131025246 Bug 1554499 - Part 12: Remove index from nsDisplayOwnLayer r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D74091
2020-05-11 16:58:26 +00:00
Miko Mynttinen
1965529d52 Bug 1554499 - Part 7: Remove index from nsDisplayCompositorHitTestInfo r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D74086
2020-05-11 16:57:01 +00:00
Sylvestre Ledru
1929dd1ab3 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D73347
2020-05-09 14:51:53 +00:00
Kagami Sascha Rosylight
5ae938ffc0 Bug 1630704 - Merge XUL methods to nsIFrame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D74335
2020-05-08 17:31:35 +00:00
Emilio Cobos Álvarez
3eb9ef9c18 Bug 1365806 - Make scrollbars not impose a minimum size on the scroller. r=dholbert
Also, don't suppress scrollbars if the scrollport is less than their
length, as that can happen after this patch :)

Differential Revision: https://phabricator.services.mozilla.com/D73395
2020-05-07 20:44:25 +00:00
Emilio Cobos Álvarez
0be2a79efd Bug 1571376 - Make all themes support non-disappearing scrollbar sizes. r=mstange
That is, so that the select dropdown button always take the size of a
native scrollbar rather than a potentially custom scrollbar.

Differential Revision: https://phabricator.services.mozilla.com/D73261
2020-05-07 15:28:35 +00:00
Narcis Beleuzu
6d7a08d1fd Backed out changeset 842955b61f01 (bug 1365806) for wr failures on contain-size-scrollbars-002.html . CLOSED TREE 2020-05-06 14:23:49 +03:00
Emilio Cobos Álvarez
0d476766fc Bug 1365806 - Make scrollbars not impose a minimum size on the scroller. r=dholbert
Also, don't suppress scrollbars if the scrollport is less than their
length, as that can happen after this patch :)

Differential Revision: https://phabricator.services.mozilla.com/D73395
2020-05-06 09:46:20 +00:00
Botond Ballo
173d001b86 Bug 1556556 - Propagate RelativeTo far and wide. r=kats,mattwoodrow
This "upgrades" various nsLayoutUtils functions which take as inputs
a set of coordinates and a frame that the coordinates are relative to,
to accept a RelativeTo object instead of a frame.

Most of the patch is just dumb propagation, but the few places where
we use an explicit ViewportType::Visual are important. There are
probably a few other places I've overlooked, but this seems to cover
the important ones that come up commonly.

There are undoubtedly other functions into which we can propagate
RelativeTo, in this patch I've propagated it as far as necessary
for my needs in this bug (mainly GetTransformToAncestor() and
GetEventCoordinatesRelativeTo()).

Differential Revision: https://phabricator.services.mozilla.com/D68919
2020-05-05 19:26:38 +00:00
Botond Ballo
f55eb5c394 Bug 1556556 - Use the "relative to layout viewport" flag to determine when to divide the composition bounds clip by the resolution. r=mstange
We were using "during event delivery" as a proxy for this, but it was an inaccurate proxy.

Differential Revision: https://phabricator.services.mozilla.com/D68915
2020-05-05 19:24:21 +00:00
Botond Ballo
62da5ce412 Bug 1556556 - Apply the visual-to-layout transform during display list building and display list based hit testing. r=kats,mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D68728
2020-05-05 19:23:02 +00:00
Csoregi Natalia
b073baab86 Backed out 30 changesets (bug 1556556, bug 1631568) for multiple mochitest failures. CLOSED TREE
Backed out changeset edd529f7a9c5 (bug 1631568)
Backed out changeset 1cc0881e244b (bug 1631568)
Backed out changeset ed3c1e85d5e3 (bug 1556556)
Backed out changeset 38ffc6215bbf (bug 1556556)
Backed out changeset 03c2c25d8023 (bug 1556556)
Backed out changeset 9c717eb067b8 (bug 1556556)
Backed out changeset 98e26bc98b85 (bug 1556556)
Backed out changeset 05a6a581e755 (bug 1556556)
Backed out changeset 867946cf05bb (bug 1556556)
Backed out changeset 20d72a334530 (bug 1556556)
Backed out changeset 2c62e61d9054 (bug 1556556)
Backed out changeset 62a223d057d2 (bug 1556556)
Backed out changeset 2c5d55a1f0b1 (bug 1556556)
Backed out changeset 700447945b4e (bug 1556556)
Backed out changeset 93190ae4f5ff (bug 1556556)
Backed out changeset a7bd34d961bb (bug 1556556)
Backed out changeset fccd1d3c7189 (bug 1556556)
Backed out changeset 24056e47183d (bug 1556556)
Backed out changeset 204881474cc1 (bug 1556556)
Backed out changeset 387320881876 (bug 1556556)
Backed out changeset be8f5eb58460 (bug 1556556)
Backed out changeset 629c58a9166b (bug 1556556)
Backed out changeset 4312b2b5dda8 (bug 1556556)
Backed out changeset d11dbf6403a5 (bug 1556556)
Backed out changeset 95c54c023779 (bug 1556556)
Backed out changeset 80fcb7e71188 (bug 1556556)
Backed out changeset d75a4ecb0d47 (bug 1556556)
Backed out changeset 903c4de34e7a (bug 1556556)
Backed out changeset f15334a3e803 (bug 1556556)
Backed out changeset 9553e99137ea (bug 1556556)
2020-04-28 12:43:11 +03:00
Botond Ballo
405c8807cd Bug 1556556 - Propagate RelativeTo far and wide. r=kats,mattwoodrow
This "upgrades" various nsLayoutUtils functions which take as inputs
a set of coordinates and a frame that the coordinates are relative to,
to accept a RelativeTo object instead of a frame.

Most of the patch is just dumb propagation, but the few places where
we use an explicit ViewportType::Visual are important. There are
probably a few other places I've overlooked, but this seems to cover
the important ones that come up commonly.

There are undoubtedly other functions into which we can propagate
RelativeTo, in this patch I've propagated it as far as necessary
for my needs in this bug (mainly GetTransformToAncestor() and
GetEventCoordinatesRelativeTo()).

Differential Revision: https://phabricator.services.mozilla.com/D68919
2020-04-28 01:40:35 +00:00
Botond Ballo
bc3d0b2701 Bug 1556556 - Use the "relative to layout viewport" flag to determine when to divide the composition bounds clip by the resolution. r=mstange
We were using "during event delivery" as a proxy for this, but it was an inaccurate proxy.

Differential Revision: https://phabricator.services.mozilla.com/D68915
2020-04-28 01:38:00 +00:00
Botond Ballo
480ee775c9 Bug 1556556 - Apply the visual-to-layout transform during display list building and display list based hit testing. r=kats,mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D68728
2020-04-28 01:36:34 +00:00
Sylvestre Ledru
34acbb653a Bug 1619165 - Reformat recent changes to the Google coding style r=andi
First reformat with clang-format 10

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D68802
2020-04-25 09:40:08 +00:00
Emilio Cobos Álvarez
3e3dc71cba Bug 1631887 - Claim to support NonDisappearingScrollbarWidth on the non-native theme. r=spohl
This is used by platforms with overlay scrollbars, only in order to
reserve enough space for the chevron of the `<select>` element.

So our general min-widget-size, which is the same as for scrollbars
works.

Differential Revision: https://phabricator.services.mozilla.com/D71825
2020-04-22 17:45:39 +00:00
Kagami Sascha Rosylight
502cb439da Bug 1630704 - Merge nsBox into nsIFrame r=emilio
We want to merge nsFrame into nsIFrame, so this patch merges nsBox first which is the superclass of nsFrame.

Differential Revision: https://phabricator.services.mozilla.com/D71161
2020-04-18 12:06:09 +00:00
Ting-Yu Lin
8cd23b8a7a Bug 1626970 - Use saturating operators to avoid scrolling position overflow. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D70447

--HG--
extra : moz-landing-system : lando
2020-04-14 23:35:35 +00:00
Kartikaya Gupta
6f24092aae Bug 1424714 - Prevent the displayport clip from clipping sticky items. r=mstange
The displayport clip that is applied to sticky items from the enclosing
scrollframe can cause sticky items to checkerboard even when they might
reasonably be left visible. This is because the displayport clip moves as
the enclosing scrollframe is scrolled, but sticky items may remain fixed
during such scrolling. The displayport clip can therefore clip out sticky
items even if they are "stuck" and should be user-visible.

This patch sets a flag to identify when a sticky item is being clipped by
the displayport clip, and ensures that it doesn't actually get clipped. In
the case where other clips are being applied to the sticky item, we leave the
clips unaffected. This allows for other enclosing elements to clip the sticky
item as before.

Differential Revision: https://phabricator.services.mozilla.com/D68582

--HG--
extra : moz-landing-system : lando
2020-04-08 04:59:14 +00:00
Kristen Wright
41a1cec59e Bug 1626388 -Convert mousewheel.min_line_scroll_amount to static pref r=njn
Converts mousewheel.min_line_scroll_amount to a static pref.

Differential Revision: https://phabricator.services.mozilla.com/D69616

--HG--
extra : moz-landing-system : lando
2020-04-06 20:18:14 +00:00
Kristen Wright
4a3747126f Bug 1626388 - Convert layout.framevisibility.numscrollportwidths/heights to static prefs r=njn
Converts layout.framevisibility.numscrollportwidths and layout.framevisibility.numscrollportheights to static prefs.

Differential Revision: https://phabricator.services.mozilla.com/D69615

--HG--
extra : moz-landing-system : lando
2020-04-06 20:16:38 +00:00
Andreas Farre
f2fa2e633c Bug 1620594 - Part 5: Use GetMainThreadSerialEventTarget instead of SystemGroup::EventTargetFor. r=nika
This patch also tries to remove the event target entirely if it would
default to the main thread on a null event target.

Depends on D67634

Differential Revision: https://phabricator.services.mozilla.com/D67635

--HG--
extra : moz-landing-system : lando
2020-04-07 15:17:07 +00:00
Kartikaya Gupta
1c73319b51 Bug 1622360 - Downgrade mPendingScrollUpdates from RenderRootArray. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D69842

--HG--
extra : moz-landing-system : lando
2020-04-06 20:44:46 +00:00
Kartikaya Gupta
5daf11b6b4 Bug 1622360 - Remove remaining gfxUtils functions dealing with the render root. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D68862

--HG--
extra : moz-landing-system : lando
2020-04-01 13:38:05 +00:00
Botond Ballo
8ee14bcbbe Bug 1623476 - Rename enum RelativeTo to DisplayportRelativeTo. r=tnikkel
This is in anticipation of introducing a struct named RelativeTo
in bug 1556556.

Differential Revision: https://phabricator.services.mozilla.com/D67515

--HG--
extra : moz-landing-system : lando
2020-03-23 22:20:11 +00:00
Kartikaya Gupta
5ebf4f9e11 Bug 1617427 - Rename things and fix up comments. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D66423

--HG--
extra : moz-landing-system : lando
2020-03-13 19:55:18 +00:00
Kartikaya Gupta
e4ce8449ae Bug 1617427 - Prefer using the root frame's displayport to the root composition bounds. r=tnikkel
If we can get the root frame's displayport, then we should use that
rect instead of the root composition bounds when clipping the scrollframe's
displayport. That way if APZ is disabled on the scrollframe, but the root
frame scrolls to bring a part of it into view, it will be fully painted and
not perma-checkerboard-y.

Note that this patch is the main fix, but leaves a bunch of comments/variables
with bad names; the next patch cleans that up.

Differential Revision: https://phabricator.services.mozilla.com/D66421

--HG--
extra : moz-landing-system : lando
2020-03-13 19:55:11 +00:00
Kartikaya Gupta
f81f55c129 Bug 1617427 - Refactor to extract helper method; no functional changes. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D66420

--HG--
extra : moz-landing-system : lando
2020-03-13 19:55:03 +00:00
Emilio Cobos Álvarez
46d1624d9d Bug 1619664 - Rename and don't null-check nsPresContext::GetTheme as it can't return null. r=dholbert
There were some callers in nsRangeFrame that were already not-null-checking.

All platforms have a native theme and should we add new ones they could use
nsBasicNativeTheme.

Differential Revision: https://phabricator.services.mozilla.com/D65169

--HG--
extra : moz-landing-system : lando
2020-03-04 01:58:30 +00:00
Emilio Cobos Álvarez
d9d7f09456 Bug 1619428 - Make the overlay scrollbars check work in all platforms. r=mstange
Reuse the AddXULMinSize logic which already deals with all the widget stuff,
non-themed scrollbars, etc.

Remove some useless margin declarations and such in GeckoView scrollbars code
now that AddXULMinSize does look at the min-width/height properties.

Differential Revision: https://phabricator.services.mozilla.com/D65129

--HG--
extra : moz-landing-system : lando
2020-03-03 20:30:52 +00:00
shindli
b961822146 Backed out changeset be3b005bfc6d (bug 1619428) for causing reftest failure in contain-size-select-elem-002-ref.html CLOSED TREE 2020-03-03 22:15:47 +02:00
Emilio Cobos Álvarez
cdad6a0be8 Bug 1619428 - Make the overlay scrollbars check work in all platforms. r=mstange
Reuse the AddXULMinSize logic which already deals with all the widget stuff,
non-themed scrollbars, etc.

Remove some useless margin declarations and such in GeckoView scrollbars code
now that AddXULMinSize does look at the min-width/height properties.

Differential Revision: https://phabricator.services.mozilla.com/D65129

--HG--
extra : moz-landing-system : lando
2020-03-03 18:50:07 +00:00
Hiroyuki Ikezoe
34ba90e714 Bug 1618432 - Move the root horizontal scrollbar in response to the dynamic toolbar transitions. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D64726

--HG--
extra : moz-landing-system : lando
2020-03-03 05:33:54 +00:00
Kartikaya Gupta
186b239065 Bug 1613199 - Fix hit-testing for scrollframes with hoisted scrollinfos. r=botond
In some cases (such as the case from this bug) the display list contains a
"hoisted" scrollinfo display item, which indicates the presence of a scroller
inside an inactive layer subtree (e.g. a div with certain kinds of filters).
The scrollinfo display item is "hoisted" outside the display list subtree so
that it doesn't get flattened away inside the inactive subtree. That display
item then causes the compositor hit-test regions to updated appropriately so
that APZ knows about the scrollframe inside the flattened content. This in turn
allows APZ to request main-thread scrolling for that scrollframe when input
events are directed to it.

With the WebRender codepath, the information represented by the hoisted
scrollinfo display item was being lost instead of being propagated to the
compositor. This was because the mechanism used for information propagation is
different (WebRender commands vs layers EventRegions). This patch ensures that
the scrollinfo display items also generate appropriate WebRender commands so
that the information is not lost, and WR knows about the scrollframe inside
the flattened content.

The patch includes:
- A code movement in nsGfxScrolllFrame.cpp so that necessary information can
  be provided to the nsDisplayScrollInfoLayer constructor
- Updates to nsDisplayScrollInfoLayer members to store the necessary information
- Addition of nsDisplayScrollInfoLayer::CreateWebRenderCommands which propagates
  the information to the WR display list
- A test to exercise the changes.

Differential Revision: https://phabricator.services.mozilla.com/D63869

--HG--
extra : moz-landing-system : lando
2020-02-24 17:26:19 +00:00
Kartikaya Gupta
85c3d9e6a5 Bug 1617565 - Convert additional compile-conditional logging bits to MOZ_LOG. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D63868

--HG--
extra : moz-landing-system : lando
2020-02-24 16:31:04 +00:00
Emilio Cobos Álvarez
61d0c10572 Bug 1613490 - Cleanup usage of ReferenceBox. r=miko
To avoid computing transform bounds over and over. It is generally just better.

Replace the various "overridebounds" thingies by using the "fallback" of the
transform-reference-box code which we need anyway.

Differential Revision: https://phabricator.services.mozilla.com/D61890

--HG--
extra : moz-landing-system : lando
2020-02-07 13:34:42 +00:00
Kousuke Takaki
b03e71473c Bug 1613094 - The parameter 'aStartPos' should use const reference. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D61585

--HG--
extra : moz-landing-system : lando
2020-02-04 16:11:21 +00:00
Kousuke Takaki
04bba6950f Bug 1602088 - Move nsIScrollableFrame::ScrollUnit to namespace scope. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D61140

--HG--
extra : source : 69fded25adc2ac25e302b49c1128f8926e1311a3
2020-01-30 09:13:19 +00:00
Cosmin Sabou
5a3d320cd0 Backed out changeset 69fded25adc2 (bug 1602088) for causing several box-shadow reftest failures.
CLOSED TREE
2020-01-30 13:23:10 +02:00
Kousuke Takaki
9681569b70 Bug 1602088 - Move nsIScrollableFrame::ScrollUnit to namespace scope. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D61140

--HG--
extra : moz-landing-system : lando
2020-01-30 09:13:19 +00:00
Martin McNickle
9f727fc9c5 Bug 1611829 - Convert scroll-behavior #defines to an enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61164

--HG--
extra : moz-landing-system : lando
2020-01-28 09:12:29 +00:00
Emilio Cobos Álvarez
13de1cb414 Bug 1610849 - Resolve scroll-padding against scrollport for scroll anchoring even when visual viewport is used. r=botond
Per https://github.com/w3c/csswg-drafts/issues/4393.

Differential Revision: https://phabricator.services.mozilla.com/D60693

--HG--
extra : moz-landing-system : lando
2020-01-25 20:48:11 +00:00
Emilio Cobos Álvarez
a25126cd0d Bug 1611181 - Make direction use an enum class. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D60857

--HG--
extra : moz-landing-system : lando
2020-01-24 11:46:14 +00:00
Bogdan Tara
6b44dbdf87 Backed out 2 changesets (bug 1516413) for valgrind failure CLOSED TREE
Backed out changeset 8eb500f31661 (bug 1516413)
Backed out changeset 333368f257b3 (bug 1516413)
2020-01-23 00:53:42 +02:00
Brad Werth
69b67fa839 Bug 1516413 Part 1: Make EventStateManager zoom delta functions send chrome events instead of acting directly. r=mstange
This patch changes the zoom behavior to always be routed through the frontend
Zoom Actor. In the existing code, the ZoomChangeUsingMouseWheel event is sent
as an after-the-fact notification of the zoom being modified directly. This
part of the patch supplements the existing event with 2 new events that
trigger the frontend to do the +/- 10% math in ChangeFullZoom and
ChangeTextZoom. The next part of the patch supplies that logic in the frontend
Zoom Actor.

This also changes the handling of events from the zoom in/out keys. Before,
those keys would only change full zoom levels. Now, they will respect the
full zoom vs text zoom toggle.

Differential Revision: https://phabricator.services.mozilla.com/D59259

--HG--
extra : moz-landing-system : lando
2020-01-22 21:42:40 +00:00
Nazım Can Altınova
d8afe0647a Bug 1609708 - Rename PROFILER_TRACING to PROFILER_TRACING_MARKER. r=gerald
Depends on D60229

Differential Revision: https://phabricator.services.mozilla.com/D60231

--HG--
extra : moz-landing-system : lando
2020-01-17 21:29:15 +00:00
Emilio Cobos Álvarez
fff6c9e1ac Bug 981248 - Rewrite <input type=number> to avoid an anonymous input. r=masayuki,surkov,jwatt,ntim,jfkthame,smaug
Instead, subclass nsTextControlFrame. This simplifies the code and avoids
correctness issues.

I kept the localization functionality though it is not spec compliant. But I
filed a bug to remove it in a followup.

Differential Revision: https://phabricator.services.mozilla.com/D57193

--HG--
extra : moz-landing-system : lando
2020-01-14 19:01:05 +00:00
Mihai Alexandru Michis
0d01c60c37 Backed out 2 changesets (bug 981248) for causing multiple failures.
CLOSED TREE

Backed out changeset 7a96708cc8b7 (bug 981248)
Backed out changeset 1eace7bd28d9 (bug 981248)
2020-01-14 19:28:17 +02:00
Emilio Cobos Álvarez
da2e4ef888 Bug 981248 - Rewrite <input type=number> to avoid an anonymous input. r=masayuki,surkov,jwatt,ntim,jfkthame,smaug
Instead, subclass nsTextControlFrame. This simplifies the code and avoids
correctness issues.

I kept the localization functionality though it is not spec compliant. But I
filed a bug to remove it in a followup.

Differential Revision: https://phabricator.services.mozilla.com/D57193

--HG--
extra : moz-landing-system : lando
2020-01-14 15:05:22 +00:00
Botond Ballo
357c20419c Bug 1605466 - Include-what-you-use fixes. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D58038

--HG--
extra : moz-landing-system : lando
2019-12-20 20:36:14 +00:00
Timothy Nikkel
e40055fcd7 Bug 1602258. Remove GetAvailableVisualScrollingDirections, it is unused. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D57611

--HG--
extra : moz-landing-system : lando
2019-12-18 23:08:36 +00:00
Timothy Nikkel
36ab8e6657 Bug 1602258. Use GetAvailableScrollingDirectionsForUserInputEvents in WheelHandlingUtils::CanScrollOn. r=botond
We also need to adjust the scroll range we use. We do this by adding GetScrollRangeForUserInputEvents which just uses the range that GetAvailableScrollingDirectionsForUserInputEvents computed.

This should give two improvements:
1) CanScrollOn will not report that the user can scroll in an overflow hidden direction.
2) CanScrollOn will report that the user can scroll in an overflow hidden direction if the document is pinch zoomed in so that the user can scroll around the layout viewport.

Differential Revision: https://phabricator.services.mozilla.com/D56301

--HG--
extra : moz-landing-system : lando
2019-12-18 23:08:24 +00:00
Timothy Nikkel
8d223d13dd Bug 1602258. Make ScrollFrameHelper::GetAvailableScrollingDirectionsForUserInputEvents check for at least half a screen pixel of scroll range instead of one app unit. r=botond
This is similar to GetAvailableScrollingDirections but also takes into account any resolution.

Differential Revision: https://phabricator.services.mozilla.com/D57610

--HG--
extra : moz-landing-system : lando
2019-12-18 23:08:11 +00:00
Emilio Cobos Álvarez
83fdd60571 Bug 1603807 - Don't divide by zero in ClampAndAlignWithPixels. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D57188

--HG--
extra : moz-landing-system : lando
2019-12-16 15:55:22 +00:00
Emilio Cobos Álvarez
ac506d6f4b Bug 1603889 - Simplify the scrollbar preference setup. r=smaug
So much plumbing to pass an enum down.

Differential Revision: https://phabricator.services.mozilla.com/D57182

--HG--
extra : moz-landing-system : lando
2019-12-15 22:56:23 +00:00
Emilio Cobos Álvarez
4a3be9604a Bug 1602317 - Switch style system to associated constants-in-body. r=heycam
This is closer to the equivalent Rust code.

Differential Revision: https://phabricator.services.mozilla.com/D56306

--HG--
extra : moz-landing-system : lando
2019-12-09 03:32:28 +00:00
Timothy Nikkel
86ad3fbc4b Bug 1601185. Add a function that returns if a user can scroll on a given scroll frame in either direction and use it in EventStateManager::ComputeScrollTargetAndMayAdjustWheelEvent. r=botond
Previously we were just checking overflow hidden here, which is not enough because we can scroll overflow hidden if we are zoomed in.

Differential Revision: https://phabricator.services.mozilla.com/D55918

--HG--
extra : moz-landing-system : lando
2019-12-07 22:56:00 +00:00