XUL/XBL Replacement Newsletter 13
This is the thirteenth edition of the XUL/XBL Replacement Newsletter. Since the last edition, we’ve gotten close to shipping the main browser window as an HTML document, made some platform improvements related to ongoing frontend work, and continued to remove XBL bindings.
Progress towards browser.xhtml
We’ve gotten close to shipping the main browser window as XHTML instead of XUL. In addition to the broader top-level HTML support which is now complete, we filed a new metabug specifically for shipping browser.xhtml.
The biggest piece of work here was Brendan Dahl adding prototype cache support to XHTML documents. With this change we are seeing equivalent performance between browser.xul and browser.xhtml.
As part of that project, he also added <html:template>
support to documents loaded with the prototype cache. This is a nice change to bring our chrome UI more in line with the Web platform and gives us a more standard way to lazify DOM creation (there’s a metabug to do so).
The final steps before enabling browser.xhtml are fixing some assertions (1, 2) that surfaced due to nsHTMLDocument being a DOM proxy and XULDocument not being a proxy. Once those are resolved we plan to flip the switch to enable browser.xhtml by default.
Platform improvements
I wanted to mention some platform improvements and code removal related to these projects, and acknowledge the people who've worked on them. These are mostly changes that were unblocked by removing in-content XBL and XBL stylesheets, and fixes for bugs we've discovered from dogfooding Web Components in the browser chrome.
- Boris Zbarsky removed the content XBL scope in XPCWrappedNativeScope and nsXBLBinding::mUsingContentXBLScope. There’s more related work to do filed in the “Blocks” field on XBL in-content metabug.
- Emilio Cobos Álvarez removed style support for XBL
<resources>
after debugging the last piece of UI that relied on some quirky XBL-specific style behavior. - In the process of working on the
<menuitem>
Custom Element conversion, we discovered a bug where Custom Elements wouldn't get attached, and Emilio landed a fix for it. - In the process of working on the
<wizard>
Custom Element conversion, we discovered a bug where focus navigation was broken in Shadow DOM, and Emilio landed a fix for it. - Emilio unshipped the
-moz-binding
CSS property from content. - Mats Palmgren removed an unnecessary
print
CSS rule in the HTML UA sheet that was related to the old XBL<marquee>
. - I landed a change to stop getting the computed style in
Element::WrapObject
in the content process, since it was only needed to check if a XBL binding had to be atttached.
Binding Removals
There are 44 bindings left, compared to 55 from the last update and 300 from the start of the project. Here’s a list of changes:
- Alex Surkov converted the
wizard-buttons
binding to a Custom Element. - Alex removed the
wizard-header
binding by creating the relevant DOM directly within<wizard>
. - Andrew Swan removed
toolbarbutton-badged-menu
andtoolbarbutton-badged-menu
, which were unnecessary ever since[display="xul:menu"]
was removed. - I converted the
<menu>
element to a Custom Element, which removed themenu-base
,menu
,menu-menubar
,menu-menubar-iconic
, andmenu-iconic
bindings. - I converted the
radio
binding to a Custom Element. - I removed the
tabbrowser-arrowscrollbox
binding by attaching the relevant events inside of the parenttabbrowser-tabs
element. This change also allowed us to stop loading the tab-overflow-indicator.png image at startup.