That's an interesting idea. Parts of CSS3 parser could be reused. You could certainly use the regexen we define to identify various CSS tokens.
My first thought was that combinators should not be allowed in that syntax (i.e. new Element('div#mynode div.someClass'), but then I suppose you could use such a syntax to mean "create a div with a class of 'someClass', then append it to the already-existing div with an id of 'mynode'." That could get pretty complicated pretty fast, though. What do other people think? Cheers, Andrew On Mar 20, 3:31 pm, "Colin Mollenhour" <[EMAIL PROTECTED]> wrote: > Just a thought, if a future version of prototype were to include a > simple element creation method, what about using CSS syntax for > specification of id and class? i.e.: > > var node = new Element('div#mynode.someClass'); > > Could the new CSS3 parser be easily reused to implement this? I looked > at it briefly but it's pretty complex :) > > Good idea or bad? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~----------~----~----~----~------~----~------~--~---