Restore the menulist binding after its removal in bug 1518932
Categories
(Thunderbird :: General, enhancement)
Tracking
(Not tracked)
People
(Reporter: Paenglab, Assigned: Paenglab)
References
Details
Attachments
(4 files, 1 obsolete file)
16.46 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
7.84 KB,
patch
|
darktrojan
:
review+
|
Details | Diff | Splinter Review |
1.13 KB,
patch
|
Details | Diff | Splinter Review | |
2.06 KB,
patch
|
darktrojan
:
review+
|
Details | Diff | Splinter Review |
Bug 1518932 removes the menulist binding by moving to custom elements.
We still extend this binding for editable menulists and some other bindings.
Assignee | ||
Comment 1•6 years ago
|
||
Only one review needed.
This should work. Normal menulists use the m-c custom elements menulists and the ones that extends the menulist use now the to us moved binding.
Bug 1518932 is in autoland and cam merge to m-c in one of the next merges.
Comment 2•6 years ago
|
||
Hmm, for richlistbox our clone was called xbl-richlistbox. Shouldn't we do this here, too?
Assignee | ||
Comment 3•6 years ago
|
||
I'd say no, because we don't use normal menulists with our binding but only extend other bindings with the menulist binding.
Comment 4•6 years ago
|
||
Doing this on top of autoland is very easy:
https://hg.mozilla.org/try-comm-central/rev/54dbcecb8cae9ed00d36c01eb4bb5f847d6148a1#l1.14
BTW, I've included more stuff in the push, so if it breaks, it may be not you fault.
Updated•6 years ago
|
Comment 5•6 years ago
|
||
Comment 6•6 years ago
|
||
But winning doesn't mean being right :-(
The try looks a bit terrible, looks like editable menu lists broke, since attachment reminder tests fail now.
I assume the forking of the XBL menulist is a temporary solution.
Can we convert the editable menulist part to a Custom element that extends the m-c menulist?
For the test breakage:
E.g. test-message-filters.js::test_address_books_appear_in_message_filter_dropdown fails with
JavaScript error: chrome://messenger/content/addressbook/addrbookWidgets.xml, line 106: TypeError: menulist.appendItem is not a function
JavaScript error: chrome://messenger/content/searchWidgets.xml, line 105: TypeError: menupopup is undefined
Maybe at https://searchfox.org/comm-central/source/mailnews/base/search/content/searchWidgets.xml#89 we can't get the menulist as custom elements do not have anonymous elements?
I assume some of our menulists are custom elements now, only some (that extend it) are based on the XBL copy you make in the patch.
Comment 8•6 years ago
|
||
(In reply to :aceman from comment #7)
I assume the forking of the XBL menulist is a temporary solution.
Can we convert the editable menulist part to a Custom element that extends
the m-c menulist?
That's the idea yes.
I assume some of our menulists are custom elements now, only some (that
extend it) are based on the XBL copy you make in the patch.
Yes, with this patch our special menulists would still be xbl, and the normal ones CEs.
Comment 9•6 years ago
|
||
Can we do another try with a patch that renames the binding to xbl-menulist. I'd like to see whether it fixes any of the current bustage.
Comment 10•6 years ago
|
||
Richard send me a patch that uses xbl-menulist in a PM. Here's a try:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=bad9b9ec9a804d4a06e753642c5afb76f9768944
Hmm, I've never posted the comment, so the result is that the number of test failures is reduced significantly. This patch won't do any harm, so in it goes.
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
OK, looking at the current test failures, at least these are related to the menu lists:
mozmill/folder-widget/test-message-filters.js
![]() |
||
Comment 13•6 years ago
|
||
This should fix mozmill/folder-widget/test-message-filters.js where the menulists were broken.
I learned a new thing:
We need to call customElements.upgrade(element) if we have an element that is a custom element inside our XBL binding. Then the CE is constructed first and then our code runs. Otherwise it is the other way round and our code can't find any of the methods of the custom element.
See bug https://bugzilla.mozilla.org/show_bug.cgi?id=1470242 .
m-c decided to not fix this automatically and so we need to call it explicitly. It may become unneeded when converting everything to custom elements.
This call may be helpful in the preferences fixes or other places where we had these races of XBL and CE.
![]() |
||
Comment 14•6 years ago
|
||
Please fix the eslint problem 'mail/base/content/mailWidgets.xml:1461:15 | 'item' is not defined. (no-undef)' when landing the patch :)
Updated•6 years ago
|
Comment 15•6 years ago
|
||
Comment 16•6 years ago
|
||
Filed those two bugs to fix up the menulists I've just butchered.
Comment 17•6 years ago
|
||
I think we're done here. I'll file a bug for the removal of xbl-menulist.
![]() |
||
Comment 18•6 years ago
|
||
Guys, has anybody tested this in the account wizard? It seems totally not working for me (linux).
Also, renaming the element to xbl-element looses all css as the rules still reference menulist (in m-c) and menulist[editable="true"] (in c-c) and not xbl-menulist[editable="true"].
I'll look at it.
Assignee | ||
Comment 19•6 years ago
|
||
I'm adding the styles for xbl-menulists in bug 1524457.
![]() |
||
Comment 20•6 years ago
|
||
But why is it needed? Why can't we keep <menulist> and get the m-c styles?
Comment 21•6 years ago
|
||
(In reply to :aceman from comment #18)
Guys, has anybody tested this in the account wizard? It seems totally not working for me (linux).
Why test it when tests are green ;-) - But seriously, we can't test every of the 20.001 functions manually.
Assignee | ||
Comment 22•6 years ago
|
||
(In reply to :aceman from comment #20)
But why is it needed? Why can't we keep <menulist> and get the m-c styles?
Look at the msgIdentity in composer and switch to edit mode. Then you see that both bindings are active. With my patch in bug 1524457 the CE part is hidden. This is only a workaround until editable menulists are moved to CE.
Comment 23•6 years ago
|
||
(In reply to :aceman from comment #20)
But why is it needed? Why can't we keep <menulist> and get the m-c styles?
Good question, this landed as bustage-fix, you'd have to ask Geoff.
![]() |
||
Comment 24•6 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #21)
But seriously, we can't test every of the 20.001 functions manually.
Sure, but there could be some expectation to test the widgets that are specifically touched by a patch :)
Otherwise why only emailWizard was changed and not composer identity picker and also not the editable menulists in editor?
Comment 25•6 years ago
|
||
I did test the widgets and I know they are broken, that's why we have bug 1524457, which Richard is now fixing. Probably the ones in editor need to be xbl-menulist too, but since they have no tests I didn't notice them at the time.
Assignee | ||
Comment 26•6 years ago
|
||
With xbl-menulists the menulist-popups don't work.
Comment 27•6 years ago
|
||
Changes the editor menulists to xbl-menulist. At least they're all broken the same way now.
Comment 28•6 years ago
|
||
Meaning that popups won't work? Advanced edit shows the content twice, but at least something works.
![]() |
||
Comment 29•6 years ago
|
||
And why isn't the #msgIdentity a xbl-menulist? Yes, it isn't an editable menulist initially, but do we really want it to switch from CE to XBL menulist when it gets the 'editable' attribute?
Anyway, to fix this properly we would have to copy all css rules in m-c for 'menulist' to 'xbl-menulist'.
Maybe should just do bug 1524457 before introducing that css fork.
![]() |
||
Comment 30•6 years ago
|
||
Anyway, I think we need this in our binding, as the <moz-input-box> and <dropmarker> are custom elements now.
Comment 31•6 years ago
|
||
What's the benefit? Does it make anything work?
Comment 32•6 years ago
|
||
Why is attachment #9040848 [details] [diff] [review] worth having? Doesn't it turn "ugly" into "non-working"?
Updated•6 years ago
|
Comment 33•6 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #32)
Why is attachment #9040848 [details] [diff] [review] worth having? Doesn't it turn "ugly" into "non-working"?
I had been under the impression that making CE menulist editable was both ugly and non-working - but apparently that wasn't the case. I made this patch so that when I fixed the non-working XBL menulist (which I intended to do, and in fact have a patch for), it would fix all of them at once. But that's not needed.
![]() |
||
Comment 34•6 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #31)
What's the benefit? Does it make anything work?
It should be more correct even without fixing any immediate bug. You can't access properties of a CE before it is initialized (upgraded). A XBL binding extending a CE may want to access its properties, as we have seen in other bugs.
![]() |
||
Comment 35•6 years ago
|
||
Opening the Advanced pane in Preferences produces:
ReferenceError: reference to undefined property "mSelectedInternal" in menulist.js:253:5
Assignee | ||
Comment 36•6 years ago
|
||
In composer, the new "To:" menulist in the next row gets double content after entering an address and press enter.
Comment 37•6 years ago
|
||
![]() |
||
Comment 38•6 years ago
|
||
Magnus noticed the "searchvalue" now has 2 constructors after my patch. My constructor on top actually didn't run so it didn't show my code was bad. Kill the surplus constructor and move the customElements.upgrade() after we fill in the menuitem labels otherwise the menulist ends up with blank items.
Comment 39•6 years ago
|
||
Updated•6 years ago
|
Comment 40•6 years ago
|
||
Description
•