From: <rb...@us...> - 2018-06-20 06:52:45
|
Revision: 15365 http://sourceforge.net/p/htmlunit/code/15365 Author: rbri Date: 2018-06-20 06:52:37 +0000 (Wed, 20 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceTiming.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceTimingTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceTiming.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceTiming.java 2018-06-20 06:48:47 UTC (rev 15364) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceTiming.java 2018-06-20 06:52:37 UTC (rev 15365) @@ -17,6 +17,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.FF60; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -131,7 +132,7 @@ /** * @return a secureConnectionStart */ - @JsxGetter(CHROME) + @JsxGetter({CHROME, FF60}) public long getSecureConnectionStart() { return 0; } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceTimingTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceTimingTest.java 2018-06-20 06:48:47 UTC (rev 15364) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceTimingTest.java 2018-06-20 06:52:37 UTC (rev 15365) @@ -87,7 +87,8 @@ */ @Test @Alerts(DEFAULT = "undefined", - CHROME = "0") + CHROME = "0", + FF60 = "0") public void secureConnectionStart() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ |
From: <rb...@us...> - 2018-06-20 07:03:01
|
Revision: 15368 http://sourceforge.net/p/htmlunit/code/15368 Author: rbri Date: 2018-06-20 07:02:52 +0000 (Wed, 20 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java Property Changed: ---------------- trunk/htmlunit/src/test/resources/com/gargoylesoftware/htmlunit/javascript/host/css/property/ElementOffsetHeightTest.properties.FF60.txt Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-20 06:59:19 UTC (rev 15367) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-20 07:02:52 UTC (rev 15368) @@ -385,7 +385,7 @@ HTMLIMAGE_BLANK_SRC_AS_EMPTY, /** Empty src attribute sets display to false. */ - @BrowserFeature({IE, FF52}) + @BrowserFeature({IE, FF}) HTMLIMAGE_EMPTY_SRC_DISPLAY_FALSE, /** Is document.cretaeElement('image') an HTMLElement. */ Index: trunk/htmlunit/src/test/resources/com/gargoylesoftware/htmlunit/javascript/host/css/property/ElementOffsetHeightTest.properties.FF60.txt =================================================================== --- trunk/htmlunit/src/test/resources/com/gargoylesoftware/htmlunit/javascript/host/css/property/ElementOffsetHeightTest.properties.FF60.txt 2018-06-20 06:59:19 UTC (rev 15367) +++ trunk/htmlunit/src/test/resources/com/gargoylesoftware/htmlunit/javascript/host/css/property/ElementOffsetHeightTest.properties.FF60.txt 2018-06-20 07:02:52 UTC (rev 15368) Property changes on: trunk/htmlunit/src/test/resources/com/gargoylesoftware/htmlunit/javascript/host/css/property/ElementOffsetHeightTest.properties.FF60.txt ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property |
From: <rb...@us...> - 2018-06-20 10:04:20
|
Revision: 15369 http://sourceforge.net/p/htmlunit/code/15369 Author: rbri Date: 2018-06-20 10:04:14 +0000 (Wed, 20 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/History.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-20 07:02:52 UTC (rev 15368) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-20 10:04:14 UTC (rev 15369) @@ -1507,7 +1507,7 @@ * Indicates, that the pathname for the url 'blank' is empty; * instead of 'blank'. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) URL_ABOUT_BLANK_HAS_BLANK_PATH, /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/History.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/History.java 2018-06-20 07:02:52 UTC (rev 15368) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/History.java 2018-06-20 10:04:14 UTC (rev 15369) @@ -17,7 +17,6 @@ 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 java.io.IOException; import java.net.MalformedURLException; @@ -168,7 +167,7 @@ * Returns the {@code scrollRestoration} property. * @return the {@code scrollRestoration} property */ - @JsxGetter({CHROME, FF52}) + @JsxGetter({CHROME, FF}) public String getScrollRestoration() { return scrollRestoration_; } @@ -176,7 +175,7 @@ /** * @param scrollRestoration the new value */ - @JsxSetter({CHROME, FF52}) + @JsxSetter({CHROME, FF}) public void setScrollRestoration(final String scrollRestoration) { if (SCROLL_RESTAURATION_AUTO.equals(scrollRestoration)) { scrollRestoration_ = SCROLL_RESTAURATION_AUTO; Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java 2018-06-20 07:02:52 UTC (rev 15368) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java 2018-06-20 10:04:14 UTC (rev 15369) @@ -17,6 +17,7 @@ import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import static java.nio.charset.StandardCharsets.ISO_8859_1; @@ -911,7 +912,7 @@ + "width", CHROME = "-", FF60 = "-") - @NotYetImplemented({FF, IE}) + @NotYetImplemented({FF52, IE}) public void applet() throws Exception { test("applet"); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java 2018-06-20 07:02:52 UTC (rev 15368) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java 2018-06-20 10:04:14 UTC (rev 15369) @@ -17,6 +17,7 @@ import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF60; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import org.junit.Test; @@ -23,10 +24,10 @@ import org.junit.runner.RunWith; import com.gargoylesoftware.htmlunit.BrowserRunner; -import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.BrowserRunner.AlertsStandards; import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; +import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.WebDriverTestCase; import com.gargoylesoftware.htmlunit.annotations.StandardsMode; @@ -7205,7 +7206,7 @@ @Alerts(DEFAULT = "exception", CHROME = "function RTCDataChannel() { [native code] }", FF60 = "function RTCDataChannel() {\n [native code]\n}") - @NotYetImplemented(CHROME) + @NotYetImplemented({CHROME, FF60}) public void rtcDataChannel() throws Exception { test("RTCDataChannel"); } @@ -10241,6 +10242,7 @@ @Test @Alerts(DEFAULT = "exception", FF60 = "function VRDisplay() {\n [native code]\n}") + @NotYetImplemented(FF60) public void vrDisplay() throws Exception { test("VRDisplay"); } @@ -10251,6 +10253,7 @@ @Test @Alerts(DEFAULT = "exception", FF60 = "function VRDisplayCapabilities() {\n [native code]\n}") + @NotYetImplemented(FF60) public void vrDisplayCapabilities() throws Exception { test("VRDisplayCapabilities"); } @@ -10261,6 +10264,7 @@ @Test @Alerts(DEFAULT = "exception", FF60 = "function VREyeParameters() {\n [native code]\n}") + @NotYetImplemented(FF60) public void vrEyeParameters() throws Exception { test("VREyeParameters"); } @@ -10271,6 +10275,7 @@ @Test @Alerts(DEFAULT = "exception", FF60 = "function VRFieldOfView() {\n [native code]\n}") + @NotYetImplemented(FF60) public void vrFieldOfView() throws Exception { test("VRFieldOfView"); } @@ -10299,6 +10304,7 @@ @Test @Alerts(DEFAULT = "exception", FF60 = "function VRPose() {\n [native code]\n}") + @NotYetImplemented(FF60) public void vrPose() throws Exception { test("VRPose"); } @@ -10318,6 +10324,7 @@ @Test @Alerts(DEFAULT = "exception", FF60 = "function VRStageParameters() {\n [native code]\n}") + @NotYetImplemented(FF60) public void vrStageParameters() throws Exception { test("VRStageParameters"); } |
From: <rb...@us...> - 2018-06-20 17:47:37
|
Revision: 15372 http://sourceforge.net/p/htmlunit/code/15372 Author: rbri Date: 2018-06-20 17:47:33 +0000 (Wed, 20 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAnchorElement2Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-20 17:44:22 UTC (rev 15371) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-20 17:47:33 UTC (rev 15372) @@ -1000,7 +1000,7 @@ JS_Iterator, /** Property form for label always returns null. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) JS_LABEL_FORM_NULL, /** location.hash returns an encoded hash. */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAnchorElement2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAnchorElement2Test.java 2018-06-20 17:44:22 UTC (rev 15371) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAnchorElement2Test.java 2018-06-20 17:47:33 UTC (rev 15372) @@ -690,7 +690,9 @@ IE = {"http:||||||/", "https:||||||/", "mailto:||||||fo...@fo...", "tel:||||||123456", "foo:||||||blabla", "file:||||||/p://", "file:||||||/p:/", "file:||||||/p:/TeMp"}, CHROME = {":||||||", ":||||||", "mailto:||||||fo...@fo...", "tel:||||||123456", - "foo:||||||blabla", "file:||||||/P://", "file:||||||/P:/", "file:||||||/P:/TeMp"}) + "foo:||||||blabla", "file:||||||/P://", "file:||||||/P:/", "file:||||||/P:/TeMp"}, + FF60 = {"http:||||||", "http:||||||", "mailto:||||||", "tel:||||||", + "foo:||||||", "p:||||||", "p:||||||", "p:||||||"}) public void propertiesNonStandardHref() throws Exception { final String html = "<html>\n" + "<body>\n" @@ -815,13 +817,11 @@ * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = {"undefined-null", "undefined-", "undefined- \t ", + @Alerts(DEFAULT = {"-null", "-", "- \t ", "no-referrer-no-referrer", + "origin-origin", "unsafe-url-unsafe-url", "-unknown"}, + IE = {"undefined-null", "undefined-", "undefined- \t ", "undefined-no-referrer", "undefined-origin", - "undefined-unsafe-url", "undefined-unknown"}, - CHROME = {"-null", "-", "- \t ", "no-referrer-no-referrer", - "origin-origin", "unsafe-url-unsafe-url", "-unknown"}, - FF52 = {"-null", "-", "- \t ", "no-referrer-no-referrer", - "origin-origin", "unsafe-url-unsafe-url", "-unknown"}) + "undefined-unsafe-url", "undefined-unknown"}) public void referrerPolicy() throws Exception { final String html = "<html>\n" @@ -853,13 +853,11 @@ * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = {"undefined-origin", "unknown-origin", "no-referrer-origin", + @Alerts(DEFAULT = {"origin-origin", "-unknown", "no-referrer-no-referrer", + "-", "no-referrer-NO-reFerrer", "origin-origin", "- ", "-unknown"}, + IE = {"undefined-origin", "unknown-origin", "no-referrer-origin", "-origin", "NO-reFerrer-origin", "NO-reFerrer-origin", - "NO-reFerrer- ", "NO-reFerrer-unknown"}, - CHROME = {"origin-origin", "-unknown", "no-referrer-no-referrer", - "-", "no-referrer-NO-reFerrer", "origin-origin", "- ", "-unknown"}, - FF52 = {"origin-origin", "-unknown", "no-referrer-no-referrer", - "-", "no-referrer-NO-reFerrer", "origin-origin", "- ", "-unknown"}) + "NO-reFerrer- ", "NO-reFerrer-unknown"}) public void setReferrerPolicy() throws Exception { final String html = "<html>\n" |
From: <rb...@us...> - 2018-06-20 18:42:38
|
Revision: 15373 http://sourceforge.net/p/htmlunit/code/15373 Author: rbri Date: 2018-06-20 18:42:28 +0000 (Wed, 20 Jun 2018) Log Message: ----------- WebClient default request header should not overwrite request-specific ones Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebClientTest.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2018-06-20 17:47:33 UTC (rev 15372) +++ trunk/htmlunit/src/changes/changes.xml 2018-06-20 18:42:28 UTC (rev 15373) @@ -8,6 +8,9 @@ <body> <release version="2.32" date="xx 2018" description="Bugfixes, FIREFOX_45 removed, FIREFOX_60 added"> + <action type="fix" dev="rbri" issue="1970"> + WebClient default request header should not overwrite request-specific ones. + </action> <action type="fix" dev="rbri" issue="1962"> Various fixes for the selector specificity calculation (CssParser). </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java 2018-06-20 17:47:33 UTC (rev 15372) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java 2018-06-20 18:42:28 UTC (rev 15373) @@ -1480,8 +1480,13 @@ && !wrs.isAdditionalHeader(HttpHeader.UPGRADE_INSECURE_REQUESTS)) { wrs.setAdditionalHeader(HttpHeader.UPGRADE_INSECURE_REQUESTS, "1"); } + // Add user-specified headers last so that they can override HtmlUnit defaults. - wrs.getAdditionalHeaders().putAll(requestHeaders_); + requestHeaders_.forEach((name, value) -> { + if (!wrs.isAdditionalHeader(name)) { + wrs.setAdditionalHeader(name, value); + } + }); } /** Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebClientTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebClientTest.java 2018-06-20 17:47:33 UTC (rev 15372) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebClientTest.java 2018-06-20 18:42:28 UTC (rev 15373) @@ -20,6 +20,7 @@ import static org.easymock.EasyMock.expectLastCall; import static org.easymock.EasyMock.replay; import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.fail; import java.io.ByteArrayOutputStream; @@ -1519,6 +1520,32 @@ } /** + * @throws Exception if something goes wrong + */ + @Test + public void requestHeaderDoNotOverwriteExisting() throws Exception { + final String content = "<html></html>"; + final WebClient client = getWebClient(); + + final MockWebConnection webConnection = new MockWebConnection(); + webConnection.setDefaultResponse(content); + client.setWebConnection(webConnection); + + client.getPage(URL_FIRST); + assertNotNull(webConnection.getLastAdditionalHeaders().get(HttpHeader.ACCEPT_LANGUAGE)); + assertNotEquals("foo value", webConnection.getLastAdditionalHeaders().get(HttpHeader.ACCEPT_LANGUAGE)); + + client.addRequestHeader(HttpHeader.ACCEPT_LANGUAGE, "foo value"); + client.getPage(URL_FIRST); + assertNotEquals("foo value", webConnection.getLastAdditionalHeaders().get(HttpHeader.ACCEPT_LANGUAGE)); + + client.removeRequestHeader(HttpHeader.ACCEPT_LANGUAGE); + client.getPage(URL_FIRST); + assertNotNull(webConnection.getLastAdditionalHeaders().get(HttpHeader.ACCEPT_LANGUAGE)); + assertNotEquals("foo value", webConnection.getLastAdditionalHeaders().get(HttpHeader.ACCEPT_LANGUAGE)); + } + + /** * Test that content type is looked in a case insensitive way. * Cf <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>: * "All media type values, subtype values, and parameter names as defined |
From: <rb...@us...> - 2018-06-21 16:36:38
|
Revision: 15376 http://sourceforge.net/p/htmlunit/code/15376 Author: rbri Date: 2018-06-21 16:36:25 +0000 (Thu, 21 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest2Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-21 16:12:46 UTC (rev 15375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-21 16:36:25 UTC (rev 15376) @@ -1529,9 +1529,13 @@ @BrowserFeature(IE) WINDOW_EXECUTE_EVENTS, - /** XMLHttpRequest.getAllResponseHeaders() has a trailing CrLf. */ + /** XMLHttpRequest.getAllResponseHeaders() uses only Lf as separator. */ + @BrowserFeature({FF60, IE}) + XHR_ALL_RESPONSE_HEADERS_SEPARATE_BY_LF, + + /** XMLHttpRequest.getAllResponseHeaders() has a trailing separator. */ @BrowserFeature(IE) - XHR_ALL_RESPONSE_HEADERS_APPEND_CRLF, + XHR_ALL_RESPONSE_HEADERS_APPEND_SEPARATOR, /** XMLHttpRequest triggers the opened event at the beginning of the send method again. */ @BrowserFeature(IE) Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java 2018-06-21 16:12:46 UTC (rev 15375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java 2018-06-21 16:36:25 UTC (rev 15376) @@ -14,7 +14,8 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.xml; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_ALL_RESPONSE_HEADERS_APPEND_CRLF; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_ALL_RESPONSE_HEADERS_APPEND_SEPARATOR; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_ALL_RESPONSE_HEADERS_SEPARATE_BY_LF; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_FIRE_STATE_OPENED_AGAIN_IN_ASYNC_MODE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_IGNORE_PORT_FOR_SAME_ORIGIN; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_LENGTH_COMPUTABLE; @@ -460,10 +461,18 @@ if (webResponse_ != null) { final StringBuilder builder = new StringBuilder(); for (final NameValuePair header : webResponse_.getResponseHeaders()) { - builder.append(header.getName()).append(": ").append(header.getValue()).append("\r\n"); + builder.append(header.getName()).append(": ").append(header.getValue()); + + if (!getBrowserVersion().hasFeature(XHR_ALL_RESPONSE_HEADERS_SEPARATE_BY_LF)) { + builder.append('\r'); + } + builder.append('\n'); } - if (getBrowserVersion().hasFeature(XHR_ALL_RESPONSE_HEADERS_APPEND_CRLF)) { - builder.append("\r\n"); + if (getBrowserVersion().hasFeature(XHR_ALL_RESPONSE_HEADERS_APPEND_SEPARATOR)) { + if (!getBrowserVersion().hasFeature(XHR_ALL_RESPONSE_HEADERS_SEPARATE_BY_LF)) { + builder.append('\r'); + } + builder.append('\n'); } return builder.toString(); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest2Test.java 2018-06-21 16:12:46 UTC (rev 15375) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest2Test.java 2018-06-21 16:36:25 UTC (rev 15376) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.xml; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF60; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import static java.nio.charset.StandardCharsets.UTF_8; @@ -950,10 +951,10 @@ + "Transfer-Encoding: chunked\r\n" + "Server: Jetty(XXX)\r\n"}, IE = {"", "", - "Date XYZ GMT\r\n" - + "Content-Type: text/xml;charset=iso-8859-1\r\n" - + "Transfer-Encoding: chunked\r\n" - + "Server: Jetty(XXX)\r\n\r\n"}, + "Date XYZ GMT\n" + + "Content-Type: text/xml;charset=iso-8859-1\n" + + "Transfer-Encoding: chunked\n" + + "Server: Jetty(XXX)\n\n"}, CHROME = {"", "", "date XYZ GMT\r\n" + "server: Jetty(XXX)\r\n" @@ -964,7 +965,7 @@ + "Date XYZ GMT\n" + "Server: Jetty(XXX)\n" + "Transfer-Encoding: chunked\n"}) - @NotYetImplemented(CHROME) + @NotYetImplemented({CHROME, FF60}) public void getAllResponseHeaders() throws Exception { final String html = "<html>\n" |
From: <rb...@us...> - 2018-06-21 16:42:44
|
Revision: 15377 http://sourceforge.net/p/htmlunit/code/15377 Author: rbri Date: 2018-06-21 16:42:37 +0000 (Thu, 21 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-21 16:36:25 UTC (rev 15376) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-21 16:42:37 UTC (rev 15377) @@ -1562,10 +1562,6 @@ @BrowserFeature({CHROME, FF}) XHR_OPEN_ALLOW_EMTPY_URL, - /** Indicates that method overrideMimeType throws if msg was already sent. */ - @BrowserFeature({CHROME, FF52, IE}) - XHR_OVERRIDE_MIME_TYPE_BEFORE_SEND, - /** Indicates that the content charset is used for response parsing. */ @BrowserFeature(FF) XHR_USE_CONTENT_CHARSET, Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java 2018-06-21 16:36:25 UTC (rev 15376) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java 2018-06-21 16:42:37 UTC (rev 15377) @@ -21,7 +21,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_LENGTH_COMPUTABLE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_NO_CROSS_ORIGIN_TO_ABOUT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_OPEN_ALLOW_EMTPY_URL; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_OVERRIDE_MIME_TYPE_BEFORE_SEND; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_USE_CONTENT_CHARSET; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_USE_DEFAULT_CHARSET_FROM_PAGE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_WITHCREDENTIALS_ALLOW_ORIGIN_ALL; @@ -938,8 +937,7 @@ */ @JsxFunction public void overrideMimeType(final String mimeType) { - if (getBrowserVersion().hasFeature(XHR_OVERRIDE_MIME_TYPE_BEFORE_SEND) - && state_ != UNSENT && state_ != OPENED) { + if (state_ != UNSENT && state_ != OPENED) { throw Context.reportRuntimeError("Property 'overrideMimeType' not writable after sent."); } overriddenMimeType_ = mimeType; Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestTest.java 2018-06-21 16:36:25 UTC (rev 15376) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestTest.java 2018-06-21 16:42:37 UTC (rev 15377) @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import static java.nio.charset.StandardCharsets.UTF_8; @@ -1587,7 +1586,7 @@ "\nfunction onreadystatechange() {\n [native code]\n}\n", "\nfunction onreadystatechange() {\n [native code]\n}\n", "true", "true"}) - @NotYetImplemented({CHROME, FF52}) + @NotYetImplemented({CHROME, FF}) public void getOwnPropertyDescriptor() throws Exception { final String html = "<html>\n" |
From: <rb...@us...> - 2018-06-21 18:31:20
|
Revision: 15378 http://sourceforge.net/p/htmlunit/code/15378 Author: rbri Date: 2018-06-21 18:31:07 +0000 (Thu, 21 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAppletElement2Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-21 16:42:37 UTC (rev 15377) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-21 18:31:07 UTC (rev 15378) @@ -1210,6 +1210,10 @@ @BrowserFeature(IE) JS_STYLE_UNSUPPORTED_PROPERTY_GETTER, + /** Indicates if style properties are always in lower case. */ + @BrowserFeature({CHROME, FF60, IE}) + JS_STYLE_VALUES_LOWERCASE, + /** Indicates wordSpacing support percent values. */ @BrowserFeature(FF) JS_STYLE_WORD_SPACING_ACCEPTS_PERCENT, @@ -1529,14 +1533,14 @@ @BrowserFeature(IE) WINDOW_EXECUTE_EVENTS, + /** XMLHttpRequest.getAllResponseHeaders() has a trailing separator. */ + @BrowserFeature(IE) + XHR_ALL_RESPONSE_HEADERS_APPEND_SEPARATOR, + /** XMLHttpRequest.getAllResponseHeaders() uses only Lf as separator. */ @BrowserFeature({FF60, IE}) XHR_ALL_RESPONSE_HEADERS_SEPARATE_BY_LF, - /** XMLHttpRequest.getAllResponseHeaders() has a trailing separator. */ - @BrowserFeature(IE) - XHR_ALL_RESPONSE_HEADERS_APPEND_SEPARATOR, - /** XMLHttpRequest triggers the opened event at the beginning of the send method again. */ @BrowserFeature(IE) XHR_FIRE_STATE_OPENED_AGAIN_IN_ASYNC_MODE, Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java 2018-06-21 16:42:37 UTC (rev 15377) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java 2018-06-21 18:31:07 UTC (rev 15378) @@ -24,6 +24,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_ZINDEX_TYPE_INTEGER; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_STYLE_SET_PROPERTY_IMPORTANT_IGNORES_CASE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_STYLE_UNSUPPORTED_PROPERTY_GETTER; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_STYLE_VALUES_LOWERCASE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_STYLE_WORD_SPACING_ACCEPTS_PERCENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_STYLE_WRONG_INDEX_RETURNS_UNDEFINED; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; @@ -1680,7 +1681,7 @@ if (element != null && element.getValue() != null) { final String value = element.getValue(); if (!value.contains("url") - && getBrowserVersion().hasFeature(JS_STYLE_SET_PROPERTY_IMPORTANT_IGNORES_CASE)) { + && getBrowserVersion().hasFeature(JS_STYLE_VALUES_LOWERCASE)) { return value.toLowerCase(Locale.ROOT); } return value; Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java 2018-06-21 16:42:37 UTC (rev 15377) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java 2018-06-21 18:31:07 UTC (rev 15378) @@ -37,12 +37,10 @@ private PrintStream originalErr_; private final ByteArrayOutputStream baos_ = new ByteArrayOutputStream(); private static final Pattern[] PATTERNS = { - // chrome Pattern.compile("Starting ChromeDriver " + ExternalTest.CHROME_DRIVER_.replace(".", "\\.") + "\\.[0-9]+ ?\\(?[0-9a-f]*\\)? on port \\d*\r?\n" + "Only local connections are allowed\\.\r?\n"), - // GeckoDriver Pattern.compile("[0-9]*\\sgeckodriver\\sINFO\\sgeckodriver " + ExternalTest.GECKO_DRIVER_.replace(".", "\\.") + ".*", Pattern.DOTALL), @@ -51,7 +49,6 @@ + "3\\.8\\.0\\.0\r?\n" + "Listening on port \\d*\r?\n" + "Only local connections are allowed\r?\n"), - // edge Pattern.compile(".*Listening on http://localhost:\\d*/ \r\r?\n"), Pattern.compile(".*Stopping server.\r\r?\n"), Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAppletElement2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAppletElement2Test.java 2018-06-21 16:42:37 UTC (rev 15377) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAppletElement2Test.java 2018-06-21 18:31:07 UTC (rev 15378) @@ -43,7 +43,8 @@ */ @Test public void callAppletMethodFromJS() throws Exception { - if (getBrowserVersion().isChrome()) { + if (getBrowserVersion().isChrome() + || (getBrowserVersion().isFirefox() && !getBrowserVersion().isFirefox52())) { return; } |
From: <rb...@us...> - 2018-06-21 19:22:44
|
Revision: 15379 http://sourceforge.net/p/htmlunit/code/15379 Author: rbri Date: 2018-06-21 19:22:38 +0000 (Thu, 21 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-21 18:31:07 UTC (rev 15378) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-21 19:22:38 UTC (rev 15379) @@ -955,9 +955,9 @@ @BrowserFeature(IE) JS_INNER_HTML_ADD_CHILD_FOR_NULL_VALUE, - /** Indicates that innerHTML uses {@code crnl} instead of {@code nl}. */ + /** Indicates that innerHTML uses {@code lf} instead of {@code lf}. */ @BrowserFeature(IE) - JS_INNER_TEXT_CR_NL, + JS_INNER_TEXT_LF, /** Indicates that innerText setter supports null values. */ @BrowserFeature({CHROME, FF52}) Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element.java 2018-06-21 18:31:07 UTC (rev 15378) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element.java 2018-06-21 19:22:38 UTC (rev 15379) @@ -17,7 +17,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_BOUNDINGCLIENTRECT_THROWS_IF_DISCONNECTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ELEMENT_GET_ATTRIBUTE_RETURNS_EMPTY; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INNER_HTML_ADD_CHILD_FOR_NULL_VALUE; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INNER_TEXT_CR_NL; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INNER_TEXT_LF; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_OUTER_HTML_NULL_AS_STRING; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_OUTER_HTML_REMOVES_CHILDREN_FOR_DETACHED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_OUTER_HTML_THROWS_FOR_DETACHED; @@ -733,7 +733,7 @@ * * @see <a href="http://msdn.microsoft.com/en-us/library/ie/ms536451.aspx">MSDN</a> */ - @JsxFunction({CHROME, FF52}) + @JsxFunction({CHROME, FF}) public Object insertAdjacentElement(final String where, final Object insertedElement) { if (insertedElement instanceof Node) { final DomNode childNode = ((Node) insertedElement).getDomNodeOrDie(); @@ -760,7 +760,7 @@ * * @see <a href="http://msdn.microsoft.com/en-us/library/ie/ms536453.aspx">MSDN</a> */ - @JsxFunction({CHROME, FF52}) + @JsxFunction({CHROME, FF}) public void insertAdjacentText(final String where, final String text) { final Object[] values = getInsertAdjacentLocation(where); final DomNode node = (DomNode) values[0]; @@ -1064,8 +1064,8 @@ if (node instanceof HtmlElement) { final HtmlElement element = (HtmlElement) node; if ("p".equals(element.getTagName())) { - if (getBrowserVersion().hasFeature(JS_INNER_TEXT_CR_NL)) { - builder.append("\r\n"); // \r\n because it's to implement something IE specific + if (getBrowserVersion().hasFeature(JS_INNER_TEXT_LF)) { + builder.append('\n'); // \r\n because it's to implement something IE specific } else { int i = builder.length() - 1; 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 2018-06-21 18:31:07 UTC (rev 15378) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java 2018-06-21 19:22:38 UTC (rev 15379) @@ -1776,7 +1776,7 @@ @Test @Alerts(CHROME = {"Old = Old\ninnerText", "New = New cell value"}, FF = {"Old = Old\n\ninnerText", "New = New cell value"}, - IE = {"Old = Old \r\ninnerText", "New = New cell value"}) + IE = {"Old = Old \ninnerText", "New = New cell value"}) @NotYetImplemented(FF) public void getSetInnerTextSimple() throws Exception { final String html = "<html>\n" |
From: <rb...@us...> - 2018-06-24 12:48:10
|
Revision: 15381 http://sourceforge.net/p/htmlunit/code/15381 Author: rbri Date: 2018-06-24 12:47:59 +0000 (Sun, 24 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection3Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-23 09:50:50 UTC (rev 15380) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-24 12:47:59 UTC (rev 15381) @@ -514,7 +514,7 @@ HTTP_COOKIE_START_DATE_1970, /** Browser sends Upgrade-Insecure-Requests header. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) HTTP_HEADER_UPGRADE_INSECURE_REQUEST, /** Supports redirect via 308 code. */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection3Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection3Test.java 2018-06-23 09:50:50 UTC (rev 15380) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/HttpWebConnection3Test.java 2018-06-24 12:47:59 UTC (rev 15381) @@ -53,8 +53,7 @@ FF = {HttpHeader.HOST, HttpHeader.USER_AGENT, HttpHeader.ACCEPT, HttpHeader.ACCEPT_LANGUAGE, HttpHeader.ACCEPT_ENCODING, HttpHeader.CONNECTION, HttpHeader.UPGRADE_INSECURE_REQUESTS}, IE = {HttpHeader.ACCEPT, HttpHeader.ACCEPT_LANGUAGE, HttpHeader.USER_AGENT, - HttpHeader.ACCEPT_ENCODING, HttpHeader.HOST, HttpHeader.DNT, HttpHeader.CONNECTION}) - @NotYetImplemented(IE) + HttpHeader.ACCEPT_ENCODING, HttpHeader.HOST, HttpHeader.CONNECTION}) public void headers() throws Exception { final String response = "HTTP/1.1 200 OK\r\n" + "Content-Length: 2\r\n" @@ -99,9 +98,8 @@ HttpHeader.ACCEPT_ENCODING, HttpHeader.REFERER, HttpHeader.COOKIE, HttpHeader.CONNECTION, HttpHeader.UPGRADE_INSECURE_REQUESTS}, IE = {HttpHeader.ACCEPT, HttpHeader.REFERER, HttpHeader.ACCEPT_LANGUAGE, HttpHeader.USER_AGENT, - HttpHeader.ACCEPT_ENCODING, HttpHeader.HOST, HttpHeader.DNT, HttpHeader.CONNECTION, + HttpHeader.ACCEPT_ENCODING, HttpHeader.HOST, HttpHeader.CONNECTION, HttpHeader.COOKIE}) - @NotYetImplemented(IE) public void headers_cookie_referer() throws Exception { final String htmlResponse = "<a href='2.html'>Click me</a>"; final String response = "HTTP/1.1 200 OK\r\n" |
From: <rb...@us...> - 2018-06-27 18:36:04
|
Revision: 15392 http://sourceforge.net/p/htmlunit/code/15392 Author: rbri Date: 2018-06-27 18:35:57 +0000 (Wed, 27 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.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/javascript/host/html/HTMLInputElement.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-27 18:04:10 UTC (rev 15391) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-27 18:35:57 UTC (rev 15392) @@ -345,6 +345,10 @@ @BrowserFeature(FF) HTMLDEFINITION_INLINE_IN_QUIRKS, + /** {@code document.applets} returns a NodeList. */ + @BrowserFeature(FF60) + HTMLDOCUMENT_APPLETS_NODELIST, + /** Is {@code document.charset} lower-case. */ @BrowserFeature(IE) HTMLDOCUMENT_CHARSET_LOWERCASE, @@ -366,6 +370,12 @@ HTMLDOCUMENT_GET_FOR_ID_AND_OR_NAME, /** + /** {@code document.getElementsByName} returns an empty list if called with the empty string. + */ + @BrowserFeature(FF60) + HTMLDOCUMENT_ELEMENTS_BY_NAME_EMPTY, + + /** * Calls to <code>document.XYZ</code> should first look at standard functions before looking at elements * named <code>XYZ</code>. */ 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 2018-06-27 18:04:10 UTC (rev 15391) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2018-06-27 18:35:57 UTC (rev 15392) @@ -20,6 +20,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_TYPE_KEY_EVENTS; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_TYPE_POINTEREVENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_TYPE_PROGRESSEVENT; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_APPLETS_NODELIST; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_CHARSET_LOWERCASE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ANCHORS_REQUIRES_NAME_OR_ID; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_CREATE_ELEMENT_STRICT; @@ -34,8 +35,8 @@ 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.FF60; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import static com.gargoylesoftware.htmlunit.util.StringUtils.parseHttpDate; @@ -880,6 +881,14 @@ */ @JsxGetter({CHROME, IE}) public Object getApplets() { + if (getBrowserVersion().hasFeature(HTMLDOCUMENT_APPLETS_NODELIST)) { + return new NodeList(getDomNodeOrDie(), false) { + @Override + protected boolean isMatching(final DomNode node) { + return node instanceof HtmlApplet; + } + }; + } return new HTMLCollection(getDomNodeOrDie(), false) { @Override protected boolean isMatching(final DomNode node) { 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 2018-06-27 18:04:10 UTC (rev 15391) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java 2018-06-27 18:35:57 UTC (rev 15392) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_COLOR; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_ELEMENTS_BY_NAME_EMPTY; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_FUNCTION_DETACHED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_GET_ALSO_FRAMES; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_GET_FOR_ID_AND_OR_NAME; @@ -726,17 +727,17 @@ @JsxFunction(FF) public HTMLCollection getElementsByName(final String elementName) { implicitCloseIfNecessary(); - if ("null".equals(elementName)) { + if ("null".equals(elementName) + || (elementName.isEmpty() + && getBrowserVersion().hasFeature(HTMLDOCUMENT_ELEMENTS_BY_NAME_EMPTY))) { return HTMLCollection.emptyCollection(getWindow().getDomNodeOrDie()); } - // Null must me changed to '' for proper collection initialization. - final String expElementName = "null".equals(elementName) ? "" : elementName; final HtmlPage page = getPage(); return new HTMLCollection(page, true) { @Override protected List<DomNode> computeElements() { - return new ArrayList<>(page.getElementsByName(expElementName)); + return new ArrayList<>(page.getElementsByName(elementName)); } @Override 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 2018-06-27 18:04:10 UTC (rev 15391) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElement.java 2018-06-27 18:35:57 UTC (rev 15392) @@ -28,6 +28,7 @@ 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.FF60; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.io.File; @@ -806,7 +807,7 @@ * Returns the labels associated with the element. * @return the labels associated with the element */ - @JsxGetter(CHROME) + @JsxGetter({CHROME, FF60}) public AbstractList getLabels() { if (labels_ == null) { labels_ = new LabelsHelper(getDomNodeOrDie()); 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 2018-06-27 18:04:10 UTC (rev 15391) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java 2018-06-27 18:35:57 UTC (rev 15392) @@ -868,13 +868,14 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"2", "0"}, - FF60 = {"0", "0"}) + @Alerts(DEFAULT = {"2", "0", "0"}, + FF60 = {"0", "0", "0"}) public void getElementsByName_emptyName() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "<html><head><title>foo</title><script>\n" + " function test() {\n" + " alert(document.getElementsByName('').length);\n" + + " alert(document.getElementsByName(' ').length);\n" + " alert(document.getElementsByName(null).length);\n" + " }\n" + "</script></head><body onload='test()'>\n" |
From: <rb...@us...> - 2018-06-27 19:30:40
|
Revision: 15395 http://sourceforge.net/p/htmlunit/code/15395 Author: rbri Date: 2018-06-27 19:30:26 +0000 (Wed, 27 Jun 2018) Log Message: ----------- ff60 support (wip) 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/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.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 2018-06-27 19:00:38 UTC (rev 15394) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-27 19:30:26 UTC (rev 15395) @@ -945,6 +945,12 @@ JS_IMAGE_PROTOTYPE_SAME_AS_HTML_IMAGE, /** + * Getting the width and height of an image tag with an empty source returns 0x0. + */ + @BrowserFeature({CHROME, FF60}) + JS_IMAGE_WIDTH_HEIGHT_EMPTY_SOURCE_RETURNS_0x0, + + /** * Getting the width and height of an image tag without a source returns 16x16; * for invalid values returns 0. */ @@ -952,8 +958,8 @@ JS_IMAGE_WIDTH_HEIGHT_RETURNS_16x16_0x0, /** - * Getting the width and height of an image tag without a source returns 18x20; - * for invalid values returns 1. + * Getting the width and height of an image tag without a source returns 24x24; + * for invalid values returns 0x0. */ @BrowserFeature(FF) JS_IMAGE_WIDTH_HEIGHT_RETURNS_24x24_0x0, 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 2018-06-27 19:00:38 UTC (rev 15394) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-06-27 19:30:26 UTC (rev 15395) @@ -1765,7 +1765,7 @@ * @see <a href="http://msdn.microsoft.com/en-us/library/ms536759.aspx">MSDN Documentation</a> * @see <a href="https://developer.mozilla.org/en/DOM/window.showModalDialog">Mozilla Documentation</a> */ - @JsxFunction({IE, FF}) + @JsxFunction({IE, FF52}) public Object showModalDialog(final String url, final Object arguments, final String features) { final WebWindow webWindow = getWebWindow(); final WebClient client = webWindow.getWebClient(); Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java 2018-06-27 19:00:38 UTC (rev 15394) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java 2018-06-27 19:30:26 UTC (rev 15395) @@ -15,8 +15,9 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ALIGN_ACCEPTS_ARBITRARY_VALUES; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_EMPTY_SOURCE_RETURNS_0x0; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_RETURNS_16x16_0x0; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_RETURNS_24x24_0x0; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_RETURNS_16x16_0x0; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_RETURNS_28x30_28x30; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; @@ -253,6 +254,9 @@ } final BrowserVersion browserVersion = getBrowserVersion(); + if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_EMPTY_SOURCE_RETURNS_0x0) && StringUtils.isEmpty(src)) { + return 0; + } if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_16x16_0x0) && StringUtils.isBlank(src)) { return 0; } @@ -313,6 +317,9 @@ } final BrowserVersion browserVersion = getBrowserVersion(); + if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_EMPTY_SOURCE_RETURNS_0x0) && StringUtils.isEmpty(src)) { + return 0; + } if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_16x16_0x0) && StringUtils.isBlank(src)) { return 0; } 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 2018-06-27 19:00:38 UTC (rev 15394) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2018-06-27 19:30:26 UTC (rev 15395) @@ -1143,15 +1143,15 @@ */ @Test @Alerts(DEFAULT = { - "string string 7 number string", - "string string 8 number object", - "string string 9 number object", - "string string 1 number object"}, + "string string 7 number string", + "string string 8 number object", + "string string 9 number object", + "string string 1 number object"}, FF = { - "string string 0 number string", - "string string 0 number object", - "string string 9 number object", - "string string 1 number object"}) + "string string 0 number string", + "string string 0 number object", + "string string 9 number object", + "string string 1 number object"}) public void onErrorExceptionInstance() throws Exception { final String html = "<html>\n" |
From: <rb...@us...> - 2018-06-27 19:45:53
|
Revision: 15396 http://sourceforge.net/p/htmlunit/code/15396 Author: rbri Date: 2018-06-27 19:45:45 +0000 (Wed, 27 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitContextFactory.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine2Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-27 19:30:26 UTC (rev 15395) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-27 19:45:45 UTC (rev 15396) @@ -90,6 +90,11 @@ @BrowserFeature({CHROME, IE}) CSS_INPUT_DISPLAY_INLINE_BLOCK, + /** The default value of the display property for the 'input' tags of type + * radio or checkbox is 'inline-block'. */ + @BrowserFeature(FF60) + CSS_INPUT_DISPLAY_RADIO_CHECKBOX_INLINE_BLOCK, + /** 'initial' is a valid length value. */ @BrowserFeature({CHROME, FF}) CSS_LENGTH_INITIAL, @@ -902,10 +907,6 @@ @BrowserFeature(IE) JS_FORM_USABLE_AS_FUNCTION, - /** Indicates that function is defined even before its declaration, inside a block. */ - @BrowserFeature({CHROME, FF52, IE}) - JS_FUNCTION_DECLARED_FORWARD_IN_BLOCK, - /** Indicates if the method toSource exists on the native objects. */ @BrowserFeature(FF) JS_FUNCTION_TOSOURCE, Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java 2018-06-27 19:30:26 UTC (rev 15395) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java 2018-06-27 19:45:45 UTC (rev 15396) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.html; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_INPUT_DISPLAY_INLINE_BLOCK; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_INPUT_DISPLAY_RADIO_CHECKBOX_INLINE_BLOCK; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_MOUSE_ON_DISABLED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_DOES_NOT_CLICK_SURROUNDING_ANCHOR; @@ -627,6 +628,15 @@ if (hasFeature(CSS_INPUT_DISPLAY_INLINE_BLOCK)) { return DisplayStyle.INLINE_BLOCK; } + + if (hasFeature(CSS_INPUT_DISPLAY_RADIO_CHECKBOX_INLINE_BLOCK)) { + final String type = getTypeAttribute(); + if ("radio".equals(type) + || "checkbox".equals(type)) { + return DisplayStyle.INLINE_BLOCK; + } + } + return DisplayStyle.INLINE; } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitContextFactory.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitContextFactory.java 2018-06-27 19:30:26 UTC (rev 15395) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitContextFactory.java 2018-06-27 19:45:45 UTC (rev 15396) @@ -18,7 +18,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ARRAY_CONSTRUCTION_PROPERTIES; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ENUM_NUMBERS_FIRST; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ERROR_STACK; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FUNCTION_DECLARED_FORWARD_IN_BLOCK; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IGNORES_LAST_LINE_CONTAINING_UNCOMMENTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_PRE_WIDTH_STRING; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_PROPERTY_DESCRIPTOR_NAME; @@ -350,7 +349,7 @@ case Context.FEATURE_HTMLUNIT_ERROR_STACK: return browserVersion_.hasFeature(JS_ERROR_STACK); case Context.FEATURE_HTMLUNIT_FUNCTION_DECLARED_FORWARD_IN_BLOCK: - return browserVersion_.hasFeature(JS_FUNCTION_DECLARED_FORWARD_IN_BLOCK); + return true; case Context.FEATURE_HTMLUNIT_ENUM_NUMBERS_FIRST: return browserVersion_.hasFeature(JS_ENUM_NUMBERS_FIRST); case Context.FEATURE_HTMLUNIT_MEMBERBOX_NAME: Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine2Test.java 2018-06-27 19:30:26 UTC (rev 15395) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine2Test.java 2018-06-27 19:45:45 UTC (rev 15396) @@ -14,9 +14,6 @@ */ package com.gargoylesoftware.htmlunit.javascript; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import static org.junit.Assert.fail; import org.junit.Test; @@ -150,7 +147,7 @@ @Test @Alerts(DEFAULT = {"undefined", "function foo() {}"}, IE = {"function foo() {}", "function foo() {}"}) - @NotYetImplemented({IE, CHROME, FF52}) + @NotYetImplemented public void variableNotDefined() throws Exception { final String html = "<html><head></head><body>\n" + "<script>\n" |
From: <rb...@us...> - 2018-06-28 18:26:56
|
Revision: 15397 http://sourceforge.net/p/htmlunit/code/15397 Author: rbri Date: 2018-06-28 18:26:51 +0000 (Thu, 28 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlApplet2Test.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInputTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/WindowTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-27 19:45:45 UTC (rev 15396) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-28 18:26:51 UTC (rev 15397) @@ -989,7 +989,7 @@ JS_INPUT_IGNORE_NEGATIVE_SELECTION_START, /** Chrome/FF returns null for selectionStart/selectionEnd. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) JS_INPUT_NUMBER_SELECTION_START_END_NULL, /** Setting the type property of an input converts the type to lowercase. */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlApplet2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlApplet2Test.java 2018-06-27 19:45:45 UTC (rev 15396) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlApplet2Test.java 2018-06-28 18:26:51 UTC (rev 15397) @@ -57,7 +57,8 @@ final WebDriver driver = loadPageWithAlerts2(html); if (driver instanceof HtmlUnitDriver) { - if (getBrowserVersion().isChrome()) { + if (getBrowserVersion().isChrome() + || (getBrowserVersion().isFirefox() && !getBrowserVersion().isFirefox52())) { final HtmlPage page = (HtmlPage) getWebWindowOf((HtmlUnitDriver) driver).getEnclosedPage(); assertTrue(HtmlUnknownElement.class.isInstance(page.getHtmlElementById("myId"))); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInputTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInputTest.java 2018-06-27 19:45:45 UTC (rev 15396) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInputTest.java 2018-06-28 18:26:51 UTC (rev 15397) @@ -22,6 +22,7 @@ import org.junit.runner.RunWith; import org.openqa.selenium.By; import org.openqa.selenium.InvalidElementStateException; +import org.openqa.selenium.Keys; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; @@ -66,13 +67,13 @@ final WebElement t = driver.findElement(By.id("t")); t.sendKeys("123"); assertEquals("123", t.getAttribute("value")); - t.sendKeys("\b"); + t.sendKeys(Keys.BACK_SPACE); assertEquals("12", t.getAttribute("value")); - t.sendKeys("\b"); + t.sendKeys(Keys.BACK_SPACE); assertEquals("1", t.getAttribute("value")); - t.sendKeys("\b"); + t.sendKeys(Keys.BACK_SPACE); assertEquals("", t.getAttribute("value")); - t.sendKeys("\b"); + t.sendKeys(Keys.BACK_SPACE); assertEquals("", t.getAttribute("value")); } @@ -523,11 +524,8 @@ * @throws Exception if test fails */ @Test - @Alerts(DEFAULT = {"0,0", "11,11", "3,11", "3,10"}, - CHROME = {"null,null", "null,null", "exception", + @Alerts(DEFAULT = {"null,null", "null,null", "exception", "null,null", "exception", "null,null"}, - FF52 = {"null,null", "null,null", "exception", - "null,null", "exception", "null,null"}, IE = {"0,0", "0,0", "3,3", "3,10"}) public void selection2_1() throws Exception { selection2(3, 10); @@ -537,11 +535,8 @@ * @throws Exception if test fails */ @Test - @Alerts(DEFAULT = {"0,0", "11,11", "0,11", "0,11"}, - CHROME = {"null,null", "null,null", "exception", + @Alerts(DEFAULT = {"null,null", "null,null", "exception", "null,null", "exception", "null,null"}, - FF52 = {"null,null", "null,null", "exception", - "null,null", "exception", "null,null"}, IE = {"0,0", "0,0", "0,0", "0,11"}) public void selection2_2() throws Exception { selection2(-3, 15); @@ -551,11 +546,8 @@ * @throws Exception if test fails */ @Test - @Alerts(DEFAULT = {"0,0", "11,11", "10,11", "5,5"}, - CHROME = {"null,null", "null,null", "exception", + @Alerts(DEFAULT = {"null,null", "null,null", "exception", "null,null", "exception", "null,null"}, - FF52 = {"null,null", "null,null", "exception", - "null,null", "exception", "null,null"}, IE = {"0,0", "0,0", "10,10", "5,5"}) public void selection2_3() throws Exception { selection2(10, 5); @@ -600,9 +592,7 @@ * @throws Exception if test fails */ @Test - @Alerts(DEFAULT = {"0,0", "4,5", "10,10", "4,4", "1,1"}, - CHROME = {"null,null", "exception"}, - FF52 = {"null,null", "exception"}, + @Alerts(DEFAULT = {"null,null", "exception"}, IE = {"0,0", "4,5", "0,0", "0,0", "0,0"}) public void selectionOnUpdate() throws Exception { final String html = "<html>\n" @@ -652,7 +642,7 @@ final WebDriver driver = loadPage2(html); final WebElement field = driver.findElement(By.id("t")); - field.sendKeys("\n"); + field.sendKeys(Keys.ENTER); assertEquals(2, getMockWebConnection().getRequestCount()); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/WindowTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/WindowTest.java 2018-06-27 19:45:45 UTC (rev 15396) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/WindowTest.java 2018-06-28 18:26:51 UTC (rev 15397) @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import static org.junit.Assert.fail; @@ -1192,7 +1192,8 @@ */ @Test @Alerts(DEFAULT = {"undefined", "Jane", "Smith", "sdg", "finished"}, - CHROME = "not available") + CHROME = "not available", + FF60 = "not available") public void showModalDialog() throws Exception { final String html1 = "<html><head><script>\n" @@ -1251,8 +1252,9 @@ */ @Test @Alerts(DEFAULT = {"undefined", "result", "finished"}, - CHROME = {"undefined", "not available"}) - @NotYetImplemented({FF, IE}) + CHROME = {"undefined", "not available"}, + FF60 = {"undefined", "not available"}) + @NotYetImplemented({FF52, IE}) public void showModalDialogWithButton() throws Exception { final String html1 = "<html><head>\n" |
From: <rb...@us...> - 2018-06-29 06:29:27
|
Revision: 15402 http://sourceforge.net/p/htmlunit/code/15402 Author: rbri Date: 2018-06-29 06:29:19 +0000 (Fri, 29 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlIsIndex2Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-29 06:14:33 UTC (rev 15401) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-29 06:29:19 UTC (rev 15402) @@ -492,7 +492,7 @@ HTML_COMMAND_TAG, /** HTML parser supports the 'isindex' tag. */ - @BrowserFeature(CHROME) + @BrowserFeature({CHROME, FF60}) HTML_ISINDEX_TAG, /** HTML parser supports the 'main' tag. */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlIsIndex2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlIsIndex2Test.java 2018-06-29 06:14:33 UTC (rev 15401) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlIsIndex2Test.java 2018-06-29 06:29:19 UTC (rev 15402) @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import org.junit.Test; @@ -46,7 +46,7 @@ @Alerts(DEFAULT = "null", CHROME = "[object HTMLUnknownElement]", FF60 = "[object HTMLUnknownElement]") - @NotYetImplemented({IE, FF}) + @NotYetImplemented({IE, FF52}) public void simpleScriptable() throws Exception { final String html = "<html><head>\n" + "<script>\n" |
From: <rb...@us...> - 2018-06-29 07:03:17
|
Revision: 15404 http://sourceforge.net/p/htmlunit/code/15404 Author: rbri Date: 2018-06-29 07:03:11 +0000 (Fri, 29 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- 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/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-06-29 06:48:00 UTC (rev 15403) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-06-29 07:03:11 UTC (rev 15404) @@ -1841,7 +1841,7 @@ */ @JsxGetter(FF) public int getMozInnerScreenY() { - return 91; + return 83; } /** 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 2018-06-29 06:48:00 UTC (rev 15403) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2018-06-29 07:03:11 UTC (rev 15404) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; import org.junit.Test; import org.junit.runner.RunWith; @@ -880,6 +881,7 @@ @Alerts(DEFAULT = {"undefined", "undefined"}, FF52 = {"11", "91"}, FF60 = {"11", "83"}) + @NotYetImplemented(FF52) public void mozInnerScreen() throws Exception { final String html = "<html><body onload='test()'><script>\n" @@ -1144,14 +1146,11 @@ @Test @Alerts(DEFAULT = { "string string 7 number string", - "string string 8 number object", - "string string 9 number object", - "string string 1 number object"}, + "string string 8 number object"}, FF = { "string string 0 number string", - "string string 0 number object", - "string string 9 number object", - "string string 1 number object"}) + "string string 0 number object"}) + @NotYetImplemented(FF) public void onErrorExceptionInstance() throws Exception { final String html = "<html>\n" @@ -1163,6 +1162,29 @@ + "</script>\n" + "<script>throw 'string';</script>\n" + "<script>throw {'object':'property'};</script>\n" + + "</html>"; + + if (getWebDriver() instanceof HtmlUnitDriver) { + getWebWindowOf((HtmlUnitDriver) getWebDriver()).getWebClient() + .getOptions().setThrowExceptionOnScriptError(false); + } + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts({"string string 7 number object", "string string 1 number object"}) + public void onErrorExceptionInstance2() throws Exception { + final String html + = "<html>\n" + + "<script>\n" + + " window.onerror = function(messageOrEvent, source, lineno, colno, error) {\n" + + " alert(typeof messageOrEvent + ' ' + typeof source + ' '" + + " + lineno + ' ' + typeof colno + ' ' + typeof error);\n" + + " };\n" + + "</script>\n" + "<script>does.not.exist();</script>\n" + "<script>eval('syntax[error');</script>\n" + "</html>"; |
From: <rb...@us...> - 2018-06-29 08:37:45
|
Revision: 15405 http://sourceforge.net/p/htmlunit/code/15405 Author: rbri Date: 2018-06-29 08:37:39 +0000 (Fri, 29 Jun 2018) Log Message: ----------- our selection impl does not match the spect Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection2Test.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/SelectionTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection.java 2018-06-29 07:03:11 UTC (rev 15404) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection.java 2018-06-29 08:37:39 UTC (rev 15405) @@ -42,6 +42,7 @@ * @author Ahmed Ashour * @author Daniel Gredler * @author Frank Danek + * @author Ronald Brill */ @JsxClass public class Selection extends SimpleScriptable { @@ -261,7 +262,7 @@ /** * Cancels the current selection, sets the selection type to none. */ - @JsxFunction(CHROME) + @JsxFunction({CHROME, FF60}) public void empty() { removeAllRanges(); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection2Test.java 2018-06-29 07:03:11 UTC (rev 15404) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection2Test.java 2018-06-29 08:37:39 UTC (rev 15405) @@ -41,6 +41,7 @@ * @author Daniel Gredler * @author Marc Guillemot * @author Frank Danek + * @author Ronald Brill */ @RunWith(BrowserRunner.class) public class Selection2Test extends SimpleWebTestCase { @@ -232,6 +233,7 @@ */ @Test @Alerts(DEFAULT = {"undefined", "exception", "undefined"}, + FF60 = {"None", "None"}, CHROME = {"None", "None"}) public void empty() throws Exception { test("try{selection.empty()}catch(e){alert('exception')}", "selection.type", "x ? x : 'undefined'"); Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/SelectionTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/SelectionTest.java 2018-06-29 07:03:11 UTC (rev 15404) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/SelectionTest.java 2018-06-29 08:37:39 UTC (rev 15405) @@ -14,11 +14,14 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.dom; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF60; + import org.junit.Test; import org.junit.runner.RunWith; import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; /** @@ -85,13 +88,13 @@ @Test @Alerts(DEFAULT = { "1:null/0/null/0/true/undefined/0/", - "2:s2/0/s2/1/false/undefined/1/xyz/xyz"}, + "2:s2/0/s2/1/false/undefined/1/xyz[xyz"}, CHROME = { "1:null/0/null/0/true/None/0/", - "2:s2/0/s2/1/false/Range/1/xyz/xyz"}, + "2:s2/0/s2/1/false/Range/1/xyz[xyz"}, FF60 = { "1:null/0/null/0/true/None/0/", - "2:s2/0/s2/1/false/Range/1/xyz/xyz"}) + "2:s2/0/s2/1/false/Range/1/xyz[xyz"}) public void selectAllChildren() throws Exception { final String jsSnippet = "" + " alertSelection(selection);\n" @@ -106,21 +109,21 @@ */ @Test @Alerts(DEFAULT = { - "1:s2/0/s2/1/false/undefined/1/xyz/xyz", - "2:s2/0/s3/1/false/undefined/1/xyzfoo/xyzfoo", - "3:s2/0/s3/2/false/undefined/1/xyzfoo---/xyzfoo---", - "4:s2/0/s3/3/false/undefined/1/xyzfoo---foo/xyzfoo---foo"}, + "1:s2/0/s2/1/false/undefined/1/xyz[xyz", + "2:s2/0/s3/1/false/undefined/1/xyzfoo[xyzfoo", + "3:s2/0/s3/2/false/undefined/1/xyzfoo---[xyzfoo---", + "4:s2/0/s3/3/false/undefined/1/xyzfoo---foo[xyzfoo---foo"}, CHROME = { - "1:s2/0/s2/1/false/Range/1/xyz/xyz", - "2:s2/0/s3/1/false/Range/1/xyzfoo/xyzfoo", - "3:s2/0/s3/2/false/Range/1/xyzfoo---/xyzfoo---", - "4:s2/0/s3/3/false/Range/1/xyzfoo---foo/xyzfoo---foo"}, + "1:s2/0/s2/1/false/Range/1/xyz[xyz", + "2:s2/0/s3/1/false/Range/1/xyzfoo[xyzfoo", + "3:s2/0/s3/2/false/Range/1/xyzfoo---[xyzfoo---", + "4:s2/0/s3/3/false/Range/1/xyzfoo---foo[xyzfoo---foo"}, FF60 = { - "1:s2/0/s2/1/false/Range/1/xyz/xyz", - "2:s2/0/s3/1/false/Range/1/xyzfoo/xyzfoo", - "3:s2/0/s3/2/false/Range/1/xyzfoo---/xyzfoo---", - "4:s2/0/s3/3/false/Range/1/xyzfoo---foo/xyzfoo---foo"}, - IE = {"1:s2/0/s2/1/false/undefined/1/xyz/xyz", + "1:s2/0/s2/1/false/Range/1/xyz[xyz", + "2:s2/0/s3/1/false/Range/1/xyzfoo[xyzfoo", + "3:s2/0/s3/2/false/Range/1/xyzfoo---[xyzfoo---", + "4:s2/0/s3/3/false/Range/1/xyzfoo---foo[xyzfoo---foo"}, + IE = {"1:s2/0/s2/1/false/undefined/1/xyz[xyz", "selection.extend not available"}) public void extend() throws Exception { final String jsSnippet = "" @@ -143,14 +146,14 @@ */ @Test @Alerts(DEFAULT = { - "1:s2/0/s2/1/false/undefined/1/xyz/xyz", - "2:s2/0/s2/0/true/undefined/1//"}, + "1:s2/0/s2/1/false/undefined/1/xyz[xyz", + "2:s2/0/s2/0/true/undefined/1/["}, CHROME = { - "1:s2/0/s2/1/false/Range/1/xyz/xyz", - "2:s2/0/s2/0/true/Caret/1//"}, + "1:s2/0/s2/1/false/Range/1/xyz[xyz", + "2:s2/0/s2/0/true/Caret/1/["}, FF60 = { - "1:s2/0/s2/1/false/Range/1/xyz/xyz", - "2:s2/0/s2/0/true/Caret/1//"}) + "1:s2/0/s2/1/false/Range/1/xyz[xyz", + "2:s2/0/s2/0/true/Caret/1/["}) public void collapseToStart() throws Exception { final String jsSnippet = "" + " selection.selectAllChildren(s2);\n" @@ -166,14 +169,14 @@ */ @Test @Alerts(DEFAULT = { - "1:s2/0/s2/1/false/undefined/1/xyz/xyz", - "2:s2/1/s2/1/true/undefined/1//"}, + "1:s2/0/s2/1/false/undefined/1/xyz[xyz", + "2:s2/1/s2/1/true/undefined/1/["}, CHROME = { - "1:s2/0/s2/1/false/Range/1/xyz/xyz", - "2:s2/1/s2/1/true/Caret/1//"}, + "1:s2/0/s2/1/false/Range/1/xyz[xyz", + "2:s2/1/s2/1/true/Caret/1/["}, FF60 = { - "1:s2/0/s2/1/false/Range/1/xyz/xyz", - "2:s2/1/s2/1/true/Caret/1//"}) + "1:s2/0/s2/1/false/Range/1/xyz[xyz", + "2:s2/1/s2/1/true/Caret/1/["}) public void collapseToEnd() throws Exception { final String jsSnippet = "" + " selection.selectAllChildren(s2);\n" @@ -188,30 +191,79 @@ * @throws Exception if an error occurs */ @Test + @Alerts(DEFAULT = {"1:s2/0/s2/1/false/Range/1/xyz[xyz", + "2:null/0/null/0/true/None/0/"}, + FF52 = {"1:s2/0/s2/1/false/undefined/1/xyz[xyz", "exception"}, + IE = {"1:s2/0/s2/1/false/undefined/1/xyz[xyz", "exception"}) + public void empty() throws Exception { + final String jsSnippet = "" + + " selection.selectAllChildren(s2);\n" + + " alertSelection(selection);\n" + + " selection.empty();\n" + + " alertSelection(selection);\n"; + + tester(jsSnippet); + } + + /** + * @throws Exception if an error occurs + */ + @Test @Alerts(DEFAULT = { "1:null/0/null/0/true/undefined/0/", "2:null/0/null/0/true/undefined/0/", - "3:s2/1/s3/1/false/undefined/1/foo/foo", - "4:null/0/null/0/true/undefined/0/"}, + "3:s2/1/s3/1/false/undefined/1/foo[foo"}, CHROME = { "1:null/0/null/0/true/None/0/", "2:null/0/null/0/true/None/0/", - "3:s2/1/s3/1/false/Range/1/foo/foo", - "4:null/0/null/0/true/None/0/"}, + "3:s2/1/s3/1/false/Range/1/foo[foo"}, FF60 = { "1:null/0/null/0/true/None/0/", "2:null/0/null/0/true/None/0/", - "3:s2/1/s3/1/false/Range/1//foo", - "4:null/0/null/0/true/None/0/"}) - public void range() throws Exception { + "3:s2/1/s3/1/false/Range/1/[foo"}) + @NotYetImplemented(FF60) + public void addRange() throws Exception { final String jsSnippet = "" + " alertSelection(selection);\n" + + " var range = document.createRange();\n" + " range.setStart(s2, 1);\n" + " range.setEnd(s3, 1);\n" + " alertSelection(selection);\n" + + " selection.addRange(range);\n" + + " alertSelection(selection);\n"; + + tester(jsSnippet); + } + + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts(DEFAULT = { + "1:null/0/null/0/true/undefined/0/", + "2:s1/1/s3/1/false/undefined/1/xyzfoo[xyzfoo", + "3:null/0/null/0/true/undefined/0/"}, + CHROME = { + "1:null/0/null/0/true/None/0/", + "2:s1/1/s3/1/false/Range/1/xyzfoo[xyzfoo", + "3:null/0/null/0/true/None/0/"}, + FF60 = { + "1:null/0/null/0/true/None/0/", + "2:s1/1/s3/1/false/Range/1/[xyzfoo", + "3:null/0/null/0/true/None/0/"}) + @NotYetImplemented(FF60) + public void removeAllRanges() throws Exception { + final String jsSnippet = "" + " alertSelection(selection);\n" + + + " var range = document.createRange();\n" + + " range.setStart(s1, 1);\n" + + " range.setEnd(s3, 1);\n" + + " selection.addRange(range);\n" + + " alertSelection(selection);\n" + + " selection.removeAllRanges();\n" + " alertSelection(selection);\n"; @@ -219,6 +271,154 @@ } /** + * The toString impl in FF60 seems to be buggy. + * @throws Exception if an error occurs + */ + @Test + @Alerts(DEFAULT = { + "1:s1/1/s3/1/false/undefined/1/xyzfoo[xyzfoo", + "2:null/0/null/0/true/undefined/0/"}, + CHROME = { + "1:s1/1/s3/1/false/Range/1/xyzfoo[xyzfoo", + "2:null/0/null/0/true/None/0/"}, + FF60 = { + "1:s1/1/s3/1/false/Range/1/[xyzfoo", + "2:null/0/null/0/true/None/0/"}) + @NotYetImplemented(FF60) + public void removeAllRanges2() throws Exception { + final String jsSnippet = "" + + " var range = document.createRange();\n" + + " range.setStart(s1, 1);\n" + + " range.setEnd(s3, 1);\n" + + " selection.addRange(range);\n" + + " alertSelection(selection);\n" + + + " selection.removeAllRanges();\n" + + " alertSelection(selection);\n"; + + tester(jsSnippet); + } + + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts(DEFAULT = { + "1:null/0/null/0/true/undefined/0/", + "2:s1/0/s1/1/false/undefined/1/abc[abc", + "3:null/0/null/0/true/undefined/0/"}, + CHROME = { + "1:null/0/null/0/true/None/0/", + "2:s1/0/s1/1/false/Range/1/abc[abc", + "3:null/0/null/0/true/None/0/"}, + FF60 = { + "1:null/0/null/0/true/None/0/", + "2:s1/1/s3/1/false/Range/2/[abc[xyzfoo", + "3:null/0/null/0/true/None/0/"}, + FF52 = { + "1:null/0/null/0/true/undefined/0/", + "2:s1/1/s3/1/false/undefined/2/abcxyzfoo[abc[xyzfoo", + "3:null/0/null/0/true/undefined/0/"}) + @NotYetImplemented + public void selectAllChildrenAddRange() throws Exception { + final String jsSnippet = "" + + " alertSelection(selection);\n" + + + " selection.selectAllChildren(s1);\n" + + " var range = document.createRange();\n" + + " range.setStart(s1, 1);\n" + + " range.setEnd(s3, 1);\n" + + " selection.addRange(range);\n" + + " alertSelection(selection);\n" + + + " selection.removeAllRanges();\n" + + " alertSelection(selection);\n"; + + tester(jsSnippet); + } + + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts(DEFAULT = { + "1:null/0/null/0/true/None/0/", + "2:s1/0/s1/1/false/Range/1/abc[abc", + "3:null/0/null/0/true/None/0/"}, + IE = { + "1:null/0/null/0/true/undefined/0/", + "2:s1/0/s1/1/false/undefined/1/abc[abc", + "3:null/0/null/0/true/undefined/0/"}, + FF52 = { + "1:null/0/null/0/true/undefined/0/", + "2:s1/0/s1/1/false/undefined/1/abc[abc", + "3:null/0/null/0/true/undefined/0/"}) + public void addRangeSelectAllChildren() throws Exception { + final String jsSnippet = "" + + " alertSelection(selection);\n" + + + " var range = document.createRange();\n" + + " range.setStart(s1, 1);\n" + + " range.setEnd(s3, 1);\n" + + " selection.addRange(range);\n" + + " selection.selectAllChildren(s1);\n" + + " alertSelection(selection);\n" + + + " selection.removeAllRanges();\n" + + " alertSelection(selection);\n"; + + tester(jsSnippet); + } + + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts(DEFAULT = { + "1:null/0/null/0/true/undefined/0/", + "2:s1/0/s1/1/false/undefined/1/abc[abc", + "3:s1/0/s1/1/false/undefined/1/abc[abc", + "4:null/0/null/0/true/undefined/0/"}, + CHROME = { + "1:null/0/null/0/true/None/0/", + "2:s1/0/s1/1/false/Range/1/abc[abc", + "3:s1/0/s1/1/false/Range/1/abc[abc", + "4:null/0/null/0/true/None/0/"}, + FF60 = { + "1:null/0/null/0/true/None/0/", + "2:s1/1/s2/1/false/Range/2/[abc[xyz", + "3:s2/1/s3/3/false/Range/3/[abc[xyz[foo---foo", + "4:null/0/null/0/true/None/0/"}, + FF52 = { + "1:null/0/null/0/true/undefined/0/", + "2:s1/1/s2/1/false/undefined/2/abcxyz[abc[xyz", + "3:s2/1/s3/3/false/undefined/3/abcxyzfoo---foo[abc[xyz[foo---foo", + "4:null/0/null/0/true/undefined/0/"}) + @NotYetImplemented + public void addRangeAddRange() throws Exception { + final String jsSnippet = "" + + " alertSelection(selection);\n" + + + " selection.selectAllChildren(s1);\n" + + " var range = document.createRange();\n" + + " range.setStart(s1, 1);\n" + + " range.setEnd(s2, 1);\n" + + " selection.addRange(range);\n" + + " alertSelection(selection);\n" + + + " var range = document.createRange();\n" + + " range.setStart(s2, 1);\n" + + " range.setEnd(s3, 3);\n" + + " selection.addRange(range);\n" + + " alertSelection(selection);\n" + + + " selection.removeAllRanges();\n" + + " alertSelection(selection);\n"; + + tester(jsSnippet); + } + + /** * Test selection's anchorNode and focusNode after call to removeRange. Surprisingly, this is * not null. * @throws Exception if an error occurs @@ -225,15 +425,15 @@ */ @Test @Alerts(DEFAULT = { - "1:[object Text]/1/[object Text]/2/false/undefined/1/yzfo/yzfo", + "1:[object Text]/1/[object Text]/2/false/undefined/1/yzfo[yzfo", "2:null/0/null/0/true/undefined/0/", "false", "true"}, CHROME = { - "1:[object Text]/1/[object Text]/2/false/Range/1/yzfo/yzfo", + "1:[object Text]/1/[object Text]/2/false/Range/1/yzfo[yzfo", "2:null/0/null/0/true/None/0/", "false", "true"}, FF60 = { - "1:[object Text]/1/[object Text]/2/false/Range/1/yzfo/yzfo", + "1:[object Text]/1/[object Text]/2/false/Range/1/yzfo[yzfo", "2:null/0/null/0/true/None/0/", "false", "true"}) public void aLittleBitOfEverything_removeRange() throws Exception { @@ -275,7 +475,7 @@ + " var msg = (x++) + ':' + anchorNode + '/' + s.anchorOffset + '/' + focusNode + '/' +\n" + " s.focusOffset + '/' + s.isCollapsed + '/' + s.type + '/' + s.rangeCount + '/' + s;\n" + " for(var i = 0; i < s.rangeCount; i++) {\n" - + " msg += '/' + s.getRangeAt(i);\n" + + " msg += '[' + s.getRangeAt(i);\n" + " }\n" + " alert(msg);\n" + " }\n" |
From: <rb...@us...> - 2018-06-29 09:33:13
|
Revision: 15407 http://sourceforge.net/p/htmlunit/code/15407 Author: rbri Date: 2018-06-29 09:33:09 +0000 (Fri, 29 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PopStateEvent.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/PopStateEventTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-29 08:40:51 UTC (rev 15406) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-29 09:33:09 UTC (rev 15407) @@ -230,6 +230,10 @@ @BrowserFeature(IE) EVENT_ONMOUSEUP_NOT_FOR_SELECT_OPTION, + /** <code>PopStateEvent</code> can not be created by calling document.createEvent('PopStateEvent'). */ + @BrowserFeature(FF60) + EVENT_ONPOPSTATE_DOCUMENT_CREATE_NOT_SUPPORTED, + /** Supports event type 'BeforeUnloadEvent'. */ @BrowserFeature({CHROME, FF}) EVENT_TYPE_BEFOREUNLOADEVENT, 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 2018-06-29 08:40:51 UTC (rev 15406) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2018-06-29 09:33:09 UTC (rev 15407) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONCLOSE_DOCUMENT_CREATE_NOT_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONPOPSTATE_DOCUMENT_CREATE_NOT_SUPPORTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_TYPE_BEFOREUNLOADEVENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_TYPE_HASHCHANGEEVENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_TYPE_KEY_EVENTS; @@ -1208,6 +1209,11 @@ || "ProgressEvent".equals(eventType) && getBrowserVersion().hasFeature(EVENT_TYPE_PROGRESSEVENT))) { clazz = SUPPORTED_VENDOR_EVENT_TYPE_MAP.get(eventType); + + if (PopStateEvent.class == clazz + && getBrowserVersion().hasFeature(EVENT_ONPOPSTATE_DOCUMENT_CREATE_NOT_SUPPORTED)) { + clazz = null; + } } if (clazz == null) { Context.throwAsScriptRuntimeEx(new DOMException(DOMException.NOT_SUPPORTED_ERR, Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PopStateEvent.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PopStateEvent.java 2018-06-29 08:40:51 UTC (rev 15406) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PopStateEvent.java 2018-06-29 09:33:09 UTC (rev 15407) @@ -18,9 +18,11 @@ 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.IE; 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 net.sourceforge.htmlunit.corejs.javascript.Context; @@ -92,6 +94,20 @@ } /** + * Initializes this event. + * @param type the event type + * @param bubbles whether or not the event should bubble + * @param cancelable whether or not the event the event should be cancelable + * @param state the state + */ + @JsxFunction(IE) + public void initPopStateEvent(final String type, final boolean bubbles, + final boolean cancelable, final Object state) { + initEvent(type, bubbles, cancelable); + state_ = state; + } + + /** * Return the state object. * @return the state object */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/PopStateEventTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/PopStateEventTest.java 2018-06-29 08:40:51 UTC (rev 15406) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/PopStateEventTest.java 2018-06-29 09:33:09 UTC (rev 15407) @@ -100,7 +100,8 @@ * @throws Exception if the test fails */ @Test - @Alerts({"[object PopStateEvent]", "null", "", "false", "false", "null"}) + @Alerts(DEFAULT = {"[object PopStateEvent]", "null", "", "false", "false", "null"}, + FF60 = "exception") public void create_createEvent() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "<html><head><title>foo</title><script>\n" @@ -121,7 +122,8 @@ * @throws Exception if the test fails */ @Test - @Alerts({"[object PopStateEvent]", "null", "", "false", "false", "null"}) + @Alerts(DEFAULT = {"[object PopStateEvent]", "null", "", "false", "false", "null"}, + FF60 = "exception") public void setState() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "<html><head><title>foo</title><script>\n" @@ -143,8 +145,8 @@ * @throws Exception if the test fails */ @Test - @Alerts("exception") - @NotYetImplemented({IE, CHROME, FF52}) + @Alerts(DEFAULT = "dispatched", + FF60 = "exception ctor") public void dispatchEvent() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "<html><head><title>foo</title><script>\n" @@ -151,8 +153,42 @@ + " function test() {\n" + " try {\n" + " var event = document.createEvent('PopStateEvent');\n" + + " event.initEvent('', true, true);\n" + + " } catch (e) { alert('exception ctor'); return; }\n" + + + " try {\n" + " dispatchEvent(event);\n" + " alert('dispatched');\n" + + " } catch (e) { alert('exception' + e) }\n" + + " }\n" + + DUMP_EVENT_FUNCTION + + " try {\n" + + " window.addEventListener('popstate',dump);\n" + + " } catch (e) { }\n" + + "</script></head><body onload='test()'>\n" + + "</body></html>"; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "exception", + FF60 = "exception ctor") + @NotYetImplemented({CHROME, FF52, IE}) + public void dispatchEventWithoutInit() throws Exception { + final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + + "<html><head><title>foo</title><script>\n" + + " function test() {\n" + + " try {\n" + + " var event = document.createEvent('PopStateEvent');\n" + + " } catch (e) { alert('exception ctor') }\n" + + + " try {\n" + + " dispatchEvent(event);\n" + + " alert('dispatched');\n" + " } catch (e) { alert('exception') }\n" + " }\n" + DUMP_EVENT_FUNCTION @@ -164,4 +200,33 @@ loadPageWithAlerts2(html); } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "no initPopStateEvent", + FF60 = "exception ctor", + IE = {"[object PopStateEvent]", "null", "PopState", "true", "false", "html"}) + public void initPopStateEvent() throws Exception { + final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + + "<html><head><title>foo</title><script>\n" + + " function test() {\n" + + " try {\n" + + " var event = document.createEvent('PopStateEvent');\n" + + " } catch (e) { alert('exception ctor') }\n" + + + " try {\n" + + " if (event.initPopStateEvent) {\n" + + " event.initPopStateEvent('PopState', true, false, 'html');\n" + + " dump(event);\n" + + " } else { alert('no initPopStateEvent'); }\n" + + " } catch (e) { alert('exception') }\n" + + " }\n" + + DUMP_EVENT_FUNCTION + + "</script></head><body onload='test()'>\n" + + "</body></html>"; + + loadPageWithAlerts2(html); + } } |
From: <rb...@us...> - 2018-06-29 11:20:31
|
Revision: 15408 http://sourceforge.net/p/htmlunit/code/15408 Author: rbri Date: 2018-06-29 11:20:25 +0000 (Fri, 29 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisErrorEvent.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserParameterizedRunner.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 2018-06-29 09:33:09 UTC (rev 15407) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisErrorEvent.java 2018-06-29 11:20:25 UTC (rev 15408) @@ -16,10 +16,9 @@ import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.host.event.SpeechSynthesisEvent; /** * A JavaScript object for {@code SpeechSynthesisErrorEvent}. @@ -27,40 +26,8 @@ * @author Ronald Brill */ @JsxClass(FF) -public class SpeechSynthesisErrorEvent extends SimpleScriptable { +public class SpeechSynthesisErrorEvent extends SpeechSynthesisEvent { - /** Constant. */ - @JsxConstant(FF) - public static final int ALT_MASK = 0x1; - - /** Constant. */ - @JsxConstant(FF) - public static final int CONTROL_MASK = 0x2; - - /** Constant. */ - @JsxConstant(FF) - public static final int SHIFT_MASK = 0x4; - - /** Constant. */ - @JsxConstant(FF) - public static final int META_MASK = 0x8; - - /** The first event phase: the capturing phase. */ - @JsxConstant(FF) - public static final short CAPTURING_PHASE = 1; - - /** The second event phase: at the event target. */ - @JsxConstant(FF) - public static final short AT_TARGET = 2; - - /** The third (and final) event phase: the bubbling phase. */ - @JsxConstant(FF) - public static final short BUBBLING_PHASE = 3; - - /** No event phase. */ - @JsxConstant(FF) - public static final short NONE = 0; - /** * Creates a new instance. */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserParameterizedRunner.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserParameterizedRunner.java 2018-06-29 09:33:09 UTC (rev 15407) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserParameterizedRunner.java 2018-06-29 11:20:25 UTC (rev 15408) @@ -156,7 +156,7 @@ runners_.add(new BrowserVersionClassRunnerWithParameters( klass, BrowserVersion.CHROME, false, tests)); } - if (browsers.contains("hu_ff60")) { + if (browsers.contains("hu-ff60")) { runners_.add(new BrowserVersionClassRunnerWithParameters( klass, BrowserVersion.FIREFOX_60, false, tests)); } |
From: <rb...@us...> - 2018-06-29 13:18:43
|
Revision: 15411 http://sourceforge.net/p/htmlunit/code/15411 Author: rbri Date: 2018-06-29 13:18:27 +0000 (Fri, 29 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDateTimeLocalInput.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMonthInput.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTimeInput.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlWeekInput.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElement.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElementTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-29 11:57:58 UTC (rev 15410) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-29 13:18:27 UTC (rev 15411) @@ -443,6 +443,14 @@ @BrowserFeature({CHROME, FF60, IE}) HTMLINPUT_FILE_VALUE_FAKEPATH, + /** HTMLInputElement date and time types are supported. */ + @BrowserFeature({CHROME, FF60}) + HTMLINPUT_TYPE_DATETIME_SUPPORTED, + + /** HTMLInputElement date and time types are supported. */ + @BrowserFeature(FF60) + HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED, + /** Should the HTMLElement of {@code keygen} have no end tag. */ @BrowserFeature(IE) HTMLKEYGEN_END_TAG_FORBIDDEN, @@ -1000,7 +1008,7 @@ @BrowserFeature(IE) JS_INPUT_SET_TYPE_LOWERCASE, - /** Setting the value of an Input Date to blank will result in an empty value. */ + /** Setting the value of an Input Date will check for correct format. */ @BrowserFeature({CHROME, FF60}) JS_INPUT_SET_VALUE_DATE_SUPPORTED, Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDateTimeLocalInput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDateTimeLocalInput.java 2018-06-29 11:57:58 UTC (rev 15410) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDateTimeLocalInput.java 2018-06-29 13:18:27 UTC (rev 15411) @@ -14,7 +14,8 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_VALUE_DATE_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_DATETIME_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; @@ -49,7 +50,8 @@ @Override public void setValueAttribute(final String newValue) { try { - if (hasFeature(JS_INPUT_SET_VALUE_DATE_SUPPORTED)) { + if (hasFeature(HTMLINPUT_TYPE_DATETIME_SUPPORTED) + && !hasFeature(HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED)) { FORMATTER_.parse(newValue); } super.setValueAttribute(newValue); Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMonthInput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMonthInput.java 2018-06-29 11:57:58 UTC (rev 15410) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMonthInput.java 2018-06-29 13:18:27 UTC (rev 15411) @@ -14,7 +14,8 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_VALUE_DATE_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_DATETIME_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; @@ -49,7 +50,8 @@ @Override public void setValueAttribute(final String newValue) { try { - if (hasFeature(JS_INPUT_SET_VALUE_DATE_SUPPORTED)) { + if (hasFeature(HTMLINPUT_TYPE_DATETIME_SUPPORTED) + && !hasFeature(HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED)) { FORMATTER_.parse(newValue); } super.setValueAttribute(newValue); Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTimeInput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTimeInput.java 2018-06-29 11:57:58 UTC (rev 15410) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTimeInput.java 2018-06-29 13:18:27 UTC (rev 15411) @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_VALUE_DATE_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_DATETIME_SUPPORTED; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; @@ -49,7 +49,7 @@ @Override public void setValueAttribute(final String newValue) { try { - if (hasFeature(JS_INPUT_SET_VALUE_DATE_SUPPORTED)) { + if (hasFeature(HTMLINPUT_TYPE_DATETIME_SUPPORTED)) { FORMATTER_.parse(newValue); } super.setValueAttribute(newValue); Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlWeekInput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlWeekInput.java 2018-06-29 11:57:58 UTC (rev 15410) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlWeekInput.java 2018-06-29 13:18:27 UTC (rev 15411) @@ -14,7 +14,8 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_VALUE_DATE_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_DATETIME_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; @@ -49,7 +50,8 @@ @Override public void setValueAttribute(final String newValue) { try { - if (hasFeature(JS_INPUT_SET_VALUE_DATE_SUPPORTED)) { + if (hasFeature(HTMLINPUT_TYPE_DATETIME_SUPPORTED) + && !hasFeature(HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED)) { FORMATTER_.parse(newValue); } super.setValueAttribute(newValue); 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 2018-06-29 11:57:58 UTC (rev 15410) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElement.java 2018-06-29 13:18:27 UTC (rev 15411) @@ -18,16 +18,16 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_FILES_UNDEFINED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_FILE_SELECTION_START_END_NULL; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_FILE_VALUE_FAKEPATH; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_DATETIME_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ALIGN_FOR_INPUT_IGNORES_VALUES; 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; import static com.gargoylesoftware.htmlunit.html.DomElement.ATTRIBUTE_NOT_DEFINED; 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.FF60; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -100,7 +100,7 @@ if (!InputElementFactory.isSupported(type)) { type = "text"; } - else if (!browserVersion.hasFeature(JS_INPUT_SET_VALUE_DATE_SUPPORTED)) { + else if (!browserVersion.hasFeature(HTMLINPUT_TYPE_DATETIME_SUPPORTED)) { switch (type) { case "date": case "time": @@ -113,6 +113,17 @@ default: } } + else if (browserVersion.hasFeature(HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED)) { + switch (type) { + case "datetime-local": + case "month": + case "week": + type = "text"; + break; + + default: + } + } if ("color".equals(type) && browserVersion.hasFeature(HTMLINPUT_FILES_UNDEFINED)) { type = "text"; } @@ -425,7 +436,7 @@ * Gets the {@code minLength}. * @return the {@code minLength} */ - @JsxGetter({CHROME, FF52}) + @JsxGetter({CHROME, FF}) public int getMinLength() { final String attrValue = getDomNodeOrDie().getAttribute("minLength"); return NumberUtils.toInt(attrValue, -1); @@ -435,7 +446,7 @@ * Sets the value of {@code minLength} attribute. * @param length the new value */ - @JsxSetter({CHROME, FF52}) + @JsxSetter({CHROME, FF}) public void setMinLength(final int length) { getDomNodeOrDie().setMinLength(length); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElementTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElementTest.java 2018-06-29 11:57:58 UTC (rev 15410) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElementTest.java 2018-06-29 13:18:27 UTC (rev 15411) @@ -267,7 +267,7 @@ + "</form>\n" + "</body></html>"; - loadPageWithAlerts2(html, 2 * DEFAULT_WAIT_TIME); + loadPageWithAlerts2(html, 7777777); } /** |
From: <rb...@us...> - 2018-06-29 14:01:37
|
Revision: 15413 http://sourceforge.net/p/htmlunit/code/15413 Author: rbri Date: 2018-06-29 14:01:31 +0000 (Fri, 29 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/NativeFunctionToStringFunction.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementChildNodesTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElementTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-29 13:28:37 UTC (rev 15412) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-29 14:01:31 UTC (rev 15413) @@ -1093,6 +1093,10 @@ @BrowserFeature(IE) JS_NATIVE_FUNCTION_TOSTRING_NEW_LINE, + /** Indicates if the String representation of a native function has a newline for empty parameter list. */ + @BrowserFeature(FF60) + JS_NATIVE_FUNCTION_TOSTRING_NL, + /** Navigator.doNotTrack returns unspecified if not set. */ @BrowserFeature(FF) JS_NAVIGATOR_DO_NOT_TRACK_UNSPECIFIED, Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/NativeFunctionToStringFunction.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/NativeFunctionToStringFunction.java 2018-06-29 13:28:37 UTC (rev 15412) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/NativeFunctionToStringFunction.java 2018-06-29 14:01:31 UTC (rev 15413) @@ -16,6 +16,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_NATIVE_FUNCTION_TOSTRING_COMPACT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_NATIVE_FUNCTION_TOSTRING_NEW_LINE; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_NATIVE_FUNCTION_TOSTRING_NL; import com.gargoylesoftware.htmlunit.BrowserVersion; @@ -55,6 +56,13 @@ final Function newToString = new NativeFunctionToStringFunctionChrome(originalToString); ScriptableObject.putProperty(fnPrototype, "toString", newToString); } + else if (browserVersion.hasFeature(JS_NATIVE_FUNCTION_TOSTRING_NL)) { + final ScriptableObject fnPrototype = + (ScriptableObject) ScriptableObject.getClassPrototype(window, "Function"); + final Function originalToString = (Function) ScriptableObject.getProperty(fnPrototype, "toString"); + final Function newToString = new NativeFunctionToStringFunctionFF(originalToString); + ScriptableObject.putProperty(fnPrototype, "toString", newToString); + } } NativeFunctionToStringFunction(final Function wrapped) { @@ -92,7 +100,22 @@ final String functionName = ((BaseFunction) thisObj).getFunctionName(); return "function " + functionName + "() { [native code] }"; } - return s; + return s.replace("function anonymous() {", "function anonymous(\n) {"); } } + static class NativeFunctionToStringFunctionFF extends FunctionWrapper { + + NativeFunctionToStringFunctionFF(final Function wrapped) { + super(wrapped); + } + + /** + * {@inheritDoc} + */ + @Override + public Object call(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args) { + final String s = (String) super.call(cx, scope, thisObj, args); + return s.replace("function anonymous() {", "function anonymous(\n) {"); + } + } } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementChildNodesTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementChildNodesTest.java 2018-06-29 13:28:37 UTC (rev 15412) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/ElementChildNodesTest.java 2018-06-29 14:01:31 UTC (rev 15413) @@ -14,11 +14,14 @@ */ package com.gargoylesoftware.htmlunit.general; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF60; + import org.junit.Test; import org.junit.runner.RunWith; import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; /** @@ -415,6 +418,7 @@ @Test @Alerts(DEFAULT = {"3", "2", "2", "3", "2", "2"}, FF60 = {"1", "0", "1", "1", "0", "1"}) + @NotYetImplemented(FF60) public void dialog() throws Exception { loadPageWithAlerts2(test("dialog")); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElementTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElementTest.java 2018-06-29 13:28:37 UTC (rev 15412) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElementTest.java 2018-06-29 14:01:31 UTC (rev 15413) @@ -267,7 +267,7 @@ + "</form>\n" + "</body></html>"; - loadPageWithAlerts2(html, 7777777); + loadPageWithAlerts2(html, 2 * DEFAULT_WAIT_TIME); } /** |
From: <rb...@us...> - 2018-06-29 14:18:49
|
Revision: 15415 http://sourceforge.net/p/htmlunit/code/15415 Author: rbri Date: 2018-06-29 14:18:41 +0000 (Fri, 29 Jun 2018) Log Message: ----------- NPE in HtmlTextArea.removeFocus() Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextAreaTest.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2018-06-29 14:05:13 UTC (rev 15414) +++ trunk/htmlunit/src/changes/changes.xml 2018-06-29 14:18:41 UTC (rev 15415) @@ -8,6 +8,15 @@ <body> <release version="2.32" date="xx 2018" description="Bugfixes, FIREFOX_45 removed, FIREFOX_60 added"> + <action type="add" dev="rbri"> + FF60 ESR support. + </action> + <action type="remove" dev="rbri"> + FF45 support removed. + </action> + <action type="fix" dev="rbri" issue="1964"> + NPE in HtmlTextArea.removeFocus(). + </action> <action type="fix" dev="rbri" issue="1970"> WebClient default request header should not overwrite request-specific ones. </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea.java 2018-06-29 14:05:13 UTC (rev 15414) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea.java 2018-06-29 14:18:41 UTC (rev 15415) @@ -512,7 +512,7 @@ @Override public void removeFocus() { super.removeFocus(); - if (!valueAtFocus_.equals(getText())) { + if (valueAtFocus_ != null && !valueAtFocus_.equals(getText())) { HtmlInput.executeOnChangeHandlerIfAppropriate(this); } valueAtFocus_ = null; Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextAreaTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextAreaTest.java 2018-06-29 14:05:13 UTC (rev 15414) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextAreaTest.java 2018-06-29 14:18:41 UTC (rev 15415) @@ -279,4 +279,17 @@ t.type(KeyboardEvent.DOM_VK_DELETE); assertEquals("tt", t.getText()); } + + /** + * Make sure removeFocus does not throw. + * + * @throws Exception if the test fails + */ + @Test + public void removeFocus() throws Exception { + final String html = "<html><head></head><body><textarea id='t'></textarea></body></html>"; + final HtmlPage page = loadPage(html, null); + final HtmlTextArea t = page.getHtmlElementById("t"); + t.removeFocus(); + } } |
From: <rb...@us...> - 2018-06-29 19:51:30
|
Revision: 15418 http://sourceforge.net/p/htmlunit/code/15418 Author: rbri Date: 2018-06-29 19:51:23 +0000 (Fri, 29 Jun 2018) Log Message: ----------- Correct handling of additional parameters provided in functions setTimeout/setInterval. Issue 1966 Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/BackgroundJavaScriptFactory.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptFunctionJob.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2018-06-29 17:33:58 UTC (rev 15417) +++ trunk/htmlunit/src/changes/changes.xml 2018-06-29 19:51:23 UTC (rev 15418) @@ -14,6 +14,9 @@ <action type="remove" dev="rbri"> FF45 support removed. </action> + <action type="fix" dev="rbri" issue="1966" due-to="Atsushi Nakagawa"> + Correct handling of additional parameters provided in functions setTimeout/setInterval. + </action> <action type="fix" dev="rbri" issue="1964"> NPE in HtmlTextArea.removeFocus(). </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/BackgroundJavaScriptFactory.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/BackgroundJavaScriptFactory.java 2018-06-29 17:33:58 UTC (rev 15417) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/BackgroundJavaScriptFactory.java 2018-06-29 19:51:23 UTC (rev 15418) @@ -28,6 +28,7 @@ * JavaScript engine. * * @author Ronald Brill + * @author Atsushi Nakagawa */ public class BackgroundJavaScriptFactory { @@ -73,13 +74,14 @@ * @param label the label for the job * @param window the window to which the job belongs * @param function the JavaScript code to execute + * @param args the arguments to pass into the function call * * @return JavaScriptJob the created job */ public JavaScriptFunctionJob createJavaScriptJob(final int initialDelay, final Integer period, final String label, - final WebWindow window, final Function function) { - return new JavaScriptFunctionJob(initialDelay, period, label, window, function); + final WebWindow window, final Function function, final Object[] args) { + return new JavaScriptFunctionJob(initialDelay, period, label, window, function, args); } /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptFunctionJob.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptFunctionJob.java 2018-06-29 17:33:58 UTC (rev 15417) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptFunctionJob.java 2018-06-29 19:51:23 UTC (rev 15418) @@ -24,11 +24,14 @@ /** * A {@link JavaScriptJob} created from a {@link Function} object. * @author Brad Clarke + * @author Ronald Brill + * @author Atsushi Nakagawa */ class JavaScriptFunctionJob extends JavaScriptExecutionJob { /** The JavaScript code to execute. */ private final Function function_; + private final Object[] args_; /** * Creates a new JavaScript execution job, where the JavaScript code to execute is a function. @@ -37,11 +40,13 @@ * @param label the label for the job * @param window the window to which the job belongs * @param function the JavaScript code to execute + * @param args the arguments to pass into the function call */ JavaScriptFunctionJob(final int initialDelay, final Integer period, final String label, - final WebWindow window, final Function function) { + final WebWindow window, final Function function, final Object[] args) { super(initialDelay, period, label, window); function_ = function; + args_ = args; } /** {@inheritDoc} */ @@ -49,7 +54,7 @@ protected void runJavaScript(final HtmlPage page) { final DomElement doc = page.getDocumentElement(); final Scriptable scriptable = page.getEnclosingWindow().getScriptableObject(); - page.executeJavaScriptFunction(function_, scriptable, new Object[0], doc); + page.executeJavaScriptFunction(function_, scriptable, args_, doc); } } 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 2018-06-29 17:33:58 UTC (rev 15417) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-06-29 19:51:23 UTC (rev 15418) @@ -24,8 +24,8 @@ 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.FF60; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.io.IOException; @@ -155,6 +155,7 @@ * @author Frank Danek * @author Carsten Steul * @author Colin Alworth + * @author Atsushi Nakagawa * @see <a href="http://msdn.microsoft.com/en-us/library/ms535873.aspx">MSDN documentation</a> */ @JsxClass @@ -483,32 +484,77 @@ * The invocation occurs only if the window is opened after the delay * and does not contain an other page than the one that originated the setTimeout. * - * @param code specifies the function pointer or string that indicates the code to be executed - * when the specified interval has elapsed - * @param timeout specifies the number of milliseconds - * @param language specifies language + * @see <a href="https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout"> + * MDN web docs</a> + * + * @param context the JavaScript context + * @param thisObj the scriptable + * @param args the arguments passed into the method + * @param function the function * @return the id of the created timer */ @JsxFunction - public int setTimeout(final Object code, int timeout, final Object language) { + public static Object setTimeout(final Context context, final Scriptable thisObj, + final Object[] args, final Function function) { + if (args.length < 1) { + throw ScriptRuntime.typeError("Function not provided"); + } + + final int timeout = ScriptRuntime.toInt32((args.length > 1) ? args[1] : Undefined.instance); + final Object[] params = (args.length > 2) + ? Arrays.copyOfRange(args, 2, args.length) + : ScriptRuntime.emptyArgs; + return ((Window) thisObj).setTimeoutIntervalImpl(args[0], timeout, true, params); + } + + /** + * Sets a chunk of JavaScript to be invoked each time a specified number of milliseconds has elapsed. + * + * @see <a href="https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval"> + * MDN web docs</a> + * @param context the JavaScript context + * @param thisObj the scriptable + * @param args the arguments passed into the method + * @param function the function + * @return the id of the created interval + */ + @JsxFunction + public static Object setInterval(final Context context, final Scriptable thisObj, + final Object[] args, final Function function) { + if (args.length < 1) { + throw ScriptRuntime.typeError("Function not provided"); + } + + final int timeout = ScriptRuntime.toInt32((args.length > 1) ? args[1] : Undefined.instance); + final Object[] params = (args.length > 2) + ? Arrays.copyOfRange(args, 2, args.length) + : ScriptRuntime.emptyArgs; + return ((Window) thisObj).setTimeoutIntervalImpl(args[0], timeout, false, params); + } + + private int setTimeoutIntervalImpl(final Object code, int timeout, final boolean isTimeout, final Object[] params) { if (timeout < MIN_TIMER_DELAY) { timeout = MIN_TIMER_DELAY; } - if (code == null) { - throw Context.reportRuntimeError("Function not provided."); - } - final int id; final WebWindow webWindow = getWebWindow(); final Page page = (Page) getDomNodeOrNull(); + Integer period = null; + if (!isTimeout) { + period = Integer.valueOf(timeout); + } + if (code instanceof String) { final String s = (String) code; - final String description = "window.setTimeout(" + s + ", " + timeout + ")"; + final String description = "window.set" + + (isTimeout ? "Timeout" : "Interval") + + "(" + s + ", " + timeout + ")"; final JavaScriptJob job = BackgroundJavaScriptFactory.theFactory(). - createJavaScriptJob(timeout, null, description, webWindow, s); - id = webWindow.getJobManager().addJob(job, page); + createJavaScriptJob(timeout, period, description, webWindow, s); + return webWindow.getJobManager().addJob(job, page); } - else if (code instanceof Function) { + + if (code instanceof Function) { final Function f = (Function) code; final String functionName; if (f instanceof FunctionObject) { @@ -518,15 +564,15 @@ functionName = String.valueOf(f); // can this happen? } - final String description = "window.setTimeout(" + functionName + ", " + timeout + ")"; + final String description = "window.set" + + (isTimeout ? "Timeout" : "Interval") + + "(" + functionName + ", " + timeout + ")"; final JavaScriptJob job = BackgroundJavaScriptFactory.theFactory(). - createJavaScriptJob(timeout, null, description, webWindow, f); - id = webWindow.getJobManager().addJob(job, page); + createJavaScriptJob(timeout, period, description, webWindow, f, params); + return webWindow.getJobManager().addJob(job, page); } - else { - throw Context.reportRuntimeError("Unknown type for function."); - } - return id; + + throw Context.reportRuntimeError("Unknown type for function."); } /** @@ -543,6 +589,21 @@ } /** + * Cancels the interval previously started using the {@link #setInterval(Object, int, Object)} method. + * Current implementation does nothing. + * @param intervalID specifies the interval to cancel as returned by the + * {@link #setInterval(Object, int, Object)} method + * @see <a href="http://msdn.microsoft.com/en-us/library/ms536353.aspx">MSDN documentation</a> + */ + @JsxFunction + public void clearInterval(final int intervalID) { + if (LOG.isDebugEnabled()) { + LOG.debug("clearInterval(" + intervalID + ")"); + } + getWebWindow().getJobManager().removeJob(intervalID); + } + + /** * Returns the JavaScript property {@code navigator}. * @return the navigator */ @@ -1487,61 +1548,6 @@ } /** - * Sets a chunk of JavaScript to be invoked each time a specified number of milliseconds has elapsed. - * - * @see <a href="http://msdn.microsoft.com/en-us/library/ms536749.aspx">MSDN documentation</a> - * @param code specifies the function pointer or string that indicates the code to be executed - * when the specified interval has elapsed - * @param timeout specifies the number of milliseconds - * @param language specifies language - * @return the id of the created interval - */ - @JsxFunction - public int setInterval(final Object code, int timeout, final Object language) { - if (timeout < MIN_TIMER_DELAY) { - timeout = MIN_TIMER_DELAY; - } - final int id; - final WebWindow w = getWebWindow(); - final Page page = (Page) getDomNodeOrNull(); - final String description = "window.setInterval(" + timeout + ")"; - if (code == null) { - throw Context.reportRuntimeError("Function not provided."); - } - else if (code instanceof String) { - final String s = (String) code; - final JavaScriptJob job = BackgroundJavaScriptFactory.theFactory(). - createJavaScriptJob(timeout, Integer.valueOf(timeout), description, w, s); - id = w.getJobManager().addJob(job, page); - } - else if (code instanceof Function) { - final Function f = (Function) code; - final JavaScriptJob job = BackgroundJavaScriptFactory.theFactory(). - createJavaScriptJob(timeout, Integer.valueOf(timeout), description, w, f); - id = w.getJobManager().addJob(job, page); - } - else { - throw Context.reportRuntimeError("Unknown type for function."); - } - return id; - } - - /** - * Cancels the interval previously started using the {@link #setInterval(Object, int, Object)} method. - * Current implementation does nothing. - * @param intervalID specifies the interval to cancel as returned by the - * {@link #setInterval(Object, int, Object)} method - * @see <a href="http://msdn.microsoft.com/en-us/library/ms536353.aspx">MSDN documentation</a> - */ - @JsxFunction - public void clearInterval(final int intervalID) { - if (LOG.isDebugEnabled()) { - LOG.debug("clearInterval(" + intervalID + ")"); - } - getWebWindow().getJobManager().removeJob(intervalID); - } - - /** * Returns the {@code innerWidth}. * @return the {@code innerWidth} * @see <a href="http://www.mozilla.org/docs/dom/domref/dom_window_ref28.html">Mozilla doc</a> |
From: <rb...@us...> - 2018-06-30 12:07:13
|
Revision: 15421 http://sourceforge.net/p/htmlunit/code/15421 Author: rbri Date: 2018-06-30 12:06:58 +0000 (Sat, 30 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/WebKitCSSMatrix.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/FileSystemFileEntry.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioBufferSourceNode.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OfflineAudioContext.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OscillatorNode.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceNavigationTiming.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOf.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfBTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfCTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfFTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfHTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfITest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfMTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfPTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfSTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfTTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfWTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/WebKitCSSMatrix.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/WebKitCSSMatrix.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/WebKitCSSMatrix.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -18,9 +18,9 @@ import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -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.host.dom.DOMMatrix; /** * A JavaScript object for {@code WebKitCSSMatrix}. @@ -29,7 +29,7 @@ * @author Ronald Brill */ @JsxClass({CHROME, EDGE, FF}) -public class WebKitCSSMatrix extends SimpleScriptable { +public class WebKitCSSMatrix extends DOMMatrix { /** * Creates an instance. 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 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryEntry.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -26,7 +25,7 @@ * @author Ronald Brill */ @JsxClass(FF) -public class FileSystemDirectoryEntry extends SimpleScriptable { +public class FileSystemDirectoryEntry extends FileSystemEntry { /** * Creates a new instance. 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 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemFileEntry.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -26,7 +25,7 @@ * @author Ronald Brill */ @JsxClass(FF) -public class FileSystemFileEntry extends SimpleScriptable { +public class FileSystemFileEntry extends FileSystemEntry { /** * Creates a new instance. Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioBufferSourceNode.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioBufferSourceNode.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioBufferSourceNode.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -20,14 +20,16 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.host.AudioScheduledSourceNode; /** * A JavaScript object for {@code AudioBufferSourceNode}. * * @author Ahmed Ashour + * @author Ronald Brill */ @JsxClass({CHROME, FF, EDGE}) -public class AudioBufferSourceNode extends AudioNode { +public class AudioBufferSourceNode extends AudioScheduledSourceNode { /** * Creates an instance. Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OfflineAudioContext.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OfflineAudioContext.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OfflineAudioContext.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -25,9 +25,10 @@ * A JavaScript object for {@code OfflineAudioContext}. * * @author Ahmed Ashour + * @author Ronald Brill */ @JsxClass({CHROME, FF, EDGE}) -public class OfflineAudioContext extends AudioContext { +public class OfflineAudioContext extends BaseAudioContext { /** * Creates an instance. Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OscillatorNode.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OscillatorNode.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OscillatorNode.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -20,14 +20,16 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.host.AudioScheduledSourceNode; /** * A JavaScript object for {@code OscillatorNode}. * * @author Ahmed Ashour + * @author Ronald Brill */ @JsxClass({CHROME, FF, EDGE}) -public class OscillatorNode extends AudioNode { +public class OscillatorNode extends AudioScheduledSourceNode { /** * Creates an instance. Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceNavigationTiming.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceNavigationTiming.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceNavigationTiming.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -18,7 +18,6 @@ import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -29,7 +28,7 @@ * @author Ronald Brill */ @JsxClass({CHROME, FF60, IE}) -public class PerformanceNavigationTiming extends SimpleScriptable { +public class PerformanceNavigationTiming extends PerformanceResourceTiming { /** * Creates an instance. Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOf.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOf.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOf.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -32,6 +32,7 @@ * Tests two Host classes, if one prototype is parent of another. * * @author Ahmed Ashour + * @author Ronald Brill */ public abstract class HostParentOf extends WebDriverTestCase { 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 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -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.FF; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; import java.util.Collection; @@ -33,6 +34,7 @@ * This class handles all host names which starts by character 'A'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfATest extends HostParentOf { @@ -180,7 +182,7 @@ @Test @Alerts(DEFAULT = "true", IE = "false") - @NotYetImplemented({CHROME, FF52}) + @NotYetImplemented({CHROME, FF}) public void _Audio_HTMLAudioElement() throws Exception { test("Audio", "HTMLAudioElement"); } @@ -221,7 +223,7 @@ @Test @Alerts(DEFAULT = "false", FF52 = "true") - @NotYetImplemented(CHROME) + @NotYetImplemented(FF52) public void _AudioContext_OfflineAudioContext() throws Exception { test("AudioContext", "OfflineAudioContext"); } @@ -495,7 +497,6 @@ @Alerts(DEFAULT = "false", CHROME = "true", FF60 = "true") - @NotYetImplemented(CHROME) public void _AudioScheduledSourceNode_AudioBufferSourceNode() throws Exception { test("AudioScheduledSourceNode", "AudioBufferSourceNode"); } @@ -529,7 +530,6 @@ @Alerts(DEFAULT = "false", CHROME = "true", FF60 = "true") - @NotYetImplemented(CHROME) public void _AudioScheduledSourceNode_OscillatorNode() throws Exception { test("AudioScheduledSourceNode", "OscillatorNode"); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfBTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfBTest.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfBTest.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -29,6 +29,7 @@ * This class handles all host names which starts by character 'B'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfBTest extends HostParentOf { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfCTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfCTest.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfCTest.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -32,6 +32,7 @@ * This class handles all host names which starts by character 'C'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfCTest extends HostParentOf { 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 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -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.FF; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; import java.util.Collection; @@ -256,7 +257,6 @@ @Test @Alerts(DEFAULT = "true", IE = "false") - @NotYetImplemented({CHROME, FF52}) public void _DOMMatrix_WebKitCSSMatrix() throws Exception { test("DOMMatrix", "WebKitCSSMatrix"); } @@ -287,7 +287,6 @@ @Test @Alerts(DEFAULT = "true", IE = "false") - @NotYetImplemented({CHROME, FF52}) public void _DOMMatrixReadOnly_WebKitCSSMatrix() throws Exception { test("DOMMatrixReadOnly", "WebKitCSSMatrix"); } @@ -1938,7 +1937,7 @@ @Test @Alerts(DEFAULT = "true", IE = "false") - @NotYetImplemented({CHROME, FF52}) + @NotYetImplemented({CHROME, FF}) public void _Error_DOMException() throws Exception { test("Error", "DOMException"); } @@ -4141,7 +4140,7 @@ @Test @Alerts(DEFAULT = "false", FF = "true") - @NotYetImplemented(FF52) + @NotYetImplemented(FF) public void _EventTarget_Screen() throws Exception { test("EventTarget", "Screen"); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfFTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfFTest.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfFTest.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -14,6 +14,8 @@ */ package com.gargoylesoftware.htmlunit.general.huge; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; + import java.util.Collection; import org.junit.Test; @@ -22,6 +24,7 @@ import com.gargoylesoftware.htmlunit.BrowserParameterizedRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; /** * Tests two Host classes, if one prototype is parent of another. @@ -29,6 +32,7 @@ * This class handles all host names which starts by character 'F' to 'G'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfFTest extends HostParentOf { @@ -119,6 +123,7 @@ @Test @Alerts(DEFAULT = "false", FF60 = "true") + @NotYetImplemented(FF52) public void _FileSystemEntry_FileSystemDirectoryEntry() throws Exception { test("FileSystemEntry", "FileSystemDirectoryEntry"); } @@ -139,6 +144,7 @@ @Test @Alerts(DEFAULT = "false", FF60 = "true") + @NotYetImplemented(FF52) public void _FileSystemEntry_FileSystemFileEntry() throws Exception { test("FileSystemEntry", "FileSystemFileEntry"); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfHTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfHTest.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfHTest.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -33,6 +33,7 @@ * This class handles all host names which starts by character 'H'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfHTest extends HostParentOf { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfITest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfITest.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfITest.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -32,6 +32,7 @@ * This class handles all host names which starts by character 'I' to 'L'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfITest extends HostParentOf { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfMTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfMTest.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfMTest.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -33,6 +33,7 @@ * This class handles all host names which starts by character 'M' to 'O'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfMTest extends HostParentOf { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfPTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfPTest.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfPTest.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -16,6 +16,7 @@ import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import java.util.Collection; @@ -33,6 +34,7 @@ * This class handles all host names which starts by character 'P' to 'R'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfPTest extends HostParentOf { @@ -175,7 +177,7 @@ @Alerts(DEFAULT = "false", CHROME = "true", FF60 = "true") - @NotYetImplemented(CHROME) + @NotYetImplemented(IE) public void _PerformanceEntry_PerformanceNavigationTiming() throws Exception { test("PerformanceEntry", "PerformanceNavigationTiming"); } @@ -262,7 +264,7 @@ @Alerts(DEFAULT = "false", CHROME = "true", FF60 = "true") - @NotYetImplemented(CHROME) + @NotYetImplemented(IE) public void _PerformanceResourceTiming_PerformanceNavigationTiming() throws Exception { test("PerformanceResourceTiming", "PerformanceNavigationTiming"); } 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 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfSTest.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -16,6 +16,7 @@ import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF60; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import java.util.Collection; @@ -34,6 +35,7 @@ * This class handles all host names which starts by character 'S'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfSTest extends HostParentOf { @@ -1585,6 +1587,7 @@ @Test @Alerts(DEFAULT = "false", CHROME = "true") + @NotYetImplemented(FF60) public void _SVGGeometryElement_SVGCircleElement() throws Exception { test("SVGGeometryElement", "SVGCircleElement"); } @@ -1595,6 +1598,7 @@ @Test @Alerts(DEFAULT = "false", CHROME = "true") + @NotYetImplemented(FF60) public void _SVGGeometryElement_SVGEllipseElement() throws Exception { test("SVGGeometryElement", "SVGEllipseElement"); } @@ -1616,6 +1620,7 @@ @Test @Alerts(DEFAULT = "false", CHROME = "true") + @NotYetImplemented(FF60) public void _SVGGeometryElement_SVGLineElement() throws Exception { test("SVGGeometryElement", "SVGLineElement"); } @@ -1637,6 +1642,7 @@ @Test @Alerts(DEFAULT = "false", CHROME = "true") + @NotYetImplemented(FF60) public void _SVGGeometryElement_SVGPolygonElement() throws Exception { test("SVGGeometryElement", "SVGPolygonElement"); } @@ -1647,6 +1653,7 @@ @Test @Alerts(DEFAULT = "false", CHROME = "true") + @NotYetImplemented(FF60) public void _SVGGeometryElement_SVGPolylineElement() throws Exception { test("SVGGeometryElement", "SVGPolylineElement"); } @@ -1657,6 +1664,7 @@ @Test @Alerts(DEFAULT = "false", CHROME = "true") + @NotYetImplemented(FF60) public void _SVGGeometryElement_SVGRectElement() throws Exception { test("SVGGeometryElement", "SVGRectElement"); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfTTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfTTest.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfTTest.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -29,6 +29,7 @@ * This class handles all host names which starts by character 'T' to 'V'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfTTest extends HostParentOf { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfWTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfWTest.java 2018-06-30 11:31:19 UTC (rev 15420) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfWTest.java 2018-06-30 12:06:58 UTC (rev 15421) @@ -33,6 +33,7 @@ * This class handles all host names which starts by character 'W' to 'Z'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfWTest extends HostParentOf { |
From: <rb...@us...> - 2018-07-05 06:22:52
|
Revision: 15429 http://sourceforge.net/p/htmlunit/code/15429 Author: rbri Date: 2018-07-05 06:22:42 +0000 (Thu, 05 Jul 2018) Log Message: ----------- ff60 support (wip) 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 2018-07-05 06:11:38 UTC (rev 15428) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java 2018-07-05 06:22:42 UTC (rev 15429) @@ -126,7 +126,7 @@ // FF60 FIREFOX_60.applicationVersion_ = "5.0 (Windows)"; FIREFOX_60.userAgent_ = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0"; - FIREFOX_60.buildId_ = "20180605201706"; + FIREFOX_60.buildId_ = "20180621121604"; FIREFOX_60.productSub_ = "20100101"; FIREFOX_60.headerNamesOrdered_ = new String[] { HttpHeader.HOST, @@ -152,7 +152,7 @@ // FF52 FIREFOX_52.applicationVersion_ = "5.0 (Windows)"; FIREFOX_52.userAgent_ = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0"; - FIREFOX_52.buildId_ = "20180430140610"; + FIREFOX_52.buildId_ = "20180621064021"; FIREFOX_52.productSub_ = "20100101"; FIREFOX_52.headerNamesOrdered_ = new String[] { HttpHeader.HOST, 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 2018-07-05 06:11:38 UTC (rev 15428) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/NavigatorTest.java 2018-07-05 06:22:42 UTC (rev 15429) @@ -385,7 +385,7 @@ */ @Test @Alerts(DEFAULT = "undefined", - FF60 = "20180605201706", + FF60 = "20180621121604", FF52 = "20180621064021") public void buildID() throws Exception { final String html |