Zend Framework

View Helper HeadStyle does not accept comma separated strings with spaces for media attribute

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.3
  • Fix Version/s: 1.9.5
  • Component/s: Zend_View
  • Labels:
    None

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).

Activity

Hide
Travis Pew added a comment -

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"

Show
Travis Pew added a comment - 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"
Hide
Stefan Gehrig added a comment -

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

Show
Stefan Gehrig added a comment - Fixed in trunk (r18571) and in 1.9-release branch (r18572)

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: