mootools / slick

Standalone CSS Selector Parser and Engine. An official MooTools project.
MIT License
149 stars 22 forks source link

Support Namespaced Selectors (level 3) #65

Open jiggliemon opened 13 years ago

jiggliemon commented 13 years ago

Slick doesn't support CSS3 namespace selectors:

Slick.find('ns|a') // [<ns:a></ns:a>]
subtleGradient commented 13 years ago

The workaround is to use an escaped colon. That should work in all browsers. Iirc we should have some specs for this in the SlickSpec already.

— Thomas Aylott - SubtleGradient - MooTools - Sencha (from iPhone)

On Nov 14, 2011, at 3:55 PM, Chasereply@reply.github.com wrote:

Slick doesn't support CSS3 namespace selectors:

Slick.find('ns|a') // [<ns:a></ns:a>]

Reply to this email directly or view it on GitHub: https://github.com/mootools/slick/issues/65

jiggliemon commented 13 years ago

The one problem I see is that the standard "select all" selector doesn't work using the :;
None of these work:
`Slick.find('ns|
')`Slick.find('ns\:*') Slick.find('ns\\:*')

subtleGradient commented 13 years ago

good point. You could implement that with a custom pseudoclass though. e.g. Slick.search(document, '*:ns(foo)')

Not ideal, obviously, but it would work.

The implementation of the custom pseudo could be something like function(ns){ return this.nodeName.split(':')[0] == ns }. There may be a faster way to do it, but that should work.

Thomas Aylott SubtleGradient MooTools Sencha

On Nov 15, 2011, at 1:23 PM, Chase wrote:

The one problem I see is that the standard "select all" selector doesn't work using the :;
None of these work:
`Slick.find('ns|
')`Slick.find('ns\:*') Slick.find('ns\\:*')


Reply to this email directly or view it on GitHub: https://github.com/mootools/slick/issues/65#issuecomment-2751541