47 bytes, text/x-phabricator-request
|Details | Review|
This appears to be only called in one place: https://searchfox.org/mozilla-central/rev/3fdc51e66c9487b39220ad58dcee275fca070ccd/browser/base/content/browser.js#8049. There are two insertion points, but I think only the [includes="row"] is used: https://searchfox.org/mozilla-central/rev/3fdc51e66c9487b39220ad58dcee275fca070ccd/toolkit/components/prompts/content/tabprompts.xml. A couple notes: - If running this through the converter script, be aware that there are some #ifdefs that will be dropped and will need to be re-added with AppConstants check. - The attributes on xbl:content get copied onto the host node - It looks like there's some cleanup that could be done in the <constructor>, around the lookup of child nodes in `this.ui`. Could happen here or in a follow up.
I am working on getting it converted to a JSM and have the caller pass around the JSM class instead of the element reference. The call path is quite messy but let's hope our test coverage is reliable.
Assignee: nobody → timdream
Status: NEW → ASSIGNED
(In reply to Tim Guan-tin Chien [:timdream] (please needinfo) from comment #2) > https://treeherder.mozilla.org/#/ > jobs?repo=try&revision=e560bd5c8313954754c06466166d259d587582fa So ... this kind of work except it is not easy for tests to get to the instances of the newly created class. I will need to investigate more about this or switch to custom element.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=23acf569e0efc2d78ed39d2dc9422869cdc56ab9 I've not fixed all the tests yet.
What I found it extremely weird is that when the tabprompt binding is forced attached with https://searchfox.org/mozilla-central/rev/8a135a9c5a96b59269f544fcaee76d8fd5a7026a/browser/base/content/browser.js#8032 the children binding seems to be all force attached too, even when many of them are set to hidden=true in the markup (or under a parent that is hidden). I don't think I can duplicate that with my setup...
This converts the tabmodalprompt binding to a class, to be constructed along side with the element by TabModalPromptBox. TabModalPromptBox will keep the instances in a map and pass it to the callers, instead of the element. The tests and callers can access the class instance by passing the element reference to the map.
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/92f9e0296e62 Convert tabmodalprompt binding to JSM module r=Gijs
Summary: Convert tabmodalprompt to a Custom Element or JS module → Convert tabmodalprompt to a JS module
3 months ago
Flags: needinfo?(timdream) → needinfo?(gijskruitbosch+bugs)
You need to log in before you can comment on or make changes to this bug.