Neil's Place

Archive for August, 2008

A small feature update

Saturday, August 16th, 2008

Just thought I’d mention some of the new XUL features that will appear in the next version of Firefox.

Dão added support for a search textbox which may be used via <textbox type=”search”>. It includes search and clear buttons and may be used in one of two modes. The default mode searches when the field is modified and functions similar to the search field in the Firefox bookmarks organizer. If the ’searchbutton’ attribute is set to true, then the search is only performed when the search button or Enter is pressed. This latter mode would be used for the search field in the Addons dialog where searching is a longer process as it searches the remote addons site. The corresponding bug is 388811.

In bug 111034, I added support for the clientLeft, clientTop, clientWidth, clientHeight, scrollLeft, scrollTop, scrollWidth, scrollHeight properties for all elements. For XUL, this means that you can retrieve and modify the scroll position of any scrollable element without having to use a <scrollbox>.

In addition, ‘width’ and ‘height’ properties were added to the ClientRect object, which are the rectangles returned by the getClientRects and getBoundingClientRects methods. This width returns the displayed width plus the border and padding; the clientWidth returns the displayed width plus the padding only.

Combined, these features make it easier to determine the size of an element without having to use the boxObject. They are described in more detail in the specification.

In bug 437640 I added the ability to remove <keyset> elements and disable them with the ‘disabled’ attribute. This makes it possible to do keyboard shortcut editing dialogs where you insert and remove a keyset containing the defined shortcuts. The motivation behind being able to disable keysets is to allow an application to define different sets of keyboard shortcuts in different environments.

For those creating themes, the <gripper> element that was inside the scrollbar thumb has been removed, such that only the <thumb> is used. See bug 448704 for more details.