Back out 47de36ef3ab4 (bug 1075670) for breaking context menu in e10s CLOSED TREE

This commit is contained in:
Bill McCloskey 2015-01-28 16:11:56 -08:00
parent 373db355db
commit 0eaeb7c104
4 changed files with 5 additions and 67 deletions

View File

@ -227,9 +227,6 @@ public:
void ActivateUpdateHitRegion();
void DeactivateUpdateHitRegion();
// Properly retrieves documentSize of any subdocument type.
nsresult GetWindowDimensions(nsIntRect& aRect);
private:
void SetOwnerContent(mozilla::dom::Element* aContent);
@ -285,6 +282,9 @@ private:
nsresult MaybeCreateDocShell();
nsresult EnsureMessageManager();
// Properly retrieves documentSize of any subdocument type.
nsresult GetWindowDimensions(nsIntRect& aRect);
// Updates the subdocument position and size. This gets called only
// when we have our own in-process DocShell.
void UpdateBaseWindowPositionAndSize(nsSubDocumentFrame *aIFrame);

View File

@ -76,7 +76,6 @@
#include "nsICancelable.h"
#include "gfxPrefs.h"
#include "nsILoginManagerPrompter.h"
#include "nsPIWindowRoot.h"
#include <algorithm>
using namespace mozilla::dom;
@ -317,27 +316,7 @@ TabParent::RemoveTabParentFromTable(uint64_t aLayersId)
void
TabParent::SetOwnerElement(Element* aElement)
{
// If we held previous content then unregister for its events.
if (mFrameElement && mFrameElement->OwnerDoc()->GetWindow()) {
nsCOMPtr<nsPIDOMWindow> window = mFrameElement->OwnerDoc()->GetWindow();
nsCOMPtr<EventTarget> eventTarget = window->GetTopWindowRoot();
if (eventTarget) {
eventTarget->RemoveEventListener(NS_LITERAL_STRING("MozUpdateWindowPos"),
this, false);
}
}
// Update to the new content, and register to listen for events from it.
mFrameElement = aElement;
if (mFrameElement && mFrameElement->OwnerDoc()->GetWindow()) {
nsCOMPtr<nsPIDOMWindow> window = mFrameElement->OwnerDoc()->GetWindow();
nsCOMPtr<EventTarget> eventTarget = window->GetTopWindowRoot();
if (eventTarget) {
eventTarget->AddEventListener(NS_LITERAL_STRING("MozUpdateWindowPos"),
this, false, false);
}
}
TryCacheDPIAndScale();
}
@ -373,8 +352,6 @@ TabParent::Destroy()
return;
}
SetOwnerElement(nullptr);
// If this fails, it's most likely due to a content-process crash,
// and auto-cleanup will kick in. Otherwise, the child side will
// destroy itself and send back __delete__().
@ -823,9 +800,8 @@ TabParent::UpdateDimensions(const nsIntRect& rect, const nsIntSize& size,
mRect = rect;
mDimensions = size;
mOrientation = orientation;
mChromeDisp = aChromeDisp;
unused << SendUpdateDimensions(mRect, mDimensions, mOrientation, mChromeDisp);
unused << SendUpdateDimensions(mRect, mDimensions, mOrientation, aChromeDisp);
}
}
@ -2574,27 +2550,6 @@ TabParent::DeallocPPluginWidgetParent(mozilla::plugins::PPluginWidgetParent* aAc
return true;
}
nsresult
TabParent::HandleEvent(nsIDOMEvent* aEvent)
{
nsAutoString eventType;
aEvent->GetType(eventType);
if (eventType.EqualsLiteral("MozUpdateWindowPos")) {
// This event is sent when the widget moved. Therefore we only update
// the position.
nsRefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
if (!frameLoader) {
return NS_OK;
}
nsIntRect windowDims;
NS_ENSURE_SUCCESS(frameLoader->GetWindowDimensions(windowDims), NS_ERROR_FAILURE);
UpdateDimensions(windowDims, mDimensions, mChromeDisp);
return NS_OK;
}
return NS_OK;
}
class FakeChannel MOZ_FINAL : public nsIChannel,
public nsIAuthPromptCallback,
public nsIInterfaceRequestor,

View File

@ -22,7 +22,6 @@
#include "Units.h"
#include "WritingModes.h"
#include "js/TypeDecls.h"
#include "nsIDOMEventListener.h"
class nsFrameLoader;
class nsIContent;
@ -58,8 +57,7 @@ class nsIContentParent;
class Element;
struct StructuredCloneData;
class TabParent : public PBrowserParent
, public nsIDOMEventListener
class TabParent : public PBrowserParent
, public nsITabParent
, public nsIAuthPromptProvider
, public nsISecureBrowserUI
@ -100,9 +98,6 @@ public:
mBrowserDOMWindow = aBrowserDOMWindow;
}
// nsIDOMEventListener interfaces
NS_DECL_NSIDOMEVENTLISTENER
already_AddRefed<nsILoadContext> GetLoadContext();
nsIXULBrowserWindow* GetXULBrowserWindow();
@ -430,7 +425,6 @@ protected:
nsIntRect mRect;
nsIntSize mDimensions;
ScreenOrientation mOrientation;
nsIntPoint mChromeDisp;
float mDPI;
CSSToLayoutDeviceScale mDefaultScale;
bool mShown;

View File

@ -71,8 +71,6 @@
#include "mozilla/DebugOnly.h"
#include "mozilla/MouseEvents.h"
#include "nsPIWindowRoot.h"
#ifdef XP_MACOSX
#include "nsINativeMenuService.h"
#define USE_NATIVE_MENUS
@ -260,15 +258,6 @@ nsWebShellWindow::WindowMoved(nsIWidget* aWidget, int32_t x, int32_t y)
pm->AdjustPopupsOnWindowChange(window);
}
// Notify all tabs that the widget moved.
if (mDocShell && mDocShell->GetWindow()) {
nsCOMPtr<EventTarget> eventTarget = mDocShell->GetWindow()->GetTopWindowRoot();
nsContentUtils::DispatchChromeEvent(mDocShell->GetDocument(),
eventTarget,
NS_LITERAL_STRING("MozUpdateWindowPos"),
false, false, nullptr);
}
// Persist position, but not immediately, in case this OS is firing
// repeated move events as the user drags the window
SetPersistenceTimer(PAD_POSITION);