mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 09:18:42 +09:00
Issue #1792 - Part 4: Implement constructors for the EventTarget interface.
This commit is contained in:
parent
6e0c05056b
commit
467e117fd9
4 changed files with 19 additions and 2 deletions
|
|
@ -7,11 +7,26 @@
|
|||
#include "mozilla/dom/Event.h"
|
||||
#include "mozilla/dom/EventTarget.h"
|
||||
#include "mozilla/dom/EventTargetBinding.h"
|
||||
#include "mozilla/dom/ConstructibleEventTarget.h"
|
||||
#include "nsIGlobalObject.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
/* static */
|
||||
already_AddRefed<EventTarget>
|
||||
EventTarget::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
|
||||
if (!global) {
|
||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
return nullptr;
|
||||
}
|
||||
RefPtr<EventTarget> target = new ConstructibleEventTarget(global);
|
||||
return target.forget();
|
||||
}
|
||||
|
||||
void
|
||||
EventTarget::RemoveEventListener(const nsAString& aType,
|
||||
EventListener* aListener,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue