This is the third edition of the XBL Replacement Newsletter. Since the last update, we’ve removed 27 bindings and have been preparing to migrate bindings to Custom Elements.
Just a reminder that easiest way to follow along with the work is to follow the main meta bug. If you’d like to help, we are tagging bugs that are unblocked and ready to be worked on with xbl-available.
Custom Elements have been enabled in Nightly by default, which is a big step towards being able to use them in the browser chrome. Mossop has landed initial Custom Element support for XUL elements, and we have a couple of follow-ups on file before we can start using them. We are also working to find the best way to include Custom Element scripts (bug 1411707) and styles (bug 1420229) in XUL documents.
One of the features that XBL provides is a way to assign a ‘role’ to
elements that have a particular binding attached. For example: <binding id="toolbar" role="xul:toolbar"> will attach the XULToolbarAccessible class to all toolbar elements with that binding attached.
We needed to come up with a new solution to continue supporting the accessibility roles, and initial work for that landed in bug 1403231 when we removed the image binding. This created a new XULMap.h
file in which tag names get mapped to roles. The current implementation
won’t handle every case, like when bindings are attached using more
complex CSS selectors, but Paolo has done a thorough analysis of which bindings we can migrate right away.
There are 240 more bindings left, down from 300 at the start of the project. We’ve also started to put a dent in the number of lines of code, passing below 90%. Here’s a list of the changes:
preferences, preference, prefwindow, prefpane, and panebutton bindings from about:preferences, migrating them to vanilla JS and validating the JS module approach to removing certain types of bindings.addengine-icon binding in the search popup, which in turn allowed the button to reuse the existing ‘add’ SVG icon instead of custom PNG versions.panelview binding, creating the equivalent markup inside the existing PanelMultiView.jsm navigation functions.button-image binding.expander binding and associated UA styles.optionsDialog binding, which enabled the removal of dialogheader.dialogheader binding, after the only consumer optionsDialog was removed.timed-textbox binding, since textbox[type=timed] is unused.tabbrowser-close-tab-button binding by moving its implementation into the tabbrowser-tab binding.toolbarbutton-image binding and landed a nice cleanup to the tab markup in the process, using a plain <image> instead.stringbundleset binding, which wasn’t really doing anything.statusbar and statusbarpanel bindings, moving the accessibility role into XULMap.h.