Commit graph

1964 commits

Author SHA1 Message Date
Matt Woodrow
195a7e86e5 Bug 1540737 - Implement Paint() for all display items, and nsDisplayList so that we can paint without using FrameLayerBuilder. r=miko
This creates a new leaf nsDisplayWrapper item for consumers that just want an empty wrapper, with a Paint method that asserts. This lets us leaves Paint pure-virtual on nsDisplayWrapList, and lets the compiler force us to implement it for the other leaf types.

It also disables flattening of transform/opacity items. This is because they flatten the items even when used with FlattenedDisplayItemIterator, even though this doesn't add markers to replace them (only FLB does this). We could in theory fix this, but I don't think FLB performance matters much any more.

Differential Revision: https://phabricator.services.mozilla.com/D114676
2021-05-19 01:11:32 +00:00
Csoregi Natalia
1f3f5df2ce Backed out 8 changesets (bug 1540737) for causing graphics crashes in Bug 1711718. a=backout
Backed out changeset 37628894ffd5 (bug 1540737)
Backed out changeset 4b5f53d5127b (bug 1540737)
Backed out changeset a73e041f1f1d (bug 1540737)
Backed out changeset 81f1a9d1a5e1 (bug 1540737)
Backed out changeset b3d0cc460b24 (bug 1540737)
Backed out changeset f929de495b87 (bug 1540737)
Backed out changeset 2f5b8369d061 (bug 1540737)
Backed out changeset b4c93d182ef4 (bug 1540737)
2021-05-18 19:06:20 +03:00
Matt Woodrow
21836c0689 Bug 1540737 - Implement Paint() for all display items, and nsDisplayList so that we can paint without using FrameLayerBuilder. r=miko
This creates a new leaf nsDisplayWrapper item for consumers that just want an empty wrapper, with a Paint method that asserts. This lets us leaves Paint pure-virtual on nsDisplayWrapList, and lets the compiler force us to implement it for the other leaf types.

It also disables flattening of transform/opacity items. This is because they flatten the items even when used with FlattenedDisplayItemIterator, even though this doesn't add markers to replace them (only FLB does this). We could in theory fix this, but I don't think FLB performance matters much any more.

Differential Revision: https://phabricator.services.mozilla.com/D114676
2021-05-17 23:53:45 +00:00
Ting-Yu Lin
93ced5a058 Bug 1696885 - Fix block-end padding missing for scrollable <textarea>. r=emilio
We've added block-end padding for block frame in bug 1527949. However,
<textarea> has `overflow-clip-box: content-box` in its inline-axis (See
forms.css), and the existing logic in
nsHTMLScrollFrame::ReflowScrolledFrame(), which inflates the scrolled
frame's overflow areas with its padding, doesn't use the overflow areas
returned in aMetrics. That effectively ignores the efforts in
bug 1527949. Hence this patch.

Differential Revision: https://phabricator.services.mozilla.com/D109464
2021-03-26 01:06:14 +00:00
Ting-Yu Lin
43f0d51226 Bug 1226305 - Fix clipRect if overflow-clip-box is content-box in any axis. r=emilio
In ScrollFrameHelper::BuildDisplayList(), before comparing the clipRect
with scrollable overflow area, we should deflate the clipRect with
padding if overflow-clip-box is content-box in any axis, to get the
correct content-box dimension in that axis.

overflow-clip-box-3.html is adapted from the testcase attached in
bug 1226305 comment 0.

Differential Revision: https://phabricator.services.mozilla.com/D109097
2021-03-22 17:57:35 +00:00
Florian Quèze
8ad1e5d0aa Bug 1699742 - Remove MOZ_GECKO_PROFILER ifdefs that are no longer needed, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D109078
2021-03-22 16:29:52 +00:00
Timothy Nikkel
6a3bae0758 Bug 1698353. Don't try to restrict the display port base rect of a scroll frame with the display port of the same scroll frame because that doesn't make sense. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D108562
2021-03-17 21:29:22 +00:00
Matt Woodrow
11304ea59b Bug 1685888 - Use the correct offset to reference frame for items wrapping a transform item. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D107941
2021-03-15 03:44:57 +00:00
Timothy Nikkel
2093b6b5e7 Bug 1697262. Null check content view in ScrollFrameHelper::GetPageLoadingState. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D107953
2021-03-11 10:18:54 +00:00
Simon Giesecke
ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +00:00
Ting-Yu Lin
23ed4bcff6 Bug 1696584 - Remove UnionRectEdges() and replace the callers with the equivalent UnionEdges(). r=emilio
UnionRectEdges() and UnionEdges() are equivalent, and the later has a
modern interface with a shorter name. Let's remove the former.

