[TYPO3-core] RFC #16740: <img> Tags are rendered with border attribute in HTML5 mode
Jigal van Hemert
jigal at xs4all.nl
Fri Jan 14 20:43:38 CET 2011
Hi,
On 14-1-2011 14:51, Sebastian Michaelsen wrote:
>> Why change the check to $GLOBALS['TSFE']->config['config']['doctype'] ?
>> In TSpagegen (around line 215) it is processed:
>>
>> if (!$GLOBALS['TSFE']->config['config']['xhtmlDoctype']) {
>> $GLOBALS['TSFE']->config['config']['xhtmlDoctype'] =
>> $GLOBALS['TSFE']->config['config']['doctype'];
>> }
>> if ($GLOBALS['TSFE']->config['config']['xhtmlDoctype']) {
>> $GLOBALS['TSFE']->xhtmlDoctype =
>> $GLOBALS['TSFE']->config['config']['xhtmlDoctype'];
> A few lines below:
>
> switch((string)$GLOBALS['TSFE']->config['config']['xhtmlDoctype']) {
> // ...
> default:
> $GLOBALS['TSFE']->getPageRenderer()->setRenderXhtml(FALSE);
> $GLOBALS['TSFE']->xhtmlDoctype = '';
> $GLOBALS['TSFE']->xhtmlVersion = 0;
> }
>
> if the doctype is not a xhtml type $GLOBALS['TSFE']->xhtmlDoctype will
> be empty. That's why I need to use
> $GLOBALS['TSFE']->config['config']['doctype'] to check against.
I just took a look at TSRef and it states for xhtmlDoctype:
-----------------
If config.doctype is set to a string then config.xhtmlDoctype must be
set to one of these keywords:
"xhtml_trans" for XHTML 1.0 Transitional doctype.
"xhtml_frames" for XHTML 1.0 Frameset doctype.
"xhtml_strict" for XHTML 1.0 Strict doctype.
"xhtml_basic" for XHTML basic doctype.
"xhtml_11" for XHTML 1.1 doctype.
"xhtml_2" for XHTML 2 doctype.
This is an example to use MathML 2.0 in an XHTML 1.1 document:
config.doctype (
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
)
config.xhtmlDoctype = xhtml_11
----------------------
So there are situations where config.doctype contains a doctype header
and in these cases config.xhtmlDoctype contains the keyword you want to
test.
If config.doctype is set to a xhtml keyword, the same is present in
config.xhtmlDoctype.
If config.doctype is set to a non-xhtml keyword, config.xhtmlDoctype is
empty.
It seems that you have to check if either config.doctype or
config.xhtmlDoctype is set to an xhtml keyword or html(_)5 (converted to
lowercase just to be prepared for 'HTML5'?) to decide that the border
attribute is not rendered.
--
Kind regards / met vriendelijke groet,
Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh
More information about the TYPO3-team-core
mailing list