Commit Graph

2663 Commits

Author SHA1 Message Date
Botond Ballo
a6372c3f83 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
Dorel Luca
c3ffb52432 Backed out changeset e514b3f35198 (bug 1682929) for crashtest failures in layout/generic/crashtests/553504-1.xhtml 2020-12-21 05:00:07 +02:00
Emilio Cobos Álvarez
fe2f6d8420 Bug 1682929 - Properly prevent overflow from nsLayoutUtils::AddIntrinsicSizeOffset. r=hiro
Even though this particular test-case is regressed by bug 1624080, this
is really a pre-existing bug.

The reason why we didn't crash before that bug is that we were
incorrectly not accounting for logical border-radius properties (like
border-end-end-radius) in has_author_specified_rules, which caused us to
not disable native appearance. This in turn ended up fixing up our value
returned from AddIntrinsicSizeOffset, which covered the bug.

Use saturating math properly to prevent returning negative sizes
incorrectly from that function, which causes deeper bugs down the
pipeline.

Given the crashtest relies on our particular nscoord represenation it
doesn't seem to be worth putting in WPT, but let me know if you
disagree.

Differential Revision: https://phabricator.services.mozilla.com/D100186
2020-12-20 21:57:50 +00:00
Ting-Yu Lin
2fa4822991 Bug 1585485 Part 2 - Move IsReplacedBoxResolvedAgainstZero() into nsIFrame, and rename it. r=dholbert
We want to call it in nsFlexContainerFrame in the next part.

The method also tests form control elements via the helper
FormControlShrinksForPercentISize, not just replaced boxes, so rename it
for accuracy. We also rename the helper by dropping "I" from the
"PercentISize" because the axis the element contributingx to isn't
necessarily its inline-axis.

Differential Revision: https://phabricator.services.mozilla.com/D99951
2020-12-17 20:01:58 +00:00
Hiroyuki Ikezoe
2303538b9c Bug 1493208 - Tweak scrollable rect offset to (0, 0) for the popup window opened by extensions. r=botond
So that we can make sure APZ handles (0, 0) based coordinates for remote
contents in popup windows, etc.

Differential Revision: https://phabricator.services.mozilla.com/D99309
2020-12-14 21:21:33 +00:00
Emilio Cobos Álvarez
4d1e6d689a Bug 1677353 - Ignore padding when computing definite percentages if we're abspos boxes. r=mats
As percentages in abspos boxes resolve against the padding box.

Differential Revision: https://phabricator.services.mozilla.com/D99455
2020-12-12 11:18:56 +00:00
Emilio Cobos Álvarez
136e604164 Bug 1635914 - Move active flag handling explicitly to BrowsingContext. r=nika
And have it mirror in the parent process more automatically.

The docShellIsActive setter in the browser-custom-element side needs to
be there rather than in the usual DidSet() calls because the
AsyncTabSwitcher code relies on getting an exact amount of notifications
as response to that specific setter. Not pretty, but...

BrowserChild no longer sets IsActive() on the docshell itself for OOP
iframes. This fixes bug 1679521. PresShell activeness is used to
throttle rAF as well, which handles OOP iframes nicely as well.

Differential Revision: https://phabricator.services.mozilla.com/D96072
2020-12-11 15:43:19 +00:00
Makoto Kato
e4612db5cc Bug 1660932 - Don't use element bounding for ZoomToFocusedInput when focused element isn't single line control. r=botond
When show virtual keyboard, we calls ZoomToFocusedInput to scroll to focused
element. But this method only consider single line control. It means that this
doesn't scroll better position when focused element is multiple such as
content editable. Because we use element rectangle foo zoom to rect.

So I would like to change this for <textarea> and contenteditable.

If <textarea> or contenteditable, we should use caret frame to scroll to
better position.

Differential Revision: https://phabricator.services.mozilla.com/D96374
2020-12-07 05:05:48 +00:00
Emilio Cobos Álvarez
367b9e3c00 Bug 1666739 - Add an optional opacity threshold for visibility hit-test. r=mconley,miko
This is a best-effort thing of course, but so is the rest of the
visibility threshold stuff in practice and this should be good enough.

Differential Revision: https://phabricator.services.mozilla.com/D98360
2020-12-04 00:48:45 +00:00
Bogdan Tara
4840a3cec4 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
9a56e863c1 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
46908cfb51 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
Kartikaya Gupta
7c067f107e Bug 1678334 - Sprinkle const in a bunch of ComputeScrollMetadata. r=tnikkel
This reduces the chance that we accidentally introduce more
side-effect-producing code into this function. It doesn't remove
the side effects already in this function though.

