Issues

ZF-8056: View Helper HeadStyle does not accept comma separated strings with spaces for media attribute

Description

When using headStyle, the media attribute works when set to 'screen,projection' or array('screen', 'projection') but not 'screen, projection' (with a space).

This is inconsistent with headLink which accepts the space, and the css specifications which allow the space: http://www.w3.org/TR/CSS2/media.html

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

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"

Fixed in trunk (r18571) and in 1.9-release branch (r18572)