Issues

ZF-5846: Stylesheets are broken for Firefox 3 with application/xhtml+xml as Content-Type

Description

{{Dojo_View_Helper_Dojo_Container}} inserts an improper comment tag when producing stylesheet imports:

h4. Code:


class My_Controller_Plugin_LayoutSelector
    extends Zend_Controller_Plugin_Abstract
{
    public function routeStartup(Zend_Controller_Request_Abstract $request)
    {
               if (strpos($accepts, 'application/xhtml+xml')) {
            $this->getResponse()->setHeader(
                'Content-Type', 
                'application/xhtml+xml; charset=UTF-8');
        } else {
            $this->getResponse()->setHeader(
                'Content-Type', 
                'text/html; charset=UTF-8');
        }
        }
}

in view script:


<?= $this->dojo()->enable()
    ->setDjConfigOption('parseOnLoad', true)
    ->addStyleSheetModule('dijit.themes.tundra');
?>

h4. Output:


This causes Firefox 3 to not process the CSS in the style: https://developer.mozilla.org/En/…

This issue is probably not limited to Firefox, and should affect Opera 7+ and Mozilla 1.0+.

This issue will not occur when using Content-Type of {{text/html}}, as Firefox does not check the document for validity as XML.

h4. Workaround: Manually import all stylesheets with link tags or correct {{@import}} statements.

h4. Required fix: Check returned Content-Type and remove comments if {{application/xhtml}}.

Comments

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.