mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 920377 part.7 Get rid of nsFocusEvent r=roc
This commit is contained in:
parent
6a38167904
commit
622f0b4ed3
@ -2138,7 +2138,7 @@ Element::PreHandleEventForLinks(nsEventChainPreVisitor& aVisitor)
|
||||
// FALL THROUGH
|
||||
case NS_FOCUS_CONTENT:
|
||||
if (aVisitor.mEvent->eventStructType != NS_FOCUS_EVENT ||
|
||||
!static_cast<nsFocusEvent*>(aVisitor.mEvent)->isRefocus) {
|
||||
!static_cast<InternalFocusEvent*>(aVisitor.mEvent)->isRefocus) {
|
||||
nsAutoString target;
|
||||
GetLinkTarget(target);
|
||||
nsContentUtils::TriggerLink(this, aVisitor.mPresContext, absURI, target,
|
||||
|
@ -157,7 +157,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMEvent)
|
||||
nullptr;
|
||||
break;
|
||||
case NS_FOCUS_EVENT:
|
||||
static_cast<nsFocusEvent*>(tmp->mEvent)->relatedTarget = nullptr;
|
||||
static_cast<InternalFocusEvent*>(tmp->mEvent)->relatedTarget = nullptr;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -204,7 +204,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMEvent)
|
||||
case NS_FOCUS_EVENT:
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->relatedTarget");
|
||||
cb.NoteXPCOMChild(
|
||||
static_cast<nsFocusEvent*>(tmp->mEvent)->relatedTarget);
|
||||
static_cast<InternalFocusEvent*>(tmp->mEvent)->relatedTarget);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -654,8 +654,9 @@ nsDOMEvent::DuplicatePrivateData()
|
||||
}
|
||||
case NS_FOCUS_EVENT:
|
||||
{
|
||||
nsFocusEvent* newFocusEvent = new nsFocusEvent(false, msg);
|
||||
nsFocusEvent* oldFocusEvent = static_cast<nsFocusEvent*>(mEvent);
|
||||
InternalFocusEvent* newFocusEvent = new InternalFocusEvent(false, msg);
|
||||
InternalFocusEvent* oldFocusEvent =
|
||||
static_cast<InternalFocusEvent*>(mEvent);
|
||||
newFocusEvent->AssignFocusEventData(*oldFocusEvent, true);
|
||||
newEvent = newFocusEvent;
|
||||
break;
|
||||
|
@ -13,10 +13,11 @@ using namespace mozilla::dom;
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsDOMFocusEvent, nsDOMUIEvent, nsIDOMFocusEvent)
|
||||
|
||||
nsDOMFocusEvent::nsDOMFocusEvent(mozilla::dom::EventTarget* aOwner,
|
||||
nsPresContext* aPresContext, nsFocusEvent* aEvent)
|
||||
: nsDOMUIEvent(aOwner, aPresContext, aEvent ?
|
||||
static_cast<nsGUIEvent*>(aEvent) :
|
||||
static_cast<nsGUIEvent*>(new nsFocusEvent(false, NS_FOCUS_CONTENT)))
|
||||
nsPresContext* aPresContext,
|
||||
InternalFocusEvent* aEvent)
|
||||
: nsDOMUIEvent(aOwner, aPresContext,
|
||||
aEvent ? aEvent :
|
||||
new InternalFocusEvent(false, NS_FOCUS_CONTENT))
|
||||
{
|
||||
if (aEvent) {
|
||||
mEventIsInternal = false;
|
||||
@ -29,7 +30,7 @@ nsDOMFocusEvent::nsDOMFocusEvent(mozilla::dom::EventTarget* aOwner,
|
||||
nsDOMFocusEvent::~nsDOMFocusEvent()
|
||||
{
|
||||
if (mEventIsInternal && mEvent) {
|
||||
delete static_cast<nsFocusEvent*>(mEvent);
|
||||
delete static_cast<InternalFocusEvent*>(mEvent);
|
||||
mEvent = nullptr;
|
||||
}
|
||||
}
|
||||
@ -46,7 +47,7 @@ nsDOMFocusEvent::GetRelatedTarget(nsIDOMEventTarget** aRelatedTarget)
|
||||
mozilla::dom::EventTarget*
|
||||
nsDOMFocusEvent::GetRelatedTarget()
|
||||
{
|
||||
return static_cast<nsFocusEvent*>(mEvent)->relatedTarget;
|
||||
return static_cast<InternalFocusEvent*>(mEvent)->relatedTarget;
|
||||
}
|
||||
|
||||
nsresult
|
||||
@ -59,7 +60,7 @@ nsDOMFocusEvent::InitFocusEvent(const nsAString& aType,
|
||||
{
|
||||
nsresult rv = nsDOMUIEvent::InitUIEvent(aType, aCanBubble, aCancelable, aView, aDetail);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
static_cast<nsFocusEvent*>(mEvent)->relatedTarget = aRelatedTarget;
|
||||
static_cast<InternalFocusEvent*>(mEvent)->relatedTarget = aRelatedTarget;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -81,7 +82,7 @@ nsDOMFocusEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
|
||||
nsresult NS_NewDOMFocusEvent(nsIDOMEvent** aInstancePtrResult,
|
||||
mozilla::dom::EventTarget* aOwner,
|
||||
nsPresContext* aPresContext,
|
||||
nsFocusEvent* aEvent)
|
||||
InternalFocusEvent* aEvent)
|
||||
{
|
||||
nsDOMFocusEvent* it = new nsDOMFocusEvent(aOwner, aPresContext, aEvent);
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
|
@ -27,7 +27,8 @@ public:
|
||||
}
|
||||
|
||||
nsDOMFocusEvent(mozilla::dom::EventTarget* aOwner,
|
||||
nsPresContext* aPresContext, nsFocusEvent* aEvent);
|
||||
nsPresContext* aPresContext,
|
||||
mozilla::InternalFocusEvent* aEvent);
|
||||
|
||||
mozilla::dom::EventTarget* GetRelatedTarget();
|
||||
|
||||
|
@ -711,7 +711,7 @@ nsEventDispatcher::CreateEvent(mozilla::dom::EventTarget* aOwner,
|
||||
static_cast<nsInputEvent*>(aEvent));
|
||||
case NS_FOCUS_EVENT:
|
||||
return NS_NewDOMFocusEvent(aDOMEvent, aOwner, aPresContext,
|
||||
static_cast<nsFocusEvent*>(aEvent));
|
||||
static_cast<InternalFocusEvent*>(aEvent));
|
||||
case NS_MOUSE_SCROLL_EVENT:
|
||||
return NS_NewDOMMouseScrollEvent(aDOMEvent, aOwner, aPresContext,
|
||||
static_cast<nsInputEvent*>(aEvent));
|
||||
|
@ -3393,7 +3393,7 @@ HTMLInputElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
|
||||
// just because we raised a window.
|
||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
if (fm && IsSingleLineTextControl(false) &&
|
||||
!(static_cast<nsFocusEvent*>(aVisitor.mEvent))->fromRaise &&
|
||||
!(static_cast<InternalFocusEvent*>(aVisitor.mEvent))->fromRaise &&
|
||||
SelectTextFieldOnFocus()) {
|
||||
nsIDocument* document = GetCurrentDoc();
|
||||
if (document) {
|
||||
|
@ -1852,7 +1852,7 @@ public:
|
||||
|
||||
NS_IMETHOD Run()
|
||||
{
|
||||
nsFocusEvent event(true, mType);
|
||||
InternalFocusEvent event(true, mType);
|
||||
event.mFlags.mBubbles = false;
|
||||
event.fromRaise = mWindowRaised;
|
||||
event.isRefocus = mIsRefocus;
|
||||
|
@ -247,7 +247,7 @@ nsresult
|
||||
NS_NewDOMFocusEvent(nsIDOMEvent** aInstancePtrResult,
|
||||
mozilla::dom::EventTarget* aOwner,
|
||||
nsPresContext* aPresContext,
|
||||
nsFocusEvent* aEvent);
|
||||
mozilla::InternalFocusEvent* aEvent);
|
||||
nsresult
|
||||
NS_NewDOMMouseScrollEvent(nsIDOMEvent** aInstancePtrResult,
|
||||
mozilla::dom::EventTarget* aOwner,
|
||||
|
@ -253,6 +253,5 @@ typedef mozilla::InternalScrollPortEvent nsScrollPortEvent;
|
||||
typedef mozilla::InternalScrollAreaEvent nsScrollAreaEvent;
|
||||
typedef mozilla::InternalFormEvent nsFormEvent;
|
||||
typedef mozilla::InternalClipboardEvent nsClipboardEvent;
|
||||
typedef mozilla::InternalFocusEvent nsFocusEvent;
|
||||
|
||||
#endif // mozilla_ContentEvents_h__
|
||||
|
@ -133,6 +133,5 @@ typedef mozilla::InternalScrollPortEvent nsScrollPortEvent;
|
||||
typedef mozilla::InternalScrollAreaEvent nsScrollAreaEvent;
|
||||
typedef mozilla::InternalFormEvent nsFormEvent;
|
||||
typedef mozilla::InternalClipboardEvent nsClipboardEvent;
|
||||
typedef mozilla::InternalFocusEvent nsFocusEvent;
|
||||
|
||||
#endif // mozilla_EventForwards_h__
|
||||
|
Loading…
Reference in New Issue
Block a user