silverme / base2

Automatically exported from code.google.com/p/base2
0 stars 0 forks source link

Can't use :hover pseudo-class in JSB #44

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This code throws an exception in Firefox:

new base2.JSB.RuleList({
  "a[type=command]:hover": {
    style: { backgroundColor: "yellow" }
  }
});

The exception in Firefox:
  [Exception... "'SyntaxError: 'a[type=command]:hover' is not a valid CSS selector.' when calling   
method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c 
(NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "<unknown>" data: no]

In Safari: 'a[type=command]:hover' is not a valid CSS selector.

The thing: I'm not sure if you intend for this code to work (using dynamic 
pseudo selectors), but the 
Firefox exception should really be caught, and re-thrown a bit more friendly.

BTW: the new grid-view for the issues rulez! (first, I didn't notice the 
List/Grid choice on the right)

Original issue reported on code.google.com by doek...@gmail.com on 25 Jul 2007 at 2:58

GoogleCodeExporter commented 8 years ago
I don't think this is a bug. The Selectors API does not support dynamic pseudo
classes. In JSB you already have the mouseover/mouseout events. You should use 
those
in conjunction with addClass/removeClass. Maybe a more friendly error message 
though. :-)

BTW, I think I prefer the list view but the grid view is admittedly cool.

Original comment by dean.edw...@gmail.com on 25 Jul 2007 at 5:23

GoogleCodeExporter commented 8 years ago
I've filtered the exception, and gave a bit more descriptive message. 

I think I will continue using the list-view. But the grid-view is handy to get 
some overview (the settings should persist however)...

Original comment by doek...@gmail.com on 26 Jul 2007 at 3:30