Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.6.5

Bug #12769 Omit CDATA for inline styles containing @import-rule
Submitted: 2007-12-24 08:50 UTC
From: immemosol Assigned: kguest
Status: Closed Package: HTML_Page2
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 30 + 42 = ?

 [2007-12-24 08:50 UTC] immemosol (Will Fris)
Description: ------------ Omit CDATA for inline styles containing @import-rule. If CDATA is added before @import then the @import will not be parsed. I have created a script, but it's not perfect yet. People can start some other css-code after the @import-rule and with this script those further lines will not get <![CDATA[ around them. Test script: --------------- /* #Options I put in $options for new HTML_Page2() $doctype = 'XHTML 1.0 Strict'; $mimeEncoding = 'application/xhtml+xml'; $prolog = TRUE; */ $page = new HTML_Page2($options); $page->addStyleDeclaration('@import url("/css/real.css");'); echo $page->toHTML(); Expected result: ---------------- I expect this: <style type="text/css"> <![CDATA[ @import url("/css/real.css"); ]]> </style> I now changed it to this: <style type="text/css"> @import url("/css/real.css"); </style> It should probably be like this: <style type="text/css"> @import url("/css/real.css"); /*Maybe other @... rules as well?*/ <![CDATA[ html , body{margin:0;padding:0;} /*And other css*/ ]]> </style> Actual result: -------------- <style type="text/css"> <![CDATA[ @import url("/css/real.css"); ]]> </style>


 [2008-04-05 18:42 UTC] cweiske (Christian Weiske)
Which browser does not parse the @import when it is in CDATA? The xml generated is valid, so it seems to be a browser bug..
 [2008-04-06 10:35 UTC] cweiske (Christian Weiske)
Will sent me an example which shows that both opera and firefox have a problem with it.
 [2008-04-07 00:59 UTC] thesaur (Klaus Guenther)
I'll take a look at this later this week and patch it.
 [2008-12-27 07:16 UTC] doconnor (Daniel O'Connor)
Ping, Klaus! If you are fine with the patch, I'm sure cweiske or myself could commit it
 [2011-09-08 04:32 UTC] kguest (Ken Guest)
-Assigned To: thesaur +Assigned To: kguest
 [2011-09-08 04:48 UTC] kguest (Ken Guest)
applying patch...
 [2011-09-08 05:03 UTC] kguest (Ken Guest)
-Status: Verified +Status: Closed
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at