Bug 1455055 part 4. Clean up HandleEvent implementations in accessible. r=masayuki

MozReview-Commit-ID: B3ez0ESo21g
This commit is contained in:
Boris Zbarsky 2018-04-20 00:49:29 -04:00
parent bac3f2e054
commit 1deca54b91
3 changed files with 15 additions and 17 deletions

View File

@ -359,8 +359,7 @@ DocManager::HandleEvent(Event* aEvent)
nsAutoString type;
aEvent->GetType(type);
nsCOMPtr<nsIDocument> document =
do_QueryInterface(aEvent->InternalDOMEvent()->GetTarget());
nsCOMPtr<nsIDocument> document = do_QueryInterface(aEvent->GetTarget());
NS_ASSERTION(document, "pagehide or DOMContentLoaded for non document!");
if (!document)
return NS_OK;

View File

@ -233,8 +233,7 @@ NS_IMETHODIMP
RootAccessible::HandleEvent(Event* aDOMEvent)
{
MOZ_ASSERT(aDOMEvent);
Event* event = aDOMEvent->InternalDOMEvent();
nsCOMPtr<nsINode> origTargetNode = do_QueryInterface(event->GetOriginalTarget());
nsCOMPtr<nsINode> origTargetNode = do_QueryInterface(aDOMEvent->GetOriginalTarget());
if (!origTargetNode)
return NS_OK;
@ -253,7 +252,7 @@ RootAccessible::HandleEvent(Event* aDOMEvent)
// Root accessible exists longer than any of its descendant documents so
// that we are guaranteed notification is processed before root accessible
// is destroyed.
document->HandleNotification<RootAccessible, nsIDOMEvent>
document->HandleNotification<RootAccessible, Event>
(this, &RootAccessible::ProcessDOMEvent, aDOMEvent);
}
@ -262,11 +261,11 @@ RootAccessible::HandleEvent(Event* aDOMEvent)
// RootAccessible protected
void
RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
RootAccessible::ProcessDOMEvent(Event* aDOMEvent)
{
MOZ_ASSERT(aDOMEvent);
Event* event = aDOMEvent->InternalDOMEvent();
nsCOMPtr<nsINode> origTargetNode = do_QueryInterface(event->GetOriginalTarget());
nsCOMPtr<nsINode> origTargetNode =
do_QueryInterface(aDOMEvent->GetOriginalTarget());
nsAutoString eventType;
aDOMEvent->GetType(eventType);
@ -652,11 +651,11 @@ RootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
#ifdef MOZ_XUL
static void
GetPropertyBagFromEvent(nsIDOMEvent* aEvent, nsIPropertyBag2** aPropertyBag)
GetPropertyBagFromEvent(Event* aEvent, nsIPropertyBag2** aPropertyBag)
{
*aPropertyBag = nullptr;
CustomEvent* customEvent = aEvent->InternalDOMEvent()->AsCustomEvent();
CustomEvent* customEvent = aEvent->AsCustomEvent();
if (!customEvent)
return;
@ -682,7 +681,7 @@ GetPropertyBagFromEvent(nsIDOMEvent* aEvent, nsIPropertyBag2** aPropertyBag)
}
void
RootAccessible::HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
RootAccessible::HandleTreeRowCountChangedEvent(Event* aEvent,
XULTreeAccessible* aAccessible)
{
nsCOMPtr<nsIPropertyBag2> propBag;
@ -704,7 +703,7 @@ RootAccessible::HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
}
void
RootAccessible::HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
RootAccessible::HandleTreeInvalidatedEvent(Event* aEvent,
XULTreeAccessible* aAccessible)
{
nsCOMPtr<nsIPropertyBag2> propBag;

View File

@ -58,7 +58,7 @@ protected:
/**
* Process the DOM event.
*/
void ProcessDOMEvent(nsIDOMEvent* aEvent);
void ProcessDOMEvent(dom::Event* aEvent);
/**
* Process "popupshown" event. Used by HandleEvent().
@ -71,10 +71,10 @@ protected:
void HandlePopupHidingEvent(nsINode* aNode);
#ifdef MOZ_XUL
void HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
XULTreeAccessible* aAccessible);
void HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
XULTreeAccessible* aAccessible);
void HandleTreeRowCountChangedEvent(dom::Event* aEvent,
XULTreeAccessible* aAccessible);
void HandleTreeInvalidatedEvent(dom::Event* aEvent,
XULTreeAccessible* aAccessible);
uint32_t GetChromeFlags();
#endif