Depends on D97624

Differential Revision: https://phabricator.services.mozilla.com/D97625
2020-11-19 22:59:45 +00:00
Kartikaya Gupta
449a6c74d4 Bug 1678334 - Mark a bunch of parameters const. r=tnikkel
These parameters are conceptually not modified by the functions,
so they should be const.

Depends on D97623

Differential Revision: https://phabricator.services.mozilla.com/D97624
2020-11-19 22:52:36 +00:00
coderboncuk
3e2d5b4708 Bug 1676299 - Removed the xMajor parameter from BaseMatrix::ScaleFactors() r=botond
Differential Revision: https://phabricator.services.mozilla.com/D97449
2020-11-18 18:53:01 +00:00
Ting-Yu Lin
558d6cf95c 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
Ting-Yu Lin
fa5721c7e1 Bug 1676778 - Remove StyleFrame() in nsComputedDOMStyle.cpp. r=emilio
`StyleFrame()` is equivalent to `nsLayoutUtils::GetStyleFrame()`.

Differential Revision: https://phabricator.services.mozilla.com/D96799
2020-11-12 11:12:37 +00:00
Steven MacLeod
cc94eb3f9f Bug 1606061 - move TouchEventsOverride to BrowsingContext. r=farre,devtools-backward-compat-reviewers
This change removes docshell's `mTouchEventsOverride` and replaces it
with a new `BrowsingContext` field `TouchEventsOverrideInternal`.
All uses of the old field have been replaced and an override should
now work under fission when there are cross-origin descendent frames.

Differential Revision: https://phabricator.services.mozilla.com/D96414
2020-11-10 15:57:30 +00:00
Hiroyuki Ikezoe
fcaede7cb9 Bug 1663000 - Send the composition size without the dynamic toolbar height to the compositor. r=botond
Also add AsyncPanZoomController::CanScrollDownwardsWithDynamicToolbar to tell
whether the root APZC is scrollable or there is room covered by the dynamic
toolbar so that we can tell GeckoView to move the dynamic toolbar in such cases.

Differential Revision: https://phabricator.services.mozilla.com/D93914
2020-11-04 03:16:04 +00:00
Miko Mynttinen
c16c1ddb9c Bug 1674766 - Remove DisplayListChecker r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D95531
2020-11-02 20:04:37 +00:00
Alaa Emad
5b0ec8efc0 Bug 1507189 - Replace nsIPresShell::ScrollDirection with an enumset over layers::ScrollDirection r=botond
Differential Revision: https://phabricator.services.mozilla.com/D94146
2020-10-26 04:04:16 +00:00
Ting-Yu Lin
b39ea72da3 Bug 1673056 - Remove nsLayoutUtils::MIN_ISIZE and nsLayoutUtils::PREF_ISIZE. r=mats
Both are aliases to IntrinsicISizeType::MinISize and
IntrinsicISizeType::PrefISize.

Remove MOZ_ASSERT in nsLayoutUtils::IntrinsicForAxis and
nsContainerFrame::DoInlineIntrinsicISize since IntrinsicISizeType is a
enum class nowadays, which cannot have other values.

I've compiled this patch with DEBUG_INTRINSIC_WIDTH defined in
nsLayoutUtils.cpp, and fixed aWM undefined in
nsLayoutUtils::MinSizeContributionForAxis().

Differential Revision: https://phabricator.services.mozilla.com/D94618
2020-10-23 22:52:02 +00:00
Kartikaya Gupta
bdea9d74b3 Bug 1669982 - Keep the margin adjustment when calculating margins on the main thread. r=botond
The code in CalculateAndSetDisplayPortMargins computes metrics for the content,
which may be the RCD and therefore have separate visual and layout scroll offsets.
The code then uses CalculatePendingDisplayPort to compute displayport margins,
but that function computes the margins based on the visual scroll offset. The
code then uses that as the final margins, when in fact those margins might
need adjusting so that they can be applied to the base rect (which is based
on the layout scroll offset).

This function is invoked by MobileViewportManager after load complete, at
which point the displayport may already be set and the layout and visual offsets
may have diverged. This can happen if, for example, the user manipulates the
visual viewport early during page load, or if a visual viewport is restored
after navigating backwards. In these scenarios the existing "with adjustment"
displayport margins are clobbered by the new, incorrect "with no adjustment"
margins. This patch corrects this by specifying the necessary adjustment.

All the other call sites of this function only call it to initialize the
displayport for the first time, so they cannot run into this problem of
"clobbering" an existing margins. However, I kept this patch general enough
so that if any of those call sites were to change in the future, it wouldn't
run into the same problem.

Differential Revision: https://phabricator.services.mozilla.com/D93494
2020-10-14 20:30:30 +00:00
Timothy Nikkel
3f1b82d053 Bug 1668966. Only clear PresShell::mResolutionUpdated after the apz transaction. r=kats,botond
We clear PresShell::mResolutionUpdated in nsLayoutUtils::ComputeScrollMetadata here

https://searchfox.org/mozilla-central/rev/7ef5cefd0468b8f509efe38e0212de2398f4c8b3/layout/base/nsLayoutUtils.cpp#9419

but that is incorrect because we call ComputeScrollMetadata twice for one transaction with webrender. This is why ScrollFrameHelper::NotifyApzTransaction exists: to clear things on the layout side after they are sent to the compositor.

Differential Revision: https://phabricator.services.mozilla.com/D92316
2020-10-04 21:26:46 +00:00
Botond Ballo
071d29be49 Bug 1667475 - Moved displayport-related functions from nsLayoutUtils to a new DisplayPortUtils class. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D92006
2020-10-03 21:07:34 +00:00
Timothy Nikkel
a5a27341c7 Bug 1656689. Use GetAvailableScrollingDirectionsForUserInputEvents in nsLayoutUtils::GetNearestScrollableFrameForDirection. r=kats
Keyboard arrow key scrolls go through PresShell::ScrollLine/ScrollCharacter. When these look for a scroll frame they eventually end up at nsLayoutUtils::GetNearestScrollableFrameForDirection.

nsLayoutUtils::GetNearestScrollableFrameForDirection does two things wrong when determining if the scroll frame is scrollable by apz: it disallows overflow hidden scrolling, and it uses GetAvailableScrollingDirections which is based on the layout scroll range.

Using GetAvailableScrollingDirectionsForUserInputEvents takes into account both of these factors.

GetNearestScrollableFrameForDirection is used by:
-gfx/layers/apz/src/FocusTarget.cpp
-EventStateManager::DoContentCommandScrollEvent
-PageMove, ScrollPage, ScrollLine, ScrollCharacter, CompleteScroll of PresShell
All of these should want the more apz aware function.

Differential Revision: https://phabricator.services.mozilla.com/D90498
2020-09-27 03:27:05 +00:00
Emilio Cobos Álvarez
56cd679ea1 Bug 1668156 - Fix some IntersectionObserver edge cases, and enable the assertion for good. r=hiro
This patch fixes two issues, described below:

First, the GetTopLevelDocument function was looking at the browsing
context tree. It should look at the window context tree, as looking at
the browsing context tree means that if you're in a discarded or
about-to-get-discarded document, you can end up with a document from a
different tree. Computing intersections between those of course makes no
sense and triggers the assertion we're enabling.

Second, this patch fixes an issue when you have fission enabled, and a
setup such as:

  A1 -> B1 -> A2

If you try to use IntersectionObserver from A2 with the implicit root,
we'd end up with:

  * rootRect: A1's root scrollport rect (this is fine, because it's only
              used to compute the root margin and bounds and so on, not
              to compute geometry).

  * rootFrame: A1's root scroll frame (this is _not_ fine, see below).

Then, we'd try to map rects from A2's target to A1's viewport, and we
can't really do that sensibly with the existing nsLayoutUtils functions,
because we're not accounting for all the OOP iframe transforms that may
be going on. This also triggers the assertion that this patch enables in
same-origin-grand-child-iframe.sub.html.

To fix it, for the A2 case, use the same code that we have for other OOP
iframes. The test tweaks fails with fission enabled without the patch
(because we don't account for the OOP iframe clip).

Differential Revision: https://phabricator.services.mozilla.com/D92089
2020-10-01 22:41:55 +00:00
Emilio Cobos Álvarez
96d2c59b95 Bug 1668156 - Make PositionedEventTargeting code not violate TransformRectToAncestor invariants. r=kats
And enable the assertion for the same-document case.

Without this patch, the assertion would fire in tests like
gfx/layers/apz/test/mochitest/test_group_zoom.html, where stuff like
MaybeHandleEventWithAccessibleCaret, which passes a non-root-frame down
here, and a target, which ends up violating the preconditions of
ClipToFrame, etc.

Enable the assertion for the same-document case, there are other
violations when fission is enabled in the cross-document case.

Differential Revision: https://phabricator.services.mozilla.com/D91966
2020-09-30 17:20:21 +00:00
Botond Ballo
1074cb3575 Bug 1667594 - Move nsLayoutUtils::RectCallback to namespace scope. r=emilio,jgilbert
This allows it to be forward-declared (while a nested class cannot be),
such that headers files that use RectCallback by pointer or reference
do not need to include nsLayoutUtils.h.

This avoids including nsLayoutUtils.h in nsRange.h.

Differential Revision: https://phabricator.services.mozilla.com/D91685
2020-09-30 21:06:47 +00:00
Botond Ballo
7c3f28b3c1 Bug 1667594 - Move nsLayoutUtils::SurfaceFromElementResult to its own file. r=emilio
Along with a dependent struct DirectDrawInfo.

This allows nsImageRenderer.h and CanvasRenderingContext2D.h to
avoid including nsLayoutUtils.h.

For nsImageRenderer.h in particular, a forward declaration is
not sufficient as nsImageRenderer stores SurfaceFromElementResult
by value.

A couple of method definitions elsewhere are moved out of line
to keep things compiling without including nsLayoutUtils.h in
additional headers.

Differential Revision: https://phabricator.services.mozilla.com/D91684
2020-09-30 21:05:34 +00:00
Emilio Cobos Álvarez
3f75bca3ca Bug 1665447 - Fix BoxToRect when the "relative to" frame is not an ancestor. r=dholbert,mstange
Right now the BoxToRect callback assumes that when it gets a
RECTS_ACCOUNT_FOR_TRANSFORMS flag, the "relative to" is an ancestor.

This holds for all the callers of GetAllInFlowRectsUnion except for [1],
which was introduced in bug 1581876, because they pass
GetContainingBlockForClientRect (that is, the root frame) as the root.

But that caller passes target, so IB split continuations or such would
get two siblings as the from/to frames, messing up the bounds.

An alternative would be to not pass the RECTS_ACCOUNT_FOR_TRANSFORMS
flag for that call (as it's computing a rect relative to self, but I
don't think that'd be quite correct in the presence of fragmentation
with transformed containers (if that's possible at all? would need to
think harder...)), but it seems like the API should just behave more
generally, or assert otherwise.

To that effect, this patch adds an assertion to TransformRectToAncestor
that would've caught this bug (though there are some pre-existing
violations, so we'll fix them in another bug).

[1]: https://searchfox.org/mozilla-central/rev/dfd9c0f72f9765bd4a187444e0c1e19e8834a506/dom/base/DOMIntersectionObserver.cpp#340-341

Differential Revision: https://phabricator.services.mozilla.com/D91883
2020-09-30 02:25:34 +00:00
Ting-Yu Lin
41e2882093 Bug 1660122 Part 5 - Add nsIFrame::GetAspectRatio() skeleton, and adapt existing callers. r=emilio
For now, GetAspectRatio() is just an alias for GetIntrinicRatio(). In
Part 7, we're going to have GetAspectRatio() consider aspect-ratio
property so that each replaced elements only need to report their
intrinsic ratio via GetIntrinicRatio(). Non-replaced element can also
call GetAspectRatio() to get the ratio suitable to calculate layout
size.

As of this patch, all the replaced elements'
GetIntrinsicRatio() (including nsImageFrame::mIntrinsicRatio) consider
aspect-ratio properties (added in bug 1639963). This is wrong, because
it affects replaced element's content ratio. So we adapt only callers
[1] involving the computation of the frame's external sizes to retain
the behavior after Part 7.

This change shouldn't change behavior.

[1] Exceptions include 1) a caller in nsIFrame::ComputeSize() checking
the frame has no intrinsic ratio; 2) other frame classes implementing
nsIFrame::GetIntrinsicRatio() by calling their parent's
GetIntrinicRatio(). nsSubDocumentFrame::GetIntrinicRatio() is an
example.

Differential Revision: https://phabricator.services.mozilla.com/D91227
2020-09-29 22:32:50 +00:00
Kartikaya Gupta
acf1cf336d Bug 1667863 - Replace AppendToString for MarginTyped with ostream. r=mattwoodrow
Depends on D91653

