Граф коммитов

61 Коммитов

Автор SHA1 Сообщение Дата
Timothy Nikkel a64e3a50db Bug 1872002. Don't descend into popups in MaybeCreateDisplayPortInFirstScrollFrameEncountered. r=layout-reviewers,emilio
When building the display list for popup frames we hit this early return

https://searchfox.org/mozilla-central/rev/08899071a2c8a573ac47ac632869bb92269b3ec3/layout/generic/nsIFrame.cpp#4089

because menupopups are given top layer style here

https://searchfox.org/mozilla-central/rev/08899071a2c8a573ac47ac632869bb92269b3ec3/toolkit/content/xul.css#370

The place where top layer items would get added to the display list is

https://searchfox.org/mozilla-central/rev/08899071a2c8a573ac47ac632869bb92269b3ec3/layout/generic/ViewportFrame.cpp#163

However that iterates the toplayer list from the document which does not contain menupopups; it contains things like popover, fullscreen, dialog.

However, if not culled by that toplayer early return, popups would be culled by this popup specific early return a few lines later

https://searchfox.org/mozilla-central/rev/08899071a2c8a573ac47ac632869bb92269b3ec3/layout/generic/nsIFrame.cpp#4110

So I think using a popup check here is the right way to go.

Differential Revision: https://phabricator.services.mozilla.com/D197313
2023-12-30 04:47:11 +00:00
Butkovits Atila 41b6ca07bc Backed out changeset 2feca7f78d58 (bug 1871751) for causing failures at DisplayPortUtils.cpp. CLOSED TREE 2023-12-26 14:12:45 +02:00
Timothy Nikkel 4a9339c873 Bug 1871751. Avoid AsyncPanZoomEnabled call in MaybeCreateDisplayPortInFirstScrollFrameEncountered. r=layout-reviewers,emilio
The return value of nsLayoutUtils::AsyncPanZoomEnabled only changes if we descend into a frame whose display root widget is different. But that is not possible, we do not descend into any frames that are in different widgets.

Differential Revision: https://phabricator.services.mozilla.com/D197237
2023-12-26 11:39:54 +00:00
Timothy Nikkel a958e79ad1 Bug 1860474. A few small optimizations to DisplayPortUtils::MaybeCreateDisplayPort. r=hiro
These are small but they do show up in sp3 profiles.

IsPaintingToWindow is always true, so just assert it.

HaveScrollableDisplayPort is a simple pointer check, whereas AsyncPanZoomEnabled needs to jump several pointers (and WantAsyncScroll is slower yet), so change the order.

HasNonMinimalNonZeroDisplayPort is not needed unless we are inside that if, so don't call it outside the if.

Differential Revision: https://phabricator.services.mozilla.com/D191599
2023-10-25 22:39:18 +00:00
Hiroyuki Ikezoe 0f97319b31 Bug 1781007 - Skip calling RestrictToRootDisplayPort in the case where the scroll container has empty displayport margins. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D189323
2023-10-05 06:38:55 +00:00
Cristina Horotan 29ea4ce56e Backed out changeset 413c83e8ccda (bug 1781007) for causing mochitest failures at test_group_checkerboarding.html. CLOSED TREE 2023-10-04 08:39:46 +03:00
Hiroyuki Ikezoe bd13aa7916 Bug 1781007 - Skip calling RestrictToRootDisplayPort in the case where the scroll container has empty displayport margins. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D189323
2023-10-04 04:50:01 +00:00
Botond Ballo 79c1c52c91 Bug 1818967 - Remove DisplayPortMargins::mScale which is no longer used. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D173578
2023-03-30 03:59:05 +00:00
Botond Ballo 35ae7c50d1 Bug 1818967 - Use the correct scale in DisplayPortMargins::GetRelativeToLayoutViewport(). r=hiro
mScale is the zoom at the time the displayport margins were set, but
the resulting ScreenMargin will be interpreted in the context of the
scale at which we're about to paint, which may be different.

Note that mMargins themselves are not affected by these two scales
being potentially different, since we want the magnitude of the
margins to the constant in Screen pixels (i.e. a constant fraction
of the viewport size).

