From: <asa...@us...> - 2017-05-05 17:40:14
|
Revision: 14376 http://sourceforge.net/p/htmlunit/code/14376 Author: asashour Date: 2017-05-05 17:40:11 +0000 (Fri, 05 May 2017) Log Message: ----------- - SgmlPage.getContentType - Document: implement .children, .embeds, .plugins, .contentType Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/SgmlPage.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/SgmlPage.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/SgmlPage.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/SgmlPage.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -390,4 +390,10 @@ final boolean entityReferenceExpansion) throws DOMException { return new DomNodeIterator((DomNode) root, whatToShow, filter, entityReferenceExpansion); } + + /** + * Returns the content type of this page. + * @return the content type of this page + */ + public abstract String getContentType(); } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -535,6 +535,14 @@ /** * {@inheritDoc} + */ + @Override + public String getContentType() { + return getWebResponse().getContentType(); + } + + /** + * {@inheritDoc} * Not yet implemented. */ @Override Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -33,8 +33,8 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; +import com.gargoylesoftware.htmlunit.javascript.host.dom.Document; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLCollection; -import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLLinkElement; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLStyleElement; @@ -111,7 +111,7 @@ * * @param document the owning document */ - public StyleSheetList(final HTMLDocument document) { + public StyleSheetList(final Document document) { setParentScope(document); setPrototype(getPrototype(getClass())); Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -24,6 +24,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ANCHORS_REQUIRES_NAME_OR_ID; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_CREATE_ELEMENT_STRICT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_DESIGN_MODE_INHERIT; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_SELECTION_RANGE_COUNT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_SETTING_DOMAIN_THROWS_FOR_ABOUT_BLANK; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_SET_LOCATION_EXECUTED_IN_ANCHOR; @@ -42,6 +43,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; @@ -73,8 +75,11 @@ import com.gargoylesoftware.htmlunit.html.HTMLParser; import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlApplet; +import com.gargoylesoftware.htmlunit.html.HtmlArea; import com.gargoylesoftware.htmlunit.html.HtmlAttributeChangeEvent; import com.gargoylesoftware.htmlunit.html.HtmlElement; +import com.gargoylesoftware.htmlunit.html.HtmlEmbed; +import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlImage; import com.gargoylesoftware.htmlunit.html.HtmlInput; import com.gargoylesoftware.htmlunit.html.HtmlPage; @@ -95,6 +100,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.Location; import com.gargoylesoftware.htmlunit.javascript.host.NativeFunctionPrefixResolver; import com.gargoylesoftware.htmlunit.javascript.host.Window; +import com.gargoylesoftware.htmlunit.javascript.host.css.StyleSheetList; import com.gargoylesoftware.htmlunit.javascript.host.event.BeforeUnloadEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.CloseEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.CustomEvent; @@ -1760,15 +1766,144 @@ } /** - * Returns the value of the JavaScript property {@code forms}. - * @return the value of the JavaScript property {@code forms} + * Returns the value of the {@code forms} property. + * @return the value of the {@code forms} property */ @JsxGetter({CHROME, IE}) public Object getForms() { - return null; + return new HTMLCollection(getDomNodeOrDie(), false) { + @Override + protected boolean isMatching(final DomNode node) { + return node instanceof HtmlForm && node.getPrefix() == null; + } + + @Override + public Object call(final Context cx, final Scriptable scope, + final Scriptable thisObj, final Object[] args) { + if (getBrowserVersion().hasFeature(JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED)) { + return super.call(cx, scope, thisObj, args); + } + throw Context.reportRuntimeError("TypeError: document.forms is not a function"); + } + }; } /** + * Returns the value of the {@code embeds} property. + * @return the value of the {@code embeds} property + */ + @JsxGetter({CHROME, IE}) + public Object getEmbeds() { + return new HTMLCollection(getDomNodeOrDie(), false) { + @Override + protected boolean isMatching(final DomNode node) { + return node instanceof HtmlEmbed; + } + + @Override + public Object call(final Context cx, final Scriptable scope, + final Scriptable thisObj, final Object[] args) { + if (getBrowserVersion().hasFeature(JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED)) { + return super.call(cx, scope, thisObj, args); + } + throw Context.reportRuntimeError("TypeError: document.embeds is not a function"); + } + }; + } + + /** + * Returns the value of the {@code embeds} property. + * @return the value of the {@code embeds} property + */ + @JsxGetter({CHROME, IE}) + public Object getImages() { + return new HTMLCollection(getDomNodeOrDie(), false) { + @Override + protected boolean isMatching(final DomNode node) { + return node instanceof HtmlImage; + } + + @Override + public Object call(final Context cx, final Scriptable scope, + final Scriptable thisObj, final Object[] args) { + if (getBrowserVersion().hasFeature(JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED)) { + return super.call(cx, scope, thisObj, args); + } + throw Context.reportRuntimeError("TypeError: document.images is not a function"); + } + }; + } + + /** + * Returns the value of the {@code scripts} property. + * @return the value of the {@code scripts} property + */ + @JsxGetter({CHROME, IE}) + public Object getScripts() { + return new HTMLCollection(getDomNodeOrDie(), false) { + @Override + protected boolean isMatching(final DomNode node) { + return node instanceof HtmlScript; + } + + @Override + public Object call(final Context cx, final Scriptable scope, + final Scriptable thisObj, final Object[] args) { + if (getBrowserVersion().hasFeature(JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED)) { + return super.call(cx, scope, thisObj, args); + } + throw Context.reportRuntimeError("TypeError: document.scripts is not a function"); + } + }; + } + + /** + * Retrieves a collection of stylesheet objects representing the style sheets that correspond + * to each instance of a Link or + * {@link com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleDeclaration} object in the document. + * + * @return styleSheet collection + */ + @JsxGetter + public StyleSheetList getStyleSheets() { + return new StyleSheetList(this); + } + + /** + * Returns the value of the {@code plugins} property. + * @return the value of the {@code plugins} property + */ + @JsxGetter({CHROME, IE}) + public Object getPlugins() { + return getEmbeds(); + } + + /** + * Returns the value of the JavaScript property {@code links}. Refer also to the + * <a href="http://msdn.microsoft.com/en-us/library/ms537465.aspx">MSDN documentation</a>. + * @return the value of this property + */ + @JsxGetter + public Object getLinks() { + return new HTMLCollection(getDomNodeOrDie(), true) { + @Override + protected boolean isMatching(final DomNode node) { + return (node instanceof HtmlAnchor || node instanceof HtmlArea) + && ((HtmlElement) node).hasAttribute("href"); + } + + @Override + protected EffectOnCache getEffectOnCache(final HtmlAttributeChangeEvent event) { + final HtmlElement node = event.getHtmlElement(); + if ((node instanceof HtmlAnchor || node instanceof HtmlArea) && "href".equals(event.getName())) { + return EffectOnCache.RESET; + } + return EffectOnCache.NONE; + } + }; + } + + /** * Returns all the descendant elements with the specified class name. * @param className the name to search for * @return all the descendant elements with the specified class name @@ -1820,4 +1955,54 @@ public void setTitle(final String title) { } + /** + * Gets the children of the current node. + * @see <a href="http://msdn.microsoft.com/en-us/library/ms537446.aspx">MSDN documentation</a> + * @return the child at the given position + */ + @JsxGetter({CHROME, FF}) + public HTMLCollection getChildren() { + final DomNode node = getPage(); + final HTMLCollection collection = new HTMLCollection(node, false) { + @Override + protected List<DomNode> computeElements() { + final List<DomNode> children = new LinkedList<>(); + for (DomNode domNode : node.getChildNodes()) { + if (domNode instanceof DomElement) { + children.add(domNode); + } + } + return children; + } + }; + return collection; + } + + /** + * Returns the {@code contentType} property. + * @return the {@code contentType} property + */ + @JsxGetter({CHROME, FF}) + public String getContentType() { + return getPage().getContentType(); + } + + /** + * Returns the current selection. + * @return the current selection + */ + @JsxFunction(CHROME) + public Selection getSelection() { + return null; + } + + /** + * Returns this document's {@code head} element. + * @return this document's {@code head} element + */ + @JsxGetter({CHROME, IE}) + public Object getHead() { + return null; + } + } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -22,7 +22,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_GET_PREFERS_STANDARD_FUNCTIONS; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_COLOR_EXPAND_ZERO; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_CREATE_ATTRUBUTE_LOWER_CASE; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; @@ -52,9 +51,7 @@ import com.gargoylesoftware.htmlunit.html.DomElement; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.FrameWindow; -import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlApplet; -import com.gargoylesoftware.htmlunit.html.HtmlArea; import com.gargoylesoftware.htmlunit.html.HtmlAttributeChangeEvent; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlForm; @@ -73,7 +70,6 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; import com.gargoylesoftware.htmlunit.javascript.host.Window; -import com.gargoylesoftware.htmlunit.javascript.host.css.StyleSheetList; import com.gargoylesoftware.htmlunit.javascript.host.dom.Attr; import com.gargoylesoftware.htmlunit.javascript.host.dom.Document; import com.gargoylesoftware.htmlunit.javascript.host.dom.Selection; @@ -162,46 +158,34 @@ @Override @JsxGetter(FF) public Object getForms() { - return new HTMLCollection(getDomNodeOrDie(), false) { - @Override - protected boolean isMatching(final DomNode node) { - return node instanceof HtmlForm && node.getPrefix() == null; - } + return super.getForms(); + } - @Override - public Object call(final Context cx, final Scriptable scope, - final Scriptable thisObj, final Object[] args) { - if (getBrowserVersion().hasFeature(JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED)) { - return super.call(cx, scope, thisObj, args); - } - throw Context.reportRuntimeError("TypeError: document.forms is not a function"); - } - }; + /** + * {@inheritDoc} + */ + @Override + @JsxGetter(FF) + public Object getEmbeds() { + return super.getEmbeds(); } /** - * Returns the value of the JavaScript property {@code links}. Refer also to the - * <a href="http://msdn.microsoft.com/en-us/library/ms537465.aspx">MSDN documentation</a>. - * @return the value of this property + * {@inheritDoc} */ - @JsxGetter + @Override + @JsxGetter(FF) + public Object getPlugins() { + return super.getPlugins(); + } + + /** + * {@inheritDoc} + */ + @Override + @JsxGetter(FF) public Object getLinks() { - return new HTMLCollection(getDomNodeOrDie(), true) { - @Override - protected boolean isMatching(final DomNode node) { - return (node instanceof HtmlAnchor || node instanceof HtmlArea) - && ((HtmlElement) node).hasAttribute("href"); - } - - @Override - protected EffectOnCache getEffectOnCache(final HtmlAttributeChangeEvent event) { - final HtmlElement node = event.getHtmlElement(); - if ((node instanceof HtmlAnchor || node instanceof HtmlArea) && "href".equals(event.getName())) { - return EffectOnCache.RESET; - } - return EffectOnCache.NONE; - } - }; + return super.getLinks(); } /** @@ -570,17 +554,12 @@ } /** - * Returns the value of the {@code images} property. - * @return the value of the {@code images} property + * {@inheritDoc} */ - @JsxGetter + @Override + @JsxGetter(FF) public Object getImages() { - return new HTMLCollection(getDomNodeOrDie(), false) { - @Override - protected boolean isMatching(final DomNode node) { - return node instanceof HtmlImage; - } - }; + return super.getImages(); } /** @@ -883,9 +862,9 @@ } /** - * Returns this document's {@code head} element. - * @return this document's {@code head} element + * {@inheritDoc} */ + @Override @JsxGetter public HTMLElement getHead() { final HtmlElement head = getPage().getHead(); @@ -1087,17 +1066,12 @@ } /** - * Returns the value of the {@code scripts} property. - * @return the value of the {@code scripts} property + * {@inheritDoc} */ - @JsxGetter + @Override + @JsxGetter(FF) public Object getScripts() { - return new HTMLCollection(getDomNodeOrDie(), false) { - @Override - protected boolean isMatching(final DomNode node) { - return node instanceof HtmlScript; - } - }; + return super.getScripts(); } /** @@ -1111,18 +1085,6 @@ } /** - * Retrieves a collection of stylesheet objects representing the style sheets that correspond - * to each instance of a Link or - * {@link com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleDeclaration} object in the document. - * - * @return styleSheet collection - */ - @JsxGetter - public StyleSheetList getStyleSheets() { - return new StyleSheetList(this); - } - - /** * {@inheritDoc} */ @Override @@ -1206,9 +1168,9 @@ } /** - * Returns the current selection. - * @return the current selection + * {@inheritDoc} */ + @Override @JsxFunction public Selection getSelection() { return getWindow().getSelectionImpl(); Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -370,6 +370,14 @@ * {@inheritDoc} */ @Override + public String getContentType() { + return "application/xml"; + } + + /** + * {@inheritDoc} + */ + @Override protected void setDocumentType(final DocumentType type) { super.setDocumentType(type); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -2363,4 +2363,62 @@ verifyAlerts(driver, getExpectedAlerts()); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"1", "[object HTMLHtmlElement]"}, + IE = "not found") + public void children() throws Exception { + final String html = "<html>\n" + + "<head>\n" + + " <script>\n" + + " function test() {\n" + + " if (document.children) {\n" + + " alert(document.children.length);\n" + + " alert(document.children.item(0));\n" + + " }\n" + + " else {\n" + + " alert('not found');\n" + + " }\n" + + " }\n" + + " </script>\n" + + "</head>\n" + + "<body onload='test()'></body>\n" + + "</html>"; + + final URL url = new URL(URL_FIRST, "abc%20def"); + expandExpectedAlertsVariables(url); + + final WebDriver driver = loadPage2(html, url); + verifyAlerts(driver, getExpectedAlerts()); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"application/xml", "text/html"}, + IE = {"undefined", "undefined"}) + public void contentType() throws Exception { + final String html = "<html>\n" + + "<head>\n" + + " <script>\n" + + " function test() {\n" + + " var xmlDocument = document.implementation.createDocument('', '', null);\n" + + " alert(xmlDocument.contentType);\n" + + " alert(document.contentType);\n" + + " }\n" + + " </script>\n" + + "</head>\n" + + "<body onload='test()'></body>\n" + + "</html>"; + + final URL url = new URL(URL_FIRST, "abc%20def"); + expandExpectedAlertsVariables(url); + + final WebDriver driver = loadPage2(html, url); + verifyAlerts(driver, getExpectedAlerts()); + } + } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -2552,10 +2552,84 @@ + " }\n" + "</script>\n" + "</head>\n" - + "<body onload='test()'><div/>" + + "<body onload='test()'>\n" + + " <div/>\n" + "</body></html>"; loadPageWithAlerts2(html); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "exception", + IE = "[object HTMLEmbedElement]") + public void embeds() throws Exception { + final String html = "" + + "<html><head>\n" + + "<script>\n" + + " function test() {\n" + + " try {\n" + + " alert(document.embeds(0));\n" + + " } catch(e) {alert('exception'); }\n" + + " }\n" + + "</script>\n" + + "</head>\n" + + "<body onload='test()'>\n" + + " <embed>\n" + + "</body></html>"; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"1", "exception"}, + IE = {"1", "[object HTMLEmbedElement]"}) + public void plugins() throws Exception { + final String html = "" + + "<html><head>\n" + + "<script>\n" + + " function test() {\n" + + " try {\n" + + " alert(document.plugins.length);\n" + + " alert(document.plugins(0));\n" + + " } catch(e) {alert('exception'); }\n" + + " }\n" + + "</script>\n" + + "</head>\n" + + "<body onload='test()'>\n" + + " <embed>\n" + + "</body></html>"; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "exception", + IE = "[object HTMLImageElement]") + public void images() throws Exception { + final String html = "" + + "<html><head>\n" + + "<script>\n" + + " function test() {\n" + + " try {\n" + + " alert(document.images(0));\n" + + " } catch(e) {alert('exception'); }\n" + + " }\n" + + "</script>\n" + + "</head>\n" + + "<body onload='test()'>\n" + + " <img>\n" + + "</body></html>"; + + loadPageWithAlerts2(html); + } + } |
From: <asa...@us...> - 2017-05-05 17:46:50
|
Revision: 14377 http://sourceforge.net/p/htmlunit/code/14377 Author: asashour Date: 2017-05-05 17:46:48 +0000 (Fri, 05 May 2017) Log Message: ----------- Fixing build Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Node.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/ElementTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Node.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Node.java 2017-05-05 17:40:11 UTC (rev 14376) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Node.java 2017-05-05 17:46:48 UTC (rev 14377) @@ -20,7 +20,7 @@ import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.*; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.util.ArrayList; @@ -717,7 +717,7 @@ * Returns the namespace prefix. * @return the namespace prefix */ - @JsxGetter(IE) + @JsxGetter({FF45, IE}) public Object getPrefix() { return getDomNodeOrDie().getPrefix(); } @@ -726,7 +726,7 @@ * Returns the local name of this attribute. * @return the local name of this attribute */ - @JsxGetter(IE) + @JsxGetter({FF45, IE}) public Object getLocalName() { return getDomNodeOrDie().getLocalName(); } @@ -735,7 +735,7 @@ * Returns the URI that identifies an XML namespace. * @return the URI that identifies an XML namespace */ - @JsxGetter(IE) + @JsxGetter({FF45, IE}) public Object getNamespaceURI() { return getDomNodeOrDie().getNamespaceURI(); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/ElementTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/ElementTest.java 2017-05-05 17:40:11 UTC (rev 14376) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/ElementTest.java 2017-05-05 17:46:48 UTC (rev 14377) @@ -436,11 +436,9 @@ = "<html>\n" + "<script>\n" + " function test() {\n" - + " try {\n" - + " debug(document.createElement('dIv'));\n" - + " debug(document.createElement('app:dIv'));\n" - + " debug(document.createElementNS('http://www.appcelerator.org', 'app:dIv'));\n" - + " } catch (e) {alert('createElementNS() is not defined')}\n" + + " debug(document.createElement('dIv'));\n" + + " debug(document.createElement('app:dIv'));\n" + + " debug(document.createElementNS('http://www.appcelerator.org', 'app:dIv'));\n" + " debug(document.getElementById('dIv1'));\n" + " debug(document.getElementById('dIv2'));\n" + " }\n" @@ -542,12 +540,10 @@ = "<html xmlns='http://www.w3.org/1999/xhtml' xmlns:app='http://www.appcelerator.org'>\n" + "<script>\n" + " function test() {\n" - + " try {\n" - + " debug(document.createElement('dIv'));\n" - + " debug(document.createElement('app:dIv'));\n" - + " debug(document.createElement('another:dIv'));\n" - + " debug(document.createElementNS('http://www.appcelerator.org', 'app:dIv'));\n" - + " } catch (e) {alert('createElementNS() is not defined')}\n" + + " debug(document.createElement('dIv'));\n" + + " debug(document.createElement('app:dIv'));\n" + + " debug(document.createElement('another:dIv'));\n" + + " debug(document.createElementNS('http://www.appcelerator.org', 'app:dIv'));\n" + " debug(document.getElementById('dIv1'));\n" + " debug(document.getElementById('dIv2'));\n" + " debug(document.getElementById('dIv3'));\n" |
From: <rb...@us...> - 2017-05-06 07:30:23
|
Revision: 14383 http://sourceforge.net/p/htmlunit/code/14383 Author: rbri Date: 2017-05-06 07:30:20 +0000 (Sat, 06 May 2017) Log Message: ----------- FF52/Chrome Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-05-05 20:33:28 UTC (rev 14382) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-05-06 07:30:20 UTC (rev 14383) @@ -1332,10 +1332,6 @@ @BrowserFeature(IE) JS_WINDOW_FRAME_BY_ID_RETURNS_WINDOW, - /** <code>window.mozPaintCount</code> returns 0 instead of 8. */ - @BrowserFeature(FF45) - JS_WINDOW_MOZ_PAINT_COUNT_ZERO, - /** * Difference of window.outer/inner height is 63. */ Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2017-05-05 20:33:28 UTC (rev 14382) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2017-05-06 07:30:20 UTC (rev 14383) @@ -18,7 +18,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_FORMFIELDS_ACCESSIBLE_BY_NAME; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_FRAMES_ACCESSIBLE_BY_ID; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_FRAME_BY_ID_RETURNS_WINDOW; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_MOZ_PAINT_COUNT_ZERO; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_SELECTION_NULL_IF_INVISIBLE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_TOP_WRITABLE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; @@ -1784,10 +1783,7 @@ */ @JsxGetter(FF) public int getMozPaintCount() { - if (getBrowserVersion().hasFeature(JS_WINDOW_MOZ_PAINT_COUNT_ZERO)) { - return 0; - } - return 8; + return 0; } /** Definition of special cases for the smart DomHtmlAttributeChangeListenerImpl */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2017-05-05 20:33:28 UTC (rev 14382) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2017-05-06 07:30:20 UTC (rev 14383) @@ -684,9 +684,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(CHROME = {"675", "1256", "658", "1239"}, + @Alerts(CHROME = {"636", "1256", "619", "1239"}, FF45 = {"674", "1258", "657", "1241"}, - FF52 = {"851", "1266", "834", "1249"}, + FF52 = {"674", "1258", "657", "1241"}, IE = {"705", "1256", "688", "1239"}) @NotYetImplemented // TODO width and height calculation needs to be reworked in HtmlUnit @@ -720,8 +720,7 @@ */ @Test @Alerts(DEFAULT = {"0,0", "100,200", "110,230", "0,0", "no scrollByLines()", "0,0", "no scrollByPages()"}, - FF45 = {"0,0", "100,200", "110,230", "0,0", "0,95", "0,0", "0,1238"}, - FF52 = {"0,0", "100,200", "110,230", "0,0", "0,95", "0,0", "0,1592"}) + FF = {"0,0", "100,200", "110,230", "0,0", "0,95", "0,0", "0,1238"}) @NotYetImplemented(FF) public void scrolling1() throws Exception { scrolling(true); @@ -809,16 +808,15 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"undefined", "undefined", "undefined"}, - FF45 = {"11", "91", "0"}, - FF52 = {"11", "91", "8"}) - public void mozInnerScreenX() throws Exception { + @Alerts(DEFAULT = {"undefined", "undefined"}, + FF45 = {"11", "91"}, + FF52 = {"11", "91"}) + public void mozInnerScreen() throws Exception { final String html = "<html><body onload='test()'><script>\n" + "function test() {\n" + " alert(window.mozInnerScreenX);\n" + " alert(window.mozInnerScreenY);\n" - + " alert(window.mozPaintCount);\n" + "}\n" + "</script>\n" + "</body></html>"; @@ -829,6 +827,23 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = "undefined", + FF = "number") + public void mozPaintCount() throws Exception { + final String html + = "<html><body onload='test()'><script>\n" + + "function test() {\n" + + " alert(typeof window.mozPaintCount);\n" + + "}\n" + + "</script>\n" + + "</body></html>"; + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts({"exception", "exception", "Success"}) public void eval() throws Exception { final String html |
From: <rb...@us...> - 2017-05-06 12:27:18
|
Revision: 14387 http://sourceforge.net/p/htmlunit/code/14387 Author: rbri Date: 2017-05-06 12:27:15 +0000 (Sat, 06 May 2017) Log Message: ----------- FF52 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/NavigatorTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java 2017-05-06 12:23:10 UTC (rev 14386) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java 2017-05-06 12:27:15 UTC (rev 14387) @@ -179,7 +179,7 @@ // FF52 FIREFOX_52.initDefaultFeatures(); FIREFOX_52.setVendor(""); - FIREFOX_52.buildId_ = "20170417065206"; + FIREFOX_52.buildId_ = "20170504112025"; FIREFOX_52.setHeaderNamesOrdered(new String[] { "Host", "User-Agent", "Accept", "Accept-Language", "Accept-Encoding", "Referer", "Cookie", "Connection"}); FIREFOX_52.setHtmlAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/NavigatorTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/NavigatorTest.java 2017-05-06 12:23:10 UTC (rev 14386) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/NavigatorTest.java 2017-05-06 12:27:15 UTC (rev 14387) @@ -375,7 +375,7 @@ @Test @Alerts(DEFAULT = "undefined", FF45 = "20170411115307", - FF52 = "20170417065206") + FF52 = "20170504112025") public void buildID() throws Exception { final String html = "<html><head><title>First</title>\n" |
From: <asa...@us...> - 2017-05-06 12:41:08
|
Revision: 14388 http://sourceforge.net/p/htmlunit/code/14388 Author: asashour Date: 2017-05-06 12:41:05 +0000 (Sat, 06 May 2017) Log Message: ----------- Document.xml properties Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2017-05-06 12:27:15 UTC (rev 14387) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2017-05-06 12:41:05 UTC (rev 14388) @@ -415,20 +415,18 @@ /** * {@inheritDoc} - * Not yet implemented. */ @Override public String getXmlEncoding() { - throw new UnsupportedOperationException("HtmlPage.getXmlEncoding is not yet implemented."); + return null; } /** * {@inheritDoc} - * Not yet implemented. */ @Override public boolean getXmlStandalone() { - throw new UnsupportedOperationException("HtmlPage.getXmlStandalone is not yet implemented."); + return false; } /** @@ -442,11 +440,10 @@ /** * {@inheritDoc} - * Not yet implemented. */ @Override public String getXmlVersion() { - throw new UnsupportedOperationException("HtmlPage.getXmlVersion is not yet implemented."); + return null; } /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-06 12:27:15 UTC (rev 14387) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-06 12:41:05 UTC (rev 14388) @@ -1096,6 +1096,15 @@ } /** + * Returns the value of the {@code documentURI} property. + * @return the value of the {@code documentURI} property + */ + @JsxGetter({CHROME, FF}) + public String getDocumentURI() { + return getURL(); + } + + /** * Returns the value of the {@code URLUnencoded} property. * @return the value of the {@code URLUnencoded} property */ @@ -2205,4 +2214,38 @@ return getPage().getFirstChild().getScriptableObject(); } + /** + * Returns the {@code xmlEncoding} property. + * @return the {@code xmlEncoding} property + */ + @JsxGetter({CHROME, IE}) + public String getXmlEncoding() { + String encoding = getPage().getXmlEncoding(); + if (encoding == null && getBrowserVersion().hasFeature(HTMLDOCUMENT_CHARSET_LOWERCASE)) { + encoding = ""; + } + return encoding; + } + + /** + * Returns the {@code xmlStandalone} property. + * @return the {@code xmlStandalone} property + */ + @JsxGetter({CHROME, IE}) + public boolean isXmlStandalone() { + return getPage().getXmlStandalone(); + } + + /** + * Returns the {@code xmlVersion} property. + * @return the {@code xmlVersion} property + */ + @JsxGetter({CHROME, IE}) + public String getXmlVersion() { + String version = getPage().getXmlVersion(); + if (version == null && getBrowserVersion().hasFeature(HTMLDOCUMENT_CHARSET_LOWERCASE)) { + version = ""; + } + return version; + } } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java 2017-05-06 12:27:15 UTC (rev 14387) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java 2017-05-06 12:41:05 UTC (rev 14388) @@ -279,29 +279,26 @@ /** * {@inheritDoc} - * Not yet implemented. */ @Override public String getXmlEncoding() { - throw new UnsupportedOperationException("XmlPage.getXmlEncoding is not yet implemented."); + return null; } /** * {@inheritDoc} - * Not yet implemented. */ @Override public boolean getXmlStandalone() { - throw new UnsupportedOperationException("XmlPage.getXmlStandalone is not yet implemented."); + return false; } /** * {@inheritDoc} - * Not yet implemented. */ @Override public String getXmlVersion() { - throw new UnsupportedOperationException("XmlPage.getXmlVersion is not yet implemented."); + return "1.0"; } /** Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java 2017-05-06 12:27:15 UTC (rev 14387) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java 2017-05-06 12:41:05 UTC (rev 14388) @@ -2414,11 +2414,78 @@ + "<body onload='test()'></body>\n" + "</html>"; - final URL url = new URL(URL_FIRST, "abc%20def"); - expandExpectedAlertsVariables(url); + loadPageWithAlerts2(html); + } - final WebDriver driver = loadPage2(html, url); - verifyAlerts(driver, getExpectedAlerts()); + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"null", "null"}, + IE = {"", ""}, + FF = {"undefined", "undefined"}) + public void xmlEncoding() throws Exception { + final String html = "<html>\n" + + "<head>\n" + + " <script>\n" + + " function test() {\n" + + " var xmlDocument = document.implementation.createDocument('', '', null);\n" + + " alert(xmlDocument.xmlEncoding);\n" + + " alert(document.xmlEncoding);\n" + + " }\n" + + " </script>\n" + + "</head>\n" + + "<body onload='test()'></body>\n" + + "</html>"; + + loadPageWithAlerts2(html); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"false", "false"}, + FF = {"undefined", "undefined"}) + public void xmlStandalone() throws Exception { + final String html = "<html>\n" + + "<head>\n" + + " <script>\n" + + " function test() {\n" + + " var xmlDocument = document.implementation.createDocument('', '', null);\n" + + " alert(xmlDocument.xmlStandalone);\n" + + " alert(document.xmlStandalone);\n" + + " }\n" + + " </script>\n" + + "</head>\n" + + "<body onload='test()'></body>\n" + + "</html>"; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"1.0", "null"}, + FF = {"undefined", "undefined"}, + IE = {"1.0", ""}) + public void xmlVersion() throws Exception { + final String html = "<html>\n" + + "<head>\n" + + " <script>\n" + + " function test() {\n" + + " var xmlDocument = document.implementation.createDocument('', '', null);\n" + + " alert(xmlDocument.xmlVersion);\n" + + " alert(document.xmlVersion);\n" + + " }\n" + + " </script>\n" + + "</head>\n" + + "<body onload='test()'></body>\n" + + "</html>"; + + loadPageWithAlerts2(html); + } + } |
From: <rb...@us...> - 2017-05-06 12:41:28
|
Revision: 14389 http://sourceforge.net/p/htmlunit/code/14389 Author: rbri Date: 2017-05-06 12:41:25 +0000 (Sat, 06 May 2017) Log Message: ----------- FF52 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersion2Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java 2017-05-06 12:41:05 UTC (rev 14388) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java 2017-05-06 12:41:25 UTC (rev 14389) @@ -183,8 +183,6 @@ FIREFOX_52.setHeaderNamesOrdered(new String[] { "Host", "User-Agent", "Accept", "Accept-Language", "Accept-Encoding", "Referer", "Cookie", "Connection"}); FIREFOX_52.setHtmlAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); - FIREFOX_52.setXmlHttpRequestAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); - FIREFOX_52.setImgAcceptHeader("image/png,image/*;q=0.8,*/*;q=0.5"); FIREFOX_52.setCssAcceptHeader("text/css,*/*;q=0.1"); // IE Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersion2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersion2Test.java 2017-05-06 12:41:05 UTC (rev 14388) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersion2Test.java 2017-05-06 12:41:25 UTC (rev 14389) @@ -126,6 +126,7 @@ @Test @Alerts(DEFAULT = "Accept: image/png,image/*;q=0.8,*/*;q=0.5", CHROME = "Accept: image/webp,image/*,*/*;q=0.8", + FF52 = "Accept: */*", IE = "Accept: image/png, image/svg+xml, image/*;q=0.8, */*;q=0.5") public void acceptHeaderImage() throws Exception { final String html @@ -352,7 +353,7 @@ */ @Test @Alerts(DEFAULT = "Accept: */*", - FF = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") + FF45 = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") public void acceptHeaderXMLHttpRequest() throws Exception { final String html = "<html>\n" |
From: <asa...@us...> - 2017-05-06 13:25:20
|
Revision: 14391 http://sourceforge.net/p/htmlunit/code/14391 Author: asashour Date: 2017-05-06 13:25:17 +0000 (Sat, 06 May 2017) Log Message: ----------- body and element event handlers Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBodyElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-06 12:47:32 UTC (rev 14390) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-06 13:25:17 UTC (rev 14391) @@ -2202,7 +2202,8 @@ */ @JsxGetter({CHROME, FF}) public Element getLastElementChild() { - return getPage().getLastChild().getScriptableObject(); + final DomNode child = getPage().getLastChild(); + return child == null ? null : child.getScriptableObject(); } /** @@ -2211,7 +2212,8 @@ */ @JsxGetter({CHROME, FF}) public Element getFirstElementChild() { - return getPage().getFirstChild().getScriptableObject(); + final DomNode child = getPage().getFirstChild(); + return child == null ? null : child.getScriptableObject(); } /** @@ -2248,4 +2250,1859 @@ } return version; } + + /** + * Returns the {@code onabort} event handler for this element. + * @return the {@code onabort} event handler for this element + */ + @JsxGetter + public Function getOnabort() { + return getEventHandler("onabort"); + } + + /** + * Sets the {@code onabort} event handler for this element. + * @param onchange the {@code onabort} event handler for this element + */ + @JsxSetter + public void setOnabort(final Object onabort) { + setEventHandler("onabort", onabort); + } + + /** + * Returns the {@code onauxclick} event handler for this element. + * @return the {@code onauxclick} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOnauxclick() { + return getEventHandler("onauxclick"); + } + + /** + * Sets the {@code onauxclick} event handler for this element. + * @param onchange the {@code onauxclick} event handler for this element + */ + @JsxSetter(CHROME) + public void setOnauxclick(final Object onauxclick) { + setEventHandler("onauxclick", onauxclick); + } + + /** + * Returns the {@code onbeforecopy} event handler for this element. + * @return the {@code onbeforecopy} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOnbeforecopy() { + return getEventHandler("onbeforecopy"); + } + + /** + * Sets the {@code onbeforecopy} event handler for this element. + * @param onchange the {@code onbeforecopy} event handler for this element + */ + @JsxSetter(CHROME) + public void setOnbeforecopy(final Object onbeforecopy) { + setEventHandler("onbeforecopy", onbeforecopy); + } + + /** + * Returns the {@code onbeforecut} event handler for this element. + * @return the {@code onbeforecut} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOnbeforecut() { + return getEventHandler("onbeforecut"); + } + + /** + * Sets the {@code onbeforecut} event handler for this element. + * @param onchange the {@code onbeforecut} event handler for this element + */ + @JsxSetter(CHROME) + public void setOnbeforecut(final Object onbeforecut) { + setEventHandler("onbeforecut", onbeforecut); + } + + /** + * Returns the {@code onbeforepaste} event handler for this element. + * @return the {@code onbeforepaste} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOnbeforepaste() { + return getEventHandler("onbeforepaste"); + } + + /** + * Sets the {@code onbeforepaste} event handler for this element. + * @param onchange the {@code onbeforepaste} event handler for this element + */ + @JsxSetter(CHROME) + public void setOnbeforepaste(final Object onbeforepaste) { + setEventHandler("onbeforepaste", onbeforepaste); + } + + /** + * Returns the {@code oncancel} event handler for this element. + * @return the {@code oncancel} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOncancel() { + return getEventHandler("oncancel"); + } + + /** + * Sets the {@code oncancel} event handler for this element. + * @param onchange the {@code oncancel} event handler for this element + */ + @JsxSetter(CHROME) + public void setOncancel(final Object oncancel) { + setEventHandler("oncancel", oncancel); + } + + /** + * Returns the {@code oncanplay} event handler for this element. + * @return the {@code oncanplay} event handler for this element + */ + @JsxGetter + public Function getOncanplay() { + return getEventHandler("oncanplay"); + } + + /** + * Sets the {@code oncanplay} event handler for this element. + * @param onchange the {@code oncanplay} event handler for this element + */ + @JsxSetter + public void setOncanplay(final Object oncanplay) { + setEventHandler("oncanplay", oncanplay); + } + + /** + * Returns the {@code oncanplaythrough} event handler for this element. + * @return the {@code oncanplaythrough} event handler for this element + */ + @JsxGetter + public Function getOncanplaythrough() { + return getEventHandler("oncanplaythrough"); + } + + /** + * Sets the {@code oncanplaythrough} event handler for this element. + * @param onchange the {@code oncanplaythrough} event handler for this element + */ + @JsxSetter + public void setOncanplaythrough(final Object oncanplaythrough) { + setEventHandler("oncanplaythrough", oncanplaythrough); + } + + /** + * Returns the {@code onchange} event handler for this element. + * @return the {@code onchange} event handler for this element + */ + @JsxGetter + public Function getOnchange() { + return getEventHandler("onchange"); + } + + /** + * Sets the {@code onchange} event handler for this element. + * @param onchange the {@code onchange} event handler for this element + */ + @JsxSetter + public void setOnchange(final Object onchange) { + setEventHandler("onchange", onchange); + } + + /** + * Returns the {@code onclose} event handler for this element. + * @return the {@code onclose} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOnclose() { + return getEventHandler("onclose"); + } + + /** + * Sets the {@code onclose} event handler for this element. + * @param onchange the {@code onclose} event handler for this element + */ + @JsxSetter(CHROME) + public void setOnclose(final Object onclose) { + setEventHandler("onclose", onclose); + } + + /** + * Returns the {@code oncopy} event handler for this element. + * @return the {@code oncopy} event handler for this element + */ + @JsxGetter({CHROME, FF}) + public Function getOncopy() { + return getEventHandler("oncopy"); + } + + /** + * Sets the {@code oncopy} event handler for this element. + * @param onchange the {@code oncopy} event handler for this element + */ + @JsxSetter({CHROME, FF}) + public void setOncopy(final Object oncopy) { + setEventHandler("oncopy", oncopy); + } + + /** + * Returns the {@code oncuechange} event handler for this element. + * @return the {@code oncuechange} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOncuechange() { + return getEventHandler("oncuechange"); + } + + /** + * Sets the {@code oncuechange} event handler for this element. + * @param onchange the {@code oncuechange} event handler for this element + */ + @JsxSetter(CHROME) + public void setOncuechange(final Object oncuechange) { + setEventHandler("oncuechange", oncuechange); + } + + /** + * Returns the {@code oncut} event handler for this element. + * @return the {@code oncut} event handler for this element + */ + @JsxGetter({CHROME, FF}) + public Function getOncut() { + return getEventHandler("oncut"); + } + + /** + * Sets the {@code oncut} event handler for this element. + * @param onchange the {@code oncut} event handler for this element + */ + @JsxSetter({CHROME, FF}) + public void setOncut(final Object oncut) { + setEventHandler("oncut", oncut); + } + + /** + * Returns the {@code ondrag} event handler for this element. + * @return the {@code ondrag} event handler for this element + */ + @JsxGetter + public Function getOndrag() { + return getEventHandler("ondrag"); + } + + /** + * Sets the {@code ondrag} event handler for this element. + * @param onchange the {@code ondrag} event handler for this element + */ + @JsxSetter + public void setOndrag(final Object ondrag) { + setEventHandler("ondrag", ondrag); + } + + /** + * Returns the {@code ondragend} event handler for this element. + * @return the {@code ondragend} event handler for this element + */ + @JsxGetter + public Function getOndragend() { + return getEventHandler("ondragend"); + } + + /** + * Sets the {@code ondragend} event handler for this element. + * @param onchange the {@code ondragend} event handler for this element + */ + @JsxSetter + public void setOndragend(final Object ondragend) { + setEventHandler("ondragend", ondragend); + } + + /** + * Returns the {@code ondragenter} event handler for this element. + * @return the {@code ondragenter} event handler for this element + */ + @JsxGetter + public Function getOndragenter() { + return getEventHandler("ondragenter"); + } + + /** + * Sets the {@code ondragenter} event handler for this element. + * @param onchange the {@code ondragenter} event handler for this element + */ + @JsxSetter + public void setOndragenter(final Object ondragenter) { + setEventHandler("ondragenter", ondragenter); + } + + /** + * Returns the {@code ondragleave} event handler for this element. + * @return the {@code ondragleave} event handler for this element + */ + @JsxGetter + public Function getOndragleave() { + return getEventHandler("ondragleave"); + } + + /** + * Sets the {@code ondragleave} event handler for this element. + * @param onchange the {@code ondragleave} event handler for this element + */ + @JsxSetter + public void setOndragleave(final Object ondragleave) { + setEventHandler("ondragleave", ondragleave); + } + + /** + * Returns the {@code ondragover} event handler for this element. + * @return the {@code ondragover} event handler for this element + */ + @JsxGetter + public Function getOndragover() { + return getEventHandler("ondragover"); + } + + /** + * Sets the {@code ondragover} event handler for this element. + * @param onchange the {@code ondragover} event handler for this element + */ + @JsxSetter + public void setOndragover(final Object ondragover) { + setEventHandler("ondragover", ondragover); + } + + /** + * Returns the {@code ondragstart} event handler for this element. + * @return the {@code ondragstart} event handler for this element + */ + @JsxGetter + public Function getOndragstart() { + return getEventHandler("ondragstart"); + } + + /** + * Sets the {@code ondragstart} event handler for this element. + * @param onchange the {@code ondragstart} event handler for this element + */ + @JsxSetter + public void setOndragstart(final Object ondragstart) { + setEventHandler("ondragstart", ondragstart); + } + + /** + * Returns the {@code ondrop} event handler for this element. + * @return the {@code ondrop} event handler for this element + */ + @JsxGetter + public Function getOndrop() { + return getEventHandler("ondrop"); + } + + /** + * Sets the {@code ondrop} event handler for this element. + * @param onchange the {@code ondrop} event handler for this element + */ + @JsxSetter + public void setOndrop(final Object ondrop) { + setEventHandler("ondrop", ondrop); + } + + /** + * Returns the {@code ondurationchange} event handler for this element. + * @return the {@code ondurationchange} event handler for this element + */ + @JsxGetter + public Function getOndurationchange() { + return getEventHandler("ondurationchange"); + } + + /** + * Sets the {@code ondurationchange} event handler for this element. + * @param onchange the {@code ondurationchange} event handler for this element + */ + @JsxSetter + public void setOndurationchange(final Object ondurationchange) { + setEventHandler("ondurationchange", ondurationchange); + } + + /** + * Returns the {@code onemptied} event handler for this element. + * @return the {@code onemptied} event handler for this element + */ + @JsxGetter + public Function getOnemptied() { + return getEventHandler("onemptied"); + } + + /** + * Sets the {@code onemptied} event handler for this element. + * @param onchange the {@code onemptied} event handler for this element + */ + @JsxSetter + public void setOnemptied(final Object onemptied) { + setEventHandler("onemptied", onemptied); + } + + /** + * Returns the {@code onended} event handler for this element. + * @return the {@code onended} event handler for this element + */ + @JsxGetter + public Function getOnended() { + return getEventHandler("onended"); + } + + /** + * Sets the {@code onended} event handler for this element. + * @param onchange the {@code onended} event handler for this element + */ + @JsxSetter + public void setOnended(final Object onended) { + setEventHandler("onended", onended); + } + + /** + * Returns the {@code ongotpointercapture} event handler for this element. + * @return the {@code ongotpointercapture} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOngotpointercapture() { + return getEventHandler("ongotpointercapture"); + } + + /** + * Sets the {@code ongotpointercapture} event handler for this element. + * @param onchange the {@code ongotpointercapture} event handler for this element + */ + @JsxSetter(CHROME) + public void setOngotpointercapture(final Object ongotpointercapture) { + setEventHandler("ongotpointercapture", ongotpointercapture); + } + + /** + * Returns the {@code oninvalid} event handler for this element. + * @return the {@code oninvalid} event handler for this element + */ + @JsxGetter({CHROME, FF}) + public Function getOninvalid() { + return getEventHandler("oninvalid"); + } + + /** + * Sets the {@code oninvalid} event handler for this element. + * @param onchange the {@code oninvalid} event handler for this element + */ + @JsxSetter({CHROME, FF}) + public void setOninvalid(final Object oninvalid) { + setEventHandler("oninvalid", oninvalid); + } + + /** + * Returns the {@code onload} event handler for this element. + * @return the {@code onload} event handler for this element + */ + @JsxGetter + public Function getOnload() { + return getEventHandler("onload"); + } + + /** + * Sets the {@code onload} event handler for this element. + * @param onchange the {@code onload} event handler for this element + */ + @JsxSetter + public void setOnload(final Object onload) { + setEventHandler("onload", onload); + } + + /** + * Returns the {@code onloadeddata} event handler for this element. + * @return the {@code onloadeddata} event handler for this element + */ + @JsxGetter + public Function getOnloadeddata() { + return getEventHandler("onloadeddata"); + } + + /** + * Sets the {@code onloadeddata} event handler for this element. + * @param onchange the {@code onloadeddata} event handler for this element + */ + @JsxSetter + public void setOnloadeddata(final Object onloadeddata) { + setEventHandler("onloadeddata", onloadeddata); + } + + /** + * Returns the {@code onloadedmetadata} event handler for this element. + * @return the {@code onloadedmetadata} event handler for this element + */ + @JsxGetter + public Function getOnloadedmetadata() { + return getEventHandler("onloadedmetadata"); + } + + /** + * Sets the {@code onloadedmetadata} event handler for this element. + * @param onchange the {@code onloadedmetadata} event handler for this element + */ + @JsxSetter + public void setOnloadedmetadata(final Object onloadedmetadata) { + setEventHandler("onloadedmetadata", onloadedmetadata); + } + + /** + * Returns the {@code onloadstart} event handler for this element. + * @return the {@code onloadstart} event handler for this element + */ + @JsxGetter + public Function getOnloadstart() { + return getEventHandler("onloadstart"); + } + + /** + * Sets the {@code onloadstart} event handler for this element. + * @param onchange the {@code onloadstart} event handler for this element + */ + @JsxSetter + public void setOnloadstart(final Object onloadstart) { + setEventHandler("onloadstart", onloadstart); + } + + /** + * Returns the {@code onlostpointercapture} event handler for this element. + * @return the {@code onlostpointercapture} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOnlostpointercapture() { + return getEventHandler("onlostpointercapture"); + } + + /** + * Sets the {@code onlostpointercapture} event handler for this element. + * @param onchange the {@code onlostpointercapture} event handler for this element + */ + @JsxSetter(CHROME) + public void setOnlostpointercapture(final Object onlostpointercapture) { + setEventHandler("onlostpointercapture", onlostpointercapture); + } + + /** + * Returns the {@code onmouseenter} event handler for this element. + * @return the {@code onmouseenter} event handler for this element + */ + @JsxGetter({CHROME, FF}) + public Function getOnmouseenter() { + return getEventHandler("onmouseenter"); + } + + /** + * Sets the {@code onmouseenter} event handler for this element. + * @param onchange the {@code onmouseenter} event handler for this element + */ + @JsxSetter({CHROME, FF}) + public void setOnmouseenter(final Object onmouseenter) { + setEventHandler("onmouseenter", onmouseenter); + } + + /** + * Returns the {@code onmouseleave} event handler for this element. + * @return the {@code onmouseleave} event handler for this element + */ + @JsxGetter({CHROME, FF}) + public Function getOnmouseleave() { + return getEventHandler("onmouseleave"); + } + + /** + * Sets the {@code onmouseleave} event handler for this element. + * @param onchange the {@code onmouseleave} event handler for this element + */ + @JsxSetter({CHROME, FF}) + public void setOnmouseleave(final Object onmouseleave) { + setEventHandler("onmouseleave", onmouseleave); + } + + /** + * Returns the {@code onmousewheel} event handler for this element. + * @return the {@code onmousewheel} event handler for this element + */ + @JsxGetter({CHROME, IE}) + public Function getOnmousewheel() { + return getEventHandler("onmousewheel"); + } + + /** + * Sets the {@code onmousewheel} event handler for this element. + * @param onchange the {@code onmousewheel} event handler for this element + */ + @JsxSetter({CHROME, IE}) + public void setOnmousewheel(final Object onmousewheel) { + setEventHandler("onmousewheel", onmousewheel); + } + + /** + * Returns the {@code onpaste} event handler for this element. + * @return the {@code onpaste} event handler for this element + */ + @JsxGetter({CHROME, FF}) + public Function getOnpaste() { + return getEventHandler("onpaste"); + } + + /** + * Sets the {@code onpaste} event handler for this element. + * @param onchange the {@code onpaste} event handler for this element + */ + @JsxSetter({CHROME, FF}) + public void setOnpaste(final Object onpaste) { + setEventHandler("onpaste", onpaste); + } + + /** + * Returns the {@code onpause} event handler for this element. + * @return the {@code onpause} event handler for this element + */ + @JsxGetter + public Function getOnpause() { + return getEventHandler("onpause"); + } + + /** + * Sets the {@code onpause} event handler for this element. + * @param onchange the {@code onpause} event handler for this element + */ + @JsxSetter + public void setOnpause(final Object onpause) { + setEventHandler("onpause", onpause); + } + + /** + * Returns the {@code onplay} event handler for this element. + * @return the {@code onplay} event handler for this element + */ + @JsxGetter + public Function getOnplay() { + return getEventHandler("onplay"); + } + + /** + * Sets the {@code onplay} event handler for this element. + * @param onchange the {@code onplay} event handler for this element + */ + @JsxSetter + public void setOnplay(final Object onplay) { + setEventHandler("onplay", onplay); + } + + /** + * Returns the {@code onplaying} event handler for this element. + * @return the {@code onplaying} event handler for this element + */ + @JsxGetter + public Function getOnplaying() { + return getEventHandler("onplaying"); + } + + /** + * Sets the {@code onplaying} event handler for this element. + * @param onchange the {@code onplaying} event handler for this element + */ + @JsxSetter + public void setOnplaying(final Object onplaying) { + setEventHandler("onplaying", onplaying); + } + + /** + * Returns the {@code onpointercancel} event handler for this element. + * @return the {@code onpointercancel} event handler for this element + */ + @JsxGetter({CHROME, IE}) + public Function getOnpointercancel() { + return getEventHandler("onpointercancel"); + } + + /** + * Sets the {@code onpointercancel} event handler for this element. + * @param onchange the {@code onpointercancel} event handler for this element + */ + @JsxSetter({CHROME, IE}) + public void setOnpointercancel(final Object onpointercancel) { + setEventHandler("onpointercancel", onpointercancel); + } + + /** + * Returns the {@code onpointerdown} event handler for this element. + * @return the {@code onpointerdown} event handler for this element + */ + @JsxGetter({CHROME, IE}) + public Function getOnpointerdown() { + return getEventHandler("onpointerdown"); + } + + /** + * Sets the {@code onpointerdown} event handler for this element. + * @param onchange the {@code onpointerdown} event handler for this element + */ + @JsxSetter({CHROME, IE}) + public void setOnpointerdown(final Object onpointerdown) { + setEventHandler("onpointerdown", onpointerdown); + } + + /** + * Returns the {@code onpointerenter} event handler for this element. + * @return the {@code onpointerenter} event handler for this element + */ + @JsxGetter({CHROME, IE}) + public Function getOnpointerenter() { + return getEventHandler("onpointerenter"); + } + + /** + * Sets the {@code onpointerenter} event handler for this element. + * @param onchange the {@code onpointerenter} event handler for this element + */ + @JsxSetter({CHROME, IE}) + public void setOnpointerenter(final Object onpointerenter) { + setEventHandler("onpointerenter", onpointerenter); + } + + /** + * Returns the {@code onpointerleave} event handler for this element. + * @return the {@code onpointerleave} event handler for this element + */ + @JsxGetter({CHROME, IE}) + public Function getOnpointerleave() { + return getEventHandler("onpointerleave"); + } + + /** + * Sets the {@code onpointerleave} event handler for this element. + * @param onchange the {@code onpointerleave} event handler for this element + */ + @JsxSetter({CHROME, IE}) + public void setOnpointerleave(final Object onpointerleave) { + setEventHandler("onpointerleave", onpointerleave); + } + + /** + * Returns the {@code onpointerlockchange} event handler for this element. + * @return the {@code onpointerlockchange} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOnpointerlockchange() { + return getEventHandler("onpointerlockchange"); + } + + /** + * Sets the {@code onpointerlockchange} event handler for this element. + * @param onchange the {@code onpointerlockchange} event handler for this element + */ + @JsxSetter(CHROME) + public void setOnpointerlockchange(final Object onpointerlockchange) { + setEventHandler("onpointerlockchange", onpointerlockchange); + } + + /** + * Returns the {@code onpointerlockerror} event handler for this element. + * @return the {@code onpointerlockerror} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOnpointerlockerror() { + return getEventHandler("onpointerlockerror"); + } + + /** + * Sets the {@code onpointerlockerror} event handler for this element. + * @param onchange the {@code onpointerlockerror} event handler for this element + */ + @JsxSetter(CHROME) + public void setOnpointerlockerror(final Object onpointerlockerror) { + setEventHandler("onpointerlockerror", onpointerlockerror); + } + + /** + * Returns the {@code onpointermove} event handler for this element. + * @return the {@code onpointermove} event handler for this element + */ + @JsxGetter({CHROME, IE}) + public Function getOnpointermove() { + return getEventHandler("onpointermove"); + } + + /** + * Sets the {@code onpointermove} event handler for this element. + * @param onchange the {@code onpointermove} event handler for this element + */ + @JsxSetter({CHROME, IE}) + public void setOnpointermove(final Object onpointermove) { + setEventHandler("onpointermove", onpointermove); + } + + /** + * Returns the {@code onpointerout} event handler for this element. + * @return the {@code onpointerout} event handler for this element + */ + @JsxGetter({CHROME, IE}) + public Function getOnpointerout() { + return getEventHandler("onpointerout"); + } + + /** + * Sets the {@code onpointerout} event handler for this element. + * @param onchange the {@code onpointerout} event handler for this element + */ + @JsxSetter({CHROME, IE}) + public void setOnpointerout(final Object onpointerout) { + setEventHandler("onpointerout", onpointerout); + } + + /** + * Returns the {@code onpointerover} event handler for this element. + * @return the {@code onpointerover} event handler for this element + */ + @JsxGetter({CHROME, IE}) + public Function getOnpointerover() { + return getEventHandler("onpointerover"); + } + + /** + * Sets the {@code onpointerover} event handler for this element. + * @param onchange the {@code onpointerover} event handler for this element + */ + @JsxSetter({CHROME, IE}) + public void setOnpointerover(final Object onpointerover) { + setEventHandler("onpointerover", onpointerover); + } + + /** + * Returns the {@code onpointerup} event handler for this element. + * @return the {@code onpointerup} event handler for this element + */ + @JsxGetter({CHROME, IE}) + public Function getOnpointerup() { + return getEventHandler("onpointerup"); + } + + /** + * Sets the {@code onpointerup} event handler for this element. + * @param onchange the {@code onpointerup} event handler for this element + */ + @JsxSetter({CHROME, IE}) + public void setOnpointerup(final Object onpointerup) { + setEventHandler("onpointerup", onpointerup); + } + + /** + * Returns the {@code onprogress} event handler for this element. + * @return the {@code onprogress} event handler for this element + */ + @JsxGetter + public Function getOnprogress() { + return getEventHandler("onprogress"); + } + + /** + * Sets the {@code onprogress} event handler for this element. + * @param onchange the {@code onprogress} event handler for this element + */ + @JsxSetter + public void setOnprogress(final Object onprogress) { + setEventHandler("onprogress", onprogress); + } + + /** + * Returns the {@code onratechange} event handler for this element. + * @return the {@code onratechange} event handler for this element + */ + @JsxGetter + public Function getOnratechange() { + return getEventHandler("onratechange"); + } + + /** + * Sets the {@code onratechange} event handler for this element. + * @param onchange the {@code onratechange} event handler for this element + */ + @JsxSetter + public void setOnratechange(final Object onratechange) { + setEventHandler("onratechange", onratechange); + } + + /** + * Returns the {@code onreadystatechange} event handler for this element. + * @return the {@code onreadystatechange} event handler for this element + */ + @JsxGetter + public Function getOnreadystatechange() { + return getEventHandler("onreadystatechange"); + } + + /** + * Sets the {@code onreadystatechange} event handler for this element. + * @param onchange the {@code onreadystatechange} event handler for this element + */ + @JsxSetter + public void setOnreadystatechange(final Object onreadystatechange) { + setEventHandler("onreadystatechange", onreadystatechange); + } + + /** + * Returns the {@code onreset} event handler for this element. + * @return the {@code onreset} event handler for this element + */ + @JsxGetter + public Function getOnreset() { + return getEventHandler("onreset"); + } + + /** + * Sets the {@code onreset} event handler for this element. + * @param onchange the {@code onreset} event handler for this element + */ + @JsxSetter + public void setOnreset(final Object onreset) { + setEventHandler("onreset", onreset); + } + + /** + * Returns the {@code onscroll} event handler for this element. + * @return the {@code onscroll} event handler for this element + */ + @JsxGetter + public Function getOnscroll() { + return getEventHandler("onscroll"); + } + + /** + * Sets the {@code onscroll} event handler for this element. + * @param onchange the {@code onscroll} event handler for this element + */ + @JsxSetter + public void setOnscroll(final Object onscroll) { + setEventHandler("onscroll", onscroll); + } + + /** + * Returns the {@code onsearch} event handler for this element. + * @return the {@code onsearch} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOnsearch() { + return getEventHandler("onsearch"); + } + + /** + * Sets the {@code onsearch} event handler for this element. + * @param onchange the {@code onsearch} event handler for this element + */ + @JsxSetter(CHROME) + public void setOnsearch(final Object onsearch) { + setEventHandler("onsearch", onsearch); + } + + /** + * Returns the {@code onseeked} event handler for this element. + * @return the {@code onseeked} event handler for this element + */ + @JsxGetter + public Function getOnseeked() { + return getEventHandler("onseeked"); + } + + /** + * Sets the {@code onseeked} event handler for this element. + * @param onchange the {@code onseeked} event handler for this element + */ + @JsxSetter + public void setOnseeked(final Object onseeked) { + setEventHandler("onseeked", onseeked); + } + + /** + * Returns the {@code onseeking} event handler for this element. + * @return the {@code onseeking} event handler for this element + */ + @JsxGetter + public Function getOnseeking() { + return getEventHandler("onseeking"); + } + + /** + * Sets the {@code onseeking} event handler for this element. + * @param onchange the {@code onseeking} event handler for this element + */ + @JsxSetter + public void setOnseeking(final Object onseeking) { + setEventHandler("onseeking", onseeking); + } + + /** + * Returns the {@code onselect} event handler for this element. + * @return the {@code onselect} event handler for this element + */ + @JsxGetter + public Function getOnselect() { + return getEventHandler("onselect"); + } + + /** + * Sets the {@code onselect} event handler for this element. + * @param onchange the {@code onselect} event handler for this element + */ + @JsxSetter + public void setOnselect(final Object onselect) { + setEventHandler("onselect", onselect); + } + + /** + * Returns the {@code onselectionchange} event handler for this element. + * @return the {@code onselectionchange} event handler for this element + */ + @JsxGetter({CHROME, IE}) + public Function getOnselectionchange() { + return getEventHandler("onselectionchange"); + } + + /** + * Sets the {@code onselectionchange} event handler for this element. + * @param onchange the {@code onselectionchange} event handler for this element + */ + @JsxSetter({CHROME, IE}) + public void setOnselectionchange(final Object onselectionchange) { + setEventHandler("onselectionchange", onselectionchange); + } + + /** + * Returns the {@code onselectstart} event handler for this element. + * @return the {@code onselectstart} event handler for this element + */ + @JsxGetter({CHROME, IE}) + public Function getOnselectstart() { + return getEventHandler("onselectstart"); + } + + /** + * Sets the {@code onselectstart} event handler for this element. + * @param onchange the {@code onselectstart} event handler for this element + */ + @JsxSetter({CHROME, IE}) + public void setOnselectstart(final Object onselectstart) { + setEventHandler("onselectstart", onselectstart); + } + + /** + * Returns the {@code onshow} event handler for this element. + * @return the {@code onshow} event handler for this element + */ + @JsxGetter({CHROME, FF}) + public Function getOnshow() { + return getEventHandler("onshow"); + } + + /** + * Sets the {@code onshow} event handler for this element. + * @param onchange the {@code onshow} event handler for this element + */ + @JsxSetter({CHROME, FF}) + public void setOnshow(final Object onshow) { + setEventHandler("onshow", onshow); + } + + /** + * Returns the {@code onstalled} event handler for this element. + * @return the {@code onstalled} event handler for this element + */ + @JsxGetter + public Function getOnstalled() { + return getEventHandler("onstalled"); + } + + /** + * Sets the {@code onstalled} event handler for this element. + * @param onchange the {@code onstalled} event handler for this element + */ + @JsxSetter + public void setOnstalled(final Object onstalled) { + setEventHandler("onstalled", onstalled); + } + + /** + * Returns the {@code onsubmit} event handler for this element. + * @return the {@code onsubmit} event handler for this element + */ + @JsxGetter + public Function getOnsubmit() { + return getEventHandler("onsubmit"); + } + + /** + * Sets the {@code onsubmit} event handler for this element. + * @param onchange the {@code onsubmit} event handler for this element + */ + @JsxSetter + public void setOnsubmit(final Object onsubmit) { + setEventHandler("onsubmit", onsubmit); + } + + /** + * Returns the {@code onsuspend} event handler for this element. + * @return the {@code onsuspend} event handler for this element + */ + @JsxGetter + public Function getOnsuspend() { + return getEventHandler("onsuspend"); + } + + /** + * Sets the {@code onsuspend} event handler for this element. + * @param onchange the {@code onsuspend} event handler for this element + */ + @JsxSetter + public void setOnsuspend(final Object onsuspend) { + setEventHandler("onsuspend", onsuspend); + } + + /** + * Returns the {@code ontimeupdate} event handler for this element. + * @return the {@code ontimeupdate} event handler for this element + */ + @JsxGetter + public Function getOntimeupdate() { + return getEventHandler("ontimeupdate"); + } + + /** + * Sets the {@code ontimeupdate} event handler for this element. + * @param onchange the {@code ontimeupdate} event handler for this element + */ + @JsxSetter + public void setOntimeupdate(final Object ontimeupdate) { + setEventHandler("ontimeupdate", ontimeupdate); + } + + /** + * Returns the {@code ontoggle} event handler for this element. + * @return the {@code ontoggle} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOntoggle() { + return getEventHandler("ontoggle"); + } + + /** + * Sets the {@code ontoggle} event handler for this element. + * @param onchange the {@code ontoggle} event handler for this element + */ + @JsxSetter(CHROME) + public void setOntoggle(final Object ontoggle) { + setEventHandler("ontoggle", ontoggle); + } + + /** + * Returns the {@code onvolumechange} event handler for this element. + * @return the {@code onvolumechange} event handler for this element + */ + @JsxGetter + public Function getOnvolumechange() { + return getEventHandler("onvolumechange"); + } + + /** + * Sets the {@code onvolumechange} event handler for this element. + * @param onchange the {@code onvolumechange} event handler for this element + */ + @JsxSetter + public void setOnvolumechange(final Object onvolumechange) { + setEventHandler("onvolumechange", onvolumechange); + } + + /** + * Returns the {@code onwaiting} event handler for this element. + * @return the {@code onwaiting} event handler for this element + */ + @JsxGetter + public Function getOnwaiting() { + return getEventHandler("onwaiting"); + } + + /** + * Sets the {@code onwaiting} event handler for this element. + * @param onchange the {@code onwaiting} event handler for this element + */ + @JsxSetter + public void setOnwaiting(final Object onwaiting) { + setEventHandler("onwaiting", onwaiting); + } + + /** + * Returns the {@code onwebkitfullscreenchange} event handler for this element. + * @return the {@code onwebkitfullscreenchange} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOnwebkitfullscreenchange() { + return getEventHandler("onwebkitfullscreenchange"); + } + + /** + * Sets the {@code onwebkitfullscreenchange} event handler for this element. + * @param onchange the {@code onwebkitfullscreenchange} event handler for this element + */ + @JsxSetter(CHROME) + public void setOnwebkitfullscreenchange(final Object onwebkitfullscreenchange) { + setEventHandler("onwebkitfullscreenchange", onwebkitfullscreenchange); + } + + /** + * Returns the {@code onwebkitfullscreenerror} event handler for this element. + * @return the {@code onwebkitfullscreenerror} event handler for this element + */ + @JsxGetter(CHROME) + public Function getOnwebkitfullscreenerror() { + return getEventHandler("onwebkitfullscreenerror"); + } + + /** + * Sets the {@code onwebkitfullscreenerror} event handler for this element. + * @param onchange the {@code onwebkitfullscreenerror} event handler for this element + */ + @JsxSetter + public void setOnwebkitfullscreenerror(final Object onwebkitfullscreenerror) { + setEventHandler("onwebkitfullscreenerror", onwebkitfullscreenerror); + } + + /** + * Returns the {@code onwheel} event handler for this element. + * @return the {@code onwheel} event handler for this element + */ + @JsxGetter({CHROME, FF}) + public Function getOnwheel() { + return getEventHandler("onwheel"); + } + + /** + * Sets the {@code onwheel} event handler for this element. + * @param onchange the {@code onwheel} event handler for this element + */ + @JsxSetter({CHROME, FF}) + public void setOnwheel(final Object onwheel) { + setEventHandler("onwheel", onwheel); + } + + /** + * Returns the {@code onafterscriptexecute} event handler for this element. + * @return the {@code onafterscriptexecute} event handler for this element + */ + @JsxGetter(FF) + public Function getOnafterscriptexecute() { + return getEventHandler("onafterscriptexecute"); + } + + /** + * Sets the {@code onafterscriptexecute} event handler for this element. + * @param onchange the {@code onafterscriptexecute} event handler for this element + */ + @JsxSetter(FF) + public void setOnafterscriptexecute(final Object onafterscriptexecute) { + setEventHandler("onafterscriptexecute", onafterscriptexecute); + } + + /** + * Returns the {@code onbeforescriptexecute} event handler for this element. + * @return the {@code onbeforescriptexecute} event handler for this element + */ + @JsxGetter(FF) + public Function getOnbeforescriptexecute() { + return getEventHandler("onbeforescriptexecute"); + } + + /** + * Sets the {@code onbeforescriptexecute} event handler for this element. + * @param onchange the {@code onbeforescriptexecute} event handler for this element + */ + @JsxSetter(FF) + public void setOnbeforescriptexecute(final Object onbeforescriptexecute) { + setEventHandler("onbeforescriptexecute", onbeforescriptexecute); + } + + /** + * Returns the {@code onmozfullscreenchange} event handler for this element. + * @return the {@code onmozfullscreenchange} event handler for this element + */ + @JsxGetter(FF) + public Function getOnmozfullscreenchange() { + return getEventHandler("onmozfullscreenchange"); + } + + /** + * Sets the {@code onmozfullscreenchange} event handler for this element. + * @param onchange the {@code onmozfullscreenchange} event handler for this element + */ + @JsxSetter(FF) + public void setOnmozfullscreenchange(final Object onmozfullscreenchange) { + setEventHandler("onmozfullscreenchange", onmozfullscreenchange); + } + + /** + * Returns the {@code onmozfullscreenerror} event handler for this element. + * @return the {@code onmozfullscreenerror} event handler for this element + */ + @JsxGetter(FF) + public Function getOnmozfullscreenerror() { + return getEventHandler("onmozfullscreenerror"); + } + + /** + * Sets the {@code onmozfullscreenerror} event handler for this element. + * @param onchange the {@code onmozfullscreenerror} event handler for this element + */ + @JsxSetter(FF) + public void setOnmozfullscreenerror(final Object onmozfullscreenerror) { + setEventHandler("onmozfullscreenerror", onmozfullscreenerror); + } + + /** + * Returns the {@code onmozpointerlockchange} event handler for this element. + * @return the {@code onmozpointerlockchange} event handler for this element + */ + @JsxGetter(FF) + public Function getOnmozpointerlockchange() { + return getEventHandler("onmozpointerlockchange"); + } + + /** + * Sets the {@code onmozpointerlockchange} event handler for this element. + * @param onchange the {@code onmozpointerlockchange} event handler for this element + */ + @JsxSetter(FF) + public void setOnmozpointerlockchange(final Object onmozpointerlockchange) { + setEventHandler("onmozpointerlockchange", onmozpointerlockchange); + } + + /** + * Returns the {@code onmozpointerlockerror} event handler for this element. + * @return the {@code onmozpointerlockerror} event handler for this element + */ + @JsxGetter(FF) + public Function getOnmozpointerlockerror() { + return getEventHandler("onmozpointerlockerror"); + } + + /** + * Sets the {@code onmozpointerlockerror} event handler for this element. + * @param onchange the {@code onmozpointerlockerror} event handler for this element + */ + @JsxSetter(FF) + public void setOnmozpointerlockerror(final Object onmozpointerlockerror) { + setEventHandler("onmozpointerlockerror", onmozpointerlockerror); + } + + /** + * Returns the {@code onhelp} event handler for this element. + * @return the {@code onhelp} event handler for this element + */ + @JsxGetter(IE) + public Function getOnhelp() { + return getEventHandler("onhelp"); + } + + /** + * Sets the {@code onhelp} event handler for this element. + * @param onchange the {@code onhelp} event handler for this element + */ + @JsxSetter(IE) + public void setOnhelp(final Object onhelp) { + setEventHandler("onhelp", onhelp); + } + + /** + * Returns the {@code onmscontentzoom} event handler for this element. + * @return the {@code onmscontentzoom} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmscontentzoom() { + return getEventHandler("onmscontentzoom"); + } + + /** + * Sets the {@code onmscontentzoom} event handler for this element. + * @param onchange the {@code onmscontentzoom} event handler for this element + */ + @JsxSetter(IE) + public void setOnmscontentzoom(final Object onmscontentzoom) { + setEventHandler("onmscontentzoom", onmscontentzoom); + } + + /** + * Returns the {@code onmsfullscreenchange} event handler for this element. + * @return the {@code onmsfullscreenchange} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmsfullscreenchange() { + return getEventHandler("onmsfullscreenchange"); + } + + /** + * Sets the {@code onmsfullscreenchange} event handler for this element. + * @param onchange the {@code onmsfullscreenchange} event handler for this element + */ + @JsxSetter(IE) + public void setOnmsfullscreenchange(final Object onmsfullscreenchange) { + setEventHandler("onmsfullscreenchange", onmsfullscreenchange); + } + + /** + * Returns the {@code onmsfullscreenerror} event handler for this element. + * @return the {@code onmsfullscreenerror} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmsfullscreenerror() { + return getEventHandler("onmsfullscreenerror"); + } + + /** + * Sets the {@code onmsfullscreenerror} event handler for this element. + * @param onchange the {@code onmsfullscreenerror} event handler for this element + */ + @JsxSetter(IE) + public void setOnmsfullscreenerror(final Object onmsfullscreenerror) { + setEventHandler("onmsfullscreenerror", onmsfullscreenerror); + } + + /** + * Returns the {@code onmsgesturechange} event handler for this element. + * @return the {@code onmsgesturechange} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmsgesturechange() { + return getEventHandler("onmsgesturechange"); + } + + /** + * Sets the {@code onmsgesturechange} event handler for this element. + * @param onchange the {@code onmsgesturechange} event handler for this element + */ + @JsxSetter(IE) + public void setOnmsgesturechange(final Object onmsgesturechange) { + setEventHandler("onmsgesturechange", onmsgesturechange); + } + + /** + * Returns the {@code onmsgesturedoubletap} event handler for this element. + * @return the {@code onmsgesturedoubletap} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmsgesturedoubletap() { + return getEventHandler("onmsgesturedoubletap"); + } + + /** + * Sets the {@code onmsgesturedoubletap} event handler for this element. + * @param onchange the {@code onmsgesturedoubletap} event handler for this element + */ + @JsxSetter(IE) + public void setOnmsgesturedoubletap(final Object onmsgesturedoubletap) { + setEventHandler("onmsgesturedoubletap", onmsgesturedoubletap); + } + + /** + * Returns the {@code onmsgestureend} event handler for this element. + * @return the {@code onmsgestureend} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmsgestureend() { + return getEventHandler("onmsgestureend"); + } + + /** + * Sets the {@code onmsgestureend} event handler for this element. + * @param onchange the {@code onmsgestureend} event handler for this element + */ + @JsxSetter(IE) + public void setOnmsgestureend(final Object onmsgestureend) { + setEventHandler("onmsgestureend", onmsgestureend); + } + + /** + * Returns the {@code onmsgesturehold} event handler for this element. + * @return the {@code onmsgesturehold} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmsgesturehold() { + return getEventHandler("onmsgesturehold"); + } + + /** + * Sets the {@code onmsgesturehold} event handler for this element. + * @param onchange the {@code onmsgesturehold} event handler for this element + */ + @JsxSetter(IE) + public void setOnmsgesturehold(final Object onmsgesturehold) { + setEventHandler("onmsgesturehold", onmsgesturehold); + } + + /** + * Returns the {@code onmsgesturestart} event handler for this element. + * @return the {@code onmsgesturestart} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmsgesturestart() { + return getEventHandler("onmsgesturestart"); + } + + /** + * Sets the {@code onmsgesturestart} event handler for this element. + * @param onchange the {@code onmsgesturestart} event handler for this element + */ + @JsxSetter(IE) + public void setOnmsgesturestart(final Object onmsgesturestart) { + setEventHandler("onmsgesturestart", onmsgesturestart); + } + + /** + * Returns the {@code onmsgesturetap} event handler for this element. + * @return the {@code onmsgesturetap} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmsgesturetap() { + return getEventHandler("onmsgesturetap"); + } + + /** + * Sets the {@code onmsgesturetap} event handler for this element. + * @param onchange the {@code onmsgesturetap} event handler for this element + */ + @JsxSetter(IE) + public void setOnmsgesturetap(final Object onmsgesturetap) { + setEventHandler("onmsgesturetap", onmsgesturetap); + } + + /** + * Returns the {@code onmsinertiastart} event handler for this element. + * @return the {@code onmsinertiastart} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmsinertiastart() { + return getEventHandler("onmsinertiastart"); + } + + /** + * Sets the {@code onmsinertiastart} event handler for this element. + * @param onchange the {@code onmsinertiastart} event handler for this element + */ + @JsxSetter(IE) + public void setOnmsinertiastart(final Object onmsinertiastart) { + setEventHandler("onmsinertiastart", onmsinertiastart); + } + + /** + * Returns the {@code onmsmanipulationstatechanged} event handler for this element. + * @return the {@code onmsmanipulationstatechanged} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmsmanipulationstatechanged() { + return getEventHandler("onmsmanipulationstatechanged"); + } + + /** + * Sets the {@code onmsmanipulationstatechanged} event handler for this element. + * @param onchange the {@code onmsmanipulationstatechanged} event handler for this element + */ + @JsxSetter(IE) + public void setOnmsmanipulationstatechanged(final Object onmsmanipulationstatechanged) { + setEventHandler("onmsmanipulationstatechanged", onmsmanipulationstatechanged); + } + + /** + * Returns the {@code onmspointercancel} event handler for this element. + * @return the {@code onmspointercancel} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmspointercancel() { + return getEventHandler("onmspointercancel"); + } + + /** + * Sets the {@code onmspointercancel} event handler for this element. + * @param onchange the {@code onmspointercancel} event handler for this element + */ + @JsxSetter(IE) + public void setOnmspointercancel(final Object onmspointercancel) { + setEventHandler("onmspointercancel", onmspointercancel); + } + + /** + * Returns the {@code onmspointerdown} event handler for this element. + * @return the {@code onmspointerdown} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmspointerdown() { + return getEventHandler("onmspointerdown"); + } + + /** + * Sets the {@code onmspointerdown} event handler for this element. + * @param onchange the {@code onmspointerdown} event handler for this element + */ + @JsxSetter(IE) + public void setOnmspointerdown(final Object onmspointerdown) { + setEventHandler("onmspointerdown", onmspointerdown); + } + + /** + * Returns the {@code onmspointerenter} event handler for this element. + * @return the {@code onmspointerenter} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmspointerenter() { + return getEventHandler("onmspointerenter"); + } + + /** + * Sets the {@code onmspointerenter} event handler for this element. + * @param onchange the {@code onmspointerenter} event handler for this element + */ + @JsxSetter(IE) + public void setOnmspointerenter(final Object onmspointerenter) { + setEventHandler("onmspointerenter", onmspointerenter); + } + + /** + * Returns the {@code onmspointerleave} event handler for this element. + * @return the {@code onmspointerleave} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmspointerleave() { + return getEventHandler("onmspointerleave"); + } + + /** + * Sets the {@code onmspointerleave} event handler for this element. + * @param onchange the {@code onmspointerleave} event handler for this element + */ + @JsxSetter(IE) + public void setOnmspointerleave(final Object onmspointerleave) { + setEventHandler("onmspointerleave", onmspointerleave); + } + + /** + * Returns the {@code onmspointermove} event handler for this element. + * @return the {@code onmspointermove} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmspointermove() { + return getEventHandler("onmspointermove"); + } + + /** + * Sets the {@code onmspointermove} event handler for this element. + * @param onchange the {@code onmspointermove} event handler for this element + */ + @JsxSetter(IE) + public void setOnmspointermove(final Object onmspointermove) { + setEventHandler("onmspointermove", onmspointermove); + } + + /** + * Returns the {@code onmspointerout} event handler for this element. + * @return the {@code onmspointerout} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmspointerout() { + return getEventHandler("onmspointerout"); + } + + /** + * Sets the {@code onmspointerout} event handler for this element. + * @param onchange the {@code onmspointerout} event handler for this element + */ + @JsxSetter(IE) + public void setOnmspointerout(final Object onmspointerout) { + setEventHandler("onmspointerout", onmspointerout); + } + + /** + * Returns the {@code onmspointerover} event handler for this element. + * @return the {@code onmspointerover} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmspointerover() { + return getEventHandler("onmspointerover"); + } + + /** + * Sets the {@code onmspointerover} event handler for this element. + * @param onchange the {@code onmspointerover} event handler for this element + */ + @JsxSetter(IE) + public void setOnmspointerover(final Object onmspointerover) { + setEventHandler("onmspointerover", onmspointerover); + } + + /** + * Returns the {@code onmspointerup} event handler for this element. + * @return the {@code onmspointerup} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmspointerup() { + return getEventHandler("onmspointerup"); + } + + /** + * Sets the {@code onmspointerup} event handler for this element. + * @param onchange the {@code onmspointerup} event handler for this element + */ + @JsxSetter(IE) + public void setOnmspointerup(final Object onmspointerup) { + setEventHandler("onmspointerup", onmspointerup); + } + + /** + * Returns the {@code onmssitemodejumplistitemremoved} event handler for this element. + * @return the {@code onmssitemodejumplistitemremoved} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmssitemodejumplistitemremoved() { + return getEventHandler("onmssitemodejumplistitemremoved"); + } + + /** + * Sets the {@code onmssitemodejumplistitemremoved} event handler for this element. + * @param onchange the {@code onmssitemodejumplistitemremoved} event handler for this element + */ + @JsxSetter(IE) + public void setOnmssitemodejumplistitemremoved(final Object onmssitemodejumplistitemremoved) { + setEventHandler("onmssitemodejumplistitemremoved", onmssitemodejumplistitemremoved); + } + + /** + * Returns the {@code onmsthumbnailclick} event handler for this element. + * @return the {@code onmsthumbnailclick} event handler for this element + */ + @JsxGetter(IE) + public Function getOnmsthumbnailclick() { + return getEventHandler("onmsthumbnailclick"); + } + + /** + * Sets the {@code onmsthumbnailclick} event handler for this element. + * @param onchange the {@code onmsthumbnailclick} event handler for this element + */ + @JsxSetter(IE) + publi... [truncated message content] |
From: <asa...@us...> - 2017-05-07 09:41:36
|
Revision: 14405 http://sourceforge.net/p/htmlunit/code/14405 Author: asashour Date: 2017-05-07 09:41:33 +0000 (Sun, 07 May 2017) Log Message: ----------- Fix case Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventTarget.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2017-05-07 09:32:43 UTC (rev 14404) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2017-05-07 09:41:33 UTC (rev 14405) @@ -1099,7 +1099,7 @@ */ @JsxGetter public Object getOnload() { - final Object onload = getHandlerForJavaScript("load"); + final Object onload = getEventHandler("load"); if (onload == null) { final HtmlPage page = (HtmlPage) getWebWindow().getEnclosedPage(); final HtmlElement body = page.getBody(); @@ -1136,10 +1136,19 @@ */ @JsxGetter public Object getOnblur() { - return getHandlerForJavaScript(Event.TYPE_BLUR); + return getEventHandler(Event.TYPE_BLUR); } /** + * Returns the {@code onclick} property (not necessary a function if something else has been set). + * @return the {@code onclick} property + */ + @JsxGetter + public Object getOnclick() { + return getEventHandler(Event.TYPE_LOAD); + } + + /** * Sets the value of the {@code onclick} event handler. * @param onclick the new handler */ @@ -1154,7 +1163,7 @@ */ @JsxGetter public Object getOndblclick() { - return getHandlerForJavaScript(MouseEvent.TYPE_DBL_CLICK); + return getEventHandler(MouseEvent.TYPE_DBL_CLICK); } /** @@ -1172,7 +1181,7 @@ */ @JsxGetter public Object getOnhashchange() { - return getHandlerForJavaScript(Event.TYPE_HASH_CHANGE); + return getEventHandler(Event.TYPE_HASH_CHANGE); } /** @@ -1208,7 +1217,7 @@ */ @JsxGetter public Object getOnbeforeunload() { - return getHandlerForJavaScript(Event.TYPE_BEFORE_UNLOAD); + return getEventHandler(Event.TYPE_BEFORE_UNLOAD); } /** @@ -1226,7 +1235,7 @@ */ @JsxGetter public Object getOnerror() { - return getHandlerForJavaScript(Event.TYPE_ERROR); + return getEventHandler(Event.TYPE_ERROR); } /** @@ -1244,7 +1253,7 @@ */ @JsxGetter public Object getOnmessage() { - return getHandlerForJavaScript(Event.TYPE_MESSAGE); + return getEventHandler(Event.TYPE_MESSAGE); } /** @@ -1274,10 +1283,6 @@ } } - private Object getHandlerForJavaScript(final String eventName) { - return getEventListenersContainer().getEventHandler(eventName); - } - private void setHandlerForJavaScript(final String eventName, final Object handler) { if (handler == null || handler instanceof Function) { getEventListenersContainer().setEventHandler(eventName, handler); @@ -2060,7 +2065,7 @@ */ @JsxGetter public Object getOnchange() { - return getHandlerForJavaScript(Event.TYPE_CHANGE); + return getEventHandler(Event.TYPE_CHANGE); } /** @@ -2078,7 +2083,7 @@ */ @JsxGetter public Object getOnsubmit() { - return getHandlerForJavaScript(Event.TYPE_SUBMIT); + return getEventHandler(Event.TYPE_SUBMIT); } /** @@ -2299,7 +2304,7 @@ */ @JsxSetter(IE) public void setOnfocusin(final Object onfocusin) { - setEventHandler("focusin", onfocusin); + setHandlerForJavaScript("focusin", onfocusin); } /** @@ -2317,7 +2322,7 @@ */ @JsxSetter public void setOnfocus(final Object onfocus) { - setEventHandler("focus", onfocus); + setHandlerForJavaScript("focus", onfocus); } /** @@ -2335,7 +2340,7 @@ */ @JsxSetter public void setOndragend(final Object ondragend) { - setEventHandler("dragend", ondragend); + setHandlerForJavaScript("dragend", ondragend); } /** @@ -2353,7 +2358,7 @@ */ @JsxSetter({CHROME, FF}) public void setOninvalid(final Object oninvalid) { - setEventHandler("invalid", oninvalid); + setHandlerForJavaScript("invalid", oninvalid); } /** @@ -2371,7 +2376,7 @@ */ @JsxSetter({CHROME, IE}) public void setOnpointerout(final Object onpointerout) { - setEventHandler("pointerout", onpointerout); + setHandlerForJavaScript("pointerout", onpointerout); } /** @@ -2389,7 +2394,7 @@ */ @JsxSetter(IE) public void setOnhelp(final Object onhelp) { - setEventHandler("help", onhelp); + setHandlerForJavaScript("help", onhelp); } /** @@ -2407,7 +2412,7 @@ */ @JsxSetter public void setOnratechange(final Object onratechange) { - setEventHandler("ratechange", onratechange); + setHandlerForJavaScript("ratechange", onratechange); } /** @@ -2425,7 +2430,7 @@ */ @JsxSetter(CHROME) public void setOnanimationiteration(final Object onanimationiteration) { - setEventHandler("animationiteration", onanimationiteration); + setHandlerForJavaScript("animationiteration", onanimationiteration); } /** @@ -2443,7 +2448,7 @@ */ @JsxSetter public void setOncanplaythrough(final Object oncanplaythrough) { - setEventHandler("canplaythrough", oncanplaythrough); + setHandlerForJavaScript("canplaythrough", oncanplaythrough); } /** @@ -2461,7 +2466,7 @@ */ @JsxSetter(CHROME) public void setOncancel(final Object oncancel) { - setEventHandler("cancel", oncancel); + setHandlerForJavaScript("cancel", oncancel); } /** @@ -2479,7 +2484,7 @@ */ @JsxSetter({CHROME, IE}) public void setOnpointerenter(final Object onpointerenter) { - setEventHandler("pointerenter", onpointerenter); + setHandlerForJavaScript("pointerenter", onpointerenter); } /** @@ -2497,7 +2502,7 @@ */ @JsxSetter public void setOnselect(final Object onselect) { - setEventHandler("select", onselect); + setHandlerForJavaScript("select", onselect); } /** @@ -2515,7 +2520,7 @@ */ @JsxSetter(CHROME) public void setOnauxclick(final Object onauxclick) { - setEventHandler("auxclick", onauxclick); + setHandlerForJavaScript("auxclick", onauxclick); } /** @@ -2533,7 +2538,7 @@ */ @JsxSetter public void setOnscroll(final Object onscroll) { - setEventHandler("scroll", onscroll); + setHandlerForJavaScript("scroll", onscroll); } /** @@ -2551,7 +2556,7 @@ */ @JsxSetter public void setOnkeydown(final Object onkeydown) { - setEventHandler("keydown", onkeydown); + setHandlerForJavaScript("keydown", onkeydown); } /** @@ -2569,7 +2574,7 @@ */ @JsxSetter(IE) public void setOnmspointerleave(final Object onmspointerleave) { - setEventHandler("mspointerleave", onmspointerleave); + setHandlerForJavaScript("mspointerleave", onmspointerleave); } /** @@ -2587,7 +2592,7 @@ */ @JsxSetter(FF) public void setOnmozpointerlockchange(final Object onmozpointerlockchange) { - setEventHandler("mozpointerlockchange", onmozpointerlockchange); + setHandlerForJavaScript("mozpointerlockchange", onmozpointerlockchange); } /** @@ -2605,7 +2610,7 @@ */ @JsxSetter(CHROME) public void setOnwebkitanimationstart(final Object onwebkitanimationstart) { - setEventHandler("webkitanimationstart", onwebkitanimationstart); + setHandlerForJavaScript("webkitanimationstart", onwebkitanimationstart); } /** @@ -2623,7 +2628,7 @@ */ @JsxSetter public void setOnkeyup(final Object onkeyup) { - setEventHandler("keyup", onkeyup); + setHandlerForJavaScript("keyup", onkeyup); } /** @@ -2641,7 +2646,7 @@ */ @JsxSetter(IE) public void setOnmsgesturestart(final Object onmsgesturestart) { - setEventHandler("msgesturestart", onmsgesturestart); + setHandlerForJavaScript("msgesturestart", onmsgesturestart); } /** @@ -2659,7 +2664,7 @@ */ @JsxSetter(FF) public void setOndeviceproximity(final Object ondeviceproximity) { - setEventHandler("deviceproximity", ondeviceproximity); + setHandlerForJavaScript("deviceproximity", ondeviceproximity); } /** @@ -2677,7 +2682,7 @@ */ @JsxSetter public void setOnreset(final Object onreset) { - setEventHandler("reset", onreset); + setHandlerForJavaScript("reset", onreset); } /** @@ -2695,7 +2700,7 @@ */ @JsxSetter public void setOnkeypress(final Object onkeypress) { - setEventHandler("keypress", onkeypress); + setHandlerForJavaScript("keypress", onkeypress); } /** @@ -2713,7 +2718,7 @@ */ @JsxSetter public void setOndrag(final Object ondrag) { - setEventHandler("drag", ondrag); + setHandlerForJavaScript("drag", ondrag); } /** @@ -2731,7 +2736,7 @@ */ @JsxSetter(IE) public void setOnfocusout(final Object onfocusout) { - setEventHandler("focusout", onfocusout); + setHandlerForJavaScript("focusout", onfocusout); } /** @@ -2749,7 +2754,7 @@ */ @JsxSetter public void setOnseeked(final Object onseeked) { - setEventHandler("seeked", onseeked); + setHandlerForJavaScript("seeked", onseeked); } /** @@ -2767,7 +2772,7 @@ */ @JsxSetter public void setOnoffline(final Object onoffline) { - setEventHandler("offline", onoffline); + setHandlerForJavaScript("offline", onoffline); } /** @@ -2785,7 +2790,7 @@ */ @JsxSetter({CHROME, FF}) public void setOndeviceorientation(final Object ondeviceorientation) { - setEventHandler("deviceorientation", ondeviceorientation); + setHandlerForJavaScript("deviceorientation", ondeviceorientation); } /** @@ -2803,7 +2808,7 @@ */ @JsxSetter(CHROME) public void setOntoggle(final Object ontoggle) { - setEventHandler("toggle", ontoggle); + setHandlerForJavaScript("toggle", ontoggle); } /** @@ -2821,7 +2826,7 @@ */ @JsxSetter public void setOnplay(final Object onplay) { - setEventHandler("play", onplay); + setHandlerForJavaScript("play", onplay); } /** @@ -2839,7 +2844,7 @@ */ @JsxSetter public void setOncontextmenu(final Object oncontextmenu) { - setEventHandler("contextmenu", oncontextmenu); + setHandlerForJavaScript("contextmenu", oncontextmenu); } /** @@ -2857,7 +2862,7 @@ */ @JsxSetter public void setOnmousemove(final Object onmousemove) { - setEventHandler("mousemove", onmousemove); + setHandlerForJavaScript("mousemove", onmousemove); } /** @@ -2875,7 +2880,7 @@ */ @JsxSetter(IE) public void setOnreadystatechange(final Object onreadystatechange) { - setEventHandler("readystatechange", onreadystatechange); + setHandlerForJavaScript("readystatechange", onreadystatechange); } /** @@ -2893,7 +2898,7 @@ */ @JsxSetter(IE) public void setOnmspointerover(final Object onmspointerover) { - setEventHandler("mspointerover", onmspointerover); + setHandlerForJavaScript("mspointerover", onmspointerover); } /** @@ -2911,7 +2916,7 @@ */ @JsxSetter({CHROME, IE}) public void setOnpointermove(final Object onpointermove) { - setEventHandler("pointermove", onpointermove); + setHandlerForJavaScript("pointermove", onpointermove); } /** @@ -2929,7 +2934,7 @@ */ @JsxSetter(IE) public void setOnmspointermove(final Object onmspointermove) { - setEventHandler("mspointermove", onmspointermove); + setHandlerForJavaScript("mspointermove", onmspointermove); } /** @@ -2947,7 +2952,7 @@ */ @JsxSetter public void setOnmouseover(final Object onmouseover) { - setEventHandler("mouseover", onmouseover); + setHandlerForJavaScript("mouseover", onmouseover); } /** @@ -2965,7 +2970,7 @@ */ @JsxSetter(FF) public void setOnuserproximity(final Object onuserproximity) { - setEventHandler("userproximity", onuserproximity); + setHandlerForJavaScript("userproximity", onuserproximity); } /** @@ -2983,7 +2988,7 @@ */ @JsxSetter(CHROME) public void setOnlostpointercapture(final Object onlostpointercapture) { - setEventHandler("lostpointercapture", onlostpointercapture); + setHandlerForJavaScript("lostpointercapture", onlostpointercapture); } /** @@ -3001,7 +3006,7 @@ */ @JsxSetter({CHROME, IE}) public void setOnpointerover(final Object onpointerover) { - setEventHandler("pointerover", onpointerover); + setHandlerForJavaScript("pointerover", onpointerover); } /** @@ -3019,7 +3024,7 @@ */ @JsxSetter(CHROME) public void setOnclose(final Object onclose) { - setEventHandler("close", onclose); + setHandlerForJavaScript("close", onclose); } /** @@ -3037,7 +3042,7 @@ */ @JsxSetter(CHROME) public void setOnanimationend(final Object onanimationend) { - setEventHandler("animationend", onanimationend); + setHandlerForJavaScript("animationend", onanimationend); } /** @@ -3055,7 +3060,7 @@ */ @JsxSetter public void setOndragenter(final Object ondragenter) { - setEventHandler("dragenter", ondragenter); + setHandlerForJavaScript("dragenter", ondragenter); } /** @@ -3073,7 +3078,7 @@ */ @JsxSetter(FF) public void setOnafterprint(final Object onafterprint) { - setEventHandler("afterprint", onafterprint); + setHandlerForJavaScript("afterprint", onafterprint); } /** @@ -3091,7 +3096,7 @@ */ @JsxSetter(FF) public void setOnmozfullscreenerror(final Object onmozfullscreenerror) { - setEventHandler("mozfullscreenerror", onmozfullscreenerror); + setHandlerForJavaScript("mozfullscreenerror", onmozfullscreenerror); } /** @@ -3109,7 +3114,7 @@ */ @JsxSetter public void setOnmouseleave(final Object onmouseleave) { - setEventHandler("mouseleave", onmouseleave); + setHandlerForJavaScript("mouseleave", onmouseleave); } /** @@ -3127,7 +3132,7 @@ */ @JsxSetter({CHROME, IE}) public void setOnmousewheel(final Object onmousewheel) { - setEventHandler("mousewheel", onmousewheel); + setHandlerForJavaScript("mousewheel", onmousewheel); } /** @@ -3145,7 +3150,7 @@ */ @JsxSetter public void setOnseeking(final Object onseeking) { - setEventHandler("seeking", onseeking); + setHandlerForJavaScript("seeking", onseeking); } /** @@ -3163,7 +3168,7 @@ */ @JsxSetter(CHROME) public void setOncuechange(final Object oncuechange) { - setEventHandler("cuechange", oncuechange); + setHandlerForJavaScript("cuechange", oncuechange); } /** @@ -3181,7 +3186,7 @@ */ @JsxSetter public void setOnpageshow(final Object onpageshow) { - setEventHandler("pageshow", onpageshow); + setHandlerForJavaScript("pageshow", onpageshow); } /** @@ -3199,7 +3204,7 @@ */ @JsxSetter(IE) public void setOnmspointerenter(final Object onmspointerenter) { - setEventHandler("mspointerenter", onmspointerenter); + setHandlerForJavaScript("mspointerenter", onmspointerenter); } /** @@ -3217,7 +3222,7 @@ */ @JsxSetter(FF) public void setOnmozfullscreenchange(final Object onmozfullscreenchange) { - setEventHandler("mozfullscreenchange", onmozfullscreenchange); + setHandlerForJavaScript("mozfullscreenchange", onmozfullscreenchange); } /** @@ -3235,7 +3240,7 @@ */ @JsxSetter public void setOndurationchange(final Object ondurationchange) { - setEventHandler("durationchange", ondurationchange); + setHandlerForJavaScript("durationchange", ondurationchange); } /** @@ -3253,7 +3258,7 @@ */ @JsxSetter public void setOnplaying(final Object onplaying) { - setEventHandler("playing", onplaying); + setHandlerForJavaScript("playing", onplaying); } /** @@ -3271,7 +3276,7 @@ */ @JsxSetter public void setOnended(final Object onended) { - setEventHandler("ended", onended); + setHandlerForJavaScript("ended", onended); } /** @@ -3289,7 +3294,7 @@ */ @JsxSetter public void setOnloadeddata(final Object onloadeddata) { - setEventHandler("loadeddata", onloadeddata); + setHandlerForJavaScript("loadeddata", onloadeddata); } /** @@ -3307,7 +3312,7 @@ */ @JsxSetter(CHROME) public void setOnunhandledrejection(final Object onunhandledrejection) { - setEventHandler("unhandledrejection", onunhandledrejection); + setHandlerForJavaScript("unhandledrejection", onunhandledrejection); } /** @@ -3325,7 +3330,7 @@ */ @JsxSetter public void setOnmouseout(final Object onmouseout) { - setEventHandler("mouseout", onmouseout); + setHandlerForJavaScript("mouseout", onmouseout); } /** @@ -3343,7 +3348,7 @@ */ @JsxSetter public void setOnsuspend(final Object onsuspend) { - setEventHandler("suspend", onsuspend); + setHandlerForJavaScript("suspend", onsuspend); } /** @@ -3361,7 +3366,7 @@ */ @JsxSetter public void setOnwaiting(final Object onwaiting) { - setEventHandler("waiting", onwaiting); + setHandlerForJavaScript("waiting", onwaiting); } /** @@ -3379,7 +3384,7 @@ */ @JsxSetter public void setOncanplay(final Object oncanplay) { - setEventHandler("canplay", oncanplay); + setHandlerForJavaScript("canplay", oncanplay); } /** @@ -3397,7 +3402,7 @@ */ @JsxSetter public void setOnmousedown(final Object onmousedown) { - setEventHandler("mousedown", onmousedown); + setHandlerForJavaScript("mousedown", onmousedown); } /** @@ -3415,7 +3420,7 @@ */ @JsxSetter({CHROME, FF}) public void setOnlanguagechange(final Object onlanguagechange) { - setEventHandler("languagechange", onlanguagechange); + setHandlerForJavaScript("languagechange", onlanguagechange); } /** @@ -3433,7 +3438,7 @@ */ @JsxSetter public void setOnemptied(final Object onemptied) { - setEventHandler("emptied", onemptied); + setHandlerForJavaScript("emptied", onemptied); } /** @@ -3451,7 +3456,7 @@ */ @JsxSetter(CHROME) public void setOnrejectionhandled(final Object onrejectionhandled) { - setEventHandler("rejectionhandled", onrejectionhandled); + setHandlerForJavaScript("rejectionhandled", onrejectionhandled); } /** @@ -3469,7 +3474,7 @@ */ @JsxSetter({CHROME, IE}) public void setOnpointercancel(final Object onpointercancel) { - setEventHandler("pointercancel", onpointercancel); + setHandlerForJavaScript("pointercancel", onpointercancel); } /** @@ -3487,7 +3492,7 @@ */ @JsxSetter(IE) public void setOnmsgestureend(final Object onmsgestureend) { - setEventHandler("msgestureend", onmsgestureend); + setHandlerForJavaScript("msgestureend", onmsgestureend); } /** @@ -3505,7 +3510,7 @@ */ @JsxSetter public void setOnresize(final Object onresize) { - setEventHandler("resize", onresize); + setHandlerForJavaScript("resize", onresize); } /** @@ -3523,7 +3528,7 @@ */ @JsxSetter public void setOnpause(final Object onpause) { - setEventHandler("pause", onpause); + setHandlerForJavaScript("pause", onpause); } /** @@ -3541,7 +3546,7 @@ */ @JsxSetter public void setOnloadstart(final Object onloadstart) { - setEventHandler("loadstart", onloadstart); + setHandlerForJavaScript("loadstart", onloadstart); } /** @@ -3559,7 +3564,7 @@ */ @JsxSetter public void setOnprogress(final Object onprogress) { - setEventHandler("progress", onprogress); + setHandlerForJavaScript("progress", onprogress); } /** @@ -3577,7 +3582,7 @@ */ @JsxSetter({CHROME, IE}) public void setOnpointerup(final Object onpointerup) { - setEventHandler("pointerup", onpointerup); + setHandlerForJavaScript("pointerup", onpointerup); } /** @@ -3595,7 +3600,7 @@ */ @JsxSetter({CHROME, FF}) public void setOnwheel(final Object onwheel) { - setEventHandler("wheel", onwheel); + setHandlerForJavaScript("wheel", onwheel); } /** @@ -3613,7 +3618,7 @@ */ @JsxSetter(IE) public void setOnmspointerdown(final Object onmspointerdown) { - setEventHandler("mspointerdown", onmspointerdown); + setHandlerForJavaScript("mspointerdown", onmspointerdown); } /** @@ -3631,7 +3636,7 @@ */ @JsxSetter({CHROME, IE}) public void setOnpointerleave(final Object onpointerleave) { - setEventHandler("pointerleave", onpointerleave); + setHandlerForJavaScript("pointerleave", onpointerleave); } /** @@ -3649,7 +3654,7 @@ */ @JsxSetter(FF) public void setOnbeforeprint(final Object onbeforeprint) { - setEventHandler("beforeprint", onbeforeprint); + setHandlerForJavaScript("beforeprint", onbeforeprint); } /** @@ -3667,7 +3672,7 @@ */ @JsxSetter public void setOnstorage(final Object onstorage) { - setEventHandler("storage", onstorage); + setHandlerForJavaScript("storage", onstorage); } /** @@ -3685,7 +3690,7 @@ */ @JsxSetter(FF) public void setOndevicelight(final Object ondevicelight) { - setEventHandler("devicelight", ondevicelight); + setHandlerForJavaScript("devicelight", ondevicelight); } /** @@ -3703,7 +3708,7 @@ */ @JsxSetter(CHROME) public void setOnanimationstart(final Object onanimationstart) { - setEventHandler("animationstart", onanimationstart); + setHandlerForJavaScript("animationstart", onanimationstart); } /** @@ -3721,7 +3726,7 @@ */ @JsxSetter(IE) public void setOnmspointercancel(final Object onmspointercancel) { - setEventHandler("mspointercancel", onmspointercancel); + setHandlerForJavaScript("mspointercancel", onmspointercancel); } /** @@ -3739,7 +3744,7 @@ */ @JsxSetter public void setOntimeupdate(final Object ontimeupdate) { - setEventHandler("timeupdate", ontimeupdate); + setHandlerForJavaScript("timeupdate", ontimeupdate); } /** @@ -3757,7 +3762,7 @@ */ @JsxSetter public void setOnpagehide(final Object onpagehide) { - setEventHandler("pagehide", onpagehide); + setHandlerForJavaScript("pagehide", onpagehide); } /** @@ -3775,7 +3780,7 @@ */ @JsxSetter(CHROME) public void setOnwebkitanimationiteration(final Object onwebkitanimationiteration) { - setEventHandler("webkitanimationiteration", onwebkitanimationiteration); + setHandlerForJavaScript("webkitanimationiteration", onwebkitanimationiteration); } /** @@ -3793,7 +3798,7 @@ */ @JsxSetter(IE) public void setOnmspointerup(final Object onmspointerup) { - setEventHandler("mspointerup", onmspointerup); + setHandlerForJavaScript("mspointerup", onmspointerup); } /** @@ -3811,7 +3816,7 @@ */ @JsxSetter({CHROME, FF}) public void setOnabort(final Object onabort) { - setEventHandler("abort", onabort); + setHandlerForJavaScript("abort", onabort); } /** @@ -3829,7 +3834,7 @@ */ @JsxSetter public void setOnloadedmetadata(final Object onloadedmetadata) { - setEventHandler("loadedmetadata", onloadedmetadata); + setHandlerForJavaScript("loadedmetadata", onloadedmetadata); } /** @@ -3847,7 +3852,7 @@ */ @JsxSetter(IE) public void setOnmsinertiastart(final Object onmsinertiastart) { - setEventHandler("msinertiastart", onmsinertiastart); + setHandlerForJavaScript("msinertiastart", onmsinertiastart); } /** @@ -3865,7 +3870,7 @@ */ @JsxSetter public void setOnmouseup(final Object onmouseup) { - setEventHandler("mouseup", onmouseup); + setHandlerForJavaScript("mouseup", onmouseup); } /** @@ -3883,7 +3888,7 @@ */ @JsxSetter(IE) public void setOnmsgesturetap(final Object onmsgesturetap) { - setEventHandler("msgesturetap", onmsgesturetap); + setHandlerForJavaScript("msgesturetap", onmsgesturetap); } /** @@ -3901,7 +3906,7 @@ */ @JsxSetter public void setOndragover(final Object ondragover) { - setEventHandler("dragover", ondragover); + setHandlerForJavaScript("dragover", ondragover); } /** @@ -3919,7 +3924,7 @@ */ @JsxSetter public void setOnonline(final Object ononline) { - setEventHandler("online", ononline); + setHandlerForJavaScript("online", ononline); } /** @@ -3937,7 +3942,7 @@ */ @JsxSetter(IE) public void setOnmsgesturedoubletap(final Object onmsgesturedoubletap) { - setEventHandler("msgesturedoubletap", onmsgesturedoubletap); + setHandlerForJavaScript("msgesturedoubletap", onmsgesturedoubletap); } /** @@ -3955,7 +3960,7 @@ */ @JsxSetter(CHROME) public void setOnsearch(final Object onsearch) { - setEventHandler("search", onsearch); + setHandlerForJavaScript("search", onsearch); } /** @@ -3973,7 +3978,7 @@ */ @JsxSetter public void setOninput(final Object oninput) { - setEventHandler("input", oninput); + setHandlerForJavaScript("input", oninput); } /** @@ -3991,7 +3996,7 @@ */ @JsxSetter(FF) public void setOnmozpointerlockerror(final Object onmozpointerlockerror) { - setEventHandler("mozpointerlockerror", onmozpointerlockerror); + setHandlerForJavaScript("mozpointerlockerror", onmozpointerlockerror); } /** @@ -4009,7 +4014,7 @@ */ @JsxSetter(CHROME) public void setOnwebkittransitionend(final Object onwebkittransitionend) { - setEventHandler("webkittransitionend", onwebkittransitionend); + setHandlerForJavaScript("webkittransitionend", onwebkittransitionend); } /** @@ -4027,7 +4032,7 @@ */ @JsxSetter(IE) public void setOnmspointerout(final Object onmspointerout) { - setEventHandler("mspointerout", onmspointerout); + setHandlerForJavaScript("mspointerout", onmspointerout); } /** @@ -4045,7 +4050,7 @@ */ @JsxSetter({CHROME, FF}) public void setOndevicemotion(final Object ondevicemotion) { - setEventHandler("devicemotion", ondevicemotion); + setHandlerForJavaScript("devicemotion", ondevicemotion); } /** @@ -4063,7 +4068,7 @@ */ @JsxSetter public void setOnstalled(final Object onstalled) { - setEventHandler("stalled", onstalled); + setHandlerForJavaScript("stalled", onstalled); } /** @@ -4081,7 +4086,7 @@ */ @JsxSetter public void setOnmouseenter(final Object onmouseenter) { - setEventHandler("mouseenter", onmouseenter); + setHandlerForJavaScript("mouseenter", onmouseenter); } /** @@ -4099,7 +4104,7 @@ */ @JsxSetter public void setOndragleave(final Object ondragleave) { - setEventHandler("dragleave", ondragleave); + setHandlerForJavaScript("dragleave", ondragleave); } /** @@ -4117,7 +4122,7 @@ */ @JsxSetter({CHROME, IE}) public void setOnpointerdown(final Object onpointerdown) { - setEventHandler("pointerdown", onpointerdown); + setHandlerForJavaScript("pointerdown", onpointerdown); } /** @@ -4135,7 +4140,7 @@ */ @JsxSetter public void setOndrop(final Object ondrop) { - setEventHandler("drop", ondrop); + setHandlerForJavaScript("drop", ondrop); } /** @@ -4153,7 +4158,7 @@ */ @JsxSetter public void setOnunload(final Object onunload) { - setEventHandler("unload", onunload); + setHandlerForJavaScript("unload", onunload); } /** @@ -4171,7 +4176,7 @@ */ @JsxSetter(CHROME) public void setOnwebkitanimationend(final Object onwebkitanimationend) { - setEventHandler("webkitanimationend", onwebkitanimationend); + setHandlerForJavaScript("webkitanimationend", onwebkitanimationend); } /** @@ -4189,7 +4194,7 @@ */ @JsxSetter public void setOndragstart(final Object ondragstart) { - setEventHandler("dragstart", ondragstart); + setHandlerForJavaScript("dragstart", ondragstart); } /** @@ -4207,7 +4212,7 @@ */ @JsxSetter(CHROME) public void setOntransitionend(final Object ontransitionend) { - setEventHandler("transitionend", ontransitionend); + setHandlerForJavaScript("transitionend", ontransitionend); } /** @@ -4225,7 +4230,7 @@ */ @JsxSetter(IE) public void setOnmsgesturehold(final Object onmsgesturehold) { - setEventHandler("msgesturehold", onmsgesturehold); + setHandlerForJavaScript("msgesturehold", onmsgesturehold); } /** @@ -4243,7 +4248,7 @@ */ @JsxSetter(CHROME) public void setOndeviceorientationabsolute(final Object ondeviceorientationabsolute) { - setEventHandler("deviceorientationabsolute", ondeviceorientationabsolute); + setHandlerForJavaScript("deviceorientationabsolute", ondeviceorientationabsolute); } /** @@ -4261,7 +4266,7 @@ */ @JsxSetter({CHROME, FF}) public void setOnshow(final Object onshow) { - setEventHandler("show", onshow); + setHandlerForJavaScript("show", onshow); } /** @@ -4279,7 +4284,7 @@ */ @JsxSetter public void setOnvolumechange(final Object onvolumechange) { - setEventHandler("volumechange", onvolumechange); + setHandlerForJavaScript("volumechange", onvolumechange); } /** @@ -4297,7 +4302,7 @@ */ @JsxSetter(IE) public void setOnmsgesturechange(final Object onmsgesturechange) { - setEventHandler("msgesturechange", onmsgesturechange); + setHandlerForJavaScript("msgesturechange", onmsgesturechange); } /** @@ -4315,7 +4320,7 @@ */ @JsxSetter(CHROME) public void setOngotpointercapture(final Object ongotpointercapture) { - setEventHandler("gotpointercapture", ongotpointercapture); + setHandlerForJavaScript("gotpointercapture", ongotpointercapture); } /** @@ -4333,7 +4338,7 @@ */ @JsxSetter public void setOnpopstate(final Object onpopstate) { - setEventHandler("popstate", onpopstate); + setHandlerForJavaScript("popstate", onpopstate); } } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventTarget.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventTarget.java 2017-05-07 09:32:43 UTC (rev 14404) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventTarget.java 2017-05-07 09:41:33 UTC (rev 14405) @@ -228,10 +228,7 @@ * @return the handler function, or {@code null} if the property is null or not a function */ public Function getEventHandler(final String eventType) { - if (eventListenersContainer_ == null) { - return null; - } - return eventListenersContainer_.getEventHandler(eventType); + return getEventListenersContainer().getEventHandler(eventType); } /** Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java 2017-05-07 09:32:43 UTC (rev 14404) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java 2017-05-07 09:41:33 UTC (rev 14405) @@ -1218,7 +1218,6 @@ */ @Test @Alerts({"123", "captured"}) - @NotYetImplemented public void captureEvents() throws Exception { final String content = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "<html><head><title>foo</title>\n" |
From: <rb...@us...> - 2017-05-08 06:41:06
|
Revision: 14411 http://sourceforge.net/p/htmlunit/code/14411 Author: rbri Date: 2017-05-08 06:41:03 +0000 (Mon, 08 May 2017) Log Message: ----------- FF52 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMCursor.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMCursor.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMCursor.java 2017-05-08 06:36:19 UTC (rev 14410) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMCursor.java 2017-05-08 06:41:03 UTC (rev 14411) @@ -18,6 +18,7 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget; /** * A JavaScript object for {@code DOMCursor}. @@ -25,7 +26,7 @@ * @author Ahmed Ashour */ @JsxClass(FF) -public class DOMCursor extends DOMRequest { +public class DOMCursor extends EventTarget { /** * Creates a new instance. Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java 2017-05-08 06:36:19 UTC (rev 14410) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java 2017-05-08 06:41:03 UTC (rev 14411) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.general.huge; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; import java.util.Collection; @@ -347,6 +348,7 @@ @Test @Alerts(DEFAULT = "false", FF52 = "true") + @NotYetImplemented(FF52) public void _Audio_HTMLAudioElement() throws Exception { test("Audio", "HTMLAudioElement"); } @@ -1306,6 +1308,7 @@ @Alerts(DEFAULT = "false", FF52 = "true", CHROME = "true") + @NotYetImplemented(FF52) public void _AudioNode_ConstantSourceNode() throws Exception { test("AudioNode", "ConstantSourceNode"); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java 2017-05-08 06:36:19 UTC (rev 14410) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java 2017-05-08 06:41:03 UTC (rev 14411) @@ -15,6 +15,8 @@ package com.gargoylesoftware.htmlunit.general.huge; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF45; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; import java.util.Collection; @@ -3697,6 +3699,7 @@ @Test @Alerts(DEFAULT = "false", FF52 = "true") + @NotYetImplemented(FF52) public void _EventTarget_Screen() throws Exception { test("EventTarget", "Screen"); } @@ -4112,6 +4115,7 @@ @Alerts(DEFAULT = "true", FF52 = "false", IE = "false") + @NotYetImplemented(FF52) public void _EventTarget_MediaQueryList() throws Exception { test("EventTarget", "MediaQueryList"); } @@ -4220,6 +4224,7 @@ @Alerts(DEFAULT = "true", FF52 = "false", IE = "false") + @NotYetImplemented(FF52) public void _EventTarget_Performance() throws Exception { test("EventTarget", "Performance"); } @@ -4287,6 +4292,7 @@ @Test @Alerts(DEFAULT = "false", FF45 = "true") + @NotYetImplemented(FF45) public void _DOMRequest_DOMCursor() throws Exception { test("DOMRequest", "DOMCursor"); } @@ -4388,7 +4394,7 @@ @Alerts(DEFAULT = "false", CHROME = "true", FF52 = "true") - @NotYetImplemented(CHROME) + @NotYetImplemented({CHROME, FF52}) public void _Error_DOMException() throws Exception { test("Error", "DOMException"); } @@ -4458,6 +4464,7 @@ @Test @Alerts(DEFAULT = "false", FF52 = "true") + @NotYetImplemented(FF52) public void _DOMMatrixReadOnly_WebKitCSSMatrix() throws Exception { test("DOMMatrixReadOnly", "WebKitCSSMatrix"); } @@ -4468,6 +4475,7 @@ @Test @Alerts(DEFAULT = "false", FF52 = "true") + @NotYetImplemented(FF52) public void _DOMMatrix_WebKitCSSMatrix() throws Exception { test("DOMMatrix", "WebKitCSSMatrix"); } @@ -5273,6 +5281,7 @@ @Alerts(DEFAULT = "false", CHROME = "true", FF52 = "true") + @NotYetImplemented(FF52) public void _EventTarget_ConstantSourceNode() throws Exception { test("EventTarget", "ConstantSourceNode"); } |
From: <asa...@us...> - 2017-05-08 08:38:17
|
Revision: 14418 http://sourceforge.net/p/htmlunit/code/14418 Author: asashour Date: 2017-05-08 08:38:14 +0000 (Mon, 08 May 2017) Log Message: ----------- JavaScript: document.rootElement Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLDocumentTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-08 07:45:53 UTC (rev 14417) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-08 08:38:14 UTC (rev 14418) @@ -377,6 +377,15 @@ } /** + * Gets the JavaScript property {@code rootElement}. + * @return the root node for the document + */ + @JsxGetter({CHROME, FF52, IE}) + public Element getRootElement() { + return null; + } + + /** * Gets the JavaScript property {@code doctype} for the document. * @return the DocumentType of the document */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java 2017-05-08 07:45:53 UTC (rev 14417) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java 2017-05-08 08:38:14 UTC (rev 14418) @@ -2487,4 +2487,27 @@ loadPageWithAlerts2(html); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"null", "null"}, + FF45 = {"undefined", "undefined"}) + public void rootElement() throws Exception { + final String html = "<html>\n" + + "<head>\n" + + " <script>\n" + + " function test() {\n" + + " var xmlDocument = document.implementation.createDocument('', '', null);\n" + + " alert(xmlDocument.rootElement);\n" + + " alert(document.rootElement);\n" + + " }\n" + + " </script>\n" + + "</head>\n" + + "<body onload='test()'></body>\n" + + "</html>"; + + loadPageWithAlerts2(html); + } + } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLDocumentTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLDocumentTest.java 2017-05-08 07:45:53 UTC (rev 14417) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLDocumentTest.java 2017-05-08 08:38:14 UTC (rev 14418) @@ -104,12 +104,7 @@ /** Helper. */ public static final String SERIALIZE_XML_DOCUMENT_TO_STRING_FUNCTION = "" + " function " + SERIALIZE_XML_DOCUMENT_TO_STRING_FUNCTION_NAME + "(doc) {\n" - + " if (window.XMLSerializer) {\n" - + " serializer = new XMLSerializer();\n" - + " return serializer.serializeToString(doc);\n" - + " } else {\n" - + " return doc.xml;\n" - + " }\n" + + " return new XMLSerializer().serializeToString(doc);\n" + " }\n"; /** Helper. */ @@ -965,9 +960,7 @@ + " ifr.onload = function() {\n" + " var xml = ifr.contentWindow.document;\n" + " alert(xml);\n" - + " if(xml.getElementsByTagName) {\n" - + " alert(xml.getElementsByTagName('status')[0].textContent);\n" - + " }\n" + + " alert(xml.getElementsByTagName('status')[0].textContent);\n" + " };\n" + " ifr.src = '" + URL_SECOND + "';\n" + " }\n" @@ -1042,15 +1035,6 @@ + " <div id='tester'></div>\n" + "</body></html>"; - final String xml - = "<books>\n" - + " <book>\n" - + " <title>Immortality</title>\n" - + " <author>John Smith</author>\n" - + " </book>\n" - + "</books>"; - - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); loadPageWithAlerts2(html); } } |
From: <asa...@us...> - 2017-05-08 19:22:30
|
Revision: 14419 http://sourceforge.net/p/htmlunit/code/14419 Author: asashour Date: 2017-05-08 19:22:28 +0000 (Mon, 08 May 2017) Log Message: ----------- HtmlImageInput: add .saveAs() Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImage.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput2Test.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2017-05-08 08:38:14 UTC (rev 14418) +++ trunk/htmlunit/src/changes/changes.xml 2017-05-08 19:22:28 UTC (rev 14419) @@ -8,6 +8,9 @@ <body> <release version="2.27" date="???" description="GAE broken, Bugfixes"> + <action type="add" dev="asashour" issue="43854916" system="stackoverflow"> + HtmlImageInput: add .saveAs(). + </action> <action type="fix" dev="asashour" issue="1877"> JavaScript: MouseEvent to support .pageX and .pageY for all browsers. </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImage.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImage.java 2017-05-08 08:38:14 UTC (rev 14418) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImage.java 2017-05-08 19:22:28 UTC (rev 14419) @@ -595,7 +595,7 @@ * of objects which could all be garbage collected without impacting the ImageReader it is better to * wrap it in another class. */ - private static final class ImageData implements AutoCloseable { + static final class ImageData implements AutoCloseable { private final ImageReader imageReader_; Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput.java 2017-05-08 08:38:14 UTC (rev 14418) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput.java 2017-05-08 19:22:28 UTC (rev 14419) @@ -14,16 +14,27 @@ */ package com.gargoylesoftware.htmlunit.html; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLIMAGE_BLANK_SRC_AS_EMPTY; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLIMAGE_NAME_VALUE_PARAMS; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_COMPLETE_RETURNS_TRUE_FOR_NO_REQUEST; +import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStream; +import java.net.URL; import java.util.Map; +import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import com.gargoylesoftware.htmlunit.ElementNotFoundException; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.SgmlPage; +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.WebRequest; +import com.gargoylesoftware.htmlunit.WebResponse; +import com.gargoylesoftware.htmlunit.html.HtmlImage.ImageData; import com.gargoylesoftware.htmlunit.javascript.host.event.Event; import com.gargoylesoftware.htmlunit.util.NameValuePair; @@ -45,6 +56,9 @@ private boolean wasPositionSpecified_; private int xPosition_; private int yPosition_; + private WebResponse imageWebResponse_; + private transient ImageData imageData_; + private boolean downloaded_; /** * Creates an instance. @@ -184,4 +198,52 @@ protected boolean isRequiredSupported() { return false; } + + /** + * <p>Downloads the image contained by this image element.</p> + * <p><span style="color:red">POTENTIAL PERFORMANCE KILLER - DOWNLOADS THE IMAGE - USE AT YOUR OWN RISK</span></p> + * <p>If the image has not already been downloaded, this method triggers a download and caches the image.</p> + * + * @throws IOException if an error occurs while downloading the image + */ + private void downloadImageIfNeeded() throws IOException { + if (!downloaded_) { + // HTMLIMAGE_BLANK_SRC_AS_EMPTY + final String src = getSrcAttribute(); + if (!"".equals(src) + && !(hasFeature(HTMLIMAGE_BLANK_SRC_AS_EMPTY) && StringUtils.isBlank(src))) { + final HtmlPage page = (HtmlPage) getPage(); + final WebClient webclient = page.getWebClient(); + + final URL url = page.getFullyQualifiedUrl(src); + final String accept = webclient.getBrowserVersion().getImgAcceptHeader(); + final WebRequest request = new WebRequest(url, accept); + request.setAdditionalHeader("Referer", page.getUrl().toExternalForm()); + imageWebResponse_ = webclient.loadWebResponse(request); + } + + if (imageData_ != null) { + imageData_.close(); + imageData_ = null; + } + downloaded_ = hasFeature(JS_IMAGE_COMPLETE_RETURNS_TRUE_FOR_NO_REQUEST) + || (imageWebResponse_ != null && imageWebResponse_.getContentType().contains("image")); + } + } + + /** + * Saves this image as the specified file. + * @param file the file to save to + * @throws IOException if an IO error occurs + */ + public void saveAs(final File file) throws IOException { + downloadImageIfNeeded(); + if (null != imageWebResponse_) { + try (InputStream inputStream = imageWebResponse_.getContentAsStream(); + FileOutputStream fileOut = new FileOutputStream(file)) { + IOUtils.copy(imageWebResponse_.getContentAsStream(), fileOut); + } + } + } + } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput2Test.java 2017-05-08 08:38:14 UTC (rev 14418) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput2Test.java 2017-05-08 19:22:28 UTC (rev 14419) @@ -14,10 +14,16 @@ */ package com.gargoylesoftware.htmlunit.html; +import java.io.File; +import java.io.InputStream; +import java.net.URL; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; import org.junit.Test; import org.junit.runner.RunWith; @@ -96,4 +102,32 @@ assertEquals(expectedPairs, webConnection.getLastParameters()); } + + /** + * @throws Exception if the test fails + */ + @Test + public void saveAs() throws Exception { + try (InputStream is = getClass().getClassLoader(). + getResourceAsStream("testfiles/tiny-jpg.img")) { + final byte[] directBytes = IOUtils.toByteArray(is); + final URL urlImage = new URL(URL_FIRST, "img.jpg"); + final List<NameValuePair> emptyList = Collections.emptyList(); + getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", emptyList); + } + + final String html = "<html><head>\n" + + "</head>\n" + + "<body>\n" + + " <input type='image' src='img.jpg' >\n" + + "</body></html>"; + + final HtmlPage page = loadPage(html); + + final HtmlImageInput input = page.querySelector("input"); + final File tempFile = File.createTempFile("img", ".tmp"); + input.saveAs(tempFile); + FileUtils.deleteQuietly(tempFile); + } + } |
From: <rb...@us...> - 2017-05-09 15:28:26
|
Revision: 14420 http://sourceforge.net/p/htmlunit/code/14420 Author: rbri Date: 2017-05-09 15:28:24 +0000 (Tue, 09 May 2017) Log Message: ----------- NPE in StyleSheetList.equivalentValues() Issue 1881 Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList2.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetListTest.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2017-05-08 19:22:28 UTC (rev 14419) +++ trunk/htmlunit/src/changes/changes.xml 2017-05-09 15:28:24 UTC (rev 14420) @@ -8,6 +8,9 @@ <body> <release version="2.27" date="???" description="GAE broken, Bugfixes"> + <action type="fix" dev="rbri" issue="1881" due-to="Carsten Steul"> + NPE in StyleSheetList.equivalentValues() + </action> <action type="add" dev="asashour" issue="43854916" system="stackoverflow"> HtmlImageInput: add .saveAs(). </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java 2017-05-08 19:22:28 UTC (rev 14419) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java 2017-05-09 15:28:24 UTC (rev 14420) @@ -57,6 +57,7 @@ * @author Ahmed Ashour * @author Ronald Brill * @author Frank Danek + * @author Carsten Steul */ @JsxClass public class StyleSheetList extends SimpleScriptable { @@ -200,6 +201,8 @@ */ @Override protected Object equivalentValues(final Object value) { - return getClass() == value.getClass() && getDomNodeOrNull() == ((StyleSheetList) value).getDomNodeOrNull(); + return value != null + && getClass() == value.getClass() + && getDomNodeOrNull() == ((StyleSheetList) value).getDomNodeOrNull(); } } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList2.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList2.java 2017-05-08 19:22:28 UTC (rev 14419) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList2.java 2017-05-09 15:28:24 UTC (rev 14420) @@ -63,6 +63,7 @@ * @author Ahmed Ashour * @author Ronald Brill * @author Frank Danek + * @author Carsten Steul */ @ScriptClass public class StyleSheetList2 extends SimpleScriptObject { @@ -208,7 +209,9 @@ */ @Override protected boolean equivalentValues(final Object value) { - return getClass() == value.getClass() && getDomNodeOrNull() == ((StyleSheetList2) value).getDomNodeOrNull(); + return value != null + && getClass() == value.getClass() + && getDomNodeOrNull() == ((StyleSheetList2) value).getDomNodeOrNull(); } private static MethodHandle staticHandle(final String name, final Class<?> rtype, final Class<?>... ptypes) { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetListTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetListTest.java 2017-05-08 19:22:28 UTC (rev 14419) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetListTest.java 2017-05-09 15:28:24 UTC (rev 14420) @@ -36,6 +36,7 @@ * @author Marc Guillemot * @author Ronald Brill * @author Frank Danek + * @author Carsten Steul */ @RunWith(BrowserRunner.class) public class StyleSheetListTest extends WebDriverTestCase { @@ -297,4 +298,32 @@ loadPageWithAlerts2(html); } + + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts({"true", "false", "false"}) + public void equivalentValues() throws Exception { + final String html = + "<html>\n" + + " <head>\n" + + " <link rel='stylesheet' type='text/css' href='foo.css'/>\n" + + " <script>\n" + + " function test() {\n" + + " var sheets = document.styleSheets;\n" + + " alert(sheets == document.styleSheets);\n" + + " alert(sheets == null);\n" + + " alert(null == sheets);\n" + + " }\n" + + " </script>\n" + + " </head>\n" + + " <body onload='test()'>abc</body>\n" + + "</html>"; + + final String css = "div {color:red}"; + getMockWebConnection().setDefaultResponse(css, "text/css"); + + loadPageWithAlerts2(html); + } } |
From: <rb...@us...> - 2017-05-10 13:37:13
|
Revision: 14425 http://sourceforge.net/p/htmlunit/code/14425 Author: rbri Date: 2017-05-10 13:37:10 +0000 (Wed, 10 May 2017) Log Message: ----------- ff52 expectations Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Animation.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Animation.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Animation.java 2017-05-10 13:22:21 UTC (rev 14424) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Animation.java 2017-05-10 13:37:10 UTC (rev 14425) @@ -25,7 +25,7 @@ * * @author Ronald Brill */ -@JsxClass(isJSObject = false, value = FF52) +@JsxClass(FF52) public class Animation extends SimpleScriptable { /** Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java 2017-05-10 13:22:21 UTC (rev 14424) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java 2017-05-10 13:37:10 UTC (rev 14425) @@ -887,15 +887,6 @@ * @throws Exception if the test fails */ @Test - @Alerts("true") - public void _AnimationEvent_AnimationEvent() throws Exception { - test("AnimationEvent", "AnimationEvent"); - } - - /** - * @throws Exception if the test fails - */ - @Test @Alerts(DEFAULT = "true", IE = "false") public void _CSSConditionRule_CSSConditionRule() throws Exception { @@ -1205,6 +1196,16 @@ */ @Test @Alerts(DEFAULT = "false", + FF52 = "true") + public void _Animation_Animation() throws Exception { + test("Animation", "Animation"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", CHROME = "true") public void _AnimationEvent_WebKitAnimationEvent() throws Exception { test("AnimationEvent", "WebKitAnimationEvent"); |
From: <rb...@us...> - 2017-05-10 13:53:31
|
Revision: 14426 http://sourceforge.net/p/htmlunit/code/14426 Author: rbri Date: 2017-05-10 13:53:28 +0000 (Wed, 10 May 2017) Log Message: ----------- ff52 expectations Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystem.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryEntry.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryReader.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemEntry.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemFileEntry.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystem.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystem.java 2017-05-10 13:37:10 UTC (rev 14425) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystem.java 2017-05-10 13:53:28 UTC (rev 14426) @@ -25,7 +25,7 @@ * * @author Ronald Brill */ -@JsxClass(isJSObject = false, value = FF52) +@JsxClass(FF52) public class FileSystem extends SimpleScriptable { /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryEntry.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryEntry.java 2017-05-10 13:37:10 UTC (rev 14425) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryEntry.java 2017-05-10 13:53:28 UTC (rev 14426) @@ -25,7 +25,7 @@ * * @author Ronald Brill */ -@JsxClass(isJSObject = false, value = FF52) +@JsxClass(FF52) public class FileSystemDirectoryEntry extends SimpleScriptable { /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryReader.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryReader.java 2017-05-10 13:37:10 UTC (rev 14425) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryReader.java 2017-05-10 13:53:28 UTC (rev 14426) @@ -25,7 +25,7 @@ * * @author Ronald Brill */ -@JsxClass(isJSObject = false, value = FF52) +@JsxClass(FF52) public class FileSystemDirectoryReader extends SimpleScriptable { /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemEntry.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemEntry.java 2017-05-10 13:37:10 UTC (rev 14425) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemEntry.java 2017-05-10 13:53:28 UTC (rev 14426) @@ -25,7 +25,7 @@ * * @author Ronald Brill */ -@JsxClass(isJSObject = false, value = FF52) +@JsxClass(FF52) public class FileSystemEntry extends SimpleScriptable { /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemFileEntry.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemFileEntry.java 2017-05-10 13:37:10 UTC (rev 14425) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemFileEntry.java 2017-05-10 13:53:28 UTC (rev 14426) @@ -25,7 +25,7 @@ * * @author Ronald Brill */ -@JsxClass(isJSObject = false, value = FF52) +@JsxClass(FF52) public class FileSystemFileEntry extends SimpleScriptable { /** Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java 2017-05-10 13:37:10 UTC (rev 14425) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java 2017-05-10 13:53:28 UTC (rev 14426) @@ -4281,6 +4281,56 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = "false", + FF52 = "true") + public void _FileSystem_FileSystem() throws Exception { + test("FileSystem", "FileSystem"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + FF52 = "true") + public void _FileSystemDirectoryEntry_FileSystemDirectoryEntry() throws Exception { + test("FileSystemDirectoryEntry", "FileSystemDirectoryEntry"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + FF52 = "true") + public void _FileSystemDirectoryReader_FileSystemDirectoryReader() throws Exception { + test("FileSystemDirectoryReader", "FileSystemDirectoryReader"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + FF52 = "true") + public void _FileSystemEntry_FileSystemEntry() throws Exception { + test("FileSystemEntry", "FileSystemEntry"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + FF52 = "true") + public void _FileSystemFileEntry_FileSystemFileEntry() throws Exception { + test("FileSystemFileEntry", "FileSystemFileEntry"); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts("true") public void _File_File() throws Exception { test("File", "File"); |
From: <rb...@us...> - 2017-05-10 13:58:48
|
Revision: 14427 http://sourceforge.net/p/htmlunit/code/14427 Author: rbri Date: 2017-05-10 13:58:45 +0000 (Wed, 10 May 2017) Log Message: ----------- ff52 expectations Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisErrorEvent.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisVoice.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfSTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisErrorEvent.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisErrorEvent.java 2017-05-10 13:53:28 UTC (rev 14426) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisErrorEvent.java 2017-05-10 13:58:45 UTC (rev 14427) @@ -26,7 +26,7 @@ * * @author Ronald Brill */ -@JsxClass(isJSObject = false, value = FF52) +@JsxClass(FF52) public class SpeechSynthesisErrorEvent extends SimpleScriptable { /** Constant. */ Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisVoice.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisVoice.java 2017-05-10 13:53:28 UTC (rev 14426) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisVoice.java 2017-05-10 13:58:45 UTC (rev 14427) @@ -25,7 +25,7 @@ * * @author Ronald Brill */ -@JsxClass(isJSObject = false, value = FF52) +@JsxClass(FF52) public class SpeechSynthesisVoice extends SimpleScriptable { /** Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfSTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfSTest.java 2017-05-10 13:53:28 UTC (rev 14426) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfSTest.java 2017-05-10 13:58:45 UTC (rev 14427) @@ -2428,6 +2428,16 @@ */ @Test @Alerts(DEFAULT = "false", + FF52 = "true") + public void _SpeechSynthesisErrorEvent_SpeechSynthesisErrorEvent() throws Exception { + test("SpeechSynthesisErrorEvent", "SpeechSynthesisErrorEvent"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", CHROME = "true", FF52 = "true") public void _SpeechSynthesisEvent_SpeechSynthesisEvent() throws Exception { @@ -2438,6 +2448,16 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = "false", + FF52 = "true") + public void _SpeechSynthesisVoice_SpeechSynthesisVoice() throws Exception { + test("SpeechSynthesisVoice", "SpeechSynthesisVoice"); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts("true") public void _SVGComponentTransferFunctionElement_SVGComponentTransferFunctionElement() throws Exception { test("SVGComponentTransferFunctionElement", "SVGComponentTransferFunctionElement"); |
From: <rb...@us...> - 2017-05-10 18:20:42
|
Revision: 14428 http://sourceforge.net/p/htmlunit/code/14428 Author: rbri Date: 2017-05-10 18:20:40 +0000 (Wed, 10 May 2017) Log Message: ----------- ff52 expectations Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java Added Paths: ----------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLQuery.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSampler.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSync.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLTransformFeedback.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLVertexArrayObject.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java 2017-05-10 13:58:45 UTC (rev 14427) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java 2017-05-10 18:20:40 UTC (rev 14428) @@ -112,12 +112,17 @@ import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLBuffer; import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLFramebuffer; import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLProgram; +import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLQuery; import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLRenderbuffer; import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLRenderingContext; +import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLSampler; import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLShader; import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLShaderPrecisionFormat; +import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLSync; import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLTexture; +import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLTransformFeedback; import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLUniformLocation; +import com.gargoylesoftware.htmlunit.javascript.host.canvas.WebGLVertexArrayObject; import com.gargoylesoftware.htmlunit.javascript.host.canvas.ext.ANGLE_instanced_arrays; import com.gargoylesoftware.htmlunit.javascript.host.canvas.ext.EXT_texture_filter_anisotropic; import com.gargoylesoftware.htmlunit.javascript.host.canvas.ext.OES_element_index_uint; @@ -584,9 +589,14 @@ URLSearchParams.class, UserProximityEvent.class, ValidityState.class, VideoPlaybackQuality.class, VTTCue.class, WaveShaperNode.class, WeakMap.class, WeakSet.class, WebGL2RenderingContext.class, WEBGL_compressed_texture_s3tc.class, WEBGL_debug_renderer_info.class, WebGLActiveInfo.class, WebGLBuffer.class, - WebGLContextEvent.class, WebGLFramebuffer.class, WebGLProgram.class, WebGLRenderbuffer.class, - WebGLRenderingContext.class, WebGLShader.class, WebGLShaderPrecisionFormat.class, WebGLTexture.class, - WebGLUniformLocation.class, WebKitAnimationEvent.class, + WebGLContextEvent.class, WebGLFramebuffer.class, WebGLProgram.class, + WebGLQuery.class, + WebGLRenderbuffer.class, + WebGLRenderingContext.class, + WebGLSampler.class, WebGLShader.class, WebGLShaderPrecisionFormat.class, WebGLSync.class, + WebGLTransformFeedback.class, WebGLTexture.class, + WebGLUniformLocation.class, WebGLVertexArrayObject.class, + WebKitAnimationEvent.class, WebKitCSSMatrix.class, webkitMediaStream.class, WebKitMutationObserver.class, webkitRTCPeerConnection.class, webkitSpeechGrammar.class, webkitSpeechGrammarList.class, webkitSpeechRecognition.class, webkitSpeechRecognitionError.class, Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLQuery.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLQuery.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLQuery.java 2017-05-10 18:20:40 UTC (rev 14428) @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2002-2017 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gargoylesoftware.htmlunit.javascript.host.canvas; + +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; + +import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; + +/** + * A JavaScript object for {@code WebGLQuery}. + * + * @author Ronald Brill + */ +@JsxClass({CHROME, FF52}) +public class WebGLQuery extends SimpleScriptable { + + /** + * Default constructor. + */ + @JsxConstructor + public WebGLQuery() { + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLQuery.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSampler.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSampler.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSampler.java 2017-05-10 18:20:40 UTC (rev 14428) @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2002-2017 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gargoylesoftware.htmlunit.javascript.host.canvas; + +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; + +import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; + +/** + * A JavaScript object for {@code WebGLSampler}. + * + * @author Ronald Brill + */ +@JsxClass({CHROME, FF52}) +public class WebGLSampler extends SimpleScriptable { + + /** + * Default constructor. + */ + @JsxConstructor + public WebGLSampler() { + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSampler.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSync.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSync.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSync.java 2017-05-10 18:20:40 UTC (rev 14428) @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2002-2017 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gargoylesoftware.htmlunit.javascript.host.canvas; + +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; + +import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; + +/** + * A JavaScript object for {@code WebGLSync}. + * + * @author Ronald Brill + */ +@JsxClass({CHROME, FF52}) +public class WebGLSync extends SimpleScriptable { + + /** + * Default constructor. + */ + @JsxConstructor + public WebGLSync() { + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSync.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLTransformFeedback.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLTransformFeedback.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLTransformFeedback.java 2017-05-10 18:20:40 UTC (rev 14428) @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2002-2017 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gargoylesoftware.htmlunit.javascript.host.canvas; + +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; + +import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; + +/** + * A JavaScript object for {@code WebGLTransformFeedback}. + * + * @author Ronald Brill + */ +@JsxClass({CHROME, FF52}) +public class WebGLTransformFeedback extends SimpleScriptable { + + /** + * Default constructor. + */ + @JsxConstructor + public WebGLTransformFeedback() { + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLTransformFeedback.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLVertexArrayObject.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLVertexArrayObject.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLVertexArrayObject.java 2017-05-10 18:20:40 UTC (rev 14428) @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2002-2017 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gargoylesoftware.htmlunit.javascript.host.canvas; + +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; + +import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; + +/** + * A JavaScript object for {@code WebGLVertexArrayObject}. + * + * @author Ronald Brill + */ +@JsxClass({CHROME, FF52}) +public class WebGLVertexArrayObject extends SimpleScriptable { + + /** + * Default constructor. + */ + @JsxConstructor + public WebGLVertexArrayObject() { + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLVertexArrayObject.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java 2017-05-10 13:58:45 UTC (rev 14427) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java 2017-05-10 18:20:40 UTC (rev 14428) @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import org.junit.Test; @@ -10352,7 +10351,6 @@ @Alerts(DEFAULT = "exception", CHROME = "function WebGLSync() { [native code] }", FF52 = "function WebGLSync() {\n [native code]\n}") - @NotYetImplemented({CHROME, FF52}) public void webGLSync() throws Exception { test("WebGLSync"); } @@ -10440,7 +10438,6 @@ @Alerts(DEFAULT = "exception", CHROME = "function WebGLTransformFeedback() { [native code] }", FF52 = "function WebGLTransformFeedback() {\n [native code]\n}") - @NotYetImplemented({CHROME, FF52}) public void webGLTransformFeedback() throws Exception { test("WebGLTransformFeedback"); } @@ -10452,7 +10449,6 @@ @Alerts(DEFAULT = "exception", CHROME = "function WebGLQuery() { [native code] }", FF52 = "function WebGLQuery() {\n [native code]\n}") - @NotYetImplemented({CHROME, FF52}) public void webGLQuery() throws Exception { test("WebGLQuery"); } @@ -10539,7 +10535,6 @@ @Alerts(DEFAULT = "exception", CHROME = "function WebGLVertexArrayObject() { [native code] }", FF52 = "function WebGLVertexArrayObject() {\n [native code]\n}") - @NotYetImplemented({CHROME, FF52}) public void webGLVertexArrayObject() throws Exception { test("WebGLVertexArrayObject"); } @@ -10570,7 +10565,6 @@ @Alerts(DEFAULT = "exception", CHROME = "function WebGLSampler() { [native code] }", FF52 = "function WebGLSampler() {\n [native code]\n}") - @NotYetImplemented({CHROME, FF52}) public void webGLSampler() throws Exception { test("WebGLSampler"); } |
From: <rb...@us...> - 2017-05-10 20:13:19
|
Revision: 14431 http://sourceforge.net/p/htmlunit/code/14431 Author: rbri Date: 2017-05-10 20:13:17 +0000 (Wed, 10 May 2017) Log Message: ----------- FF52/CHROME fixed Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElement.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInputTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-05-10 19:31:34 UTC (rev 14430) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-05-10 20:13:17 UTC (rev 14431) @@ -963,9 +963,9 @@ @BrowserFeature(CHROME) JS_INPUT_IGNORE_NEGATIVE_SELECTION_START, - /** Chrome throws an error if using selectionStart/selectionEnd. */ - @BrowserFeature(CHROME) - JS_INPUT_NUMBER_NO_SELECTION, + /** Chrome/FF returns null for selectionStart/selectionEnd. */ + @BrowserFeature({CHROME, FF52}) + JS_INPUT_NUMBER_SELECTION_START_END_NULL, /** Setting the type property of an input converts the type to lowercase. */ @BrowserFeature(IE) Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElement.java 2017-05-10 19:31:34 UTC (rev 14430) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElement.java 2017-05-10 20:13:17 UTC (rev 14431) @@ -20,7 +20,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_FILE_VALUE_FAKEPATH; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_FILE_VALUE_NO_PATH; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ALIGN_FOR_INPUT_IGNORES_VALUES; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_NUMBER_NO_SELECTION; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_NUMBER_SELECTION_START_END_NULL; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_TYPE_LOWERCASE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_VALUE_DATE_SUPPORTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SELECT_FILE_THROWS; @@ -318,10 +318,9 @@ public Object getSelectionStart() { final DomNode dom = getDomNodeOrDie(); if (dom instanceof SelectableTextInput) { - if ("number".equalsIgnoreCase(getType()) && getBrowserVersion().hasFeature(JS_INPUT_NUMBER_NO_SELECTION)) { - throw Context.reportRuntimeError("Failed to read the 'selectionStart' property" - + "from 'HTMLInputElement': " - + "The input element's type ('number') does not support selection."); + if ("number".equalsIgnoreCase(getType()) + && getBrowserVersion().hasFeature(JS_INPUT_NUMBER_SELECTION_START_END_NULL)) { + return null; } return ((SelectableTextInput) dom).getSelectionStart(); @@ -342,7 +341,8 @@ public void setSelectionStart(final int start) { final DomNode dom = getDomNodeOrDie(); if (dom instanceof SelectableTextInput) { - if ("number".equalsIgnoreCase(getType()) && getBrowserVersion().hasFeature(JS_INPUT_NUMBER_NO_SELECTION)) { + if ("number".equalsIgnoreCase(getType()) + && getBrowserVersion().hasFeature(JS_INPUT_NUMBER_SELECTION_START_END_NULL)) { throw Context.reportRuntimeError("Failed to set the 'selectionStart' property" + "from 'HTMLInputElement': " + "The input element's type ('number') does not support selection."); @@ -364,10 +364,9 @@ public Object getSelectionEnd() { final DomNode dom = getDomNodeOrDie(); if (dom instanceof SelectableTextInput) { - if ("number".equalsIgnoreCase(getType()) && getBrowserVersion().hasFeature(JS_INPUT_NUMBER_NO_SELECTION)) { - throw Context.reportRuntimeError("Failed to read the 'selectionEnd' property" - + "from 'HTMLInputElement': " - + "The input element's type ('number') does not support selection."); + if ("number".equalsIgnoreCase(getType()) + && getBrowserVersion().hasFeature(JS_INPUT_NUMBER_SELECTION_START_END_NULL)) { + return null; } return ((SelectableTextInput) dom).getSelectionEnd(); @@ -388,7 +387,8 @@ public void setSelectionEnd(final int end) { final DomNode dom = getDomNodeOrDie(); if (dom instanceof SelectableTextInput) { - if ("number".equalsIgnoreCase(getType()) && getBrowserVersion().hasFeature(JS_INPUT_NUMBER_NO_SELECTION)) { + if ("number".equalsIgnoreCase(getType()) + && getBrowserVersion().hasFeature(JS_INPUT_NUMBER_SELECTION_START_END_NULL)) { throw Context.reportRuntimeError("Failed to set the 'selectionEnd' property" + "from 'HTMLInputElement': " + "The input element's type ('number') does not support selection."); Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInputTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInputTest.java 2017-05-10 19:31:34 UTC (rev 14430) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInputTest.java 2017-05-10 20:13:17 UTC (rev 14431) @@ -14,8 +14,6 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; import static org.junit.Assert.fail; import java.util.Collections; @@ -30,7 +28,6 @@ import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; -import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; /** @@ -500,7 +497,6 @@ */ @Test @Alerts("0") - @NotYetImplemented(CHROME) public void selection() throws Exception { final String html = "<html><head>\n" @@ -533,7 +529,6 @@ FF52 = {"null,null", "null,null", "exception", "null,null", "exception", "null,null"}, IE = {"0,0", "0,0", "3,3", "3,10"}) - @NotYetImplemented({CHROME, FF52}) public void selection2_1() throws Exception { selection2(3, 10); } @@ -548,7 +543,6 @@ FF52 = {"null,null", "null,null", "exception", "null,null", "exception", "null,null"}, IE = {"0,0", "0,0", "0,0", "0,11"}) - @NotYetImplemented({CHROME, FF52}) public void selection2_2() throws Exception { selection2(-3, 15); } @@ -563,7 +557,6 @@ FF52 = {"null,null", "null,null", "exception", "null,null", "exception", "null,null"}, IE = {"0,0", "0,0", "10,10", "5,5"}) - @NotYetImplemented({CHROME, FF52}) public void selection2_3() throws Exception { selection2(10, 5); } @@ -611,7 +604,6 @@ CHROME = {"null,null", "exception"}, FF52 = {"null,null", "exception"}, IE = {"0,0", "4,5", "0,0", "0,0", "0,0"}) - @NotYetImplemented({CHROME, FF52}) public void selectionOnUpdate() throws Exception { final String html = "<html>\n" + "<body>\n" |
From: <asa...@us...> - 2017-05-13 14:20:28
|
Revision: 14442 http://sourceforge.net/p/htmlunit/code/14442 Author: asashour Date: 2017-05-13 14:20:25 +0000 (Sat, 13 May 2017) Log Message: ----------- Fix element.isDisplayed() Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAreaElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLButtonElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFieldSetElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFormElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLObjectElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOutputElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSelectElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTextAreaElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/ValidityState.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -808,7 +808,7 @@ ((HtmlPage) enclosedPage).setFocusedElement(activeElement.getDomNodeOrDie(), true); } } - else if (jsWindow instanceof Window2) { + else if (jsWindow != null) { final HTMLElement2 activeElement = ((HTMLDocument2) Window2.getDocument(jsWindow)).getActiveElement(); if (activeElement != null) { Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -753,6 +753,9 @@ final Object scriptableObject = ((DomNode) node).getScriptableObject(); if (scriptableObject instanceof HTMLElement) { final HTMLElement elem = (HTMLElement) scriptableObject; + if (elem.isHidden()) { + return false; + } final CSSStyleDeclaration style = elem.getWindow().getComputedStyle(elem, null); if (DisplayStyle.NONE.value().equals(style.getDisplay())) { return false; Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlElement.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlElement.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -1353,4 +1353,21 @@ public boolean isAltPressed() { return altPressed_; } + + /** + * Returns whether this element satisfies all form validation constraints set. + * @return whether this element satisfies all form validation constraints set + */ + public boolean isValid() { + return !isRequiredSupported() || getAttribute("required") == ATTRIBUTE_NOT_DEFINED + || !getAttribute("value").isEmpty(); + } + + /** + * Returns whether this {@link HtmlInput} supports the {@code required} constraint. + * @return whether this {@link HtmlInput} supports the {@code required} constraint + */ + protected boolean isRequiredSupported() { + return false; + } } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -767,18 +767,9 @@ } /** - * Returns whether this element satisfies all form validation constraints set. - * @return whether this element satisfies all form validation constraints set + * {@inheritDoc} */ - public boolean isValid() { - return !isRequiredSupported() || getAttribute("required") == ATTRIBUTE_NOT_DEFINED - || !getValueAttribute().isEmpty(); - } - - /** - * Returns whether this {@link HtmlInput} supports the {@code required} constraint. - * @return whether this {@link HtmlInput} supports the {@code required} constraint - */ + @Override protected boolean isRequiredSupported() { return true; } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAreaElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAreaElement.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAreaElement.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -108,4 +108,23 @@ area.focus(); } } + + /** + * Returns the {@code coords} attribute. + * @return the {@code coords} attribute + */ + @JsxGetter + public String getCoords() { + return getDomNodeOrDie().getAttribute("coords"); + } + + /** + * Sets the {@code coords} attribute. + * @param coords {@code coords} attribute + */ + @JsxSetter + public void setCoords(final String coords) { + getDomNodeOrDie().setAttribute("coords", coords); + } + } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLButtonElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLButtonElement.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLButtonElement.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -105,4 +105,14 @@ public TextRange createTextRange() { return super.createTextRange(); } + + /** + * Checks whether the element has any constraints and whether it satisfies them. + * @return if the element is valid + */ + @JsxFunction + public boolean checkValidity() { + return getDomNodeOrDie().isValid(); + } + } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFieldSetElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFieldSetElement.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFieldSetElement.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -23,6 +23,7 @@ import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; @@ -90,4 +91,14 @@ } return (HTMLFormElement) getScriptableFor(form); } + + /** + * Checks whether the element has any constraints and whether it satisfies them. + * @return if the element is valid + */ + @JsxFunction + public boolean checkValidity() { + return getDomNodeOrDie().isValid(); + } + } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFormElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFormElement.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFormElement.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -518,4 +518,14 @@ } return result; } + + /** + * Checks whether the element has any constraints and whether it satisfies them. + * @return if the element is valid + */ + @JsxFunction + public boolean checkValidity() { + return getDomNodeOrDie().isValid(); + } + } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLObjectElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLObjectElement.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLObjectElement.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -31,6 +31,7 @@ import com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; import com.gargoylesoftware.htmlunit.javascript.host.ActiveXObjectImpl; @@ -353,4 +354,14 @@ } return (HTMLFormElement) getScriptableFor(form); } + + /** + * Checks whether the element has any constraints and whether it satisfies them. + * @return if the element is valid + */ + @JsxFunction + public boolean checkValidity() { + return getDomNodeOrDie().isValid(); + } + } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOutputElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOutputElement.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOutputElement.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -20,6 +20,7 @@ import com.gargoylesoftware.htmlunit.html.HtmlOutput; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; import com.gargoylesoftware.htmlunit.javascript.host.dom.AbstractList; @@ -73,4 +74,13 @@ return labels_; } + /** + * Checks whether the element has any constraints and whether it satisfies them. + * @return if the element is valid + */ + @JsxFunction + public boolean checkValidity() { + return getDomNodeOrDie().isValid(); + } + } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSelectElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSelectElement.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSelectElement.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -320,4 +320,13 @@ return labels_; } + /** + * Checks whether the element has any constraints and whether it satisfies them. + * @return if the element is valid + */ + @JsxFunction + public boolean checkValidity() { + return getDomNodeOrDie().isValid(); + } + } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTextAreaElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTextAreaElement.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTextAreaElement.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -355,4 +355,14 @@ public TextRange createTextRange() { return super.createTextRange(); } + + /** + * Checks whether the element has any constraints and whether it satisfies them. + * @return if the element is valid + */ + @JsxFunction + public boolean checkValidity() { + return getDomNodeOrDie().isValid(); + } + } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/ValidityState.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/ValidityState.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/ValidityState.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -21,6 +21,7 @@ import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; /** * A JavaScript object for {@code ValidityState}. @@ -37,4 +38,84 @@ public ValidityState() { } + /** + * Returns whether the customer validity message is set or not. + * @return whether the customer validity message is set or not + */ + @JsxGetter + public boolean isCustomError() { + return false; + } + + /** + * Returns whether the element value does not match its {@code pattern} attribute. + * @return whether the element value does not match its {@code pattern} attribute + */ + @JsxGetter + public boolean isPatternMismatch() { + return false; + } + + /** + * Returns whether the element value is greater than its {@code max} attribute. + * @return whether the element value is greater than its {@code max} attribute + */ + @JsxGetter + public boolean isRangeOverlow() { + return false; + } + + /** + * Returns whether the element value is less than its {@code min} attribute. + * @return whether the element value is less than its {@code min} attribute + */ + @JsxGetter + public boolean isRangeUnderflow() { + return false; + } + + /** + * Returns whether the element value is invalid per its {@code step} attribute. + * @return whether the element value is invalid per its {@code step} attribute + */ + @JsxGetter + public boolean isStepMismatch() { + return false; + } + + /** + * Returns whether the element value exceeds its {@code maxLength} attribute. + * @return whether the element value exceeds its {@code maxLength} attribute + */ + public boolean isTooLong() { + return false; + } + + /** + * Returns whether the element value is invalid per its {@code type} attribute. + * @return whether the element value is invalid per its {@code type} attribute + */ + @JsxGetter + public boolean isTypeMismatch() { + return false; + } + + /** + * Returns whether the element (with a {@code required} attribute) has no value. + * @return whether the element (with a {@code required} attribute) has no value + */ + @JsxGetter + public boolean isValueMissing() { + return false; + } + + /** + * Returns whether the element value is valid. + * @return whether the element value is valid + */ + @JsxGetter + public boolean isValid() { + return false; + } + } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java 2017-05-12 17:30:22 UTC (rev 14441) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java 2017-05-13 14:20:25 UTC (rev 14442) @@ -23,6 +23,7 @@ import org.junit.runner.RunWith; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; @@ -4666,4 +4667,22 @@ loadPageWithAlerts2(html); } + /** + * @throws Exception if the test fails + */ + @Test + public void isDisplayed() throws Exception { + final String html = + "<html>\n" + + "<body>\n" + + " <div id='div1' hidden>\n" + + " <div id='child' />\n" + + " </div>\n" + + "</body></html>"; + + final WebDriver driver = loadPage2(html); + final WebElement element = driver.findElement(By.id("child")); + assertFalse(element.isDisplayed()); + } + } |
From: <asa...@us...> - 2017-05-13 14:41:30
|
Revision: 14444 http://sourceforge.net/p/htmlunit/code/14444 Author: asashour Date: 2017-05-13 14:41:28 +0000 (Sat, 13 May 2017) Log Message: ----------- frameset handlers Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFrameSetElement.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFrameSetElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFrameSetElement.java 2017-05-13 14:22:31 UTC (rev 14443) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFrameSetElement.java 2017-05-13 14:41:28 UTC (rev 14444) @@ -26,6 +26,7 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.Function; /** * The JavaScript object {@code HTMLFrameSetElement}. @@ -129,4 +130,293 @@ public void setOuterHTML(final Object value) { throw Context.reportRuntimeError("outerHTML is read-only for tag 'frameset'"); } + + /** + * Returns the {@code onbeforeunload} event handler. + * @return the {@code onbeforeunload} event handler + */ + @JsxGetter + public Function getOnbeforeunload() { + return getEventHandler("beforeunload"); + } + + /** + * Sets the {@code onbeforeunload} event handler. + * @param beforeunload the {@code onbeforeunload} event handler + */ + @JsxSetter + public void setOnbeforeunload(final Object beforeunload) { + setEventHandler("beforeunload", beforeunload); + } + + /** + * Returns the {@code onhashchange} event handler. + * @return the {@code onhashchange} event handler + */ + @JsxGetter + public Function getOnhashchange() { + return getEventHandler("hashchange"); + } + + /** + * Sets the {@code onhashchange} event handler. + * @param hashchange the {@code onhashchange} event handler + */ + @JsxSetter + public void setOnhashchange(final Object hashchange) { + setEventHandler("hashchange", hashchange); + } + + /** + * Returns the {@code onlanguagechange} event handler. + * @return the {@code onlanguagechange} event handler + */ + @JsxGetter({CHROME, FF}) + public Function getOnlanguagechange() { + return getEventHandler("languagechange"); + } + + /** + * Sets the {@code onlanguagechange} event handler. + * @param languagechange the {@code onlanguagechange} event handler + */ + @JsxSetter({CHROME, FF}) + public void setOnlanguagechange(final Object languagechange) { + setEventHandler("languagechange", languagechange); + } + + /** + * Returns the {@code onmessage} event handler. + * @return the {@code onmessage} event handler + */ + @JsxGetter + public Function getOnmessage() { + return getEventHandler("message"); + } + + /** + * Sets the {@code onmessage} event handler. + * @param message the {@code onmessage} event handler + */ + @JsxSetter + public void setOnmessage(final Object message) { + setEventHandler("message", message); + } + + /** + * Returns the {@code onoffline} event handler. + * @return the {@code onoffline} event handler + */ + @JsxGetter + public Function getOnoffline() { + return getEventHandler("offline"); + } + + /** + * Sets the {@code onoffline} event handler. + * @param offline the {@code onoffline} event handler + */ + @JsxSetter + public void setOnoffline(final Object offline) { + setEventHandler("offline", offline); + } + + /** + * Returns the {@code ononline} event handler. + * @return the {@code ononline} event handler + */ + @JsxGetter + public Function getOnonline() { + return getEventHandler("online"); + } + + /** + * Sets the {@code ononline} event handler. + * @param online the {@code ononline} event handler + */ + @JsxSetter + public void setOnonline(final Object online) { + setEventHandler("online", online); + } + + /** + * Returns the {@code onpagehide} event handler. + * @return the {@code onpagehide} event handler + */ + @JsxGetter + public Function getOnpagehide() { + return getEventHandler("pagehide"); + } + + /** + * Sets the {@code onpagehide} event handler. + * @param pagehide the {@code onpagehide} event handler + */ + @JsxSetter + public void setOnpagehide(final Object pagehide) { + setEventHandler("pagehide", pagehide); + } + + /** + * Returns the {@code onpageshow} event handler. + * @return the {@code onpageshow} event handler + */ + @JsxGetter + public Function getOnpageshow() { + return getEventHandler("pageshow"); + } + + /** + * Sets the {@code onpageshow} event handler. + * @param pageshow the {@code onpageshow} event handler + */ + @JsxSetter + public void setOnpageshow(final Object pageshow) { + setEventHandler("pageshow", pageshow); + } + + /** + * Returns the {@code onpopstate} event handler. + * @return the {@code onpopstate} event handler + */ + @JsxGetter({CHROME, FF}) + public Function getOnpopstate() { + return getEventHandler("popstate"); + } + + /** + * Sets the {@code onpopstate} event handler. + * @param popstate the {@code onpopstate} event handler + */ + @JsxSetter({CHROME, FF}) + public void setOnpopstate(final Object popstate) { + setEventHandler("popstate", popstate); + } + + /** + * Returns the {@code onrejectionhandled} event handler. + * @return the {@code onrejectionhandled} event handler + */ + @JsxGetter(CHROME) + public Function getOnrejectionhandled() { + return getEventHandler("rejectionhandled"); + } + + /** + * Sets the {@code onrejectionhandled} event handler. + * @param rejectionhandled the {@code onrejectionhandled} event handler + */ + @JsxSetter(CHROME) + public void setOnrejectionhandled(final Object rejectionhandled) { + setEventHandler("rejectionhandled", rejectionhandled); + } + + /** + * Returns the {@code onstorage} event handler. + * @return the {@code onstorage} event handler + */ + @JsxGetter + public Function getOnstorage() { + return getEventHandler("storage"); + } + + /** + * Sets the {@code onstorage} event handler. + * @param storage the {@code onstorage} event handler + */ + @JsxSetter + public void setOnstorage(final Object storage) { + setEventHandler("storage", storage); + } + + /** + * Returns the {@code onunhandledrejection} event handler. + * @return the {@code onunhandledrejection} event handler + */ + @JsxGetter(CHROME) + public Function getOnunhandledrejection() { + return getEventHandler("unhandledrejection"); + } + + /** + * Sets the {@code onunhandledrejection} event handler. + * @param unhandledrejection the {@code onunhandledrejection} event handler + */ + @JsxSetter(CHROME) + public void setOnunhandledrejection(final Object unhandledrejection) { + setEventHandler("unhandledrejection", unhandledrejection); + } + + /** + * Returns the {@code onunload} event handler. + * @return the {@code onunload} event handler + */ + @JsxGetter + public Function getOnunload() { + return getEventHandler("unload"); + } + + /** + * Sets the {@code onunload} event handler. + * @param unload the {@code onunload} event handler + */ + @JsxSetter + public void setOnunload(final Object unload) { + setEventHandler("unload", unload); + } + + /** + * Returns the {@code onafterprint} event handler. + * @return the {@code onafterprint} event handler + */ + @JsxGetter({FF, IE}) + public Function getOnafterprint() { + return getEventHandler("afterprint"); + } + + /** + * Sets the {@code onafterprint} event handler. + * @param afterprint the {@code onafterprint} event handler + */ + @JsxSetter({FF, IE}) + public void setOnafterprint(final Object afterprint) { + setEventHandler("afterprint", afterprint); + } + + /** + * Returns the {@code onbeforeprint} event handler. + * @return the {@code onbeforeprint} event handler + */ + @JsxGetter({FF, IE}) + public Function getOnbeforeprint() { + return getEventHandler("beforeprint"); + } + + /** + * Sets the {@code onbeforeprint} event handler. + * @param beforeprint the {@code onbeforeprint} event handler + */ + @JsxSetter({FF, IE}) + public void setOnbeforeprint(final Object beforeprint) { + setEventHandler("beforeprint", beforeprint); + } + + /** + * {@inheritDoc} + */ + @Override + @JsxGetter(IE) + public Function getOnresize() { + return super.getOnresize(); + } + + /** + * {@inheritDoc} + */ + @Override + @JsxSetter(IE) + public void setOnresize(final Object resize) { + super.setOnresize(resize); + } + } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java 2017-05-13 14:22:31 UTC (rev 14443) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java 2017-05-13 14:41:28 UTC (rev 14444) @@ -1456,7 +1456,7 @@ EDGE = "border,borderColor,cols,frameBorder,frameSpacing,name,onafterprint,onbeforeprint,onbeforeunload," + "onhashchange,onmessage,onoffline,ononline,onpagehide,onpageshow,onresize,onstorage,onunload," + "rows") - @NotYetImplemented + @NotYetImplemented(IE) public void frameset() throws Exception { test("frameset"); } |
From: <asa...@us...> - 2017-05-13 15:29:46
|
Revision: 14448 http://sourceforge.net/p/htmlunit/code/14448 Author: asashour Date: 2017-05-13 15:29:44 +0000 (Sat, 13 May 2017) Log Message: ----------- Implement td/hd headers/scope Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableCellElement.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableCellElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableCellElement.java 2017-05-13 15:16:10 UTC (rev 14447) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableCellElement.java 2017-05-13 15:29:44 UTC (rev 14448) @@ -394,4 +394,40 @@ public void setBorderColorLight(final String borderColor) { // ignore } + + /** + * Returns the {@code headers} attribute. + * @return the {@code headers} attribute + */ + @JsxGetter + public String getHeaders() { + return getDomNodeOrDie().getAttribute("headers"); + } + + /** + * Sets the {@code headers} attribute. + * @param headers the new attribute + */ + @JsxSetter + public void setHeaders(final String headers) { + getDomNodeOrDie().setAttribute("headers", headers); + } + + /** + * Returns the {@code scope} attribute. + * @return the {@code scope} attribute + */ + @JsxGetter + public String getScope() { + return getDomNodeOrDie().getAttribute("scope"); + } + + /** + * Sets the {@code scope} attribute. + * @param scope the new attribute + */ + @JsxSetter + public void setScope(final String scope) { + getDomNodeOrDie().setAttribute("scope", scope); + } } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java 2017-05-13 15:16:10 UTC (rev 14447) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java 2017-05-13 15:29:44 UTC (rev 14448) @@ -2463,7 +2463,6 @@ IE = "abbr,align,axis,background,bgColor,borderColor,borderColorDark,borderColorLight,cellIndex,ch," + "chOff,colSpan,headers,height,noWrap,rowSpan,scope,vAlign," + "width") - @NotYetImplemented public void td() throws Exception { test("td"); } @@ -2479,7 +2478,6 @@ IE = "abbr,align,axis,background,bgColor,borderColor,borderColorDark,borderColorLight,cellIndex,ch," + "chOff,colSpan,headers,height,noWrap,rowSpan,scope,vAlign," + "width") - @NotYetImplemented public void th() throws Exception { test("th"); } |
From: <asa...@us...> - 2017-05-13 19:08:46
|
Revision: 14449 http://sourceforge.net/p/htmlunit/code/14449 Author: asashour Date: 2017-05-13 19:08:43 +0000 (Sat, 13 May 2017) Log Message: ----------- Fix build Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGeometryElement.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGElement.java 2017-05-13 15:29:44 UTC (rev 14448) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGElement.java 2017-05-13 19:08:43 UTC (rev 14449) @@ -47,6 +47,17 @@ } /** + * Returns the bounding box, in current user space, of the geometry of all contained graphics elements. + * @return the bounding box + */ + protected SVGRect getBBox() { + final SVGRect rect = new SVGRect(); + rect.setParentScope(getParentScope()); + rect.setPrototype(getPrototype(rect.getClass())); + return rect; + } + + /** * {@inheritDoc} */ @Override Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGElement.java 2017-05-13 15:29:44 UTC (rev 14448) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGElement.java 2017-05-13 19:08:43 UTC (rev 14449) @@ -20,6 +20,7 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.svg.SvgGroup; /** @@ -36,4 +37,13 @@ @JsxConstructor({CHROME, FF, EDGE}) public SVGGElement() { } + + /** + * {@inheritDoc} + */ + @Override + @JsxFunction + protected SVGRect getBBox() { + return super.getBBox(); + } } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGeometryElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGeometryElement.java 2017-05-13 15:29:44 UTC (rev 14448) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGeometryElement.java 2017-05-13 19:08:43 UTC (rev 14449) @@ -21,6 +21,7 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; /** * A JavaScript object for {@code SVGGeometryElement}. @@ -37,4 +38,13 @@ @JsxConstructor public SVGGeometryElement() { } + + /** + * {@inheritDoc} + */ + @Override + @JsxFunction + protected SVGRect getBBox() { + return super.getBBox(); + } } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java 2017-05-13 15:29:44 UTC (rev 14448) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java 2017-05-13 19:08:43 UTC (rev 14449) @@ -2463,6 +2463,7 @@ IE = "abbr,align,axis,background,bgColor,borderColor,borderColorDark,borderColorLight,cellIndex,ch," + "chOff,colSpan,headers,height,noWrap,rowSpan,scope,vAlign," + "width") + @NotYetImplemented(IE) public void td() throws Exception { test("td"); } @@ -2478,6 +2479,7 @@ IE = "abbr,align,axis,background,bgColor,borderColor,borderColorDark,borderColorLight,cellIndex,ch," + "chOff,colSpan,headers,height,noWrap,rowSpan,scope,vAlign," + "width") + @NotYetImplemented(IE) public void th() throws Exception { test("th"); } |
From: <rb...@us...> - 2017-05-14 16:26:00
|
Revision: 14453 http://sourceforge.net/p/htmlunit/code/14453 Author: rbri Date: 2017-05-14 16:25:58 +0000 (Sun, 14 May 2017) Log Message: ----------- Various fixes for javascript encoding detection Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlScript.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/ScriptElementSupport.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/util/EncodingSniffer.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript2Test.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2017-05-14 07:59:08 UTC (rev 14452) +++ trunk/htmlunit/src/changes/changes.xml 2017-05-14 16:25:58 UTC (rev 14453) @@ -8,8 +8,11 @@ <body> <release version="2.27" date="???" description="GAE broken, Bugfixes"> + <action type="fix" dev="rbri"> + Various fixes for javascript encoding detection. + </action> <action type="fix" dev="rbri" issue="1881" due-to="Carsten Steul"> - NPE in StyleSheetList.equivalentValues() + NPE in StyleSheetList.equivalentValues(). </action> <action type="add" dev="asashour" issue="43854916" system="stackoverflow"> HtmlImageInput: add .saveAs(). Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2017-05-14 07:59:08 UTC (rev 14452) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2017-05-14 16:25:58 UTC (rev 14453) @@ -92,6 +92,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.event.Event2; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; import com.gargoylesoftware.htmlunit.protocol.javascript.JavaScriptURLConnection; +import com.gargoylesoftware.htmlunit.util.EncodingSniffer; import com.gargoylesoftware.htmlunit.util.UrlUtils; import com.gargoylesoftware.js.nashorn.api.scripting.ScriptObjectMirror; import com.gargoylesoftware.js.nashorn.internal.objects.Global; @@ -944,12 +945,13 @@ * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br> * * @param srcAttribute the source attribute from the script tag + * @param scriptCharset the charset from the script tag * @return the result of loading the specified external JavaScript file * @throws FailingHttpStatusCodeException if the request's status code indicates a request * failure and the {@link WebClient} was configured to throw exceptions on failing * HTTP status codes */ - JavaScriptLoadResult loadExternalJavaScriptFile(final String srcAttribute) + JavaScriptLoadResult loadExternalJavaScriptFile(final String srcAttribute, final Charset scriptCharset) throws FailingHttpStatusCodeException { final WebClient client = getWebClient(); @@ -979,7 +981,7 @@ final Object script; try { - script = loadJavaScriptFromUrl(scriptURL); + script = loadJavaScriptFromUrl(scriptURL, scriptCharset); } catch (final IOException e) { client.getJavaScriptErrorListener().loadScriptError(this, scriptURL, e); @@ -1005,6 +1007,7 @@ * there is a problem loading the code from the specified URL. * * @param url the URL of the script + * @param scriptCharset the charset from the script tag * @return the content of the file, or {@code null} if we ran into a compile error * @throws IOException if there is a problem downloading the JavaScript file * @throws FailingHttpStatusCodeException if the request's status code indicates a request @@ -1011,10 +1014,9 @@ * failure and the {@link WebClient} was configured to throw exceptions on failing * HTTP status codes */ - private Object loadJavaScriptFromUrl(final URL url) throws IOException, + private Object loadJavaScriptFromUrl(final URL url, final Charset scriptCharset) throws IOException, FailingHttpStatusCodeException { - final Charset pageEncoding = getCharset(); final WebRequest referringRequest = getWebResponse().getWebRequest(); final WebClient client = getWebClient(); @@ -1066,17 +1068,17 @@ } } - final Charset scriptEncoding; - final Charset contentCharset = response.getContentCharset(); - if (!contentCharset.equals(ISO_8859_1)) { + Charset scriptEncoding = Charset.forName("windows-1252"); + final Charset contentCharset = EncodingSniffer.sniffEncodingFromHttpHeaders(response.getResponseHeaders()); + if (contentCharset == null) { + // use info from script tag or fall back to utf-8 + if (scriptCharset != null && scriptCharset != ISO_8859_1) { + scriptEncoding = scriptCharset; + } + } + else if (contentCharset != ISO_8859_1) { scriptEncoding = contentCharset; } - else if (!pageEncoding.equals(ISO_8859_1)) { - scriptEncoding = pageEncoding; - } - else { - scriptEncoding = ISO_8859_1; - } final String scriptCode = response.getContentAsString(scriptEncoding); if (null != scriptCode) { Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlScript.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlScript.java 2017-05-14 07:59:08 UTC (rev 14452) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlScript.java 2017-05-14 16:25:58 UTC (rev 14453) @@ -371,7 +371,8 @@ } try { executed_ = true; - final JavaScriptLoadResult result = page.loadExternalJavaScriptFile(src); + final Charset charset = EncodingSniffer.toCharset(getCharsetAttribute()); + final JavaScriptLoadResult result = page.loadExternalJavaScriptFile(src, charset); if (result == JavaScriptLoadResult.SUCCESS) { executeEvent(Event.TYPE_LOAD); } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/ScriptElementSupport.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/ScriptElementSupport.java 2017-05-14 07:59:08 UTC (rev 14452) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/ScriptElementSupport.java 2017-05-14 16:25:58 UTC (rev 14453) @@ -19,6 +19,8 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SCRIPT_SUPPORTS_FOR_AND_EVENT_WINDOW; import static com.gargoylesoftware.htmlunit.html.DomElement.ATTRIBUTE_NOT_DEFINED; +import java.nio.charset.Charset; + import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -35,6 +37,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; import com.gargoylesoftware.htmlunit.protocol.javascript.JavaScriptURLConnection; +import com.gargoylesoftware.htmlunit.util.EncodingSniffer; import com.gargoylesoftware.htmlunit.xml.XmlPage; import net.sourceforge.htmlunit.corejs.javascript.BaseFunction; @@ -137,7 +140,8 @@ try { final ScriptElement scriptElement = (ScriptElement) element; scriptElement.setExecuted(true); - final JavaScriptLoadResult result = page.loadExternalJavaScriptFile(src); + final Charset charset = EncodingSniffer.toCharset(scriptElement.getCharsetAttribute()); + final JavaScriptLoadResult result = page.loadExternalJavaScriptFile(src, charset); if (result == JavaScriptLoadResult.SUCCESS) { executeEvent(element, Event.TYPE_LOAD); } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/util/EncodingSniffer.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/util/EncodingSniffer.java 2017-05-14 07:59:08 UTC (rev 14452) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/util/EncodingSniffer.java 2017-05-14 16:25:58 UTC (rev 14453) @@ -614,7 +614,7 @@ * @return the encoding sniffed from the specified HTTP headers, or {@code null} if the encoding * could not be determined */ - static Charset sniffEncodingFromHttpHeaders(final List<NameValuePair> headers) { + public static Charset sniffEncodingFromHttpHeaders(final List<NameValuePair> headers) { Charset encoding = null; for (final NameValuePair pair : headers) { final String name = pair.getName(); Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript2Test.java 2017-05-14 07:59:08 UTC (rev 14452) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript2Test.java 2017-05-14 16:25:58 UTC (rev 14453) @@ -21,10 +21,12 @@ import java.nio.charset.Charset; import org.apache.commons.io.ByteOrderMark; +import org.apache.commons.lang3.ArrayUtils; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebDriverException; import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; @@ -416,9 +418,18 @@ * @throws Exception if the test fails */ @Test + @Alerts("أهلاً") + public void null_null_null_null() throws Exception { + charset(null, "", null, null); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts("أهلاً") - public void isoCharsetWithUtfBom() throws Exception { - charsetWithBom(ISO_8859_1, ByteOrderMark.UTF_8); + public void null_null_null_UTF_8() throws Exception { + charset(null, "", null, ByteOrderMark.UTF_8); } /** @@ -425,9 +436,26 @@ * @throws Exception if the test fails */ @Test + public void null_null_null_UTF_16BE() throws Exception { + charset(null, "", null, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void null_null_UTF_8_null() throws Exception { + charset(null, "", UTF_8, null); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts("أهلاً") - public void utfCharsetWithoutBom() throws Exception { - charsetWithBom(UTF_8, null); + public void null_null_UTF_8_UTF_8() throws Exception { + charset(null, "", UTF_8, ByteOrderMark.UTF_8); } /** @@ -434,23 +462,733 @@ * @throws Exception if the test fails */ @Test + public void null_null_UTF_8_UTF_16BE() throws Exception { + charset(null, "", UTF_8, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void null_null_ISO_8859_1_null() throws Exception { + charset(null, "", ISO_8859_1, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void null_null_ISO_8859_1_UTF_8() throws Exception { + charset(null, "", ISO_8859_1, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void null_null_ISO_8859_1_UTF_16BE() throws Exception { + charset(null, "", ISO_8859_1, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts("أهلاً") - public void isoCharsetWithoutBom() throws Exception { - charsetWithBom(ISO_8859_1, null); + public void null_UTF_8_null_null() throws Exception { + charset(null, "; charset=utf-8", null, null); } - private void charsetWithBom(final Charset charsetAttribute, final ByteOrderMark bom) throws Exception { - final String html + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void null_UTF_8_null_UTF_8() throws Exception { + charset(null, "; charset=utf-8", null, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void null_UTF_8_null_UTF_16BE() throws Exception { + charset(null, "; charset=utf-8", null, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void null_UTF_8_UTF_8_null() throws Exception { + charset(null, "; charset=utf-8", UTF_8, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void null_UTF_8_UTF_8_UTF_8() throws Exception { + charset(null, "; charset=utf-8", UTF_8, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void null_UTF_8_UTF_8_UTF_16BE() throws Exception { + charset(null, "; charset=utf-8", UTF_8, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void null_UTF_8_ISO_8859_1_null() throws Exception { + charset(null, "; charset=utf-8", ISO_8859_1, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void null_UTF_8_ISO_8859_1_UTF_8() throws Exception { + charset(null, "; charset=utf-8", ISO_8859_1, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void null_UTF_8_ISO_8859_1_UTF_16BE() throws Exception { + charset(null, "; charset=utf-8", ISO_8859_1, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void null_ISO_8859_1_null_null() throws Exception { + charset(null, "; charset=iso-8859-1", null, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "أهلاً", + IE = "أهلاً") + public void null_ISO_8859_1_null_UTF_8() throws Exception { + charset(null, "; charset=iso-8859-1", null, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void null_ISO_8859_1_null_UTF_16BE() throws Exception { + charset(null, "", null, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void null_ISO_8859_1_UTF_8_null() throws Exception { + charset(null, "; charset=iso-8859-1", UTF_8, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "أهلاً", + IE = "أهلاً") + public void null_ISO_8859_1_UTF_8_UTF_8() throws Exception { + charset(null, "; charset=iso-8859-1", UTF_8, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void null_ISO_8859_1_UTF_8_UTF_16BE() throws Exception { + charset(null, "; charset=iso-8859-1", UTF_8, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void null_ISO_8859_1_ISO_8859_1_null() throws Exception { + charset(null, "; charset=iso-8859-1", ISO_8859_1, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void null_ISO_8859_1_ISO_8859_1_UTF_8() throws Exception { + charset(null, "; charset=iso-8859-1", ISO_8859_1, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {}, + IE = "?????") + public void null_ISO_8859_1_ISO_8859_1_UTF_16BE() throws Exception { + charset(null, "; charset=iso-8859-1", ISO_8859_1, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void UTF_8_null_null_null() throws Exception { + charset(UTF_8, "", null, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void UTF_8_null_null_UTF_8() throws Exception { + charset(UTF_8, "", null, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void UTF_8_null_null_UTF_16BE() throws Exception { + charset(UTF_8, "", null, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void UTF_8_null_UTF_8_null() throws Exception { + charset(UTF_8, "", UTF_8, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void UTF_8_null_UTF_8_UTF_8() throws Exception { + charset(UTF_8, "", UTF_8, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void UTF_8_null_UTF_8_UTF_16BE() throws Exception { + charset(UTF_8, "", UTF_8, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void UTF_8_null_ISO_8859_1_null() throws Exception { + charset(UTF_8, "", ISO_8859_1, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void UTF_8_null_ISO_8859_1_UTF_8() throws Exception { + charset(UTF_8, "", ISO_8859_1, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void UTF_8_null_ISO_8859_1_UTF_16BE() throws Exception { + charset(UTF_8, "", ISO_8859_1, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void UTF_8_UTF_8_null_null() throws Exception { + charset(UTF_8, "; charset=utf-8", null, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void UTF_8_UTF_8_null_UTF_8() throws Exception { + charset(UTF_8, "; charset=utf-8", null, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {}, + IE = "أهلاً") + public void UTF_8_UTF_8_null_UTF_16BE() throws Exception { + charset(UTF_8, "; charset=utf-8", null, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void UTF_8_UTF_8_UTF_8_null() throws Exception { + charset(UTF_8, "; charset=utf-8", UTF_8, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void UTF_8_UTF_8_UTF_8_UTF_8() throws Exception { + charset(UTF_8, "; charset=utf-8", UTF_8, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {}, + IE = "أهلاً") + public void UTF_8_UTF_8_UTF_8_UTF_16BE() throws Exception { + charset(UTF_8, "; charset=utf-8", UTF_8, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void UTF_8_UTF_8_ISO_8859_1_null() throws Exception { + charset(UTF_8, "; charset=utf-8", ISO_8859_1, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void UTF_8_UTF_8_ISO_8859_1_UTF_8() throws Exception { + charset(UTF_8, "; charset=utf-8", ISO_8859_1, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {}, + IE = "?????") + public void UTF_8_UTF_8_ISO_8859_1_UTF_16BE() throws Exception { + charset(UTF_8, "; charset=utf-8", ISO_8859_1, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void UTF_8_ISO_8859_1_null_null() throws Exception { + charset(UTF_8, "; charset=iso-8859-1", null, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "أهلاً", + IE = "أهلاً") + public void UTF_8_ISO_8859_1_null_UTF_8() throws Exception { + charset(UTF_8, "; charset=iso-8859-1", null, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void UTF_8_ISO_8859_1_null_UTF_16BE() throws Exception { + charset(UTF_8, "", null, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void UTF_8_ISO_8859_1_UTF_8_null() throws Exception { + charset(UTF_8, "; charset=iso-8859-1", UTF_8, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "أهلاً", + IE = "أهلاً") + public void UTF_8_ISO_8859_1_UTF_8_UTF_8() throws Exception { + charset(UTF_8, "; charset=iso-8859-1", UTF_8, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {}, + IE = "أهلاً") + public void UTF_8_ISO_8859_1_UTF_8_UTF_16BE() throws Exception { + charset(UTF_8, "; charset=iso-8859-1", UTF_8, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void UTF_8_ISO_8859_1_ISO_8859_1_null() throws Exception { + charset(UTF_8, "; charset=iso-8859-1", ISO_8859_1, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void UTF_8_ISO_8859_1_ISO_8859_1_UTF_8() throws Exception { + charset(UTF_8, "; charset=iso-8859-1", ISO_8859_1, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {}, + IE = "?????") + public void UTF_8_ISO_8859_1_ISO_8859_1_UTF_16BE() throws Exception { + charset(UTF_8, "; charset=iso-8859-1", ISO_8859_1, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void ISO_8859_1_null_null_null() throws Exception { + charset(ISO_8859_1, "", null, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void ISO_8859_1_null_null_UTF_8() throws Exception { + charset(ISO_8859_1, "", null, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void ISO_8859_1_null_null_UTF_16BE() throws Exception { + charset(ISO_8859_1, "", null, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void ISO_8859_1_null_UTF_8_null() throws Exception { + charset(ISO_8859_1, "", UTF_8, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void ISO_8859_1_null_UTF_8_UTF_8() throws Exception { + charset(ISO_8859_1, "", UTF_8, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void ISO_8859_1_null_UTF_8_UTF_16BE() throws Exception { + charset(ISO_8859_1, "", UTF_8, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void ISO_8859_1_null_ISO_8859_1_null() throws Exception { + charset(ISO_8859_1, "", ISO_8859_1, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void ISO_8859_1_null_ISO_8859_1_UTF_8() throws Exception { + charset(ISO_8859_1, "", ISO_8859_1, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void ISO_8859_1_null_ISO_8859_1_UTF_16BE() throws Exception { + charset(ISO_8859_1, "", ISO_8859_1, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void ISO_8859_1_UTF_8_null_null() throws Exception { + charset(ISO_8859_1, "; charset=utf-8", null, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void ISO_8859_1_UTF_8_null_UTF_8() throws Exception { + charset(ISO_8859_1, "; charset=utf-8", null, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {}, + IE = "أهلاً") + public void ISO_8859_1_UTF_8_null_UTF_16BE() throws Exception { + charset(ISO_8859_1, "; charset=utf-8", null, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void ISO_8859_1_UTF_8_UTF_8_null() throws Exception { + charset(ISO_8859_1, "; charset=utf-8", UTF_8, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void ISO_8859_1_UTF_8_UTF_8_UTF_8() throws Exception { + charset(ISO_8859_1, "; charset=utf-8", UTF_8, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {}, + IE = "أهلاً") + public void ISO_8859_1_UTF_8_UTF_8_UTF_16BE() throws Exception { + charset(ISO_8859_1, "; charset=utf-8", UTF_8, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void ISO_8859_1_UTF_8_ISO_8859_1_null() throws Exception { + charset(ISO_8859_1, "; charset=utf-8", ISO_8859_1, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void ISO_8859_1_UTF_8_ISO_8859_1_UTF_8() throws Exception { + charset(ISO_8859_1, "; charset=utf-8", ISO_8859_1, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {}, + IE = "?????") + public void ISO_8859_1_UTF_8_ISO_8859_1_UTF_16BE() throws Exception { + charset(ISO_8859_1, "; charset=utf-8", ISO_8859_1, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void ISO_8859_1_ISO_8859_1_null_null() throws Exception { + charset(ISO_8859_1, "; charset=iso-8859-1", null, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "أهلاً", + IE = "أهلاً") + public void ISO_8859_1_ISO_8859_1_null_UTF_8() throws Exception { + charset(ISO_8859_1, "; charset=iso-8859-1", null, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void ISO_8859_1_ISO_8859_1_null_UTF_16BE() throws Exception { + charset(ISO_8859_1, "", null, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("أهلاً") + public void ISO_8859_1_ISO_8859_1_UTF_8_null() throws Exception { + charset(ISO_8859_1, "; charset=iso-8859-1", UTF_8, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "أهلاً", + IE = "أهلاً") + public void ISO_8859_1_ISO_8859_1_UTF_8_UTF_8() throws Exception { + charset(ISO_8859_1, "; charset=iso-8859-1", UTF_8, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {}, + IE = "أهلاً") + public void ISO_8859_1_ISO_8859_1_UTF_8_UTF_16BE() throws Exception { + charset(ISO_8859_1, "; charset=iso-8859-1", UTF_8, ByteOrderMark.UTF_16BE); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void ISO_8859_1_ISO_8859_1_ISO_8859_1_null() throws Exception { + charset(ISO_8859_1, "; charset=iso-8859-1", ISO_8859_1, null); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("?????") + public void ISO_8859_1_ISO_8859_1_ISO_8859_1_UTF_8() throws Exception { + charset(ISO_8859_1, "; charset=iso-8859-1", ISO_8859_1, ByteOrderMark.UTF_8); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {}, + IE = "?????") + public void ISO_8859_1_ISO_8859_1_ISO_8859_1_UTF_16BE() throws Exception { + charset(ISO_8859_1, "; charset=iso-8859-1", ISO_8859_1, ByteOrderMark.UTF_16BE); + } + + private void charset(final Charset charsetAttribute, + final String charsetResponseHeader, + final Charset charsetResponseEncoding, + final ByteOrderMark bom) throws Exception { + + // use always a different url to avoid caching effects + final URL cssUrl = new URL(URL_SECOND, "" + System.currentTimeMillis() + ".js"); + + String html = "<html><head>\n" - + " <script src='" + URL_SECOND + "' charset='" + charsetAttribute + "'></script>\n" + + " <script src='" + cssUrl + "'"; + if (charsetAttribute != null) { + html = html + " charset='" + charsetAttribute + "'"; + } + html = html + "></script>\n" + "</head>\n" + "<body></body>\n" + "</html>"; - final String script = - (bom == null ? "" : new String(bom.getBytes())) - + "alert('أهلاً');"; - getMockWebConnection().setResponse(URL_SECOND, script, "application/javascript", UTF_8); - loadPageWithAlerts2(html); + final String js = "alert('أهلاً');"; + byte[] script = null; + if (charsetResponseEncoding == null) { + script = js.getBytes(UTF_8); + } + else { + script = js.getBytes(charsetResponseEncoding); + } + if (bom == null) { + getMockWebConnection().setResponse(cssUrl, script, 200, "OK", + "application/javascript" + charsetResponseHeader, null); + } + else { + script = ArrayUtils.addAll(bom.getBytes(), script); + getMockWebConnection().setResponse(cssUrl, script, 200, "OK", + "application/javascript" + charsetResponseHeader, null); + } + + try { + loadPageWithAlerts2(html); + } + catch (final WebDriverException e) { + if (!e.getCause().getMessage().contains("illegal character") + && !e.getCause().getMessage().contains("is not defined.")) { + throw e; + } + } } } |
From: <rb...@us...> - 2017-05-20 19:30:17
|
Revision: 14465 http://sourceforge.net/p/htmlunit/code/14465 Author: rbri Date: 2017-05-20 19:30:15 +0000 (Sat, 20 May 2017) Log Message: ----------- Fixed wrong dom tree because of duplicated head element Issue 1863 Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2017-05-19 15:25:43 UTC (rev 14464) +++ trunk/htmlunit/src/changes/changes.xml 2017-05-20 19:30:15 UTC (rev 14465) @@ -8,6 +8,9 @@ <body> <release version="2.27" date="???" description="GAE broken, FF52, Bugfixes"> + <action type="fix" dev="rbri" issue="1863"> + Fixed wrong dom tree because of duplicated head element. + </action> <action type="fix" dev="rbri" issue="1883"> Avoid CCE in innerText when the element contains a SvgElement. </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java 2017-05-19 15:25:43 UTC (rev 14464) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java 2017-05-20 19:30:15 UTC (rev 14465) @@ -773,9 +773,6 @@ if ("head".equals(tagLower)) { parsingInnerHead_ = false; } - if ("head".equals(tagLower)) { - return; - } } // Need to reset this at each closing form tag because a valid form could start afterwards. |
From: <rb...@us...> - 2017-05-21 08:03:42
|
Revision: 14466 http://sourceforge.net/p/htmlunit/code/14466 Author: rbri Date: 2017-05-21 08:03:39 +0000 (Sun, 21 May 2017) Log Message: ----------- code cleanup and test for 1863 added Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLParser4Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java 2017-05-20 19:30:15 UTC (rev 14465) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java 2017-05-21 08:03:39 UTC (rev 14466) @@ -403,7 +403,6 @@ private DomNode currentNode_; private StringBuilder characters_; private HeadParsed headParsed_ = HeadParsed.NO; - private boolean parsingInnerHead_ = false; private HtmlElement body_; private boolean lastTagWasSynthesized_; private HtmlForm formWaitingForLostChildren_; @@ -549,7 +548,6 @@ } if ("head".equals(tagLower)) { if (headParsed_ == HeadParsed.YES || page_.isParsingHtmlSnippet()) { - parsingInnerHead_ = true; return; } @@ -769,12 +767,6 @@ } } - if (parsingInnerHead_) { - if ("head".equals(tagLower)) { - parsingInnerHead_ = false; - } - } - // Need to reset this at each closing form tag because a valid form could start afterwards. if ("form".equals(tagLower)) { formWaitingForLostChildren_ = null; @@ -953,10 +945,6 @@ if ("form".equals(element.localpart)) { formWaitingForLostChildren_ = null; } - - if (parsingInnerHead_ && "head".equalsIgnoreCase(element.localpart)) { - parsingInnerHead_ = false; - } } /** @@ -972,10 +960,6 @@ if (body_ != null && "html".equalsIgnoreCase(elem.localpart) && attrs != null) { copyAttributes((DomElement) body_.getParentNode(), attrs); } - - if (headParsed_ == HeadParsed.YES && "head".equalsIgnoreCase(elem.localpart)) { - parsingInnerHead_ = true; - } } private static void copyAttributes(final DomElement to, final XMLAttributes attrs) { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLParser4Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLParser4Test.java 2017-05-20 19:30:15 UTC (rev 14465) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLParser4Test.java 2017-05-21 08:03:39 UTC (rev 14466) @@ -203,6 +203,28 @@ * @throws Exception failure */ @Test + @Alerts("<html><head><title>foo</title></head>" + + "<body><script>alert(document.documentElement.outerHTML);</script></body></html>") + public void badlyFormedHTML_duplicateHeadStructure() throws Exception { + final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + + "<html>" + + "<head>" + + "<head>" + + "<title>foo</title>" + + "</head>" + + "</head>" + + "<body>" + + "<script>alert(document.documentElement.outerHTML);</script>" + + "</body>" + + "</html>"; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception failure + */ + @Test @Alerts("<p title=\"Nimbus\ufffd X\">Nimbus\ufffd X</p>") public void badlyFormedHTML_invalidNumericCharacterReference() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ |
From: <rb...@us...> - 2017-05-23 11:31:12
|
Revision: 14470 http://sourceforge.net/p/htmlunit/code/14470 Author: rbri Date: 2017-05-23 11:31:10 +0000 (Tue, 23 May 2017) Log Message: ----------- FF update Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/NavigatorTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java 2017-05-23 06:19:49 UTC (rev 14469) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java 2017-05-23 11:31:10 UTC (rev 14470) @@ -179,7 +179,7 @@ // FF52 FIREFOX_52.initDefaultFeatures(); FIREFOX_52.setVendor(""); - FIREFOX_52.buildId_ = "20170504112025"; + FIREFOX_52.buildId_ = "20170517122419"; FIREFOX_52.setHeaderNamesOrdered(new String[] { "Host", "User-Agent", "Accept", "Accept-Language", "Accept-Encoding", "Referer", "Cookie", "Connection"}); FIREFOX_52.setHtmlAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); @@ -320,7 +320,7 @@ FIREFOX_45.getPlugins().add(flash); flash = new PluginConfiguration("Shockwave Flash", - "Shockwave Flash 25.0 r0", "25.0.0.148", "NPSWF32_25_0_0_148.dll"); + "Shockwave Flash 25.0 r0", "25.0.0.171", "NPSWF32_25_0_0_171.dll"); flash.getMimeTypes().add(new PluginConfiguration.MimeType("application/x-shockwave-flash", "Shockwave Flash", "swf")); FIREFOX_52.getPlugins().add(flash); Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/NavigatorTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/NavigatorTest.java 2017-05-23 06:19:49 UTC (rev 14469) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/NavigatorTest.java 2017-05-23 11:31:10 UTC (rev 14470) @@ -210,7 +210,7 @@ * @throws Exception on test failure */ @Test - @Alerts(FF = {"Shockwave Flash", "Shockwave Flash 25.0 r0", "25.0.0.148", "NPSWF32_25_0_0_148.dll"}, + @Alerts(FF = {"Shockwave Flash", "Shockwave Flash 25.0 r0", "25.0.0.171", "NPSWF32_25_0_0_171.dll"}, CHROME = {"Shockwave Flash", "Shockwave Flash 24.0 r0", "undefined", "internal-not-yet-present"}, IE = {"Shockwave Flash", "Shockwave Flash 25.0 r0", "25.0.0.148", "Flash32_25_0_0_148.ocx"}, EDGE = {"Shockwave Flash", "Shockwave Flash 18.0 r0", "18.0.0.232", "Flash.ocx"}) @@ -375,7 +375,7 @@ @Test @Alerts(DEFAULT = "undefined", FF45 = "20170411115307", - FF52 = "20170504112025") + FF52 = "20170517122419") public void buildID() throws Exception { final String html = "<html><head><title>First</title>\n" |