Commits

Joey Smith committed 2f87678 Merge

Merge pull request #68 from ademey/fix/opera-fraction

Fix/opera fraction

  • Participants
  • Parent commits b836285, 101ac83

Comments (0)

Files changed (3)

File src/com/yahoo/platform/yui/compressor/CssCompressor.java

         // shorter opacity IE filter
         css = css.replaceAll("(?i)progid:DXImageTransform.Microsoft.Alpha\\(Opacity=", "alpha(opacity=");
 
+        // Find a fraction that is used for Opera's -o-device-pixel-ratio query
+        // Add token to add the "\" back in later
+        css = css.replaceAll("\\(([\\-A-Za-z]+):([0-9]+)\\/([0-9]+)\\)", "($1:$2___YUI_QUERY_FRACTION___$3)");
+
         // Remove empty rules.
         css = css.replaceAll("[^\\}\\{/;]+\\{\\}", "");
 
+        // Add "\" back to fix Opera -o-device-pixel-ratio query
+        css = css.replaceAll("___YUI_QUERY_FRACTION___", "/");
+
         // TODO: Should this be after we re-insert tokens. These could alter the break points. However then
         // we'd need to make sure we don't break in the middle of a string etc.
         if (linebreakpos >= 0) {

File tests/opera-pixel-ratio.css

+@media
+	(-o-min-device-pixel-ratio:10/4),
+	(-o-max-device-pixel-ratio:  5/4),
+	(-o-device-pixel-ratio:  1/1),
+  (-o-device-pixel-ratio:  1/10),
+	(-o-device-pixel-ratio:  1.25),
+	(device-pixel-ratio:1.5)  {  
+		/* some:prop; */
+		/* An empty property with a fraction in query would break previously */
+ }
+ 
+ .something {
+	 foo: bar;
+ }

File tests/opera-pixel-ratio.css.min

+.something{foo:bar}