Differential Revision: https://phabricator.services.mozilla.com/D173577
2023-03-30 03:59:05 +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
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
Emilio Cobos Álvarez 4e978b56b5 Bug 1689816 - Implement <tabpanels> and <deck> without XUL layout. r=Gijs,Jamie,morgan,preferences-reviewers,mconley,TYLin
Gijs for front-end bits, layout for the new CSS properties and the
removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y
changes.

As discussed in the bug, the main tricky part here is handling a11y
correctly. For <deck>, that's trivial (just use `visibility: hidden` to
hide the panels visually, while removing the unselected panels from the
a11y tree).

For <tabpanels> however we need to do something special. We do want to
hide stuff visually, but we want to preserve the contents in the a11y
tree.

For that, the easiest fix is introducing a new privileged CSS property
(-moz-subtree-hidden-only-visually), which takes care of not painting
the frame, but marks stuff offscreen in the accessibility tree. This is
not intended to be a property used widely.

Other than that, the changes are relatively straight-forward, though
some of the accessible/mac changes I could get a sanity-check on.

Differential Revision: https://phabricator.services.mozilla.com/D157875
2022-09-27 04:18:16 +00:00
Marian-Vasile Laza f54a464c90 Backed out changeset 2f74f8f2ed19 (bug 1689816) for causing reftest failures on skip-ink-multiline-position.html. 2022-09-26 23:24:03 +03:00
Emilio Cobos Álvarez f875681246 Bug 1689816 - Implement <tabpanels> and <deck> without XUL layout. r=Gijs,Jamie,morgan,preferences-reviewers,mconley,TYLin
Gijs for front-end bits, layout for the new CSS properties and the
removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y
changes.

As discussed in the bug, the main tricky part here is handling a11y
correctly. For <deck>, that's trivial (just use `visibility: hidden` to
hide the panels visually, while removing the unselected panels from the
a11y tree).

For <tabpanels> however we need to do something special. We do want to
hide stuff visually, but we want to preserve the contents in the a11y
tree.

For that, the easiest fix is introducing a new privileged CSS property
(-moz-subtree-hidden-only-visually), which takes care of not painting
the frame, but marks stuff offscreen in the accessibility tree. This is
not intended to be a property used widely.

Other than that, the changes are relatively straight-forward, though
some of the accessible/mac changes I could get a sanity-check on.

Differential Revision: https://phabricator.services.mozilla.com/D157875
2022-09-26 17:40:30 +00:00
Emilio Cobos Álvarez 7a2b1a58f0 Bug 1785310 - Add a few extra missing includes that hybrid builds caught.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2022-08-18 00:08:37 +02:00
Botond Ballo 69e8a22280 Bug 1771822 - Follow-up simplifications to DisplayPortUtils functions. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D151798
2022-07-14 18:39:34 +00:00
Botond Ballo 5a6eae75b5 Bug 1771822 - Remove the layers.low-precision-{buffer,resolution} prefs. r=tnikkel
These are no longer used.

Depends on D151796

Differential Revision: https://phabricator.services.mozilla.com/D151797
2022-07-14 18:39:33 +00:00
Miko Mynttinen b72bc79cff Bug 1766650 - Store modified frames in display root frame RetainedDisplayListBuilder r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D144889
2022-05-30 14:20:58 +00:00
Timothy Nikkel 4b48b3dd2d Bug 1753881. Simplify a few IsVisualViewportOffsetSet callers. r=botond
Depends on D139472

Differential Revision: https://phabricator.services.mozilla.com/D139683
2022-02-27 13:09:27 +00:00
Timothy Nikkel cd084cd10a Bug 1755290. Don't descend into the chrome tabbar when looking for an async scrollable element to create a display port on. r=botond,emilio
A basic Firefox window has no element that WantAsyncScroll in the parent process, even if there are enough tabs to overflow the tabbar and make it scroll. This is because the underlying element is overflow hidden.

The tabbar is an arrowscrollbox

https://searchfox.org/mozilla-central/rev/e66593593f3b356901011ea0fcdf9979728e9ae8/browser/base/content/navigator-toolbox.inc.xhtml#56

