mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 31cbb80c705e, win burning
This commit is contained in:
parent
5dfda6c571
commit
37cc5f01d3
@ -914,9 +914,7 @@ nsFrameLoader::ShowRemoteFrame(const nsIntSize& size)
|
||||
|
||||
EnsureMessageManager();
|
||||
} else {
|
||||
nsRect dimensions;
|
||||
NS_ENSURE_SUCCESS(GetWindowDimensions(dimensions), false);
|
||||
mRemoteBrowser->UpdateDimensions(dimensions, size);
|
||||
mRemoteBrowser->Move(size);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -1602,51 +1600,13 @@ nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFrameLoader::GetWindowDimensions(nsRect& aRect)
|
||||
{
|
||||
// Need to get outer window position here
|
||||
nsIDocument* doc = mOwnerContent->GetDocument();
|
||||
if (!doc) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (doc->GetDisplayDocument()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWebNavigation> parentAsWebNav =
|
||||
do_GetInterface(doc->GetScriptGlobalObject());
|
||||
|
||||
if (!parentAsWebNav) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentAsItem(do_QueryInterface(parentAsWebNav));
|
||||
|
||||
NS_ASSERTION(mIsTopLevelContent, "Outer dimensions must be taken only from TopLevel content");
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeOwner> parentOwner;
|
||||
if (NS_FAILED(parentAsItem->GetTreeOwner(getter_AddRefs(parentOwner))) ||
|
||||
!parentOwner) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin(do_GetInterface(parentOwner));
|
||||
treeOwnerAsWin->GetPosition(&aRect.x, &aRect.y);
|
||||
treeOwnerAsWin->GetSize(&aRect.width, &aRect.height);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFrameLoader::UpdatePositionAndSize(nsIFrame *aIFrame)
|
||||
{
|
||||
if (mRemoteFrame) {
|
||||
if (mRemoteBrowser) {
|
||||
nsIntSize size = GetSubDocumentSize(aIFrame);
|
||||
nsRect dimensions;
|
||||
NS_ENSURE_SUCCESS(GetWindowDimensions(dimensions), NS_ERROR_FAILURE);
|
||||
mRemoteBrowser->UpdateDimensions(dimensions, size);
|
||||
mRemoteBrowser->Move(size);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -296,7 +296,6 @@ private:
|
||||
|
||||
// Properly retrieves documentSize of any subdocument type.
|
||||
NS_HIDDEN_(nsIntSize) GetSubDocumentSize(const nsIFrame *aIFrame);
|
||||
nsresult GetWindowDimensions(nsRect& aRect);
|
||||
|
||||
// Updates the subdocument position and size. This gets called only
|
||||
// when we have our own in-process DocShell.
|
||||
|
@ -239,7 +239,7 @@ child:
|
||||
|
||||
LoadURL(nsCString uri);
|
||||
|
||||
UpdateDimensions(nsRect rect, nsIntSize size);
|
||||
Move(nsIntSize size);
|
||||
|
||||
/**
|
||||
* Sending an activate message moves focus to the child.
|
||||
|
@ -122,7 +122,6 @@ TabChild::TabChild(PRUint32 aChromeFlags)
|
||||
: mRemoteFrame(nsnull)
|
||||
, mTabChildGlobal(nsnull)
|
||||
, mChromeFlags(aChromeFlags)
|
||||
, mOuterRect(0, 0, 0, 0)
|
||||
{
|
||||
printf("creating %d!\n", NS_IsMainThread());
|
||||
}
|
||||
@ -262,20 +261,9 @@ NS_IMETHODIMP
|
||||
TabChild::GetDimensions(PRUint32 aFlags, PRInt32* aX,
|
||||
PRInt32* aY, PRInt32* aCx, PRInt32* aCy)
|
||||
{
|
||||
if (aX) {
|
||||
*aX = mOuterRect.x;
|
||||
}
|
||||
if (aY) {
|
||||
*aY = mOuterRect.y;
|
||||
}
|
||||
if (aCx) {
|
||||
*aCx = mOuterRect.width;
|
||||
}
|
||||
if (aCy) {
|
||||
*aCy = mOuterRect.height;
|
||||
}
|
||||
NS_NOTREACHED("TabChild::GetDimensions not supported in TabChild");
|
||||
|
||||
return NS_OK;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -546,16 +534,9 @@ TabChild::RecvShow(const nsIntSize& size)
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size)
|
||||
TabChild::RecvMove(const nsIntSize& size)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("[TabChild] Update Dimensions to (x,y,w,h)= (%ud, %ud, %ud, %ud) and move to (w,h)= (%ud, %ud)\n", rect.x, rect.y, rect.width, rect.height, size.width, size.height);
|
||||
#endif
|
||||
|
||||
mOuterRect.x = rect.x;
|
||||
mOuterRect.y = rect.y;
|
||||
mOuterRect.width = rect.width;
|
||||
mOuterRect.height = rect.height;
|
||||
printf("[TabChild] RESIZE to (w,h)= (%ud, %ud)\n", size.width, size.height);
|
||||
|
||||
mWidget->Resize(0, 0, size.width, size.height,
|
||||
PR_TRUE);
|
||||
@ -563,7 +544,6 @@ TabChild::RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size)
|
||||
nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(mWebNav);
|
||||
baseWin->SetPositionAndSize(0, 0, size.width, size.height,
|
||||
PR_TRUE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ public:
|
||||
|
||||
virtual bool RecvLoadURL(const nsCString& uri);
|
||||
virtual bool RecvShow(const nsIntSize& size);
|
||||
virtual bool RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size);
|
||||
virtual bool RecvMove(const nsIntSize& size);
|
||||
virtual bool RecvActivate();
|
||||
virtual bool RecvDeactivate();
|
||||
virtual bool RecvMouseEvent(const nsString& aType,
|
||||
@ -268,7 +268,6 @@ private:
|
||||
RenderFrameChild* mRemoteFrame;
|
||||
nsRefPtr<TabChildGlobal> mTabChildGlobal;
|
||||
PRUint32 mChromeFlags;
|
||||
nsIntRect mOuterRect;
|
||||
|
||||
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
|
||||
};
|
||||
|
@ -209,9 +209,9 @@ TabParent::Show(const nsIntSize& size)
|
||||
}
|
||||
|
||||
void
|
||||
TabParent::UpdateDimensions(const nsRect& rect, const nsIntSize& size)
|
||||
TabParent::Move(const nsIntSize& size)
|
||||
{
|
||||
unused << SendUpdateDimensions(rect, size);
|
||||
unused << SendMove(size);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -126,7 +126,7 @@ public:
|
||||
// message-sending functions under a layer of indirection and
|
||||
// eating the return values
|
||||
void Show(const nsIntSize& size);
|
||||
void UpdateDimensions(const nsRect& rect, const nsIntSize& size);
|
||||
void Move(const nsIntSize& size);
|
||||
void Activate();
|
||||
void Deactivate();
|
||||
void SendMouseEvent(const nsAString& aType, float aX, float aY,
|
||||
|
Loading…
Reference in New Issue
Block a user