Differential Revision: https://phabricator.services.mozilla.com/D107315
2021-03-07 23:07:08 +00:00
Timothy Nikkel
aef2127a31 Bug 1692997. Make scrollbar button click + hold (repeat mode) go through apz. r=botond
(Almost?) all other scrollbar performed scrolling goes through apz already (this effort was called "desktop_zooming_scrollbars").

This one mode was missed. It uses a repeating timer and setting the curpos attribute to trigger scrolling.

Unfortunately xul trees use this path as well, so we have to keep the old path around for them.

This makes one notable change in behaviour. Both before and after this patch single clicks on scrollbar buttons pass ENABLE_SNAP to the scroll from when they request scrolling (in nsScrollbarButtonFrame::HandleButtonPress). However for repeat scrolling when clicking and holding (which is handled by nsScrollbarFrame::MoveToNewPosition), before this patch the scrolling would not use ENABLE_SNAP. This is not super clear because MoveToNewPosition sets the curpos attributes, and then ScrollFrameHelper::CurPosAttributeChanged( would get called in response to that, and it would call ScrollToWithOrigin to the do scrolling, and it does not specify the snap mode, but the default is DISABLE_SNAP. This patch changes that so that we explicitly pass ENABLE_SNAP in MoveToNewPosition. It seems that this was likely overlooked (not hard to do when it's not clear like this) when adding snapping support. It makes sense to handle snapping the same way for single clicks and clicking and holding. If this turns out to be the wrong idea we can easily change it back.

Needs a test.

Differential Revision: https://phabricator.services.mozilla.com/D105288
2021-02-26 11:47:18 +00:00
Simon Giesecke
9af107a839 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
Miko Mynttinen
285b2844a7 Bug 1526970 - Part 1: Store the list of display items the frame has as a member variable instead of frame property r=mattwoodrow,emilio
Differential Revision: https://phabricator.services.mozilla.com/D104059
2021-02-24 22:22:17 +00:00
Timothy Nikkel
d3f260db6d Bug 1692991. Set the MinimalDisplayPort property before calling SetDisplayPortMargins so a display port expiry timer isn't incorrectly started for it. r=botond
This came up while improving test_layerization.html in bug 1691878, so that will test this.

Differential Revision: https://phabricator.services.mozilla.com/D105284
2021-02-18 02:29:28 +00:00
Emilio Cobos Álvarez
951a0342d6 Bug 1692380 - The intrinsic min isize of the marquee scroller should be zero. r=dholbert
I couldn't come up with a way to effectively cause this effect with
regular CSS I could put in marquee.css... But this matches the legacy
xul behavior and the chrome behavior, which should be compatible.

This undoes a reftest expectation change I included in bug 1618584. Our
behavior in those tests before this patch matches Safari, but Safari
passes the test I'm adding on this bug, so it is somewhat inconsistent.

Differential Revision: https://phabricator.services.mozilla.com/D105045
2021-02-12 19:32:22 +00:00
Timothy Nikkel
bb82df49f5 Bug 1691879. Fix expiry with minimal display ports. r=botond
In RemoveDisplayPortCallback

https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/layout/generic/nsGfxScrollFrame.cpp#2588

we don't remove a regular display port and install a minimal display port if mIsScrollParent is true on the scroll frame. mIsScrollParent gets set to true if any child scroll frame has a display port of any time (minimal or otherwise).

We want to expire a regular display port and replace it with a minimal display port if it only contains minimal display ports (or no display ports).

This was caught while I was updating gfx/layers/apz/test/mochitest/test_layerization.html for the new activate all scroll frames code (bug 1691878).

Differential Revision: https://phabricator.services.mozilla.com/D104648
2021-02-11 08:58:06 +00:00
Timothy Nikkel
de41983d0d Bug 1691355. Check in a few places for a zero margin display port and set a full one. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D104361
2021-02-10 06:33:05 +00:00
Miko Mynttinen
b6b5546bc8 Bug 1534549 - Part 4: Shrink nsDisplayCompositorHitTestInfo r=mstange
These changes make nsDisplayCompositorHitTestInfo inherit directly from nsDisplayItem, which should shrink it slightly. This also simplifies the logic: hit testing information is now available at nsDisplayItem level as opposed to nsPaintedDisplayItem.

Differential Revision: https://phabricator.services.mozilla.com/D103773
2021-02-06 22:30:57 +00:00
Miko Mynttinen
cf0c7ae9e3 Bug 1534549 - Part 2: Allow all display items to carry hit testing information r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D102515
2021-02-06 22:30:37 +00:00
Miko Mynttinen
d481341bf4 Bug 1534549 - Part 1: Remove old FLB hit test info optimization r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D102514
2021-02-06 22:30:29 +00:00
Noemi Erli
1ea87269a8 Backed out 4 changesets (bug 1534549) for causing mochitest failures in test_group_wheelevents.html CLOSED TREE
Backed out changeset a03c745620d6 (bug 1534549)
Backed out changeset 2ac9c5dbe9f5 (bug 1534549)
Backed out changeset dabd0c5d21cf (bug 1534549)
Backed out changeset f1b390459263 (bug 1534549)
2021-02-05 02:41:19 +02:00
Miko Mynttinen
83f9800345 Bug 1534549 - Part 4: Shrink nsDisplayCompositorHitTestInfo r=mstange
These changes make nsDisplayCompositorHitTestInfo inherit directly from nsDisplayItem, which should shrink it slightly. This also simplifies the logic: hit testing information is now available at nsDisplayItem level as opposed to nsPaintedDisplayItem.

Differential Revision: https://phabricator.services.mozilla.com/D103773
2021-02-04 22:20:13 +00:00
Miko Mynttinen
63a9dd596a Bug 1534549 - Part 2: Allow all display items to carry hit testing information r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D102515
2021-02-04 22:19:56 +00:00
Miko Mynttinen
a32145a4c8 Bug 1534549 - Part 1: Remove old FLB hit test info optimization r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D102514
2021-02-02 14:30:13 +00:00
Timothy Nikkel
cf811ba8b1 Bug 1690433. Update display port expiry to handle minimal display ports. r=botond
If the activate_all_scroll_frames pref is on we want to never remove a minimal display port, and when a regular display port expires we want to downgrade it to minimal.

If the pref is off it's the same as before except we want to also remove the minimal property when on expiry.

Differential Revision: https://phabricator.services.mozilla.com/D103859
2021-02-04 11:17:16 +00:00
Timothy Nikkel
1be3156679 Bug 1690433. Update code that looks for the presence of a display port for new minimal display ports. r=botond
This patch is the result of auditing all places that look at the presence or absence of a display port to handle minimal display ports (HasDisplayPort, GetDisplayPort, etc).

Broadly speaking the places were in two categories:
1) things related to painting, that want to consider minimal display ports as display ports for purposes of things like sending over metadata and separating out layers.
2) things that care about async scrolling, and so actually want to have a properly sized display port.