Which is implemented here

https://searchfox.org/mozilla-central/rev/e66593593f3b356901011ea0fcdf9979728e9ae8/toolkit/content/widgets/arrowscrollbox.js#33

using a <scrollbox> element. These are meant to be programtically scrolled but not user scrolled, hence they are declared overflow hidden here

https://searchfox.org/mozilla-central/rev/e66593593f3b356901011ea0fcdf9979728e9ae8/toolkit/content/xul.css#540

and they have been that way since the early 2000s, so doesn' seem likely to change. overflow: hidden element do not WantAsyncScroll

https://searchfox.org/mozilla-central/rev/e66593593f3b356901011ea0fcdf9979728e9ae8/layout/generic/nsGfxScrollFrame.cpp#1691

If the tabbar structure/name changes I left a comment there pointing out this code.

In a session with a lot of tabs this code can be 15% of the total parent process time to open a new tab. With this patch it's pretty much zero.

Differential Revision: https://phabricator.services.mozilla.com/D138650
2022-02-16 20:20:49 +00:00
Miko Mynttinen 978b3d9089 Bug 1697979 - Part 1: Reuse previously built stacking context display items without merging r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D128413
2022-01-22 02:37:31 +00:00
Alexandru Michis ae4456b8b6 Backed out 3 changesets (bug 1697979) for causing reftest failures in retained-dl-displayport-1.html
Backed out changeset e4248d811360 (bug 1697979)
Backed out changeset db3882cc536c (bug 1697979)
Backed out changeset ea7ce38abaab (bug 1697979)
2022-01-21 04:01:27 +02:00
Miko Mynttinen 07449db71e Bug 1697979 - Part 1: Reuse previously built stacking context display items without merging r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D128413
2022-01-21 00:43:34 +00:00
Noemi Erli 2bfdec7254 Backed out 3 changesets (bug 1697979) for causing reftest failures CLOSED TREE
Backed out changeset 4edb10a45d13 (bug 1697979)
Backed out changeset 456b57492294 (bug 1697979)
Backed out changeset 1cb3b14f2f6c (bug 1697979)
2022-01-20 22:25:00 +02:00
Miko Mynttinen 3882f995d9 Bug 1697979 - Part 1: Reuse previously built stacking context display items without merging r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D128413
2022-01-20 18:38:59 +00:00
Miko Mynttinen c1b142f453 Bug 1751018 - Change FrameFlags to EnumSet r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D136392
2022-01-20 00:21:15 +00:00
Timothy Nikkel 0250d89cfa Bug 1733747. Remove remaining critical display port code. r=botond
There is one thing to note in this patch that is a change: this patch changes the displayport that we log for test purposes from the critical display port to the display port.

This will only be different on android. If tests were checking this then they were broken because the critical display port has no significance. I did a quick survey of the tests I could find that used this. None of them seem like they really want the critical display port (given the new world where critical display port has no significance).

Depends on D127350

Differential Revision: https://phabricator.services.mozilla.com/D127351
2022-01-17 10:29:44 +00:00
Timothy Nikkel b0abc39b82 Bug 1734478. Remove MaxSizeExceededBehaviour from displayport getter options as it is unused. r=botond
The reason that GetDisplayPortForVisibilityTesting was using Drop was because there is a test that sets a 10x zoom and we ran image visibility without updating the displayport base rect (painting would update it), so the returned displayport was based on the much larger base rect. The patches goal was to avoid the assert we removed. Using a displayport that large in that situation for image visibility seems fine because it shouldn't make us decode any more images then were previously already visible.

Depends on D127731

Differential Revision: https://phabricator.services.mozilla.com/D127732
2021-10-18 07:48:11 +00:00
Timothy Nikkel fcb5f0e008 Bug 1734478. Stop checking displayport size against max texture size. r=jrmuizel
No longer necessary, and it only NS_ASSERTION'd if we failed anyway, and we weren't even checking on mac and android due to the tiling pref.

