Bug 1245182: Move a few event handling functions to nsPIDOMWindowInner. r=smaug

This commit is contained in:
Kyle Huey 2016-02-03 13:30:45 -08:00
Родитель 0e84188646
Коммит 0483075e02
1 изменённых файлов: 59 добавлений и 63 удалений

Просмотреть файл

@ -151,32 +151,6 @@ public:
return mParentTarget;
}
bool HasMutationListeners(uint32_t aMutationEventType) const
{
MOZ_ASSERT(IsInnerWindow());
if (!mOuterWindow) {
NS_ERROR("HasMutationListeners() called on orphan inner window!");
return false;
}
return (mMutationBits & aMutationEventType) != 0;
}
void SetMutationListeners(uint32_t aType)
{
MOZ_ASSERT(IsInnerWindow());
if (!mOuterWindow) {
NS_ERROR("HasMutationListeners() called on orphan inner window!");
return;
}
mMutationBits |= aType;
}
virtual void MaybeUpdateTouchState() {}
nsIDocument* GetExtantDoc() const
@ -383,43 +357,6 @@ public:
*/
virtual void FinishFullscreenChange(bool aIsFullscreen) = 0;
/**
* Call this to check whether some node (this window, its document,
* or content in that document) has a mouseenter/leave event listener.
*/
bool HasMouseEnterLeaveEventListeners()
{
return mMayHaveMouseEnterLeaveEventListener;
}
/**
* Call this to indicate that some node (this window, its document,
* or content in that document) has a mouseenter/leave event listener.
*/
void SetHasMouseEnterLeaveEventListeners()
{
mMayHaveMouseEnterLeaveEventListener = true;
}
/**
* Call this to check whether some node (this window, its document,
* or content in that document) has a Pointerenter/leave event listener.
*/
bool HasPointerEnterLeaveEventListeners()
{
return mMayHavePointerEnterLeaveEventListener;
}
/**
* Call this to indicate that some node (this window, its document,
* or content in that document) has a Pointerenter/leave event listener.
*/
void SetHasPointerEnterLeaveEventListeners()
{
mMayHavePointerEnterLeaveEventListener = true;
}
virtual JSObject* GetCachedXBLPrototypeHandler(nsXBLPrototypeHandler* aKey) = 0;
virtual void CacheXBLPrototypeHandler(nsXBLPrototypeHandler* aKey,
JS::Handle<JSObject*> aHandler) = 0;
@ -798,6 +735,65 @@ public:
nsPerformance* GetPerformance();
bool HasMutationListeners(uint32_t aMutationEventType) const
{
if (!mOuterWindow) {
NS_ERROR("HasMutationListeners() called on orphan inner window!");
return false;
}
return (mMutationBits & aMutationEventType) != 0;
}
void SetMutationListeners(uint32_t aType)
{
if (!mOuterWindow) {
NS_ERROR("HasMutationListeners() called on orphan inner window!");
return;
}
mMutationBits |= aType;
}
/**
* Call this to check whether some node (this window, its document,
* or content in that document) has a mouseenter/leave event listener.
*/
bool HasMouseEnterLeaveEventListeners()
{
return mMayHaveMouseEnterLeaveEventListener;
}
/**
* Call this to indicate that some node (this window, its document,
* or content in that document) has a mouseenter/leave event listener.
*/
void SetHasMouseEnterLeaveEventListeners()
{
mMayHaveMouseEnterLeaveEventListener = true;
}
/**
* Call this to check whether some node (this window, its document,
* or content in that document) has a Pointerenter/leave event listener.
*/
bool HasPointerEnterLeaveEventListeners()
{
return mMayHavePointerEnterLeaveEventListener;
}
/**
* Call this to indicate that some node (this window, its document,
* or content in that document) has a Pointerenter/leave event listener.
*/
void SetHasPointerEnterLeaveEventListeners()
{
mMayHavePointerEnterLeaveEventListener = true;
}
protected:
void CreatePerformanceObjectIfNeeded();
};