PDA

View Full Version : [OPEN] Ext.util.getRule has different behaviours in different browsers



Vaevictus
26 May 2011, 7:14 AM
I use a stylesheet containing the following rule which is used to determine what icon to display:


.gridpreviewimage-32-htm, .gridpreviewimage-32-html, .gridpreviewimage-32-asp, .gridpreviewimage-32-aspx, .gridpreviewimage-32-php, .gridpreviewimage-32-cgi
{
background-image:url('../images/Icons/DocumentIcons/32x32/htm.png');
background-repeat:no-repeat;
background-position:center;
}

In IE, Ext.util.css.getRule(".gridpreviewimage-32-cgi") returns the matched cssrule object, but in chrome it does not. It is because the rule contains multiple selectors separated by commas, when the rule is as follows:


.gridpreviewimage-32-cgi
{
background-image:url('../images/Icons/DocumentIcons/32x32/htm.png');
background-repeat:no-repeat;
background-position:center;
}

both IE and Chrome get a match.

Because the behaviour is not consistent across browsers I would consider this a bug

Cheers