This project is archived and is in readonly mode.

#44 ✓invalid
Thomas Aylott

Fx.CSS : search - case sensitive (possible defect)

Reported by Thomas Aylott | May 28th, 2008 @ 10:05 AM | in 2.0 (closed)

Originally posted on Trac by maervin

Original Trac Ticket



The search function from Fx.CSS will not work in certain conditions as wanted and so will not the "to-class" transitions that depend on this function.

The cause is that while most browsers keep the case of characters in CSS selectors intact, for example IE does not. In fact, the tag names in all CSS selectors stored in styleSheet.cssRules is converted to upper case.

Anyway, the CSS selectors are case-insensitive as from design, I suggest we abide the standard and change the line:

if (! || !rule.selectorText || !rule.selectorText.test('^' + selector + '$')) return;

to (notice the second parameter to the test function - 'i'):

if (! || !rule.selectorText || !rule.selectorText.test('^' + selector + '$', 'i')) return;

Keep up the hard work!

Best Regards

Trac Attachments

Trac Comments

Changed 3 months ago by mattcoz

CSS selectors are case sensitive, it is IE that is not abiding the standard.  There was a recent change that added the case insensitive modifier, but it was backed out for this reason.  I suggest you take a look at ticket #672. 


Changed 3 months ago by maervin

Yes, sorry, I did not noticed that a ticket was already issued for this matter.  

You are right. In XML and XHTML, the tags are case-sensitive (and thus the document tree as well). As for HTML 4.01, they are not...  


Changed 3 months ago by mattcoz

But even in HTML 4.01 you have class names, ids, and attribute values that are case sensitive. 


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