mwrock / RequestReduce

Instantly makes your .net website faster by reducing the number and size of requests with almost no effort.
www.requestreduce.org
Apache License 2.0
228 stars 49 forks source link

@media rules in RR'ed CSS have truncated types #242

Open j-c opened 11 years ago

j-c commented 11 years ago

When RR'ing a series of <link /> elements, the media attributes are truncated when the attribute itself has more than just a single type (eg: "screen, tv", "screen and projection ")

Here are some cases where I've tested it:

@media onl {body.root3{}} /* only screen and (min-width: 481px) */
@media onl {body.root3{}} /* only screen and (min-width: 1020px) */
@media onl {body.root3{}} /* only screen */
body.root3{} /* all */
@media braille {body.root3{}} /* braille */
@media handheld {body.root3{}} /* handheld */
@media projection {body.root3{}} /* projection */
@media print {body.root3{}} /* print */
@media screen {body.root3{}} /* screen */
@media tty {body.root3{}} /* tty */
@media tv {body.root3{}} /* tv */
@media scree {body.root3{}} /* screen and tv */
@media screen {body.root3{}} /* screen, tv */
@media scree {body.root3{}} /* screen not projection */
j-c commented 11 years ago

Dug into the code a little more, it seems that is is due to the Regex in RequestReduce.Utilities.MediaPattern that's causing the issue.