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

Re: [ydn-javascript] Re: Problem with YUI Compressor - CSS3 attribute selectors followed by pseudo-class

Expand Messages
  • Nate Koechley
    Thanks Gareth, that s perfect. Thanks, Nate
    Message 1 of 4 , Jan 6, 2009
    • 0 Attachment
      Thanks Gareth, that's perfect.

      Thanks,
      Nate

      On Jan 6, 2009, at 8:50 AM, Gareth J M Saunders wrote:

      > Thanks Nate,
      >
      > I searched the SourceForge bug tracker and discovered that someone had
      > already filed something similar:
      >
      > Request ID 2459205
      > [#2435565]"$" signs (common in VSS)breaks compressor for CSS
      >
      > which I presume *should* read "...(common in CSS)...". Anyway, I
      > added my findings as a comment to this request.
      >
      > Hope that's okay, and that it gets addressed soon as it's a killer
      > feature for us because we use that code in quite a few of our CSS
      > files.
      >
      > Thanks again,
      >
      > Gareth J M Saunders
      > University of St Andrews
      >
      > --- In ydn-javascript@yahoogroups.com, Nate Koechley <natek@...>
      > wrote:
      >>
      >> Hey Gareth,
      >>
      >> Sounds like a bug. Would you please file a bug report against
      >> "Compressor" in Sourceforge so we can track this issue?
      >>
      >> https://sourceforge.net/tracker/?group_id=165715&atid=836476
      >>
      >> Thanks,
      >> Nate
      >>
      >>
      >>
      >> On Jan 5, 2009, at 8:31 AM, Gareth J M Saunders wrote:
      >>
      >>> Hi folks,
      >>>
      >>> I'm currently checking out YUI Compressor to compress our production
      >>> CSS for the University of St Andrews' website, but I've run into a
      >>> problem to do with attribute selectors.
      >>>
      >>> SUMMARY: It would appear that the CSS3 attribute selector using
      >>> the $=
      >>> operator causes a problem when followed by a pseudo-class, while the
      >>> ^= and *= operators do not.
      >>>
      >>> When running a compression on one of my CSS files I'm getting the
      >>> following error:
      >>>
      >>> Here's my test code:
      >>>
      >>> a[href^="pdf"]:link {
      >>> padding: 0 0 0 22px;
      >>> }
      >>>
      >>> Here's the command line I'm using:
      >>>
      >>> java -jar c:\yuicompressor-2.4.2.jar c:\test.css --type css -v -o
      >>> c:\test-compressed.css
      >>>
      >>> and the error I'm getting:
      >>>
      >>> --- START QUOTE ---
      >>> Exception in thread "main"
      >>> java.lang.reflect.InvocationTargetException
      >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      >>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      >>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
      >>> Source)
      >>> at java.lang.reflect.Method.invoke(Unknown Source)
      >>> at
      >>> com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:20)
      >>> Caused by: java.lang.IllegalArgumentException: Illegal group
      >>> reference
      >>> at java.util.regex.Matcher.appendReplacement(Unknown Source)
      >>> at
      >>> com
      >>> .yahoo.platform.yui.compressor.CssCompressor.compress(CssCompresso
      >>> r.java:86)
      >>> at
      >>> com
      >>> .yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.ja
      >>> va:178)
      >>>
      >>> --- END QUOTE ---
      >>>
      >>> I've done some testing and have discovered that I get the error with
      >>> any of the following lines of CSS code:
      >>>
      >>> a[href$="pdf"]:link { ... }
      >>> a[href$="pdf"]:visited { ... }
      >>> a[href$="pdf"]:hover { ... }
      >>> a[href$="pdf"]:active { ... }
      >>>
      >>> However, the following all work fine:
      >>>
      >>> a[href$="pdf"] { ... }
      >>>
      >>> a[href^="pdf"] { ... }
      >>> a[href^="pdf"]:link { ... }
      >>> a[href^="pdf"]:visited { ... }
      >>> a[href^="pdf"]:hover { ... }
      >>> a[href^="pdf"]:active { ... }
      >>>
      >>> a[href*="pdf"] { ... }
      >>> a[href*="pdf"]:link { ... }
      >>> a[href*="pdf"]:visited { ... }
      >>> a[href*="pdf"]:hover { ... }
      >>> a[href*="pdf"]:active { ... }
      >>>
      >>> So it would appear that the CSS3 attribute selector using the $=
      >>> operator causes a problem when followed by a pseudo-class, while the
      >>> ^= and *= operators do not. This seems to me inconsistent.
      >>>
      >>> Is this a bug, and if so can it be fixed please?
      >>>
      >>> Many thanks
      >>>
      >>> Gareth J M Saunders
      >>> St Andrews, Fife, Scotland UK
      >>>
      >>>
      >>> ------------------------------------
      >>>
      >>> Yahoo! Groups Links
      >>>
      >>>
      >>>
      >>
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.