Loading ...
Sorry, an error occurred while loading the content.

Re: Stylesheet utility does not work with IE 8

Expand Messages
  • Lucas Smith
    I took a look at the page and it turns out it was a known bug that is currently fixed in the repository head.
    Message 1 of 7 , Jul 31 2:30 PM
    • 0 Attachment
      I took a look at the page and it turns out it was a known bug that is currently fixed in the repository head.
      http://yuilibrary.com/projects/yui2/ticket/2527764

      You can pull the file from GitHub in the mean time for the patch.
      http://github.com/yui/yui2/tree/master

      Unfortunately, the bug is in the StyleSheet constructor, so there's no simple patch.

      Luke

      --- In ydn-javascript@yahoogroups.com, "rgbastro" <rgbastro@...> wrote:
      >
      > --- In ydn-javascript@yahoogroups.com, "Lucas Smith" <lucas.e.smith@> wrote:
      > >
      > > Dynamic stylesheet support is full of cross browser iniquities, so I'm not surprised IE 8 introduced a new one. The best thing for you to do would be to file a bug on yuilibrary.com with a simple repro case. http://yuilibrary.com/projects/yui2/newticket
      >
      > Filed a new bug (#2528263):
      >
      > http://yuilibrary.com/projects/yui2/ticket/2528263
      >
      > > I'd be happy to help you figure out where it's breaking down, so also link to the repro in this thread.
      > >
      > > It sounds like your repro need only consist of a blank html page with one link element and script tags loading yahoo-min.js and stylesheet.js (or -debug.js) and instantiating the StyleSheet. You should try to reduce the stylesheet as well to see if there's a particular rule that's triggering the failure. But at a minimum, please file the bug.
      >
      > The testcase is slightly more than a blank page, to display a message telling whether the script worked or not. The testcase is at:
      >
      > http://astronomia.org/yuibug.html
      >
      > and the yuibug.css file has this:
      >
      > ---
      > .someclass
      > {
      > display: block;
      > }
      >
      > .someclass, .someother
      > {
      > height: 20px;
      > }
      >
      > .notatfirst
      > {
      > display: none;
      > }
      > ---
      > Interestingly, if you remove the ", .someother" to have:
      > ---
      > .someclass
      > {
      > display: block;
      > }
      >
      > .someclass
      > {
      > height: 20px;
      > }
      >
      > ---
      > then both Firefox and Opera fail.
      >
      > In the real-world case where I found the issue, I put the YUI stylesheet statements inside a try-catch block, and apply a less efficient approach in case of error.
      >
      > HTH,
      > Carlos
      >
      > >
      > > Thanks,
      > > Luke
      > >
      > >
      > > --- In ydn-javascript@yahoogroups.com, "rgbastro" <rgbastro@> wrote:
      > > >
      > > > Forgot to mention a couple important details:
      > > >
      > > > 1) The code works just fine in FF 3.5.1 and the latest Opera 9.
      > > >
      > > > 2) The 'commonsheet' style sheet comes through a link:
      > > >
      > > > <link href="../common.css" rel="stylesheet" type="text/css" id="commonsheet" />
      > > >
      > > >
      > > > --- In ydn-javascript@yahoogroups.com, "rgbastro" <rgbastro@> wrote:
      > > > >
      > > > > --- In ydn-javascript@yahoogroups.com, Dav Glass <davglass@> wrote:
      > > > > >
      > > > > >
      > > > > > First thing is try to use the stylesheet-debug.js file, that will give
      > > > > > you a more reasonable error message.
      > > > >
      > > > > Thanks Dav,
      > > > >
      > > > > The debug file yields the 'object expected' error in line 195 character 17 of the debug file:
      > > > >
      > > > > if (cssRules[sel]) {
      > > > > cssRules[sel].style.cssText += ';' + r.style.cssText;
      > > > > --> _deleteRule(i);
      > > > > } else {
      > > > > cssRules[sel] = r;
      > > > > }
      > > > >
      > > > > The code (in my script) that triggers this is:
      > > > >
      > > > > var sheet = YAHOO.util.StyleSheet(YAHOO.util.Dom.get('commonsheet'));
      > > > >
      > > > > > Second, make sure your code passes JSLint:
      > > > > > http://www.jslint.com/
      > > > > >
      > > > > > It's probably an extra comma error..
      > > > >
      > > > > My code gives tons of "missing radix" in parseInts, but is fine otherwise.
      > > > >
      > > > > Regards,
      > > > > Carlos
      > > > >
      > > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.