Search

Bugs in Microsoft.Web.Optimization by Tore85

Closed
as Not Reproducible Help for as Not Reproducible

12
0
Sign in
to vote
Type: Bug
ID: 689523
Opened: 9/19/2011 11:36:43 AM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
1
Workaround(s)
4
User(s) can reproduce this bug
There are some issues with the new ASP.NET Optimization - Bundling package on nuget. The namespace is Microsoft.Web.Optimization.

1 - CssMinify breaks on vendor spesific css3 content.
Example: background: -webkit-gradient(linear, left top, left 25, from(white), color-stop(39%, #FFF), color-stop(70%, #EEE));


2 - For some reason the bundler is sometimes called from "/" instead of it's correct path (like "/Content/css". This makes manipulating the reference path impossible.
Example: HttpContext.Current.Request.Path <-- works initially, but with a rebuild or publish it can be called from "/" for some reason.
Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010 SP1

Steps to reproduce

1 - Css files with this content will break and not minify:
background: -webkit-gradient(linear, left top, left 25, from(white), color-stop(39%, #FFF), color-stop(70%, #EEE));

2 - Attach the debugger and rebuild/build and watch the value of this property:

public override void Process(BundleResponse bundle)
{
HttpContext.Current.Request.Path //This value will somethimes be "/"
}

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

1 - normal result
2 - wrong path

Expected results

1 - minified result
2 - correct path
File Attachments
0 attachments
Sign in to post a comment.
Posted by Daniel Schmitz on 4/2/2012 at 2:43 AM
I have a similar problem:
http://forums.asp.net/t/1786747.aspx/1?ResolveBundleUrl+with+JQuery+1+7+1+and+Opera+doesn+t+work
Posted by simnova on 11/17/2011 at 12:37 PM
The sample css file is available for download at :

http://www.simnova.com/web-optimizaiton-bug/sample.css
Posted by simnova on 10/24/2011 at 12:26 PM
I've added another bug since this was closed, complete with a CSS sample that will not compress:

https://connect.microsoft.com/VisualStudio/feedback/details/696436/microsoft-web-optimization-cannot-compress-css3-animations

Please vote at 696436 (above link) if you come across this issue.
Posted by tmcconechy on 10/20/2011 at 6:00 AM
Yes, Please reopen...

The issue is very easy to reproduce just add :

background-image: -webkit-gradient(linear, left top, left bottom, from(#444444), to(#999999));

To any file that is being *bundled* .. Fx

<link type="text/css" href="@Microsoft.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Content/css")" rel="stylesheet" /> 

The issue can be seen by opening the network tab and looking at the request...It does not minify the file with this content.

/* Minification failed. Returning unminified contents.
MinifyStyleSheet(807,32): error CSS1027: Expected semi-colon or close brace, found '('

Please fix. The importance is this tool can as of now never be used on pages that have css gradients and want to work on Safari as this is the safari css syntax. Couldn't this just be ignore or made to parse?
Posted by mkchandler on 10/19/2011 at 9:43 AM
Why was this closed? I am having the same issue and @tmcconechy posted some css3 that breaks the minifier. Please re-open this issue so that it can be fixed. The library is useless to me until it can minify css properly.
Posted by MS-Moderator10 [Feedback Moderator] on 10/6/2011 at 5:18 AM
Thank you for submitting feedback on Visual Studio 2010 and the .NET Framework. At this point, it has been more than two weeks since we initially requested additional information to reproduce your issue. Since we have not heard back from you we will close the issue. If you need further assistance on this or any other pre-release product issues in the future, please feel free to contact us and we will be happy to help.
Posted by tmcconechy on 10/3/2011 at 10:36 AM
All you need to do is add:
.ui-tabs-selected {
background-image: -webkit-gradient(linear, left top, left bottom, from(#444444), to(#999999));
}
To any page. Please see attached project. When you run it in IE
-Open the F12 Dev tools
-Network tab
-Start Capturing
-refresh the page
-click open the css file that is generated and look at the top for:


/* Minification failed. Returning unminified contents.
MinifyStyleSheet(2,37): error CSS1027: Expected semi-colon or close brace, found '('
*/
.ui-tabs-selected {
background-image: -webkit-gradient(linear, left top, left bottom, from(#444444), to(#999999));
}
Posted by MS-Moderator10 on 9/26/2011 at 11:57 PM
I am currently standing by for an update from you and would like to know how things are going on your end. If you could get back to me at your earliest convenience with information I request, we will be able to make headway towards a resolution. I look forward to hearing from you.
Posted by MS-Moderator10 on 9/19/2011 at 9:11 PM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. In order to efficiently investigate and reproduce this issue, we are requesting additional information outlined below.

Could you please give us a demo project to demonstrate this issue so that we can conduct further research?

We look forward to hearing from you with this information.

Microsoft Visual Studio Connect Support Team
Posted by MS-Moderator01 on 9/19/2011 at 11:43 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by djanosik on 12/3/2011 at 3:15 PM
https://gist.github.com/1427674