Bug 1599795 - Rename BrowserChild::GetRemoteDocumentRect to GetTopLevelViewportVisibleRectInBrowserCoords. r=emilio

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Hiroyuki Ikezoe 2020-02-11 03:35:56 +00:00
parent 03eb44ed69
commit 1c0f15006d
5 changed files with 20 additions and 14 deletions

View File

@ -1301,10 +1301,11 @@ mozilla::ipc::IPCResult BrowserChild::RecvSizeModeChanged(
mozilla::ipc::IPCResult BrowserChild::RecvChildToParentMatrix(
const mozilla::Maybe<mozilla::gfx::Matrix4x4>& aMatrix,
const mozilla::ScreenRect& aRemoteDocumentRect) {
const mozilla::ScreenRect& aTopLevelViewportVisibleRectInBrowserCoords) {
mChildToParentConversionMatrix =
LayoutDeviceToLayoutDeviceMatrix4x4::FromUnknownMatrix(aMatrix);
mRemoteDocumentRect = aRemoteDocumentRect;
mTopLevelViewportVisibleRectInBrowserCoords =
aTopLevelViewportVisibleRectInBrowserCoords;
// Triger an intersection observation since ancestor viewports changed.
if (RefPtr<Document> toplevelDoc = GetTopLevelDocument()) {
@ -1604,8 +1605,8 @@ BrowserChild::GetChildToParentConversionMatrix() const {
return LayoutDeviceToLayoutDeviceMatrix4x4::Translation(offset);
}
ScreenRect BrowserChild::GetRemoteDocumentRect() const {
return mRemoteDocumentRect;
ScreenRect BrowserChild::GetTopLevelViewportVisibleRectInBrowserCoords() const {
return mTopLevelViewportVisibleRectInBrowserCoords;
}
void BrowserChild::FlushAllCoalescedMouseData() {

View File

@ -282,7 +282,7 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
mozilla::ipc::IPCResult RecvChildToParentMatrix(
const mozilla::Maybe<mozilla::gfx::Matrix4x4>& aMatrix,
const mozilla::ScreenRect& aRemoteDocumentRect);
const mozilla::ScreenRect& aTopLevelViewportVisibleRectInBrowserCoords);
MOZ_CAN_RUN_SCRIPT_BOUNDARY
mozilla::ipc::IPCResult RecvDynamicToolbarMaxHeightChanged(
@ -636,7 +636,10 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
mozilla::LayoutDeviceToLayoutDeviceMatrix4x4
GetChildToParentConversionMatrix() const;
mozilla::ScreenRect GetRemoteDocumentRect() const;
// Returns the portion of the visible rect of this remote document in the
// top browser window coordinate system. This is the result of being clipped
// by all ancestor viewports.
mozilla::ScreenRect GetTopLevelViewportVisibleRectInBrowserCoords() const;
// Prepare to dispatch all coalesced mousemove events. We'll move all data
// in mCoalescedMouseData to a nsDeque; then we start processing them. We
@ -932,7 +935,7 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
WindowsHandle mWidgetNativeData;
Maybe<LayoutDeviceToLayoutDeviceMatrix4x4> mChildToParentConversionMatrix;
ScreenRect mRemoteDocumentRect;
ScreenRect mTopLevelViewportVisibleRectInBrowserCoords;
#ifdef XP_WIN
// Should only be accessed on main thread.

View File

@ -20,18 +20,19 @@ class MatrixMessage {
MatrixMessage() {}
MatrixMessage(const Maybe<LayerToScreenMatrix4x4>& aMatrix,
const ScreenRect& aRemoteDocumentRect,
const ScreenRect& aTopLevelViewportVisibleRectInBrowserCoords,
const LayersId& aLayersId)
: mMatrix(ToUnknownMatrix(aMatrix)),
mRemoteDocumentRect(aRemoteDocumentRect),
mTopLevelViewportVisibleRectInBrowserCoords(
aTopLevelViewportVisibleRectInBrowserCoords),
mLayersId(aLayersId) {}
inline Maybe<LayerToScreenMatrix4x4> GetMatrix() const {
return LayerToScreenMatrix4x4::FromUnknownMatrix(mMatrix);
}
inline ScreenRect GetRemoteDocumentRect() const {
return mRemoteDocumentRect;
inline ScreenRect GetTopLevelViewportVisibleRectInBrowserCoords() const {
return mTopLevelViewportVisibleRectInBrowserCoords;
}
inline const LayersId& GetLayersId() const { return mLayersId; }
@ -43,7 +44,7 @@ class MatrixMessage {
// The remote iframe document rectangle corresponding to this layer.
// The rectangle is the result of clipped out by ancestor async scrolling so
// that the rectangle will be empty if it's completely scrolled out of view.
ScreenRect mRemoteDocumentRect;
ScreenRect mTopLevelViewportVisibleRectInBrowserCoords;
LayersId mLayersId;
};
}; // namespace layers

View File

@ -288,7 +288,7 @@ void APZCCallbackHelper::NotifyLayerTransforms(
ViewAs<LayoutDeviceToLayoutDeviceMatrix4x4>(
msg.GetMatrix(),
PixelCastJustification::ContentProcessIsLayerInUiProcess),
msg.GetRemoteDocumentRect());
msg.GetTopLevelViewportVisibleRectInBrowserCoords());
}
}
}

View File

@ -10163,7 +10163,8 @@ static Maybe<ScreenRect> GetFrameVisibleRectOnScreen(const nsIFrame* aFrame) {
PixelCastJustification::ContentProcessIsLayerInUiProcess);
return Some(
browserChild->GetRemoteDocumentRect().Intersect(transformedToRoot));
browserChild->GetTopLevelViewportVisibleRectInBrowserCoords().Intersect(
transformedToRoot));
}
// static