Closed Bug 1482170 Opened 6 years ago Closed 6 years ago

Don't expose <Add/Remove>BroadcastListenerFor on XULDocument

Categories

(Core :: XUL, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: bdahl, Assigned: bdahl)

References

Details

Attachments

(1 file)

These methods are only ever used in tests and can be removed from webidl.
These methods are only ever used in tests and no longer need to be exposed.
In test_bug445177.xul I tried to preserve more of the test, but everything
after the call to addBroadcastListenerFor is dependent on that.

MozReview-Commit-ID: C4vAxNir4O8
Attachment #8998896 - Flags: review?(bzbarsky)
Priority: -- → P3
Also, if we're fine with removing this, I'll file some comm central bugs to let them know it's going away and they can switch to just creating an <observes> elements instead.
Component: DOM → XUL
Comment on attachment 8998896 [details] [diff] [review]
Remove <Add/Remove>BroadcastListenerFor on XULDocument webidl.

Looks like maybe we can kill off XULDocument soon....

>-    // WebIDL API

AddBroadcastListenerFor can stop being public.

Can we rejigger the test in terms of an actual element with "observes" or <observes> element?  Or is that all already tested?
Attachment #8998896 - Flags: review?(bzbarsky) → review+
(In reply to Boris Zbarsky [:bzbarsky, bz on IRC] (no decent commit message means r-) from comment #3)
> Can we rejigger the test in terms of an actual element with "observes" or
> <observes> element?  Or is that all already tested?

I played a bit with this, but using an <observes> element is not a direct replacement since there is slightly different behavior between it and using the JS API. If addBroadcastListenerFor is used and the element is removed from the document, it still receives updates, whereas if you use an <observe> element and the element is removed you no longer receive updates. I'm unsure if this is by design as there's no documentation on AddBroadcastListenerFor.

It also seems to me the last part of the test is not really doing what it thinks it is doing as it never calls removeBroadcastListenerFor before it adds the "observe" attribute back. I suppose it could be testing having two observers on one element?

There are a few other tests for the <observe> element, but it doesn't look like any of them test removal and attribute syncing. Would you like me to test that?
Flags: needinfo?(bzbarsky)
I wouldn't worry about it.
Flags: needinfo?(bzbarsky)
Pushed by bdahl@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/009728482717
Remove <Add/Remove>BroadcastListenerFor on XULDocument webidl. r=bz
https://hg.mozilla.org/mozilla-central/rev/009728482717
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: