Status: Unconfirmed Owner: [email protected] Labels: Type-Bug Pri-2 OS-All Area-Misc
New issue 5917 by sduddu: Incorrect behavior of CSS rules array http://code.google.com/p/chromium/issues/detail?id=5917 Chrome Version : 1.0.154.2 URLs (if applicable) : Other browsers tested: Add OK or FAIL after other browsers where you have tested this issue: Safari 3: OK Firefox 3: OK IE 7: OK What steps will reproduce the problem? 1. Create a page that refers to one external CSS. 2. Refer to out of bound cssRule: var numCssRules = document.styleSheets[0].cssRules.length; alert(document.styleSheets[0].cssRules[numCssRules]); What is the expected result? Out of bound cssRules index should result in undefined. What happens instead? Returns the last cssRule defined in the external CSS. Please provide any additional information below. Attach a screenshot if possible. Code snippet: <html> <link rel="stylesheet" type="text/css" href="chrometest.css"/> <head> <script type='text/javascript'> function printCSSInfo() { var numCssRules = document.styleSheets[0].cssRules.length; // Following should be undefined, but is not. alert(document.styleSheets[0].cssRules[numCssRules]); // Following alerts true. alert(document.styleSheets[0].cssRules[numCssRules - 1] == document.styleSheets[0].cssRules[4294967295]); } </script> </head> <body onload='printCSSInfo()'> </body> </html> -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~---------~--~----~------------~-------~--~----~ Automated mail from issue updates at http://crbug.com/ Subscription options: http://groups.google.com/group/chromium-bugs -~----------~----~----~----~------~----~------~--~---
