History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-2398
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Matthew Weier O'Phinney
Reporter: Adam Jensen
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Zend_View_Helper_HeadLink should be Doctype-aware

Created: 08/Jan/08 03:31 PM   Updated: 21/Mar/08 04:25 PM
Component/s: Zend_View
Affects Version/s: 1.6.0RC2
Fix Version/s: 1.5.0

Time Tracking:
Not Specified

 Public Fields   Internal Project Management Fields   
Resolution Date: 19/Feb/08 04:31 PM
Fix Version Priority: Should Have


 Description  « Hide
The Zend_View_Helper_HeadLink component uses shorthand tag closing notation on all link elements, regardless of the DOCTYPE provided to the Zend_View_Helper_Doctype component. I.e., it always produces elements like the following:
<link href="some-stylesheet.css" type="text/css" rel="stylesheet" />

Instead of the following:

<link href="some-stylesheet.css" type="text/css" rel="stylesheet">

The current behavior is fine for documents written as XHTML, but not necessarily for HTML without the X; running such a document through the W3 validator (as, say, HTML 4.01 Strict) produces warnings and errors.

This is a fairly trivial problem (since most browsers have no problem handling this kind of shorthand even in older flavors of HTML), but I think it would also be fairly trivial to fix (in fact, there's a good, simple precedent in lines 374-380 of the HeadScript helper), and doing so would make the framework's output more compliant with W3 standards (if only a little).



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Kevin Golding - 12/Jan/08 10:26 AM
This seems to be the source of a few inconsistencies

Neither Zend_View_Helper_HeadMeta or Zend_View_Helper_HeadStyle make any allowances for different doctypes either, however both default to using non-XHTML mark-up.

Other Zend_View_Helper_* seem to default to XHTML, as in this case, although I've only checked a few.

As we have a doctype check with isXhtml() it seems sensible to use it across the board and to have a consistent default. At the moment tag soup is inevitable due to the existing defaults and the fact that only one Helper seems to allow changes.


Matthew Weier O'Phinney - 14/Feb/08 09:23 AM
Scheduling for 1.5.0, and upgrading priority slightly.

Matthew Weier O'Phinney - 19/Feb/08 04:31 PM
All head*() helpers and (hopefully) all form*() helpers are now doctype aware.