Closed
Bug 1313762
Opened 8 years ago
Closed 8 years ago
SharedWorker::PreHandleEvent doesn't deal with widget events
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: smaug, Assigned: baku)
References
Details
Attachments
(1 file)
1.07 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
The method queues[1] only DOMEvents, but what if DOMEvent hasn't been created yet and there is just WidgetEvent? We do nothing with those in case the worker is frozen.
I guess we should explicitly create DOMEvent and queue that, something similar to
http://searchfox.org/mozilla-central/rev/445097654c1cc1098ee0171a29c439afe363a588/dom/events/EventListenerManager.cpp#1231-1237
[1] http://searchfox.org/mozilla-central/rev/445097654c1cc1098ee0171a29c439afe363a588/dom/workers/SharedWorker.cpp#187
Reporter | ||
Comment 1•8 years ago
|
||
(it is possible that we don't currently dispatch WidgetEvents without DOMEvent in workers)
Assignee | ||
Comment 2•8 years ago
|
||
We just dispatch DOMEvents in workers.
Reporter | ||
Comment 3•8 years ago
|
||
by accident. I don't anything guaranteeing that. And dispatching widget events should be just fine.
Updated•8 years ago
|
Priority: -- → P3
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → amarchesini
Assignee | ||
Comment 4•8 years ago
|
||
Attachment #8809745 -
Flags: review?(bugs)
Reporter | ||
Comment 5•8 years ago
|
||
Comment on attachment 8809745 [details] [diff] [review]
event2.patch
> nsresult
> SharedWorker::PreHandleEvent(EventChainPreVisitor& aVisitor)
> {
> AssertIsOnMainThread();
>
>- nsIDOMEvent*& event = aVisitor.mDOMEvent;
>+ nsCOMPtr<nsIDOMEvent> event = aVisitor.mDOMEvent;
>+ if (!event) {
>+ nsCOMPtr<EventTarget> et =
>+ do_QueryInterface(aVisitor.mEvent->mOriginalTarget);
Useless QI. mOriginalTarget is nsCOMPtr<dom::EventTarget>.
>+ event = EventDispatcher::CreateEvent(et, aVisitor.mPresContext,
>+ aVisitor.mEvent, EmptyString());
>+ }
You don't want to create the event all the time. Only when we're frozen.
So, move the new code inside 'if (IsFrozen())' check.
Those fixed, r+
Attachment #8809745 -
Flags: review?(bugs) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3f11622c5a78
SharedWorker::PreHandleEvent must be able to deal with widget events, r=smaug
Comment 7•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•