XUL:Element APIs

From MozillaWiki
Jump to: navigation, search

Some issues with existing element APIs:

Consistency of Attributes/Properties

There should be more consistency of attributes, properties etc. Basically a comprehensive review and uplift. For example, some elements have an icon property called "image", others "src", some both.

Comprehensive Review of Public vs. Private

Non-public methods, properties and fields should be prefixed with m or _. When JS2 comes, these should be genuinely private.

Some Stuff Shouldn't Be In Toolkit

Firefox regularly makes changes to the tabbrowser. It's of little real interest to other apps. There are also some not-necessary other items in there that potentially require many months of review and uplift. Some items should move into browser, some items should move into a real toplevel mozapps directory so that the uplift work on the "supported" toolkit is simpler.

Counter-Intuitive Binding Attachment

Binding attachment is not intuitive. You ideally write code like so:

const XUL2NS = "http://www.mozilla.org/2006/xul";
var foo = document.createElementNS(XUL2NS, "foo");
foo.bar = true;

...but it seldom works out that well. If an item has no frames constructed, attachment doesn't occur until it is inserted into the document.

allowevent and mousethrough

The allowevent and mousethrough attributes are a bit confusing.