Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 804e4f9

Browse files
committed
Bug 731746 part 1. Add a constructor on nsDOMEventTargetHelper that takes a window, for use by JS-implemented event targets. r=smaug
1 parent 02768f4 commit 804e4f9

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

content/events/src/nsDOMEventTargetHelper.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,21 @@ class nsDOMEvent;
2525
class nsDOMEventTargetHelper : public mozilla::dom::EventTarget
2626
{
2727
public:
28-
nsDOMEventTargetHelper() : mParentObject(nullptr), mOwnerWindow(nullptr), mHasOrHasHadOwnerWindow(false) {}
28+
nsDOMEventTargetHelper()
29+
: mParentObject(nullptr)
30+
, mOwnerWindow(nullptr)
31+
, mHasOrHasHadOwnerWindow(false)
32+
{}
33+
nsDOMEventTargetHelper(nsPIDOMWindow* aWindow)
34+
: mParentObject(nullptr)
35+
, mOwnerWindow(nullptr)
36+
, mHasOrHasHadOwnerWindow(false)
37+
{
38+
BindToOwner(aWindow);
39+
// All objects coming through here are WebIDL objects
40+
SetIsDOMBinding();
41+
}
42+
2943
virtual ~nsDOMEventTargetHelper();
3044
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
3145
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsDOMEventTargetHelper)

0 commit comments

Comments
 (0)