зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1563717 - Divide the RCD-RSF ScrollFrame item's clip rect by the resolution. r=kats
The clip rect is derived from the composition bounds, which is in units that are outside the resolution, but it's applied to the ScrollFrame item which is inside the resolution. Differential Revision: https://phabricator.services.mozilla.com/D37939 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
e047b206d0
Коммит
a2fc3d72a6
|
@ -283,17 +283,18 @@ Maybe<wr::WrSpaceAndClip> ClipManager::DefineScrollLayers(
|
|||
|
||||
LayoutDeviceRect contentRect =
|
||||
metrics.GetExpandedScrollableRect() * metrics.GetDevPixelsPerCSSPixel();
|
||||
LayoutDeviceRect clipBounds = LayoutDeviceRect::FromUnknownRect(
|
||||
metrics.GetCompositionBounds().ToUnknownRect());
|
||||
LayoutDeviceRect clipBounds =
|
||||
metrics.GetCompositionBounds() /
|
||||
LayoutDeviceToParentLayerScale(metrics.GetPresShellResolution());
|
||||
// The content rect that we hand to PushScrollLayer should be relative to
|
||||
// the same origin as the clipBounds that we hand to PushScrollLayer - that
|
||||
// is, both of them should be relative to the stacking context `aSc`.
|
||||
// However, when we get the scrollable rect from the FrameMetrics, the origin
|
||||
// has nothing to do with the position of the frame but instead represents
|
||||
// the minimum allowed scroll offset of the scrollable content. While APZ
|
||||
// uses this to clamp the scroll position, we don't need to send this to
|
||||
// WebRender at all. Instead, we take the position from the composition
|
||||
// bounds.
|
||||
// the same origin as the clipBounds that we hand to PushScrollLayer -
|
||||
// that is, both of them should be relative to the stacking context `aSc`.
|
||||
// However, when we get the scrollable rect from the FrameMetrics, the
|
||||
// origin has nothing to do with the position of the frame but instead
|
||||
// represents the minimum allowed scroll offset of the scrollable content.
|
||||
// While APZ uses this to clamp the scroll position, we don't need to send
|
||||
// this to WebRender at all. Instead, we take the position from the
|
||||
// composition bounds.
|
||||
contentRect.MoveTo(clipBounds.TopLeft());
|
||||
|
||||
Maybe<wr::WrSpaceAndClip> parent = ancestorSpaceAndClip;
|
||||
|
|
Загрузка…
Ссылка в новой задаче