Closed
Bug 481688
Opened 16 years ago
Closed 16 years ago
[FIX]Stop firing DOMLinkAdded/Removed events to content listeners
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bzbarsky, Assigned: bzbarsky)
Details
Attachments
(1 file)
15.50 KB,
patch
|
smaug
:
review+
smaug
:
superreview+
|
Details | Diff | Splinter Review |
We have these DOMLinkAdded/Removed events that we fire on <link> elements... Unfortunately, we fire them in ways content can see, while stomping on the DOM namespace and all. Not much we can do about the latter now, I think, but we should fix the former.
Comment 1•16 years ago
|
||
So we want to fire the events to chrome event handler, but using <link>
as the target.
![]() |
Assignee | |
Comment 2•16 years ago
|
||
Assignee: nobody → bzbarsky
Attachment #365707 -
Flags: superreview?(Olli.Pettay)
Attachment #365707 -
Flags: review?(Olli.Pettay)
Comment 3•16 years ago
|
||
Comment on attachment 365707 [details] [diff] [review]
Indeed, like so
> nsEventStatus status = nsEventStatus_eIgnore;
> rv = aDoc->GetWindow()->GetChromeEventHandler()->DispatchDOMEvent(nsnull,
> event,
> nsnull,
> &status);
Some null checks needed here, especially now that this may get called async.
https://bugzilla.mozilla.org/show_bug.cgi?id=462856#c27
>+ nsCOMPtr<nsINode> node(do_QueryInterface(elt));
>+ NS_ENSURE_TRUE(node, NS_ERROR_UNEXPECTED);
Nit, NS_ENSURE_STATE(node);
r+sr=me, with null checks. I guess those are needed on branch too,
so perhaps a separate bug which blocks this one and this could land after
that one.
Attachment #365707 -
Flags: superreview?(Olli.Pettay)
Attachment #365707 -
Flags: superreview+
Attachment #365707 -
Flags: review?(Olli.Pettay)
Attachment #365707 -
Flags: review+
Comment 4•16 years ago
|
||
Comment on attachment 365707 [details] [diff] [review]
Indeed, like so
>+ NS_ASSERTION(aDoc, "GetEventAndTarget lied?");
> NS_ENSURE_ARG_POINTER(aDoc->GetWindow());
> NS_ENSURE_ARG_POINTER(aDoc->GetWindow()->GetChromeEventHandler());
...
> rv = aDoc->GetWindow()->GetChromeEventHandler()->DispatchDOMEvent(nsnull,
> event,
> nsnull,
> &status);
Bah, null checks are there.
![]() |
Assignee | |
Updated•16 years ago
|
Status: NEW → ASSIGNED
Summary: Stop firing DOMLinkAdded/Removed events to content listeners → [FIX]Stop firing DOMLinkAdded/Removed events to content listeners
![]() |
Assignee | |
Comment 5•16 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
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
•