/**
* {@inheritDoc}
*/
@Override
public SimpleScriptable makeScriptableFor(final DomNode domNode) {
final SimpleScriptable scriptable;
// TODO: cleanup, getScriptObject() should be used!!!
if (domNode instanceof DomElement && !(domNode instanceof HtmlElement)) {
scriptable = new Element();
}
else if (domNode instanceof DomAttr) {
final Attr attribute;
if (getPage().getWebClient().getBrowserVersion().isIE()) {
attribute = new XMLAttr();
}
else {
attribute = new Attr();
}
scriptable = attribute;
}
else {
return super.makeScriptableFor(domNode);
}
scriptable.setPrototype(getPrototype(scriptable.getClass()));
scriptable.setParentScope(getParentScope());
scriptable.setDomNode(domNode);
return scriptable;
}