Type 1) were not changed by this patch. Type 2) were changed to consider minimal display ports as not display ports.

Again, we are aiming to leave behaviour unchanged.

Differential Revision: https://phabricator.services.mozilla.com/D103856
2021-02-04 11:16:59 +00:00
Timothy Nikkel
e2f27ec58a Bug 1690433. Create a minimal display port type. r=botond
We introduce a new type of display port, a minimal display port. It is controlled via a property on the content element. When the property is present any other display port specified on the element is ignored and instead the display port rect is computed by assuming 0 display port margins and no alignment (this reuses the existing code for display port suppression).

We then add code to set a minimal display port on every scroll frame that is painted that has WantAsyncScroll() when certain prefs are set (the prefs are disabled as of this patch though).

We then need to manage removing the minimal display port property when, before this patch, we would have created a regular display port. As well we need to add the minimal display port property when, before this patch, we would have removed a regular display port.

In order to do this I audited all sites where we set the display port rect and display port margins property. The changes to the code for handling the removal display ports happens in a later patch.

My audit found that all of the places we set a display port want to clear the minimal display port property except:
-UpdateSub/RootFrame in APZCCallbackHelper
-UpdateDisplayPortMarginsForPendingMetrics in DisplayPortUtils

UpdateDisplayPortMarginsForPendingMetrics is basically a fast path of the UpdateSub/RootFrame code. These are the places where we handle calls to RequestContentRepaint from apz. By adding an assert and running it through try server I found that UpdateSub/RootFrame can create a display port in the following cases:
-a scroll info layer
-a scroll frame with !WantAsyncScroll() (the main thread never creates a display port for a scroll frame with !WantAsyncScroll()) (for example if the main thread creates a scroll id and sends over metadata via nsLayoutUtils::GetRootMetaData, and then the scroll rect changes, that will cause a RequestContentRepaint call)
-a few instances that don't fall into the above that happened on try server but didn't reproduce for me locally, so I don't know more about them.
It's not very important whether we clear the minimal display port property for these cases or not (the first two cases we don't async scroll the scroll frame at all, the last case seems quite rare).

