/** * Returns notations. * @return notations */ public String jsxGet_notations() { if (getBrowserVersion().isIE()) { return ""; } return null; } }
/** * Returns entities. * @return entities */ public String jsxGet_entities() { if (getBrowserVersion().isIE()) { return ""; } return null; }
/** * Returns <tt>true</tt> if this event has been aborted via <tt>preventDefault()</tt> in * standards-compliant browsers, or via the event's <tt>returnValue</tt> property in IE, or * by the event handler returning <tt>false</tt>. * * @param result the event handler result (if <tt>false</tt>, the event is considered aborted) * @return <tt>true</tt> if this event has been aborted */ public boolean isAborted(final ScriptResult result) { final boolean ie = getBrowserVersion().isIE(); return ScriptResult.isFalse(result) || (!ie && preventDefault_) || (ie && FALSE.equals(returnValue_)); }
/** * {@inheritDoc} */ @Override public SimpleScriptable jsxGet_doctype() { if (getBrowserVersion().isIE()) { return null; } return super.jsxGet_doctype(); }
/** * {@inheritDoc} */ public Scriptable construct(final Context cx, final Scriptable scope, final Object[] args) { if (!getBrowserVersion().isIE()) { throw Context.reportRuntimeError("Window is not a function."); } return null; }
/** * Sets the value of the "align" property. * @param align the value of the "align" property */ public void jsxSet_align(final String align) { final boolean ignoreIfNoError = getBrowserVersion().isIE(); setAlign(align, ignoreIfNoError); }
/** * {@inheritDoc} */ @Override public Object jsxFunction_appendChild(final Object childObject) { if (limitAppendChildToIE() && !getBrowserVersion().isIE()) { // Firefox does not allow insertion at the document level. throw new RuntimeException("Node cannot be inserted at the specified point in the hierarchy."); } // We're emulating IE; we can allow insertion. return super.jsxFunction_appendChild(childObject); }
/** * Returns the value of the <tt>clear</tt> property. * @return the value of the <tt>clear</tt> property */ public String jsxGet_clear() { final String clear = getDomNodeOrDie().getAttribute("clear"); if (!contains(VALID_CLEAR_VALUES, clear) && getBrowserVersion().isIE()) { return ""; } return clear; }
/** * Sets the "opacity" style attribute. * @param opacity the new attribute */ public void jsxSet_opacity(final String opacity) { if (getBrowserVersion().isIE()) { setStyleAttribute("opacity", opacity); } else if (isFloat(opacity, true) || opacity.length() == 0) { setStyleAttribute("opacity", opacity.trim()); } }
/** * Returns The URI that identifies an XML namespace. * @return the URI that identifies an XML namespace */ public String jsxGet_namespaceURI() { if (getBrowserVersion().isIE()) { return ""; } return getDomNodeOrDie().getNamespaceURI(); }
/** {@inheritDoc} */ public void comment(final char[] ch, final int start, final int length) { handleCharacters(); final String data = String.valueOf(ch, start, length); if (!data.startsWith("[CDATA") || !page_.getWebClient().getBrowserVersion().isIE()) { final DomComment comment = new DomComment(page_, data); currentNode_.appendChild(comment); } }
/** * Returns The URI that identifies an XML namespace. * @return the URI that identifies an XML namespace */ public String jsxGet_namespaceURI() { if (getBrowserVersion().isIE()) { return ""; } return getDomNodeOrDie().getNamespaceURI(); }
/** * Returns the value of the "chOff" property. * @return the value of the "chOff" property */ protected String getChOff() { final boolean ie = getBrowserVersion().isIE(); if (ie) { return chOff_; } return getDomNodeOrDie().getAttribute("charOff"); }
/** * Sets the "zIndex" style attribute. * @param zIndex the new attribute */ public void jsxSet_zIndex(final Object zIndex) { if (getBrowserVersion().isIE()) { setRoundedStyleAttribute("zIndex", zIndex); } else { setIntegerStyleAttribute("zIndex", zIndex); } }
private Object getHandlerForJavaScript(final String eventName) { Object handler = getEventListenersContainer().getEventHandlerProp(eventName); if (handler == null && !getBrowserVersion().isIE()) { handler = Scriptable.NOT_FOUND; } return handler; }
/** * Returns "clientHeight" attribute. * @return the clientHeight attribute */ public int jsxGet_clientHeight() { final boolean includePadding = !getBrowserVersion().isIE(); final ComputedCSSStyleDeclaration style = getWindow().jsxFunction_getComputedStyle(this, null); return style.getCalculatedHeight(false, includePadding); }
/** * Returns "clientWidth" attribute. * @return the clientWidth attribute */ public int jsxGet_clientWidth() { final boolean includePadding = !getBrowserVersion().isIE(); final ComputedCSSStyleDeclaration style = getWindow().jsxFunction_getComputedStyle(this, null); return style.getCalculatedWidth(false, includePadding); }
/** * Removes the specified attribute. * @param name the name of the attribute to remove */ public void jsxFunction_removeAttribute(final String name) { getDomNodeOrDie().removeAttribute(name); if (getBrowserVersion().isIE()) { delete(name); } }
/** * Returns The Namespace prefix. * @return the Namespace prefix */ public String jsxGet_prefix() { final String prefix = getDomNodeOrDie().getPrefix(); if (getBrowserVersion().isIE() && (prefix == null || getDomNodeOrDie().getPage() instanceof HtmlPage)) { return ""; } return prefix; }
/** * Returns the value of the "all" property. * @return the value of the "all" property */ public HTMLCollection jsxGet_all() { if (all_ == null) { all_ = new HTMLCollectionTags(this); all_.setAvoidObjectDetection(!getBrowserVersion().isIE()); all_.init(getDomNodeOrDie(), ".//*"); } return all_; }