XBL Replacement Newsletter 4
This is the fourth edition of the XBL Replacement Newsletter. Since the last update we've continued to remove bindings and have been making progress on accessibility, autocomplete widgets, and migrating XBL to JS. The easiest way to follow along with this work is to watch the main meta bug.
Accessibility No Longer Relies on XBL
We moved all of the remaining [role]
attributes out of XBL and into the accessibility platform code. This work can be seen in Bug 1428930 and blockers. This is a big milestone since we will now be able to migrate any binding to a Custom Element and maintain accessibility. Also, we were able to delete the XBL accessibility platform integration and eliminate a few more bindings that were only used to attach roles to elements.
Autocomplete and Trees
We used to have two separate implementations of the "autocomplete" popup, which is used for combo boxes and for text input fields with an attached drop-down. The older implementation was based on the <tree>
element, and in the past few years we've been replacing more and more of its uses with the new implementation based on the <richlistbox>
element, to overcome the styling and layout limitations of <tree>
.
It turned out that the separate search bar in the toolbar was the only instance that still depended on the intricacies of the <tree>
version, and once that was fixed we could convert all the other autocomplete popups to use the <richlistbox>
version, and remove the bindings that implemented a customized <tree>
for this use case.
Tabbrowser XBL to JS Migration
Our largest binding (tabbrowser) was translated into a JS class using the converter script plus manual fixups. Thanks to the reviewers in that bug for sticking with it, and to Potch for upgrading his xmlom package to include XML comments. I’m hoping this same approach can apply to other large bindings, like <browser>
.
Binding Removals
There are 215 more bindings left, compared to 240 from the last update and 300 from the start of the project. Here are the list of changes:
- Dão Gottwald removed the
windowdragbox
binding by initializing theWindowDraggingUtils
on the titlebar in browser.js instead. - Dão also removed the
tabbrowser
binding, after I converted the implementation into a JS class (above). - Neil Deakin removed the unused
menubutton-item
binding. - Paolo Amadini removed the
autocomplete-result-popup
,autocomplete-base-popup
,autocomplete-tree
,autocomplete-treebody
,autocomplete-treerows
bindings. - Paolo continued his panel simplification work by removing the
panelmultiview
binding. - Students from the Canberra Grammar School school stopped by the Mozilla office and made their first contributions to Firefox by removing the
menulist-description
andmenu-vertical
bindings. - Tim Nguyen (ntim) removed unused functions from
textbox[type=number]
and then simplified it to rely on<html:input type="number">
instead. - ntim also removed the
feed
binding by building DOM using JS instead. - Tim Guan-tin Chien (timdream) removed the
toolbox
binding, which triggered some strange XBL construction behavior that highlighted some of the subtleties with how XBL bindings get attached. This led us to temporarily re-attach an empty binding to the element while we made progress on the tabbrowser work. - timdream also removed the
colorpickertile
binding by moving the accessibility role into platform code. - timdream also removed the unused
menuitem-iconic-desc-noaccel
binding, as well as the unusedlistitem-checkbox-iconic
andlistitem-checkbox-iconic
bindings. - I started to chip away at the in-content scrollbar binding, by the removing the
thumb
andscrollbar-base
bindings. This means that we don’t need to run JS in the content process when someone clicks on the scrollbar, which saves a bit of memory. - I removed the
root-element
binding which was attached to all:root
nodes by setting up lightweight themes in browser.js.