Differential Revision: https://phabricator.services.mozilla.com/D91654
2020-09-29 02:57:17 +00:00
Kartikaya Gupta
997b354950 Bug 1667656 - Replace AppendToString of nsRegion with ostream usage. r=mattwoodrow
Apparently a bunch of Stringify(nsRect) sites were getting converted to
Stringify(nsRegion(nsRect)) due to the the nsRegion implicit constructor, so
this updates those too.

Depends on D91524

Differential Revision: https://phabricator.services.mozilla.com/D91525
2020-09-28 01:14:00 +00:00
Butkovits Atila
60d4bd0ea5 Backed out changeset 8aecf9b4bdc4 (bug 1656689) for causing high failure rate on test_scroll_space_no_range_overflow_scroll.html. CLOSED TREE 2020-09-27 06:24:01 +03:00
Timothy Nikkel
763ed09c75 Bug 1656689. Use GetAvailableScrollingDirectionsForUserInputEvents in nsLayoutUtils::GetNearestScrollableFrameForDirection. r=kats
Keyboard arrow key scrolls go through PresShell::ScrollLine/ScrollCharacter. When these look for a scroll frame they eventually end up at nsLayoutUtils::GetNearestScrollableFrameForDirection.

nsLayoutUtils::GetNearestScrollableFrameForDirection does two things wrong when determining if the scroll frame is scrollable by apz: it disallows overflow hidden scrolling, and it uses GetAvailableScrollingDirections which is based on the layout scroll range.

Using GetAvailableScrollingDirectionsForUserInputEvents takes into account both of these factors.

GetNearestScrollableFrameForDirection is used by:
-gfx/layers/apz/src/FocusTarget.cpp
-EventStateManager::DoContentCommandScrollEvent
-PageMove, ScrollPage, ScrollLine, ScrollCharacter, CompleteScroll of PresShell
All of these should want the more apz aware function.

Differential Revision: https://phabricator.services.mozilla.com/D90498
2020-09-25 09:32:29 +00:00
Botond Ballo
013775a50c Bug 1667594 - Avoid including nsLayoutUtils.h in nsContainerFrame.h. r=emilio
nsContainerFrame.h was only using the enum nsLayoutUtils::IntrinsicISizeType,
which this patch moves to LayoutConstants.h instead.

Depends on D91505

Differential Revision: https://phabricator.services.mozilla.com/D91506
2020-09-26 18:19:14 +00:00
Botond Ballo
c4247cea95 Bug 1667475 - Remove FrameMetrics::mDisplayPortMargins. r=kats
The two existing uses were inconsistent in whether the margins
were relative to the visual viewport or the layout viewport.

We could fix this, but it turns out both uses are readily
refactored to not need the field, so this patch removes the
field.

Differential Revision: https://phabricator.services.mozilla.com/D91479
2020-09-26 17:44:03 +00:00
Miko Mynttinen
07bb188d28 Bug 1619370 - Return the rect from BrowserChild::GetVisibleRect() in app units r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D91272
2020-09-25 09:38:06 +00:00
Csoregi Natalia
935fc9ff98 Backed out changeset 66c2fb744703 (bug 1656689) for causing Bug 1667275. CLOSED TREE 2020-09-25 12:24:03 +03:00
Timothy Nikkel
f4ccc9d970 Bug 1656689. Use GetAvailableScrollingDirectionsForUserInputEvents in nsLayoutUtils::GetNearestScrollableFrameForDirection. r=kats
Keyboard arrow key scrolls go through PresShell::ScrollLine/ScrollCharacter. When these look for a scroll frame they eventually end up at nsLayoutUtils::GetNearestScrollableFrameForDirection.

nsLayoutUtils::GetNearestScrollableFrameForDirection does two things wrong when determining if the scroll frame is scrollable by apz: it disallows overflow hidden scrolling, and it uses GetAvailableScrollingDirections which is based on the layout scroll range.

Using GetAvailableScrollingDirectionsForUserInputEvents takes into account both of these factors.

GetNearestScrollableFrameForDirection is used by:
-gfx/layers/apz/src/FocusTarget.cpp
-EventStateManager::DoContentCommandScrollEvent
-PageMove, ScrollPage, ScrollLine, ScrollCharacter, CompleteScroll of PresShell
All of these should want the more apz aware function.

