Add a ::DispatchUntrustedEvent and ::DispatchEvent to nsContentUtils

RESOLVED FIXED in mozilla13

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: mounir, Assigned: mjschranz)

Tracking

Trunk
mozilla13
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [mentor=volkmar][lang=c++])

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
nsContentUtils allows us to dispatch a trusted event with ::DispatchTrustedEvent() but doesn't help to dispatch an untrusted event. We want to create a ::DispatchUntrustedEvent() and a ::DispatchEvent() functions. Both Untrusted and Trusted function would call the ::DispatchEvent() one with a different aTrusted parameter.
We can make ::DispatchEvent() method private to nsContentUtils or not.

Doing this will require adding a aTrusted boolean parameter to GetEventAndTarget which is private to nsContentUtils.cpp AFAICT.
(Reporter)

Comment 1

5 years ago
(In reply to Mounir Lamouri (:volkmar) (:mounir) from comment #0)
> Doing this will require adding a aTrusted boolean parameter to
> GetEventAndTarget which is private to nsContentUtils.cpp AFAICT.

To be exact:
content/base/src/nsContentUtils.cpp
(Assignee)

Comment 2

5 years ago
Looking to do something more challenging now for my third set of tickets and this one is definitely interesting so I'm going to pick this up if no one objects.
Status: NEW → ASSIGNED
(Assignee)

Updated

5 years ago
Assignee: nobody → schranz.m
(Assignee)

Comment 3

5 years ago
Created attachment 591358 [details] [diff] [review]
Implementation with no tests

As far as I can tell this covers the bug's requirements. Set it for feedback because I'm assuming some tests for DispatchUntrustedEvent are needed.
Attachment #591358 - Flags: feedback?(mounir)
(Reporter)

Comment 4

5 years ago
Comment on attachment 591358 [details] [diff] [review]
Implementation with no tests

Review of attachment 591358 [details] [diff] [review]:
-----------------------------------------------------------------

Seems good. Do you have try access?
Attachment #591358 - Flags: feedback?(mounir) → review+
(Reporter)

Comment 5

5 years ago
(In reply to Matthew Schranz [:mjschranz] from comment #3)
> Created attachment 591358 [details] [diff] [review]
> Implementation with no tests
> 
> As far as I can tell this covers the bug's requirements. Set it for feedback
> because I'm assuming some tests for DispatchUntrustedEvent are needed.

No tests are required here: callers will have to write tests to make sure the behavior they are looking for is ok.
(Assignee)

Comment 6

5 years ago
(In reply to Mounir Lamouri (:volkmar) (:mounir) from comment #4)
> Comment on attachment 591358 [details] [diff] [review]
> Implementation with no tests
> 
> Review of attachment 591358 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Seems good. Do you have try access?

That I do not. Been meaning to start the process for that.
(Assignee)

Comment 7

5 years ago
Man have I disregarded this for much longer than I should have. Either way I was granted level 1 try server access today so I'll get this patch up on there in a bit.
(Assignee)

Comment 8

5 years ago
Obviously not finished yet, but here is a link to my build on the try server.

https://tbpl.mozilla.org/?tree=Try&rev=bfd739d2f726
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
(Reporter)

Comment 9

5 years ago
Comment on attachment 591358 [details] [diff] [review]
Implementation with no tests

Pushed to inbound. Thank you for the patch :)
Attachment #591358 - Flags: checkin+
(Reporter)

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/d316d6781d6e
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.