This project is archived and is in readonly mode.

#687 ✓resolved
kizu (at web-standards)

Selectors.js do not find uppercase tagnames in some cases

Reported by kizu (at web-standards) | June 15th, 2009 @ 02:52 PM | in 2.0 (closed)

According to the CSS 2.1 specs (http://www.w3.org/TR/CSS21/selector.html#pattern-matching):
"The case-sensitivity of document language element names in selectors depends on the document language. For example, in HTML, element names are case-insensitive, but in XML they are case-sensitive." the element names in selectors must be case-insenssitive, and which is right for js' getElementsByTagName, but is not for some cases where the mootools' Selectors.js is used, there are some examples of selectors that NOT work:
we have following HTML:

...

and the following use of selectors: $$('P#ID') and $('ID').match('P').

I think the problem here is in the Selectors.Filters.byTag function, now it compares the lowercased self.tagName and the given tag, the proposal is to lowercase the given tag too, so the line for Selectors.Filters.byTag function'd be something like that:

byTag: function(self, tag){
    return (tag == '*' || (self.tagName && self.tagName.toLowerCase() == tag.toLowerCase()));
},

maybe this is not the best solution, but the problem exists.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Pages