XUL:Element APIs: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 2: Line 2:


'''Consistency of Attributes/Properties'''
'''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.  
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.  


'''Counter-Intuitive Binding Attachment'''
'''Counter-Intuitive Binding Attachment'''
Binding attachment is not intuitive. You ideally write code like so:
Binding attachment is not intuitive. You ideally write code like so:



Revision as of 01:04, 9 December 2005

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.

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;
docElt.appendChild(foo);

...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.