This is because, unlike headLink, headStyle for some reason checks the media types specified, and retrieves them from the string using explode (which will leave extra spaces). This also means that headLink and headStyle treat the media attribute differently in another way (headLink allows any media type, headStyle only allows those specified in its code).

Comments

Posted by Travis Pew (travisp) on 2009-10-12T13:50:54.000+0000

A patch that would allow spaces in the comma separated media attribute and a unit test to make sure that it works.

I wonder though if it wouldn't be better to just make headStyle work entirely like headLink and not check against the list of "allowed" media types because CSS3 allows media to be specified as follows: "screen, 3d-glasses, print and resolution > 90dpi"