in jQuery src support , it set a HTML node's style as : style='top:1px;float:left;opacity:.55;'
see the opacity property, it is '.55'
in jsdom runtime, using DOMElement.style.opacity to read the opacity above , it will return ".55" ,but not "0.55" ,
so it fail when test opacity support:
opacity: /^0.55/.test( a.style.opacity )
so this is different with browser's return value !!!
DOMElement.style.opacity should return a normal Number like 0.55 , but not .55
Are you sure? I thought all properties of .style should be of type 'string'. That's certainly how it's in the browser (Chromium):
and CSS2Properties's IDL also describes them as of type 'DOMString'
Yeah should be a String and not a Number, but first it should be parsed into a Number and then toString() called.