[TYPO3-core] FYI48 #10955: Output of additionalCSS not valid

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Feb 7 10:07:39 CET 2011


Steffen Gebert schrieb am 05.02.2011 13:48:
> Hi!
> 
> The following changes will be committed in 48h, if nobody objects.
> 
> Type: Bugfix
> 
> Bugtracker reference:
> http://bugs.typo3.org/view.php?id=10955
> 
> Branches:
> trunk, 4-5, 4-4
> 
> Problem:
> Output of tslib_fe::INTincScript_loadJSCode() produes invalid CSS
> markup: <!-- and // --> are not valid there.
> 
> Solution:
> Remove the lines
> 
> Note:
> See
>> $this->additionalHeaderData['_CSS']='
>>   <style type="text/css">
>>     /*<![CDATA[*/
>>     <!--
>>     '.implode(LF,$this->additionalCSS).'
>>     // -->
>>     /*]]>*/
>>   </style>';

Could you elaborate more on that, please? Why is it not valid? Aren't
those comment markers required for some "old browsers" to skip them and
not print them "in the page"?

Especially in the frontend, it could get unpredicted results if people
were used to rely on that.

Other than that, we have t3lib_pagerenderer::inlineCssWrap, which also
prints these comments:

	$this->inlineCssWrap = array(
		'<style type="text/css">' . LF . '/*<![CDATA[*/' . LF . '<!-- ' . LF,
		'-->' . LF . '/*]]>*/' . LF . '</style>' . LF
	);

We have t3lib_div::wrapJS(), so we might as well create a new
t3lib_div::wrapCSS() so that we could get rid of all occurrences of
manually doing the CSS wrap over and over again (and every author does
it differently) and have a central "right way" to do it. It might also
depend on the current's XHTML mode (or HTML5 mode) so that that central
place might have different ways of doing it.

What do you think?

Cheers,
Ernesto





More information about the TYPO3-team-core mailing list