Note that we intentionally do not change the existing behaviour of zero margin display ports set via SetZeroMarginDisplayPortOnAsyncScrollableAncestors as we are aiming for no behaviour changes with this patch (until we flip the pref). A later patch in a different bug handles changing these display ports over to minimal display ports.

Differential Revision: https://phabricator.services.mozilla.com/D103855
2021-02-04 11:16:44 +00:00
Neil Deakin
ca5dfb7222 Bug 259640, add chrome only method to add scrollbar tick marks to a window, r=smaug,tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D100938
2021-02-03 17:35:41 +00:00
Emilio Cobos Álvarez
50e0643986 Bug 1689253 - Make resizer sizing not guess a size when there's not scrollbar boxes. r=spohl
Depends on D103302

Differential Revision: https://phabricator.services.mozilla.com/D103303
2021-01-28 14:33:25 +00:00
Emilio Cobos Álvarez
4b4ff83478 Bug 1689253 - Add a more sensible scrollbar size API to nsITheme, and use it to replace ScrollbarNonDisappearing. r=spohl
There's no reason we should need an scrollbar box to query the size of a
scrollbar. I plan to use this in the following patch to make the size of a
resizer not vary depending on whether the container has scrollbars or not,
which is what ultimately causes the reftest failure.

Differential Revision: https://phabricator.services.mozilla.com/D103302
2021-01-28 22:11:54 +00:00
Emilio Cobos Álvarez
33f844c209 Bug 1667089 - Remove some dead code for collapsed resizers on the root scroll frame. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D103272
2021-01-28 08:25:54 +00:00
Mats Palmgren
b41a2b9d21 Bug 1687239 part 2 - Remove plugin support from layout/. r=emilio
Note that there's still a little plugin related code in
widget/ and gfx/ etc after this.  That can be removed
once we remove plugin support from dom/ etc.
The removal from layout/ should be pretty complete though.

Differential Revision: https://phabricator.services.mozilla.com/D102140
2021-01-25 11:53:49 +00:00
Emilio Cobos Álvarez
0ed6409ab9 Bug 1688004 - Build top layer items for XUL documents that don't have scrollframes. r=miko
This will allow the browser chrome to use `<dialog>` etc, see
bug 1685313.

Tweak the check to support scrolling="false" on reftests, so that we can
test this.

Differential Revision: https://phabricator.services.mozilla.com/D102623
2021-01-25 00:31:30 +00:00
Butkovits Atila
9d529dd4e7 Backed out changeset 62050554681e (bug 1688004) for causing failure on test_disable_scroll_frame_plain.html. CLOSED TREE 2021-01-22 22:57:33 +02:00
Emilio Cobos Álvarez
6a72aab71b Bug 1688004 - Build top layer items for XUL documents that don't have scrollframes. r=miko
This will allow the browser chrome to use `<dialog>` etc, see
bug 1685313.

Tweak the check to support scrolling="false" on reftests, so that we can
test this.

Differential Revision: https://phabricator.services.mozilla.com/D102623
2021-01-22 14:44:17 +00:00
nirmay
55420bffb0 Bug 1677643 - Replace nsIScrollableFrame::{HORIZONTAL, VERTICAL} with ScrollDirections. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D102087
2021-01-21 17:45:19 +00:00
Hiroyuki Ikezoe
2e6e03771b Bug 1683612 - Don't use mobile display size where dom.meta-viewport.enable pref is false. r=botond
If the pref is false, we don't trigger auto-shrink machinery so that we
shouldn't use the display size to layout scrollbars.

