PDA

View Full Version : [OPEN-199][3.0+] Ext is not XHTML compliant



Condor
27 Aug 2009, 4:18 AM
Ext is not XHTML compliant. Most browsers don't care, but Firefox in XHTML mode behaves according to strict W3C rules and fails.

1. There are several places in the code that use document.body.

Example (save as test.xhtml and open with Firefox):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:ext="http://www.extjs.com">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../ext/build/ext-3.0+/resources/css/ext-all.css" />
<script type="text/javascript" src="../ext/build/ext-3.0+/adapter/ext/ext-base-min.js"></script>
<script type="text/javascript" src="../ext/build/ext-3.0+/ext-all-min.js"></script>
<style type="text/css">
</style>
<script type="text/javascript">
<![CDATA[Ext.onReady(function() {
new Ext.Viewport({
layout: 'border',
items: [{
region: 'west',
title: 'West',
width: 200,
split: true
},{
region: 'center',
title: 'Center'
}]
});
});]]>
</script>
</head>
<body>
</body>
</html>
which fails on:

Ext.SplitBar.createProxy = function(dir){
var proxy = new Ext.Element(document.createElement("div"));
proxy.unselectable();
var cls = 'x-splitbar-proxy';
proxy.addClass(cls + ' ' + (dir == Ext.SplitBar.HORIZONTAL ? cls +'-h' : cls + '-v'));
document.body.appendChild(proxy.dom);
return proxy.dom;
};

I suggest changing references from document.body to Ext.getBody().dom (if documentElement isn't already used in combination with body).


2. &nbsp; isn't allowed in XHTML. Most &nbsp; characters were removed in Ext 3.0.0, but HtmlEditor still contains a few. These should also be replaced with &#160;.

evant
28 Aug 2009, 12:34 AM
Agreed, I've opened a ticket.

sacha
3 Nov 2009, 2:30 AM
Further XHTML issues (to do with assigning invalid XML via innerHTML):

http://www.extjs.com/forum/showthread.php?p=404851#post404851