Differential Revision: https://phabricator.services.mozilla.com/D127731
2021-10-18 07:48:11 +00:00
Jeff Muizelaar f76f41feb4 Bug 1736236 - Remove obsolete LayerManager.h. r=gfx-reviewers,lsalzman
This adds a bunch of #include "WindowRenderer.h" in places
that were getting it implicitly before.

Differential Revision: https://phabricator.services.mozilla.com/D128687
2021-10-17 23:00:47 +00:00
Hiroyuki Ikezoe f73bb3f591 Bug 1730998 - Remove apz peek messages stuff. r=botond
This stuff is now a no-op because the RequestContentRepaint message has a
higher priority than vsync.

Depends on D127033

Differential Revision: https://phabricator.services.mozilla.com/D127593
2021-10-14 09:43:03 +00:00
Timothy Nikkel 48be720702 Bug 1733742. Remove GetHighResolutionDisplayPort. r=botond
With the old layers backend we had low precision buffer code controlled via the pref layers.low-precision-buffer that was used on android. We would expand the displayport by 4x and then paint it as 1/4 the resolution, and then we would have a critical displayport without the 4x multipler that we would paint at the real resolution. The code to do the painting at the lower resolution was in the layers backend and has since been removed. (This is okay because webrender doesn't rasterize all of the content in the displayport.) So the critical displayport or displayport are no longer treated differently anywhere. Except a few pieces of code that should be fixed/changed/removed. This patch being one of them.

GetHighResolutionDisplayPort would return the displayport without the multipler in all situations (pref on or off).

In DisplayPortUtils we are checking the displayport rect before/after setting new displayport margins to see if it changes to determine if we need to invalidate. Since the critical displayport isn't used for anything, the regular displayport is the correct thing to use here.

In nsGfxScrollFrame we are doing a similar thing, except checking that the displayport doesn't change after a scroll.

In nsDisplayListBuilder::OutOfFlowDisplayData::ComputeVisibleRectForFrame it's also the correct thing, as we want to include the same rect for fixed content as we do for non-fixed content. But this is an significant expansion of the dirty rect of fixed content and the code history has fixes related to drawing too much of fixed content and OOMing so a little more scrutiny is reasonable. However if there was a problem with OOM, since this is the same rect we use for non-fixed content we would have OOM problems with regular content, so this should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D127344
2021-10-07 05:41:19 +00:00
Sandor Molnar c4af240897 Backed out 4 changesets (bug 1730998) for frequent Android gv-junit failures. CLOSED TREE
Backed out changeset 92641110e5c9 (bug 1730998)
Backed out changeset 7e496a4d1b55 (bug 1730998)
Backed out changeset 60d769e12932 (bug 1730998)
Backed out changeset 64a2b879aa79 (bug 1730998)
2021-10-06 16:43:50 +03:00
Hiroyuki Ikezoe 508b513463 Bug 1730998 - Remove apz peek messages stuff. r=botond
This stuff is now a no-op because the RequestContentRepaint message has a
higher priority than vsync.

Differential Revision: https://phabricator.services.mozilla.com/D127593
2021-10-06 01:07:37 +00:00
Timothy Nikkel 4fdbd2ef36 Bug 1732600. Make GetDisplayPortFromMarginsData use ancestor process transform to ancestor scale. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D126661
2021-10-05 09:28:58 +00:00
Timothy Nikkel 44555d25b7 Bug 1732600. Make ComputeDisplayportScale use the ancestor process transform to ancestor scale. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D126660
2021-10-05 09:28:57 +00:00
Timothy Nikkel 80c46c77ef Bug 1733740. Simplify some displayport calculation code now that webrender is always on. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D127343
2021-10-05 01:29:57 +00:00
Daniel Holbert 3a3ace84d5 Bug 1730741 part 2: Add includes and forward-decls to fix non-unified-build bustage in layout/base, and remove REQUIRES_UNIFIED_BUILD declaration. r=emilio
After the fixes in this patch, the REQUIRES_UNIFIED_BUILD declaration is no
longer needed, so I'm removing it here.  This directory now builds successfully
with that removed and with ac_add_options --disable-unified-build in the
mozconfig.

Differential Revision: https://phabricator.services.mozilla.com/D125601
2021-09-15 18:48:17 +00:00
Matt Woodrow cc8a4f7fb6 Bug 1728914 - Convert a few uses of AsLayerManager to use WebRenderLayerManager. r=gfx-reviewers,aosmond
Depends on D124419

Differential Revision: https://phabricator.services.mozilla.com/D124420
2021-09-05 02:16:38 +00:00
Matt Woodrow 912b7f8ef1 Bug 1721537 - Split out WindowRenderer base class from LayerManager. r=miko
Depends on D120439

Differential Revision: https://phabricator.services.mozilla.com/D120440
2021-07-22 22:58:57 +00:00
Botond Ballo cdcdf984e4 Bug 1698693 - Convert audited calls to GetCrossDocParentFrame() to GetCrossDocParentFrameInProcess(). r=tnikkel
See bug 1698693 comment 6 and subsequent comments for the audit.

Depends on D117388

Differential Revision: https://phabricator.services.mozilla.com/D117389
2021-06-23 22:05:31 +00:00
Hiroyuki Ikezoe 3faa6fa27a Bug 1709460 - Try to initialize a displayport base for OOP iframe's root scroller with its visible rect. r=tnikkel
In the same manner what we initialize a diplayport base for top level contents.

Differential Revision: https://phabricator.services.mozilla.com/D116576
2021-06-15 01:49:32 +00:00
Timothy Nikkel 12fb741116 Bug 1691160. Make MaybeCreateDisplayPortInFirstScrollFrameEncountered consider a zero margin display a not having a display port so it sets one. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D104359
2021-02-09 01:41:00 +00:00
Timothy Nikkel ec6356e1be Bug 1691186. Don't clear minimal display ports in SetZeroMarginDisplayPortOnAsyncScrollableAncestors. r=botond
See https://bugzilla.mozilla.org/show_bug.cgi?id=1675547#c25 and https://bugzilla.mozilla.org/show_bug.cgi?id=1675547#c26

Short version: we hit a situation where we have a minimal display port, then SetZeroMarginDisplayPortOnAsyncScrollableAncestors clears the minimal display port to install a zero margin display port. Once the minimal display port is cleared we get a random (errant) repaint request from apz which sets a full display port (it doesn't want a display port, it just wants to sync content and apz).

Differential Revision: https://phabricator.services.mozilla.com/D104306
2021-02-06 21:12:46 +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
Botond Ballo 7431701c98 Bug 1682919 - Avoid creating a new DisplayPortMargins object as a side effect of querying the displayport. r=tnikkel
DisplayPortMargins objects are only meant to be created when setting
display port margins, not when querying them, because the object's
constructor records the visual and layout scroll offsets at the time
of construction to use for adjusting the margins to be layout-relative.

Differential Revision: https://phabricator.services.mozilla.com/D102075
2021-01-24 04:08:00 +00:00
Botond Ballo 06fad2134b Bug 1466224 - Follow out-of-flow frames to their placeholders in GetAsyncScrollableAncestorFrame(). r=tnikkel
This ensures that the notion of a scroll frame's scrollable ancestor used in
SetZeroMarginDisplayPortOnAsyncScrollableAncestor() to activate ancestors
when activating a scroll frame, matches what the actual ancestor is
according to display list building logic.

This avoids us taking the buggy "activate a scroll parent after the fact"
codepath (AutoCurrentActiveScrolledRootSetter::InsertScrollFrame()), which
can result in a display list with incorrect ASRs, in at least some cases.

Differential Revision: https://phabricator.services.mozilla.com/D100303
2020-12-22 04:00:51 +00:00
Botond Ballo 6c367f7388 Bug 1487181 - Fix some include-what-you-use issues. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D99565
2020-12-13 21:02:25 +00:00
Botond Ballo 758856dc14 Bug 1669861 - Rename DisplayPortMargins::WithAdjustment() to FromAPZ(). r=kats
WithAdjustment() is now a misnomer now that the other methods can sometimes
apply an adjustment as well.

Differential Revision: https://phabricator.services.mozilla.com/D94537
2020-10-26 23:26:59 +00:00