mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 983049 part.2 Rename nsEventChainPreVisitor to mozilla::EventChainPreVisitor r=smaug
This commit is contained in:
parent
6ae1c47e9f
commit
84f7d80b11
@ -102,6 +102,7 @@ enum {
|
||||
ASSERT_NODE_FLAGS_SPACE(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET);
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
class EventChainVisitor;
|
||||
class EventListenerManager;
|
||||
|
||||
@ -1112,7 +1113,7 @@ protected:
|
||||
/**
|
||||
* Handle status bar updates before they can be cancelled.
|
||||
*/
|
||||
nsresult PreHandleEventForLinks(nsEventChainPreVisitor& aVisitor);
|
||||
nsresult PreHandleEventForLinks(EventChainPreVisitor& aVisitor);
|
||||
|
||||
/**
|
||||
* Handle default actions for link event if the event isn't consumed yet.
|
||||
|
@ -21,6 +21,7 @@ class nsIFrame;
|
||||
class nsXBLBinding;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
namespace dom {
|
||||
class ShadowRoot;
|
||||
struct CustomElementData;
|
||||
@ -913,7 +914,8 @@ public:
|
||||
// Overloaded from nsINode
|
||||
virtual already_AddRefed<nsIURI> GetBaseURI() const MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(
|
||||
mozilla::EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsPurple() = 0;
|
||||
virtual void RemovePurple() = 0;
|
||||
|
@ -361,7 +361,7 @@ Attr::RemoveChildAt(uint32_t aIndex, bool aNotify)
|
||||
}
|
||||
|
||||
nsresult
|
||||
Attr::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
Attr::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mCanHandle = true;
|
||||
return NS_OK;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "nsIDocument.h"
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
namespace dom {
|
||||
|
||||
// Attribute helper class used to wrap up an attribute with a dom
|
||||
@ -51,7 +52,7 @@ public:
|
||||
// nsIDOMAttr interface
|
||||
NS_DECL_NSIDOMATTR
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
// nsIAttribute interface
|
||||
void SetMap(nsDOMAttributeMap *aMap) MOZ_OVERRIDE;
|
||||
|
@ -2335,7 +2335,7 @@ Element::CheckHandleEventForLinksPrecondition(EventChainVisitor& aVisitor,
|
||||
}
|
||||
|
||||
nsresult
|
||||
Element::PreHandleEventForLinks(nsEventChainPreVisitor& aVisitor)
|
||||
Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
// Optimisation: return early if this event doesn't interest us.
|
||||
// IMPORTANT: this switch and the switch below it must be kept in sync!
|
||||
|
@ -703,7 +703,7 @@ FindChromeAccessOnlySubtreeOwner(nsIContent* aContent)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsIContent::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
//FIXME! Document how this event retargeting works, Bug 329124.
|
||||
aVisitor.mCanHandle = true;
|
||||
|
@ -7636,7 +7636,7 @@ nsDocument::GetExistingListenerManager() const
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDocument::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
nsDocument::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mCanHandle = true;
|
||||
// FIXME! This is a hack to make middle mouse paste working also in Editor.
|
||||
|
@ -98,6 +98,7 @@ class nsPointerLockPermissionRequest;
|
||||
class nsISecurityConsoleMessage;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
namespace dom {
|
||||
class UndoManager;
|
||||
class LifecycleCallbacks;
|
||||
@ -902,7 +903,8 @@ public:
|
||||
NS_DECL_NSIDOMDOCUMENTXBL
|
||||
|
||||
// nsIDOMEventTarget
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(
|
||||
mozilla::EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual mozilla::EventListenerManager*
|
||||
GetOrCreateListenerManager() MOZ_OVERRIDE;
|
||||
virtual mozilla::EventListenerManager*
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "mozilla/BasicEvents.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
class nsGenConImageContent MOZ_FINAL : public nsXMLElement,
|
||||
public nsImageLoadingContent
|
||||
{
|
||||
@ -43,7 +45,7 @@ public:
|
||||
virtual void UnbindFromTree(bool aDeep, bool aNullParent);
|
||||
virtual nsEventStates IntrinsicState() const;
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
MOZ_ASSERT(IsInNativeAnonymousSubtree());
|
||||
if (aVisitor.mEvent->message == NS_LOAD ||
|
||||
|
@ -1133,7 +1133,7 @@ nsINode::RemoveEventListener(const nsAString& aType,
|
||||
NS_IMPL_REMOVE_SYSTEM_EVENT_LISTENER(nsINode)
|
||||
|
||||
nsresult
|
||||
nsINode::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
nsINode::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
// This is only here so that we can use the NS_DECL_NSIDOMTARGET macro
|
||||
NS_ABORT();
|
||||
|
@ -24,11 +24,12 @@
|
||||
|
||||
using mozilla::dom::StructuredCloneData;
|
||||
using mozilla::dom::StructuredCloneClosure;
|
||||
using namespace mozilla;
|
||||
|
||||
bool
|
||||
nsInProcessTabChildGlobal::DoSendBlockingMessage(JSContext* aCx,
|
||||
const nsAString& aMessage,
|
||||
const mozilla::dom::StructuredCloneData& aData,
|
||||
const dom::StructuredCloneData& aData,
|
||||
JS::Handle<JSObject *> aCpows,
|
||||
nsIPrincipal* aPrincipal,
|
||||
InfallibleTArray<nsString>* aJSONRetVal,
|
||||
@ -138,7 +139,7 @@ nsInProcessTabChildGlobal::Init()
|
||||
"Couldn't initialize nsInProcessTabChildGlobal");
|
||||
mMessageManager = new nsFrameMessageManager(this,
|
||||
nullptr,
|
||||
mozilla::dom::ipc::MM_CHILD);
|
||||
dom::ipc::MM_CHILD);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -249,7 +250,7 @@ nsInProcessTabChildGlobal::GetOwnerContent()
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsInProcessTabChildGlobal::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
nsInProcessTabChildGlobal::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mCanHandle = true;
|
||||
|
||||
|
@ -23,6 +23,10 @@
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
#include "nsWeakReference.h"
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
} // namespace mozilla
|
||||
|
||||
class nsInProcessTabChildGlobal : public nsDOMEventTargetHelper,
|
||||
public nsFrameScriptExecutor,
|
||||
public nsIInProcessContentFrameMessageManager,
|
||||
@ -96,7 +100,8 @@ public:
|
||||
JS::Handle<JSObject *> aCpows,
|
||||
nsIPrincipal* aPrincipal) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(
|
||||
mozilla::EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
NS_IMETHOD AddEventListener(const nsAString& aType,
|
||||
nsIDOMEventListener* aListener,
|
||||
bool aUseCapture)
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsHTMLDNSPrefetch.h"
|
||||
#include "nsIDocument.h"
|
||||
@ -244,7 +245,7 @@ HTMLAnchorElement::IsHTMLFocusable(bool aWithMouse,
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLAnchorElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
HTMLAnchorElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
return PreHandleEventForAnchors(aVisitor);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "nsDOMTokenList.h"
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
namespace dom {
|
||||
|
||||
class HTMLAnchorElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
@ -54,7 +55,7 @@ public:
|
||||
bool aNullParent = true) MOZ_OVERRIDE;
|
||||
virtual bool IsHTMLFocusable(bool aWithMouse, bool *aIsFocusable, int32_t *aTabIndex) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual bool IsLink(nsIURI** aURI) const MOZ_OVERRIDE;
|
||||
virtual void GetLinkTarget(nsAString& aTarget) MOZ_OVERRIDE;
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/HTMLAreaElementBinding.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT(Area)
|
||||
|
||||
@ -92,7 +93,7 @@ HTMLAreaElement::SetTarget(const nsAString& aValue)
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLAreaElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
HTMLAreaElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
return PreHandleEventForAnchors(aVisitor);
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
class nsIDocument;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
namespace dom {
|
||||
|
||||
class HTMLAreaElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
@ -43,7 +44,7 @@ public:
|
||||
// nsIDOMHTMLAreaElement
|
||||
NS_DECL_NSIDOMHTMLAREAELEMENT
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual bool IsLink(nsIURI** aURI) const MOZ_OVERRIDE;
|
||||
virtual void GetLinkTarget(nsAString& aTarget) MOZ_OVERRIDE;
|
||||
|
@ -187,7 +187,7 @@ HTMLButtonElement::IsDisabledForEvents(uint32_t aMessage)
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLButtonElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
HTMLButtonElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mCanHandle = false;
|
||||
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "nsIConstraintValidation.h"
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
namespace dom {
|
||||
|
||||
class HTMLButtonElement MOZ_FINAL : public nsGenericHTMLFormElementWithState,
|
||||
@ -47,7 +48,7 @@ public:
|
||||
virtual bool IsDisabledForEvents(uint32_t aMessage) MOZ_OVERRIDE;
|
||||
|
||||
// nsIDOMEventTarget
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
// nsINode
|
||||
|
@ -67,7 +67,7 @@ HTMLFieldSetElement::IsDisabledForEvents(uint32_t aMessage)
|
||||
|
||||
// nsIContent
|
||||
nsresult
|
||||
HTMLFieldSetElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
HTMLFieldSetElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
// Do not process any DOM events if the element is disabled.
|
||||
aVisitor.mCanHandle = false;
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "mozilla/dom/ValidityState.h"
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
namespace dom {
|
||||
|
||||
class HTMLFieldSetElement MOZ_FINAL : public nsGenericHTMLFormElement,
|
||||
@ -38,7 +39,7 @@ public:
|
||||
NS_DECL_NSIDOMHTMLFIELDSETELEMENT
|
||||
|
||||
// nsIContent
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
const nsAttrValue* aValue, bool aNotify) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -482,7 +482,7 @@ HTMLFormElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLFormElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
HTMLFormElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mWantsWillHandleEvent = true;
|
||||
if (aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this)) {
|
||||
|
@ -27,6 +27,7 @@ class nsIMutableArray;
|
||||
class nsIURI;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
namespace dom {
|
||||
class HTMLFormControlsCollection;
|
||||
class HTMLImageElement;
|
||||
@ -89,7 +90,7 @@ public:
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult WillHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -341,7 +341,7 @@ HTMLImageElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
|
||||
|
||||
nsresult
|
||||
HTMLImageElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
HTMLImageElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
// If we are a map and get a mouse click, don't let it be handled by
|
||||
// the Generic Element as this could cause a click event to fire
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "Units.h"
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
namespace dom {
|
||||
|
||||
class HTMLImageElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
@ -51,7 +52,7 @@ public:
|
||||
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
bool IsHTMLFocusable(bool aWithMouse, bool *aIsFocusable, int32_t *aTabIndex) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -3222,7 +3222,8 @@ HTMLInputElement::SelectAll(nsPresContext* aPresContext)
|
||||
}
|
||||
|
||||
bool
|
||||
HTMLInputElement::NeedToInitializeEditorForEvent(nsEventChainPreVisitor& aVisitor) const
|
||||
HTMLInputElement::NeedToInitializeEditorForEvent(
|
||||
EventChainPreVisitor& aVisitor) const
|
||||
{
|
||||
// We only need to initialize the editor for single line input controls because they
|
||||
// are lazily initialized. We don't need to initialize the control for
|
||||
@ -3253,7 +3254,7 @@ HTMLInputElement::IsDisabledForEvents(uint32_t aMessage)
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLInputElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
// Do not process any DOM events if the element is disabled
|
||||
aVisitor.mCanHandle = false;
|
||||
|
@ -29,6 +29,9 @@ class nsIRadioVisitor;
|
||||
class nsTextEditorState;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class EventChainPreVisitor;
|
||||
|
||||
namespace dom {
|
||||
|
||||
class Date;
|
||||
@ -148,7 +151,7 @@ public:
|
||||
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
void PostHandleEventForRangeThumb(nsEventChainPostVisitor& aVisitor);
|
||||
void StartRangeThumbDrag(WidgetGUIEvent* aEvent);
|
||||
@ -891,7 +894,7 @@ protected:
|
||||
* Determine whether the editor needs to be initialized explicitly for
|
||||
* a particular event.
|
||||
*/
|
||||
bool NeedToInitializeEditorForEvent(nsEventChainPreVisitor& aVisitor) const;
|
||||
bool NeedToInitializeEditorForEvent(EventChainPreVisitor& aVisitor) const;
|
||||
|
||||
/**
|
||||
* Get the value mode of the element, depending of the type.
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "mozilla/dom/HTMLLinkElementBinding.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsDOMTokenList.h"
|
||||
@ -302,7 +303,7 @@ HTMLLinkElement::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLLinkElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
HTMLLinkElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
return PreHandleEventForAnchors(aVisitor);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "nsStyleLinkElement.h"
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
namespace dom {
|
||||
|
||||
class HTMLLinkElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
@ -41,7 +42,7 @@ public:
|
||||
void LinkRemoved();
|
||||
|
||||
// nsIDOMEventTarget
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
// nsINode
|
||||
|
@ -251,7 +251,7 @@ HTMLMenuItemElement::SetChecked(bool aChecked)
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLMenuItemElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
HTMLMenuItemElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
if (aVisitor.mEvent->message == NS_MOUSE_CLICK) {
|
||||
|
||||
|
@ -11,6 +11,9 @@
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class EventChainPreVisitor;
|
||||
|
||||
namespace dom {
|
||||
|
||||
class Visitor;
|
||||
@ -33,7 +36,7 @@ public:
|
||||
// nsIDOMHTMLMenuItemElement
|
||||
NS_DECL_NSIDOMHTMLMENUITEMELEMENT
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
|
@ -48,7 +48,7 @@ NS_IMPL_STRING_ATTR(HTMLOptGroupElement, Label, label)
|
||||
|
||||
|
||||
nsresult
|
||||
HTMLOptGroupElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
HTMLOptGroupElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mCanHandle = false;
|
||||
// Do not process any DOM events if the element is disabled
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
namespace dom {
|
||||
|
||||
class HTMLOptGroupElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
@ -34,7 +35,7 @@ public:
|
||||
virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) MOZ_OVERRIDE;
|
||||
|
||||
// nsIContent
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsEventStates IntrinsicState() const MOZ_OVERRIDE;
|
||||
|
||||
|
@ -1478,7 +1478,7 @@ HTMLSelectElement::IsDisabledForEvents(uint32_t aMessage)
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLSelectElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
HTMLSelectElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mCanHandle = false;
|
||||
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
|
||||
|
@ -25,6 +25,9 @@ class nsISelectControlFrame;
|
||||
class nsPresState;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class EventChainPreVisitor;
|
||||
|
||||
namespace dom {
|
||||
|
||||
class HTMLSelectElement;
|
||||
@ -259,7 +262,7 @@ public:
|
||||
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
|
||||
|
||||
// nsIContent
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsHTMLFocusable(bool aWithMouse, bool* aIsFocusable, int32_t* aTabIndex) MOZ_OVERRIDE;
|
||||
|
@ -454,7 +454,7 @@ HTMLTextAreaElement::IsDisabledForEvents(uint32_t aMessage)
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLTextAreaElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
HTMLTextAreaElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mCanHandle = false;
|
||||
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
|
||||
|
@ -29,6 +29,9 @@ class nsPresContext;
|
||||
class nsPresState;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class EventChainPreVisitor;
|
||||
|
||||
namespace dom {
|
||||
|
||||
class HTMLTextAreaElement MOZ_FINAL : public nsGenericHTMLFormElementWithState,
|
||||
@ -113,7 +116,7 @@ public:
|
||||
int32_t aModType) const MOZ_OVERRIDE;
|
||||
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsHTMLFocusable(bool aWithMouse, bool *aIsFocusable, int32_t *aTabIndex) MOZ_OVERRIDE;
|
||||
|
@ -718,7 +718,7 @@ nsGenericHTMLElement::CheckHandleEventForAnchorsPreconditions(
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericHTMLElement::PreHandleEventForAnchors(nsEventChainPreVisitor& aVisitor)
|
||||
nsGenericHTMLElement::PreHandleEventForAnchors(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
nsresult rv = nsGenericHTMLElementBase::PreHandleEvent(aVisitor);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -2285,7 +2285,7 @@ nsGenericHTMLFormElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericHTMLFormElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
nsGenericHTMLFormElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
if (aVisitor.mEvent->mFlags.mIsTrusted) {
|
||||
switch (aVisitor.mEvent->message) {
|
||||
|
@ -40,6 +40,7 @@ class nsIDOMHTMLCollection;
|
||||
class nsDOMSettableTokenList;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
class EventChainVisitor;
|
||||
class EventListenerManager;
|
||||
namespace dom {
|
||||
@ -591,7 +592,7 @@ public:
|
||||
*/
|
||||
bool CheckHandleEventForAnchorsPreconditions(
|
||||
mozilla::EventChainVisitor& aVisitor);
|
||||
nsresult PreHandleEventForAnchors(nsEventChainPreVisitor& aVisitor);
|
||||
nsresult PreHandleEventForAnchors(mozilla::EventChainPreVisitor& aVisitor);
|
||||
nsresult PostHandleEventForAnchors(nsEventChainPostVisitor& aVisitor);
|
||||
bool IsHTMLLink(nsIURI** aURI) const;
|
||||
|
||||
@ -1328,7 +1329,8 @@ public:
|
||||
virtual IMEState GetDesiredIMEState() MOZ_OVERRIDE;
|
||||
virtual nsEventStates IntrinsicState() const MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(
|
||||
mozilla::EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsDisabled() const MOZ_OVERRIDE;
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "nsIScriptError.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
|
||||
#include "mozilla/dom/ElementBinding.h"
|
||||
|
||||
@ -897,7 +898,7 @@ nsMathMLElement::MapMathMLAttributesInto(const nsMappedAttributes* aAttributes,
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsMathMLElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
nsMathMLElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
nsresult rv = Element::PreHandleEvent(aVisitor);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -17,6 +17,10 @@ class nsCSSValue;
|
||||
|
||||
typedef nsMappedAttributeElement nsMathMLElementBase;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
} // namespace mozilla
|
||||
|
||||
/*
|
||||
* The base class for MathML elements.
|
||||
*/
|
||||
@ -68,7 +72,8 @@ public:
|
||||
static void MapMathMLAttributesInto(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aRuleData);
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(
|
||||
mozilla::EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
nsresult Clone(nsINodeInfo*, nsINode**) const MOZ_OVERRIDE;
|
||||
virtual nsEventStates IntrinsicState() const MOZ_OVERRIDE;
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "mozilla/dom/SVGAElementBinding.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsSVGString.h"
|
||||
#include "nsIURI.h"
|
||||
@ -76,7 +77,7 @@ SVGAElement::Href()
|
||||
// nsINode methods
|
||||
|
||||
nsresult
|
||||
SVGAElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
SVGAElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
nsresult rv = Element::PreHandleEvent(aVisitor);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -14,6 +14,9 @@ nsresult NS_NewSVGAElement(nsIContent **aResult,
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo);
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class EventChainPreVisitor;
|
||||
|
||||
namespace dom {
|
||||
|
||||
typedef SVGGraphicsElement SVGAElementBase;
|
||||
@ -33,7 +36,7 @@ public:
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SVGAElement, SVGAElementBase)
|
||||
|
||||
// nsINode interface methods
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
||||
|
||||
|
@ -589,7 +589,7 @@ SVGSVGElement::IsAttributeMapped(const nsIAtom* name) const
|
||||
// nsIContent methods:
|
||||
|
||||
nsresult
|
||||
SVGSVGElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
SVGSVGElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
if (aVisitor.mEvent->message == NS_SVG_LOAD) {
|
||||
if (mTimedDocumentRoot) {
|
||||
|
@ -28,9 +28,10 @@ class nsSVGInnerSVGFrame;
|
||||
class nsSVGImageFrame;
|
||||
|
||||
namespace mozilla {
|
||||
class DOMSVGAnimatedPreserveAspectRatio;
|
||||
class SVGFragmentIdentifier;
|
||||
class AutoSVGRenderingState;
|
||||
class DOMSVGAnimatedPreserveAspectRatio;
|
||||
class EventChainPreVisitor;
|
||||
class SVGFragmentIdentifier;
|
||||
|
||||
namespace dom {
|
||||
class SVGAngle;
|
||||
@ -127,7 +128,7 @@ public:
|
||||
|
||||
// nsIContent interface
|
||||
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsEventAttributeName(nsIAtom* aName) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -1139,7 +1139,7 @@ nsXULElement::List(FILE* out, int32_t aIndent) const
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
nsXULElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
nsXULElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119
|
||||
nsIAtom* tag = Tag();
|
||||
|
@ -49,6 +49,7 @@ class nsXULPrototypeNode;
|
||||
typedef nsTArray<nsRefPtr<nsXULPrototypeNode> > nsPrototypeArray;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
class EventListenerManager;
|
||||
namespace css {
|
||||
class StyleRule;
|
||||
@ -374,7 +375,8 @@ public:
|
||||
mozilla::dom::Element)
|
||||
|
||||
// nsINode
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
|
||||
virtual nsresult PreHandleEvent(
|
||||
mozilla::EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
// nsIContent
|
||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
|
@ -2963,7 +2963,7 @@ nsGlobalWindow::GetJSContextForEventHandlers()
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGlobalWindow::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
nsGlobalWindow::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
NS_PRECONDITION(IsInnerWindow(), "PreHandleEvent is used on outer window!?");
|
||||
static uint32_t count = 0;
|
||||
|
@ -168,7 +168,7 @@ nsWindowRoot::GetContextForEventHandlers(nsresult* aRv)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsWindowRoot::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
nsWindowRoot::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mCanHandle = true;
|
||||
aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119
|
||||
|
@ -10,9 +10,12 @@
|
||||
class nsPIDOMWindow;
|
||||
class nsIDOMEventListener;
|
||||
class nsIDOMEvent;
|
||||
class nsEventChainPreVisitor;
|
||||
class nsEventChainPostVisitor;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
} // namespace mozilla
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/EventListenerManager.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
|
@ -57,6 +57,7 @@
|
||||
#include <algorithm>
|
||||
#include "private/pprio.h"
|
||||
#include "nsContentPermissionHelper.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
|
||||
#include "mozilla/dom/DeviceStorageBinding.h"
|
||||
|
||||
@ -4275,7 +4276,7 @@ nsDOMDeviceStorage::GetTargetForEventTargetChain()
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDOMDeviceStorage::PreHandleEvent(nsEventChainPreVisitor & aVisitor)
|
||||
nsDOMDeviceStorage::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
return nsDOMEventTargetHelper::PreHandleEvent(aVisitor);
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ nsDOMEventTargetHelper::GetEventHandler(nsIAtom* aType,
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDOMEventTargetHelper::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
nsDOMEventTargetHelper::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mCanHandle = true;
|
||||
aVisitor.mParentTarget = nullptr;
|
||||
|
@ -164,7 +164,7 @@ public:
|
||||
* Resets aVisitor object and calls PreHandleEvent.
|
||||
* Copies mItemFlags and mItemData to the current nsEventTargetChainItem.
|
||||
*/
|
||||
void PreHandleEvent(nsEventChainPreVisitor& aVisitor);
|
||||
void PreHandleEvent(EventChainPreVisitor& aVisitor);
|
||||
|
||||
/**
|
||||
* If the current item in the event target chain has an event listener
|
||||
@ -219,7 +219,7 @@ nsEventTargetChainItem::nsEventTargetChainItem(EventTarget* aTarget)
|
||||
}
|
||||
|
||||
void
|
||||
nsEventTargetChainItem::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
nsEventTargetChainItem::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.Reset();
|
||||
unused << mTarget->PreHandleEvent(aVisitor);
|
||||
@ -515,8 +515,8 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
|
||||
// Create visitor object and start event dispatching.
|
||||
// PreHandleEvent for the original target.
|
||||
nsEventStatus status = aEventStatus ? *aEventStatus : nsEventStatus_eIgnore;
|
||||
nsEventChainPreVisitor preVisitor(aPresContext, aEvent, aDOMEvent, status,
|
||||
isInAnon);
|
||||
EventChainPreVisitor preVisitor(aPresContext, aEvent, aDOMEvent, status,
|
||||
isInAnon);
|
||||
targetEtci->PreHandleEvent(preVisitor);
|
||||
|
||||
if (!preVisitor.mCanHandle && preVisitor.mAutomaticChromeDispatch && content) {
|
||||
|
@ -31,7 +31,7 @@ class EventTarget;
|
||||
* nsEventDispatcher::DispatchDOMEvent is called an event target chain is
|
||||
* created. nsEventDispatcher creates the chain by calling PreHandleEvent
|
||||
* on each event target and the creation continues until either the mCanHandle
|
||||
* member of the nsEventChainPreVisitor object is false or the mParentTarget
|
||||
* member of the EventChainPreVisitor object is false or the mParentTarget
|
||||
* does not point to a new target. The event target chain is created in the
|
||||
* heap.
|
||||
*
|
||||
@ -105,24 +105,29 @@ public:
|
||||
nsCOMPtr<nsISupports> mItemData;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
class nsEventChainPreVisitor : public mozilla::EventChainVisitor
|
||||
class EventChainPreVisitor : public EventChainVisitor
|
||||
{
|
||||
public:
|
||||
nsEventChainPreVisitor(nsPresContext* aPresContext,
|
||||
mozilla::WidgetEvent* aEvent,
|
||||
nsIDOMEvent* aDOMEvent,
|
||||
nsEventStatus aEventStatus,
|
||||
bool aIsInAnon)
|
||||
: mozilla::EventChainVisitor(aPresContext, aEvent, aDOMEvent, aEventStatus),
|
||||
mCanHandle(true), mAutomaticChromeDispatch(true),
|
||||
mForceContentDispatch(false), mRelatedTargetIsInAnon(false),
|
||||
mOriginalTargetIsInAnon(aIsInAnon), mWantsWillHandleEvent(false),
|
||||
mMayHaveListenerManager(true), mParentTarget(nullptr),
|
||||
mEventTargetAtParent(nullptr) {}
|
||||
EventChainPreVisitor(nsPresContext* aPresContext,
|
||||
WidgetEvent* aEvent,
|
||||
nsIDOMEvent* aDOMEvent,
|
||||
nsEventStatus aEventStatus,
|
||||
bool aIsInAnon)
|
||||
: EventChainVisitor(aPresContext, aEvent, aDOMEvent, aEventStatus)
|
||||
, mCanHandle(true)
|
||||
, mAutomaticChromeDispatch(true)
|
||||
, mForceContentDispatch(false)
|
||||
, mRelatedTargetIsInAnon(false)
|
||||
, mOriginalTargetIsInAnon(aIsInAnon)
|
||||
, mWantsWillHandleEvent(false)
|
||||
, mMayHaveListenerManager(true)
|
||||
, mParentTarget(nullptr)
|
||||
, mEventTargetAtParent(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset() {
|
||||
void Reset()
|
||||
{
|
||||
mItemFlags = 0;
|
||||
mItemData = nullptr;
|
||||
mCanHandle = true;
|
||||
@ -182,15 +187,17 @@ public:
|
||||
/**
|
||||
* Parent item in the event target chain.
|
||||
*/
|
||||
mozilla::dom::EventTarget* mParentTarget;
|
||||
dom::EventTarget* mParentTarget;
|
||||
|
||||
/**
|
||||
* If the event needs to be retargeted, this is the event target,
|
||||
* which should be used when the event is handled at mParentTarget.
|
||||
*/
|
||||
mozilla::dom::EventTarget* mEventTargetAtParent;
|
||||
dom::EventTarget* mEventTargetAtParent;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
class nsEventChainPostVisitor : public mozilla::EventChainVisitor
|
||||
{
|
||||
public:
|
||||
|
@ -11,6 +11,8 @@
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
USING_FILE_NAMESPACE
|
||||
|
||||
/**
|
||||
@ -66,7 +68,7 @@ ArchiveRequest::~ArchiveRequest()
|
||||
}
|
||||
|
||||
nsresult
|
||||
ArchiveRequest::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
ArchiveRequest::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mCanHandle = true;
|
||||
aVisitor.mParentTarget = nullptr;
|
||||
|
@ -13,6 +13,9 @@
|
||||
|
||||
#include "FileCommon.h"
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
} // namespace mozilla
|
||||
|
||||
BEGIN_FILE_NAMESPACE
|
||||
|
||||
@ -36,7 +39,7 @@ public:
|
||||
ArchiveReader* aReader);
|
||||
|
||||
// nsIDOMEventTarget
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
public:
|
||||
// This is called by the DOMArchiveRequestEvent
|
||||
|
@ -15,6 +15,8 @@
|
||||
#include "FileHelper.h"
|
||||
#include "LockedFile.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
USING_FILE_NAMESPACE
|
||||
|
||||
FileRequest::FileRequest(nsPIDOMWindow* aWindow)
|
||||
@ -43,7 +45,7 @@ FileRequest::Create(nsPIDOMWindow* aOwner, LockedFile* aLockedFile,
|
||||
}
|
||||
|
||||
nsresult
|
||||
FileRequest::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
FileRequest::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
|
||||
|
@ -14,6 +14,10 @@
|
||||
|
||||
class nsIDOMLockedFile;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
} // namespace mozilla
|
||||
|
||||
BEGIN_FILE_NAMESPACE
|
||||
|
||||
class FileHelper;
|
||||
@ -31,7 +35,7 @@ public:
|
||||
|
||||
// nsIDOMEventTarget
|
||||
virtual nsresult
|
||||
PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
void
|
||||
OnProgress(uint64_t aProgress, uint64_t aProgressMax)
|
||||
|
@ -341,7 +341,7 @@ NS_IMPL_EVENT_HANDLER(LockedFile, abort)
|
||||
NS_IMPL_EVENT_HANDLER(LockedFile, error)
|
||||
|
||||
nsresult
|
||||
LockedFile::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
LockedFile::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
|
||||
|
@ -17,6 +17,10 @@
|
||||
|
||||
class nsIInputStream;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
} // namespace mozilla
|
||||
|
||||
BEGIN_FILE_NAMESPACE
|
||||
|
||||
class FileHandle;
|
||||
@ -60,7 +64,7 @@ public:
|
||||
|
||||
// nsIDOMEventTarget
|
||||
virtual nsresult
|
||||
PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
nsresult
|
||||
CreateParallelStream(nsISupports** aStream);
|
||||
|
@ -386,7 +386,7 @@ NS_IMPL_ADDREF_INHERITED(IDBRequest, IDBWrapperCache)
|
||||
NS_IMPL_RELEASE_INHERITED(IDBRequest, IDBWrapperCache)
|
||||
|
||||
nsresult
|
||||
IDBRequest::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
IDBRequest::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
|
||||
|
@ -23,6 +23,7 @@ class nsIScriptContext;
|
||||
class nsPIDOMWindow;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
namespace dom {
|
||||
class OwningIDBObjectStoreOrIDBIndexOrIDBCursor;
|
||||
class ErrorEventInit;
|
||||
@ -61,7 +62,7 @@ public:
|
||||
IDBTransaction* aTransaction);
|
||||
|
||||
// nsIDOMEventTarget
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
void GetSource(Nullable<OwningIDBObjectStoreOrIDBIndexOrIDBCursor>& aSource) const;
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
|
||||
#define SAVEPOINT_NAME "savepoint"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
USING_INDEXEDDB_NAMESPACE
|
||||
using mozilla::dom::quota::QuotaManager;
|
||||
@ -722,7 +723,7 @@ IDBTransaction::ObjectStore(const nsAString& aName, ErrorResult& aRv)
|
||||
}
|
||||
|
||||
nsresult
|
||||
IDBTransaction::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
IDBTransaction::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mCanHandle = true;
|
||||
aVisitor.mParentTarget = mDatabase;
|
||||
|
@ -30,6 +30,10 @@
|
||||
class nsIThread;
|
||||
class nsPIDOMWindow;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
} // namespace mozilla
|
||||
|
||||
BEGIN_INDEXEDDB_NAMESPACE
|
||||
|
||||
class AsyncConnectionHelper;
|
||||
@ -98,7 +102,7 @@ public:
|
||||
}
|
||||
|
||||
// nsIDOMEventTarget
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
void OnNewRequest();
|
||||
void OnRequestFinished();
|
||||
|
@ -13,6 +13,7 @@
|
||||
using mozilla::dom::Nullable;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
class EventListenerManager;
|
||||
namespace dom {
|
||||
class EventTarget;
|
||||
@ -20,7 +21,6 @@ class EventTarget;
|
||||
} // namespace mozilla
|
||||
|
||||
class nsPresContext;
|
||||
class nsEventChainPreVisitor;
|
||||
class nsEventChainPostVisitor;
|
||||
%}
|
||||
|
||||
@ -32,12 +32,12 @@ class nsEventChainPostVisitor;
|
||||
* http://www.w3.org/TR/DOM-Level-2-Events/
|
||||
*/
|
||||
|
||||
[ref] native nsEventChainPreVisitorRef(nsEventChainPreVisitor);
|
||||
[ref] native nsEventChainPostVisitorRef(nsEventChainPostVisitor);
|
||||
[ptr] native WidgetEventPtr(mozilla::WidgetEvent);
|
||||
[ptr] native nsPresContextPtr(nsPresContext);
|
||||
[ptr] native nsEventStatusPtr(nsEventStatus);
|
||||
[ptr] native JSContextPtr(JSContext);
|
||||
[ref] native EventChainPreVisitorRef(mozilla::EventChainPreVisitor);
|
||||
[ptr] native EventListenerManagerPtr(mozilla::EventListenerManager);
|
||||
[ptr] native EventTargetPtr(mozilla::dom::EventTarget);
|
||||
|
||||
@ -211,7 +211,7 @@ interface nsIDOMEventTarget : nsISupports
|
||||
/**
|
||||
* Called before the capture phase of the event flow.
|
||||
* This is used to create the event target chain and implementations
|
||||
* should set the necessary members of nsEventChainPreVisitor.
|
||||
* should set the necessary members of EventChainPreVisitor.
|
||||
* At least aVisitor.mCanHandle must be set,
|
||||
* usually also aVisitor.mParentTarget if mCanHandle is PR_TRUE.
|
||||
* First one tells that this object can handle the aVisitor.mEvent event and
|
||||
@ -224,10 +224,10 @@ interface nsIDOMEventTarget : nsISupports
|
||||
* @note Only nsEventDispatcher should call this method.
|
||||
*/
|
||||
[noscript, nostdcall]
|
||||
void PreHandleEvent(in nsEventChainPreVisitorRef aVisitor);
|
||||
void PreHandleEvent(in EventChainPreVisitorRef aVisitor);
|
||||
|
||||
/**
|
||||
* If nsEventChainPreVisitor.mWantsWillHandleEvent is set PR_TRUE,
|
||||
* If EventChainPreVisitor.mWantsWillHandleEvent is set PR_TRUE,
|
||||
* called just before possible event handlers on this object will be called.
|
||||
*/
|
||||
[noscript, nostdcall]
|
||||
|
@ -118,7 +118,7 @@ public:
|
||||
}
|
||||
|
||||
nsresult
|
||||
PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
aVisitor.mForceContentDispatch = true;
|
||||
return NS_OK;
|
||||
|
@ -17,6 +17,7 @@ using mozilla::dom::EventHandlerNonNull;
|
||||
using mozilla::dom::MessagePortBase;
|
||||
using mozilla::dom::Optional;
|
||||
using mozilla::dom::Sequence;
|
||||
using namespace mozilla;
|
||||
|
||||
USING_WORKERS_NAMESPACE
|
||||
|
||||
@ -244,7 +245,7 @@ MessagePort::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
|
||||
}
|
||||
|
||||
nsresult
|
||||
MessagePort::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
MessagePort::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
AssertCorrectThread();
|
||||
|
||||
|
@ -15,6 +15,10 @@
|
||||
class nsIDOMEvent;
|
||||
class nsPIDOMWindow;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
} // namespace mozilla
|
||||
|
||||
BEGIN_WORKERS_NAMESPACE
|
||||
|
||||
class SharedWorker;
|
||||
@ -79,7 +83,7 @@ public:
|
||||
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult
|
||||
PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
using mozilla::dom::Optional;
|
||||
using mozilla::dom::Sequence;
|
||||
using namespace mozilla;
|
||||
|
||||
USING_WORKERS_NAMESPACE
|
||||
|
||||
@ -198,7 +199,7 @@ SharedWorker::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
|
||||
}
|
||||
|
||||
nsresult
|
||||
SharedWorker::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
SharedWorker::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
|
||||
|
@ -15,6 +15,10 @@
|
||||
class nsIDOMEvent;
|
||||
class nsPIDOMWindow;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPreVisitor;
|
||||
} // namespace mozilla
|
||||
|
||||
BEGIN_WORKERS_NAMESPACE
|
||||
|
||||
class MessagePort;
|
||||
@ -77,7 +81,7 @@ public:
|
||||
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult
|
||||
PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
|
||||
WorkerPrivate*
|
||||
GetWorkerPrivate() const
|
||||
|
@ -546,7 +546,7 @@ public:
|
||||
// If mNoContentDispatch is true, the event is never dispatched to the
|
||||
// event handlers which are added to the contents, onfoo attributes and
|
||||
// properties. Note that this flag is ignored when
|
||||
// nsEventChainPreVisitor::mForceContentDispatch is set true. For exapmle,
|
||||
// EventChainPreVisitor::mForceContentDispatch is set true. For exapmle,
|
||||
// window and document object sets it true. Therefore, web applications
|
||||
// can handle the event if they add event listeners to the window or the
|
||||
// document.
|
||||
|
Loading…
Reference in New Issue
Block a user