I have the same issue.

I'm using a stylesheet definition like:

body.page-main #realms a:link,
body.page-results #realms a:link,
.realmsLink_normal {
    color: #666;
    background: #f8f8f8;
}

body.page-main #realms a:hover,
body.page-results #realms a:hover,
.realmsLink_hover {
    color: black;
    background: #ffe280;
}

But Fx.CSS of MooTool 1.2 can't find the selector text due to the same
reason of the above article.
I also had to change
if (!selectorText || !selectorText.test('^' + selector + '$'))
to
if (!selectorText || !selectorText.test('\.' + selector + '$'))
, and it worked.

I think this implementation should be aware of more various
situations. In this case, sepearting each selectors by comma and
testing them independently seems to be correct.

ps. The reason why I combine :hover pseudo-class and normal class is
to do a "gradual" fallback when javascript is disabled.

On 9월1일, 오후3시46분, muniom <[EMAIL PROTECTED]> wrote:
> If anyone is interested I solved this by editing the mootools Fx.CSS
> class.
>
>         search: function(selector){
>                 if (Fx.CSS.Cache[selector]) return Fx.CSS.Cache[selector];
>                 var to = {};
>                 Array.each(document.styleSheets, function(sheet, j){
>                         var href = sheet.href;
>                         if (href && href.contains('://') && !
> href.contains(document.domain)) return;
>                         var rules = sheet.rules || sheet.cssRules;
>                         Array.each(rules, function(rule, i){
>                                 if (!rule.style) return;
>                                 var selectorText = (rule.selectorText) ?
> rule.selectorText.replace(/^\w+/, function(m){
>                                         return m.toLowerCase();
>                                 }) : null;
>                                 //if (!selectorText || !selectorText.test('^' 
> +selector+ '$'))
> return;
>                                 if (!selectorText || !selectorText.test('\.' 
> +selector+ '$'))
> return;
>                                 Element.Styles.each(function(value, style){
>                                         if (!rule.style[style] || 
> Element.ShortStyles[style]) return;
>                                         value = String(rule.style[style]);
>                                         to[style] = (value.test(/^rgb/)) ? 
> value.rgbToHex() : value;
>                                 });
>                         });
>                 });
>                 return Fx.CSS.Cache[selector] = to;
>         }
>
> Note the commented out line which changes the prefix of searches.
>
> With a bit of css massaging I was able to get my script to work
> again :)

Reply via email to