/** * Creates a new HTML element with the given tag name, and name. * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @return the new element or NOT_FOUND if the tag is not supported */ private Object createElementNS(final String namespaceURI, final String qualifiedName) { final org.w3c.dom.Element element; if ("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul".equals(namespaceURI)) { throw Context.reportRuntimeError("XUL not available"); } else if (HTMLParser.XHTML_NAMESPACE.equals(namespaceURI) || HTMLParser.SVG_NAMESPACE.equals(namespaceURI)) { element = getPage().createElementNS(namespaceURI, qualifiedName); } else { element = new DomElement(namespaceURI, qualifiedName, getPage(), null); } return getScriptableFor(element); }
/** * Creates a new HTML element with the given tag name, and name. * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @return the new element or NOT_FOUND if the tag is not supported */ private Object createElementNS(final String namespaceURI, final String qualifiedName) { final org.w3c.dom.Element element; if ("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul".equals(namespaceURI)) { throw Context.reportRuntimeError("XUL not available"); } else if (HTMLParser.XHTML_NAMESPACE.equals(namespaceURI) || HTMLParser.SVG_NAMESPACE.equals(namespaceURI)) { element = getPage().createElementNS(namespaceURI, qualifiedName); } else { element = new DomElement(namespaceURI, qualifiedName, getPage(), null); } return getScriptableFor(element); }
/** * Creates a new HTML element with the given tag name, and name. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @return the new HTML element, or NOT_FOUND if the tag is not supported */ @JsxFunction public Object createElementNS(final String namespaceURI, final String qualifiedName) { final org.w3c.dom.Element element; if ("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul".equals(namespaceURI)) { throw Context.reportRuntimeError("XUL not available"); } if (HTMLParser.XHTML_NAMESPACE.equals(namespaceURI) || HTMLParser.SVG_NAMESPACE.equals(namespaceURI)) { element = getPage().createElementNS(namespaceURI, qualifiedName); } else { element = new DomElement(namespaceURI, qualifiedName, getPage(), null); } return getScriptableFor(element); }
/** * Creates a new HTML element with the given tag name, and name. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @return the new HTML element, or NOT_FOUND if the tag is not supported */ @JsxFunction public Object createElementNS(final String namespaceURI, final String qualifiedName) { final org.w3c.dom.Element element; if ("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul".equals(namespaceURI)) { throw Context.reportRuntimeError("XUL not available"); } if (HTMLParser.XHTML_NAMESPACE.equals(namespaceURI) || HTMLParser.SVG_NAMESPACE.equals(namespaceURI)) { element = getPage().createElementNS(namespaceURI, qualifiedName); } else { element = new DomElement(namespaceURI, qualifiedName, getPage(), null); } return getScriptableFor(element); }
/** * Creates a new HTML element with the given tag name, and name. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @return the new HTML element, or NOT_FOUND if the tag is not supported */ public Object jsxFunction_createElementNS(final String namespaceURI, final String qualifiedName) { final org.w3c.dom.Element element; if (getBrowserVersion().isFirefox() && "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul".equals(namespaceURI)) { // simple hack, no need to implement the XUL objects (at least in a first time) element = new HtmlDivision(namespaceURI, qualifiedName, getPage(), null); } else if (HTMLParser.XHTML_NAMESPACE.equals(namespaceURI)) { element = getPage().createElementNS(namespaceURI, qualifiedName); } else { element = new DomElement(namespaceURI, qualifiedName, getPage(), null); } return getScriptableFor(element); }
/** * Creates a new HTML element with the given tag name, and name. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @return the new HTML element, or NOT_FOUND if the tag is not supported */ public Object jsxFunction_createElementNS(final String namespaceURI, final String qualifiedName) { final org.w3c.dom.Element element; if (getBrowserVersion().isFirefox() && "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul".equals(namespaceURI)) { // simple hack, no need to implement the XUL objects (at least in a first time) element = new HtmlDivision(namespaceURI, qualifiedName, getPage(), null); } else if (HTMLParser.XHTML_NAMESPACE.equals(namespaceURI)) { element = getPage().createElementNS(namespaceURI, qualifiedName); } else { element = new DomElement(namespaceURI, qualifiedName, getPage(), null); } return getScriptableFor(element); }
/** * Creates a new HTML element with the given tag name, and name. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @return the new HTML element, or NOT_FOUND if the tag is not supported */ public Object jsxFunction_createElementNS(final String namespaceURI, final String qualifiedName) { final org.w3c.dom.Element element; if (getBrowserVersion().isFirefox() && "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul".equals(namespaceURI)) { // simple hack, no need to implement the XUL objects (at least in a first time) element = new HtmlDivision(namespaceURI, qualifiedName, getPage(), null); } else if (HTMLParser.XHTML_NAMESPACE.equals(namespaceURI)) { element = getPage().createElementNS(namespaceURI, qualifiedName); } else { element = new DomElement(namespaceURI, qualifiedName, getPage(), null); } return getScriptableFor(element); }