W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

Re: Element.create(): a proposal for more convenient element creation

From: Charles Pritchard <chuck@jumis.com>
Date: Mon, 1 Aug 2011 19:05:34 -0700
Message-Id: <4EA29AD4-A2AE-4980-941F-BD78F1A80519@jumis.com>
Cc: Maciej Stachowiak <mjs@apple.com>, WebApps WG <public-webapps@w3.org>
To: Ian Hickson <ian@hixie.ch>




On Aug 1, 2011, at 6:43 PM, Ian Hickson <ian@hixie.ch> wrote:

> On Mon, 1 Aug 2011, Maciej Stachowiak wrote:
>> 
>>   Creates an element with the specified tag, attributes, and children.
>> 
>>   tagName - tag name as a string; by default it does "smart" selection 
>> of SVG, HTML or MathML namespace. Authors can also use an html: svg: or 
>> mathml: prefix to override these defaults.
> 
> I'd suggest just always defaulting to HTML and requiring "svg:" and 
> "mathml:" prefixes for those namespaces.

Can we have it 'inherit' a parent namespace, and have chaining properties?

Element.create('div').create('svg').create('g').create('rect', {title: 'An svg rectangle in an HTML div'});
Received on Tuesday, 2 August 2011 02:06:03 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:46 GMT