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

Stylesheet utility does not work with IE 8

Expand Messages
  • rgbastro
    Internet Explorer 8 gives me an error with YUI s styleshhet-min.js. The error is a typical Object expected : Object expected stylesheet-min.js, line 7
    Message 1 of 7 , Jul 28, 2009
    • 0 Attachment
      Internet Explorer 8 gives me an error with YUI's styleshhet-min.js.

      The error is a typical "Object expected":

      Object expected stylesheet-min.js, line 7 character 1490

      I use 2.7.0, and a "Q(S);" is found there.

      Is this a known behavior?
    • Dav Glass
      First thing is try to use the stylesheet-debug.js file, that will give you a more reasonable error message. Second, make sure your code passes JSLint:
      Message 2 of 7 , Jul 28, 2009
      • 0 Attachment
        First thing is try to use the stylesheet-debug.js file, that will give
        you a more reasonable error message.

        Second, make sure your code passes JSLint:
        http://www.jslint.com/

        It's probably an extra comma error..

        Dav

        On Tue, 28 Jul 2009, rgbastro wrote:

        > Internet Explorer 8 gives me an error with YUI's styleshhet-min.js.
        >
        > The error is a typical "Object expected":
        >
        > Object expected stylesheet-min.js, line 7 character 1490
        >
        > I use 2.7.0, and a "Q(S);" is found there.
        >
        > Is this a known behavior?
        >
        >

        --
        Dav Glass
        davglass@...
        blog.davglass.com


        + Windows: n. - The most successful computer virus, ever. +
        + A computer without a Microsoft operating system is like a dog
        without bricks tied to its head +
        + A Microsoft Certified Systems Engineer is to computing what a
        McDonalds Certified Food Specialist is to fine cuisine +
      • rgbastro
        ... 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
        Message 3 of 7 , Jul 28, 2009
        • 0 Attachment
          --- 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
        • rgbastro
          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
          Message 4 of 7 , Jul 28, 2009
          • 0 Attachment
            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
            >
          • Lucas Smith
            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
            Message 5 of 7 , Jul 29, 2009
            • 0 Attachment
              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

              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.

              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
              > >
              >
            • rgbastro
              ... Filed a new bug (#2528263): http://yuilibrary.com/projects/yui2/ticket/2528263 ... The testcase is slightly more than a blank page, to display a message
              Message 6 of 7 , Jul 29, 2009
              • 0 Attachment
                --- 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
                > > >
                > >
                >
              • 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 7 of 7 , Jul 31, 2009
                • 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.