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

Re: YUI StyleSheet Utility 2.7.0 Beta to work with iframes

Expand Messages
  • Lucas Smith
    ... Arg, you got me. It was checking the style element s parent to make sure it was the head *of the current document*. I ve filed a bug here
    Message 1 of 6 , Mar 31 10:24 PM
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, "pekka.vorne" <pekka.vorne@...> wrote:
      >
      > > And the link node in the iframe document is from the same origin? I was recommending you seed from a style node, not a link node, so as to avoid this problem. If needs be, create a style node and attach it to the head of the iframe document via js first.
      > >
      > > var s = documentIframe.createElement('style');
      > > s.type = 'text/css';
      > > documentIframe.getElementsByTagName('head')[0].appendChild(s);
      > >
      > > var iframeStyleSheet = YAHOO.util.StyleSheet(s);
      > >
      > > Hope this helps,
      > > Luke
      >
      > It didn't help either, or I just did something badly wrong.
      >
      > The YUI StyleSheet Utility is still a beta version, I hope the issue with iframes will be fixed.. or someone has time to make an example with an iframe for dummies like me. :)
      >
      > --
      > Pekka Vorne
      >


      Arg, you got me. It was checking the style element's parent to make sure it was the head *of the current document*. I've filed a bug here
      http://yuilibrary.com/projects/yui2/ticket/2527873

      and checked in the fix. Sadly, it's nothing you can patch onto the 2.7 code because it's in the constructor, but you can download the updated file directly from github
      http://github.com/yui/yui2/tree/master under /build/stylesheet/

      Thanks for finding this!

      Luke
    Your message has been successfully submitted and would be delivered to recipients shortly.