Last Comment Bug 718274 - Add a ::DispatchUntrustedEvent and ::DispatchEvent to nsContentUtils
: Add a ::DispatchUntrustedEvent and ::DispatchEvent to nsContentUtils
Status: RESOLVED FIXED
[mentor=volkmar][lang=c++]
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla13
Assigned To: Matthew Schranz [:mjschranz]
:
Mentors:
Depends on:
Blocks: 627726
  Show dependency treegraph
 
Reported: 2012-01-15 03:28 PST by Mounir Lamouri (:mounir)
Modified: 2012-02-14 02:34 PST (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Implementation with no tests (7.41 KB, patch)
2012-01-24 20:03 PST, Matthew Schranz [:mjschranz]
mounir: review+
mounir: checkin+
Details | Diff | Review

Description Mounir Lamouri (:mounir) 2012-01-15 03:28:34 PST
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.
Comment 1 Mounir Lamouri (:mounir) 2012-01-21 07:04:36 PST
(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
Comment 2 Matthew Schranz [:mjschranz] 2012-01-23 07:52:47 PST
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.
Comment 3 Matthew Schranz [:mjschranz] 2012-01-24 20:03:04 PST
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.
Comment 4 Mounir Lamouri (:mounir) 2012-01-25 00:56:21 PST
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?
Comment 5 Mounir Lamouri (:mounir) 2012-01-25 00:57:38 PST
(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.
Comment 6 Matthew Schranz [:mjschranz] 2012-01-25 08:31:56 PST
(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.
Comment 7 Matthew Schranz [:mjschranz] 2012-02-09 11:12:19 PST
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.
Comment 8 Matthew Schranz [:mjschranz] 2012-02-09 12:17:06 PST
Obviously not finished yet, but here is a link to my build on the try server.

https://tbpl.mozilla.org/?tree=Try&rev=bfd739d2f726
Comment 9 Mounir Lamouri (:mounir) 2012-02-13 15:07:51 PST
Comment on attachment 591358 [details] [diff] [review]
Implementation with no tests

Pushed to inbound. Thank you for the patch :)
Comment 10 Marco Bonardo [::mak] 2012-02-14 02:34:27 PST
https://hg.mozilla.org/mozilla-central/rev/d316d6781d6e

Note You need to log in before you can comment on or make changes to this bug.