mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 937688 - Pass the presShellId and viewId from TabChild to RenderFrameParent when requesting a zoom. r=botond
This commit is contained in:
parent
2180719bf3
commit
dfc4099c08
@ -276,7 +276,7 @@ parent:
|
||||
* Instructs the TabParent to forward a request to zoom to a rect given in
|
||||
* CSS pixels. This rect is relative to the document.
|
||||
*/
|
||||
ZoomToRect(CSSRect aRect);
|
||||
ZoomToRect(uint32_t aPresShellId, ViewID aViewId, CSSRect aRect);
|
||||
|
||||
/**
|
||||
* We know for sure that content has either preventDefaulted or not
|
||||
|
@ -362,11 +362,17 @@ TabChild::Observe(nsISupports *aSubject,
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aSubject));
|
||||
nsCOMPtr<nsITabChild> tabChild(TabChild::GetFrom(docShell));
|
||||
if (tabChild == this) {
|
||||
CSSRect rect;
|
||||
sscanf(NS_ConvertUTF16toUTF8(aData).get(),
|
||||
"{\"x\":%f,\"y\":%f,\"w\":%f,\"h\":%f}",
|
||||
&rect.x, &rect.y, &rect.width, &rect.height);
|
||||
SendZoomToRect(rect);
|
||||
nsCOMPtr<nsIDocument> doc(GetDocument());
|
||||
uint32_t presShellId;
|
||||
ViewID viewId;
|
||||
if (APZCCallbackHelper::GetScrollIdentifiers(doc->GetDocumentElement(),
|
||||
&presShellId, &viewId)) {
|
||||
CSSRect rect;
|
||||
sscanf(NS_ConvertUTF16toUTF8(aData).get(),
|
||||
"{\"x\":%f,\"y\":%f,\"w\":%f,\"h\":%f}",
|
||||
&rect.x, &rect.y, &rect.width, &rect.height);
|
||||
SendZoomToRect(presShellId, viewId, rect);
|
||||
}
|
||||
}
|
||||
} else if (!strcmp(aTopic, BEFORE_FIRST_PAINT)) {
|
||||
if (IsAsyncPanZoomEnabled()) {
|
||||
|
@ -1613,10 +1613,12 @@ TabParent::RecvPRenderFrameConstructor(PRenderFrameParent* actor,
|
||||
}
|
||||
|
||||
bool
|
||||
TabParent::RecvZoomToRect(const CSSRect& aRect)
|
||||
TabParent::RecvZoomToRect(const uint32_t& aPresShellId,
|
||||
const ViewID& aViewId,
|
||||
const CSSRect& aRect)
|
||||
{
|
||||
if (RenderFrameParent* rfp = GetRenderFrame()) {
|
||||
rfp->ZoomToRect(aRect);
|
||||
rfp->ZoomToRect(aPresShellId, aViewId, aRect);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -162,7 +162,9 @@ public:
|
||||
virtual bool RecvGetDPI(float* aValue);
|
||||
virtual bool RecvGetDefaultScale(double* aValue);
|
||||
virtual bool RecvGetWidgetNativeData(WindowsHandle* aValue);
|
||||
virtual bool RecvZoomToRect(const CSSRect& aRect);
|
||||
virtual bool RecvZoomToRect(const uint32_t& aPresShellId,
|
||||
const ViewID& aViewId,
|
||||
const CSSRect& aRect);
|
||||
virtual bool RecvUpdateZoomConstraints(const bool& aAllowZoom,
|
||||
const CSSToScreenScale& aMinZoom,
|
||||
const CSSToScreenScale& aMaxZoom);
|
||||
|
@ -1001,10 +1001,11 @@ RenderFrameParent::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
|
||||
void
|
||||
RenderFrameParent::ZoomToRect(const CSSRect& aRect)
|
||||
RenderFrameParent::ZoomToRect(uint32_t aPresShellId, ViewID aViewId,
|
||||
const CSSRect& aRect)
|
||||
{
|
||||
if (GetApzcTreeManager()) {
|
||||
GetApzcTreeManager()->ZoomToRect(ScrollableLayerGuid(mLayersId),
|
||||
GetApzcTreeManager()->ZoomToRect(ScrollableLayerGuid(mLayersId, aPresShellId, aViewId),
|
||||
aRect);
|
||||
}
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ public:
|
||||
|
||||
void NotifyDimensionsChanged(ScreenIntSize size);
|
||||
|
||||
void ZoomToRect(const CSSRect& aRect);
|
||||
void ZoomToRect(uint32_t aPresShellId, ViewID aViewId, const CSSRect& aRect);
|
||||
|
||||
void ContentReceivedTouch(bool aPreventDefault);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user