Differential Revision: https://phabricator.services.mozilla.com/D90498
2020-09-24 13:49:28 +00:00
Timothy Nikkel
7c6f27278e Bug 1666991. Remove PresShell::GetNearestScrollableFrame. r=kats
The current formulation is inconsistent. If you call it with ScrollableDirection::Either it goes into nsLayoutUtils::GetNearestScrollableFrame which will return the first scroll frame with a non-hidden overflow. If you call it with any other ScrollableDirection it calls nsLayoutUtils::GetNearestScrollableFrameForDirection which returns the first scrollframe it finds that has non-hidden overflow AND has at least one dev pixel of scroll range.

So remove that function and call nsLayoutUtils::GetNearestScrollableFrameForDirection directly. This is a slight change of behaviour but it seems desirable for all callers.

Differential Revision: https://phabricator.services.mozilla.com/D91236
2020-09-24 13:44:54 +00:00
Stephen A Pohl
2ef6b415f7 Bug 1661272: Only adjust default font sizes for buttons, lists and fields when non-native theming is enabled. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D91194
2020-09-23 22:25:23 +00:00
Hiroyuki Ikezoe
27d51d5131 Bug 1659227 - Handle SVG{Inner,Outer}Frame as the clip frame for partial pre-render. r=heycam,botond
In SVG frame tree SVG{Inner,Outer}Frame is normally not scrollable but clips
descendants, thus nsLayoutUtils::GetNearestScrollableFrame is not able to find
the clip/scroll frame.  So in this change, we introduce
GetNearestOverflowClipFrame which is a similar function to
GetNearestScrollableFrame but it also checks whether the frame is SVGInnerFrame
or SVGOuterFrame which is clipping the given nsIFrame during walking up the
frame tree.

In this change we also change the logic to get the clip/scroll frame and the scroll
id as follows;

1) Get the nearest overflow clip frame in the same document
2) Use the root frame if there is no clip frame
3) Then try to find the scroll id if the clip frame is asynchronously scrollable

so that it becomes clearer before.  It's still messy though.

Differential Revision: https://phabricator.services.mozilla.com/D90647
2020-09-23 06:37:31 +00:00
Kartikaya Gupta
fee1c15bbe Bug 1664626 - Delete now-unused code. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D90724
2020-09-19 00:36:20 +00:00
Botond Ballo
5b4c24b387 Bug 1666022 - Make nsLayoutUtils::AsyncPanZoomEnabled() const. r=hiro
The patch also adds a const version of GetDisplayRootFrame().

Differential Revision: https://phabricator.services.mozilla.com/D90754
2020-09-18 20:38:50 +00:00
Kartikaya Gupta
b732dbe230 Bug 1654836 - Redo how we expand displayport alignment for webrender. r=nical
The displayport is aligned to screen pixels by an alignment number; there was
code to increase that alignment number for the WebRender codepath. This is
desirable because it causes the displayport to move less frequently, which
provides better performance characteristics with WebRender. However, the
way that was implemented, it was possible for the aligned displayport to not
completely enclose the unaligned displayport, which could then result in
perma-checkerboarding.

This patch removes that code and replaces it with a simpler approach to scale
up the existing alignment number by a factor based on the size of the scroller's
base rect (roughly how much of the scroller is visible to the user).

This does make the displayports larger, more so for scrollers with more visible
area. This has negative performance implications, so we mitigate that by also
scaling down the displayport margin multiplier by the same scaling factor. This
isn't perfect, but seems to work well enough in practice.

Differential Revision: https://phabricator.services.mozilla.com/D90503
2020-09-18 12:40:08 +00:00
Kartikaya Gupta
3c94143647 Bug 1654836 - Add a bunch of verbose-level displayport logging. r=nical
Differential Revision: https://phabricator.services.mozilla.com/D90499
2020-09-18 08:05:50 +00:00
Kartikaya Gupta
0485d2d6c0 Bug 1662014 - Remove unused fields/APIs. r=botond,tnikkel
These things are all unused now.

Differential Revision: https://phabricator.services.mozilla.com/D88750
2020-09-12 13:06:39 +00:00
Kartikaya Gupta
95693a9601 Bug 1662013 - Introduce a ScrollPositionUpdate and plumb it in. r=tnikkel,botond
This adds a ScrollPositionUpdate class. Code in nsGfxScrollFrame creates
instances of these classes every time the scroll generation is incremented,
and saves them to an array. The array is sent in the scroll metadata to the
compositor as part of a paint transaction.

Currently this data is not used at all on the APZ side, and exists alongside
(independently of) the existing scroll fields, so this patch should not have
any functional effects.

Differential Revision: https://phabricator.services.mozilla.com/D88741
2020-09-12 13:05:53 +00:00