Differential Revision: https://phabricator.services.mozilla.com/D100312
2021-01-05 02:02:51 +00:00
Kartikaya Gupta
cc5f5affcc Bug 1667202 - Allow scroll metadata creation even for APZ-disabled scrollframes. r=botond
APZ is not always enabled; for example, on the 1proc
chrome mochitests. However, WR still relies on getting a scroll metadata
for ASRs in this situation, so that it can inform WR of the scroll range
of scrollframes. This combination results in an assertion failure where
the scroll metadata is not generated but the caller expects it to be. This
patch fixes the problem by generating the scroll metadata even if APZ is
disabled. This should be harmless, and fixes the assertion
failure.

Differential Revision: https://phabricator.services.mozilla.com/D99671
2020-12-14 16:27:06 +00:00
Simon Giesecke
1c53236b70 Bug 1679272 - Include ScopeExit.h exactly where used. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D98888
2020-12-07 14:25:59 +00:00
Bogdan Tara
4a649093b9 Backed out changeset 3e90a3759639 (bug 1679208) for scrollbars-no-margin.html failures CLOSED TREE 2020-12-03 01:11:32 +02:00
Emilio Cobos Álvarez
aa15236426 Bug 1679208 - Don't assume int return values in nsITheme. r=mstange
This doesn't hold with fractional scale values. Right now GTK truncates
the scale factor, Windows rounds, and non-native theme rounds as well.

With this native theme will propagate correctly the floating point
values.

I tried to not change behavior meaningfully in any of the other themes,
mostly to avoid risk. GTK and Windows can be trivially tweaked to
support fractional scale factors properly if we wanted to, but seems
better to not do that as part of this patch.

Depends on D98099

Differential Revision: https://phabricator.services.mozilla.com/D98100
2020-12-02 21:40:05 +00:00
Simon Giesecke
971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Botond Ballo
94bd7fb7c9 Bug 1645433 - Avoid using INT32_MAX as the z-index of inactive scrollframe items. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D97063
2020-11-20 01:18:24 +00:00
Ting-Yu Lin
545a6376cd Bug 1677635 Part 4 - Rename nsOverflowAreas to OverflowAreas, and move it into mozilla namespace. r=layout-reviewers,emilio
This patch is generated via the rename functionality in my editor; add
`mozilla::` prefix to `OverflowAreas` in headers; and remove the
`OverflowType` alias added in Part 1.

Differential Revision: https://phabricator.services.mozilla.com/D97235
2020-11-18 00:08:12 +00:00
Csoregi Natalia
9eab74eb27 Backed out 2 changesets (bug 1645433) for reftest failures. CLOSED TREE
Backed out changeset 34c5981b4667 (bug 1645433)
Backed out changeset 7e28049666b7 (bug 1645433)
2020-11-17 02:53:42 +02:00
Botond Ballo
34cf1d1b68 Bug 1645433 - Avoid using INT32_MAX as the z-index of inactive scrollframe items. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D97063
2020-11-16 21:18:41 +00:00
Kartikaya Gupta
9116b2fd7d Bug 1662019 - Encapsulate the ScrollGeneration::New calls a bit more. r=tnikkel
Instead of the scrollframe manually calling ScrollGeneration::New this has the
ScrollPositionUpdate do it automatically. Just makes things a little more
encapsulated.

Note that this patch does contain a small functional change, which is that if
ScrollFrameHelper::ScrollToImpl is called with ScrollOrigin::apz, it will not
increment mScrollGeneration whereas it used to before. As far as I can tell
this should be a harmless change.

Depends on D97036

Differential Revision: https://phabricator.services.mozilla.com/D97037
2020-11-13 22:58:13 +00:00
Kartikaya Gupta
bebe87ee86 Bug 1662019 - Replace the uint32_t scroll generation with ScrollGeneration. r=tnikkel
Depends on D97035

Differential Revision: https://phabricator.services.mozilla.com/D97036
2020-11-13 22:58:06 +00:00
Kartikaya Gupta
af977cd0ec Bug 1231177 - Allow scroll position to advance when spamming multiple scrollframes in an interleaved manner. r=botond
In the case where there are two scrollframes that get scrolled in an
interleaved manner, the scroll generation counter continually advances
and blocks APZ from updating the main-thread scroll position. This
fixes that by removing the scroll generation counter check from the
relevant condition. The clause is entirely redundant when there is only
a single scrollframe and only causes problems when there are multiple
scrollframes.

Differential Revision: https://phabricator.services.mozilla.com/D97034
2020-11-14 00:16:14 +00:00