Dev comments on cause of issue:
The error occurs here where it tries to get the tagName of the passed in element:
This.Element.adaptToElement = function(e) {
//no polymophism here...'switch' is the way then.
if (!e)
return new This.Element(e);
switch (e.tagName.toLowerCase())
{
case 'textarea':
case 'input': return new This.InputElement(e);
case 'thead':
case 'tfoot':
case 'tbody':
case 'th':
case 'td':
case 'tr': return new This.TableCellElement(e);
case 'button': return new This.ButtonElement(e);
case 'select': return new This.SelectElement(e);
case 'form': return new This.FormElement(e);
case 'body': return new This.BodyElement(e);
case 'script': return new This.ScriptElement(e);
case 'title': return new This.TitleElement(e);
case 'a': return new This.AnchorElement(e);
case 'iframe': return new This.IFrameElement(e);
default : return new This.Element(e);
}
};
Not sure why Chrome would have an issue with this compared to the other browsers. If I debug it a bit, it seems that during processing, the event.source is determined to be an HTMLDocument (which I guess makes a certain sense for the onload) but in Chrome, the HTMLDocument does not have a tagName attribute and this is what causes the exception to be thrown. I guess a fix would be to check for e.tagName and just return This.Element(e) for that as well:
This.Element.adaptToElement = function(e) {
//no polymophism here...'switch' is the way then.
if (!e)
return new This.Element(e);
if (!e.tagName)
return new This.Element(e);
switch (e.tagName.toLowerCase()) {
case 'textarea':
Dev comments on cause of issue:
The error occurs here where it tries to get the tagName of the passed in element:
This.Element.adaptToElement = function(e) {
{ case 'textarea': case 'input': return new This.InputElement(e); case 'thead': case 'tfoot': case 'tbody': case 'th': case 'td': case 'tr': return new This.TableCellElement(e); case 'button': return new This.ButtonElement(e); case 'select': return new This.SelectElement(e); case 'form': return new This.FormElement(e); case 'body': return new This.BodyElement(e); case 'script': return new This.ScriptElement(e); case 'title': return new This.TitleElement(e); case 'a': return new This.AnchorElement(e); case 'iframe': return new This.IFrameElement(e); default : return new This.Element(e); }//no polymophism here...'switch' is the way then.
if (!e)
return new This.Element(e);
switch (e.tagName.toLowerCase())
};
Not sure why Chrome would have an issue with this compared to the other browsers. If I debug it a bit, it seems that during processing, the event.source is determined to be an HTMLDocument (which I guess makes a certain sense for the onload) but in Chrome, the HTMLDocument does not have a tagName attribute and this is what causes the exception to be thrown. I guess a fix would be to check for e.tagName and just return This.Element(e) for that as well:
This.Element.adaptToElement = function(e) {
//no polymophism here...'switch' is the way then.
if (!e)
return new This.Element(e);
if (!e.tagName)
return new This.Element(e);
switch (e.tagName.toLowerCase()) {
case 'textarea':