From: <rb...@us...> - 2017-04-15 17:56:38
|
Revision: 14113 http://sourceforge.net/p/htmlunit/code/14113 Author: rbri Date: 2017-04-15 17:56:35 +0000 (Sat, 15 Apr 2017) Log Message: ----------- FF52 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMImplementationTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-15 15:21:38 UTC (rev 14112) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-15 17:56:35 UTC (rev 14113) @@ -763,7 +763,7 @@ JS_DOMIMPLEMENTATION_FEATURE_STYLESHEETS, /** If document.implementation.hasFeature() supports 'http://www.w3.org/TR/SVG11/feature#BasicStructure 1.2'. */ - @BrowserFeature(@WebBrowser(CHROME)) + @BrowserFeature({@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) JS_DOMIMPLEMENTATION_FEATURE_SVG_BASICSTRUCTURE_1_2, /** If document.implementation.hasFeature() supports 'MutationNameEvents'. */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMImplementationTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMImplementationTest.java 2017-04-15 15:21:38 UTC (rev 14112) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMImplementationTest.java 2017-04-15 17:56:35 UTC (rev 14113) @@ -269,11 +269,14 @@ */ @Test @Alerts(DEFAULT = {"http://www.w3.org/TR/SVG11/feature#BasicStructure 1.0: true", - "http://www.w3.org/TR/SVG11/feature#BasicStructure 1.1: true", - "http://www.w3.org/TR/SVG11/feature#BasicStructure 1.2: false"}, + "http://www.w3.org/TR/SVG11/feature#BasicStructure 1.1: true", + "http://www.w3.org/TR/SVG11/feature#BasicStructure 1.2: false"}, CHROME = {"http://www.w3.org/TR/SVG11/feature#BasicStructure 1.0: true", - "http://www.w3.org/TR/SVG11/feature#BasicStructure 1.1: true", - "http://www.w3.org/TR/SVG11/feature#BasicStructure 1.2: true"}) + "http://www.w3.org/TR/SVG11/feature#BasicStructure 1.1: true", + "http://www.w3.org/TR/SVG11/feature#BasicStructure 1.2: true"}, + FF52 = {"http://www.w3.org/TR/SVG11/feature#BasicStructure 1.0: true", + "http://www.w3.org/TR/SVG11/feature#BasicStructure 1.1: true", + "http://www.w3.org/TR/SVG11/feature#BasicStructure 1.2: true"}) public void hasFeature_SVG_BasicStructure() throws Exception { hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "['1.0', '1.1', '1.2']"); } @@ -283,11 +286,14 @@ */ @Test @Alerts(DEFAULT = {"http://www.w3.org/TR/SVG11/feature#Shape 1.0: true", - "http://www.w3.org/TR/SVG11/feature#Shape 1.1: true", - "http://www.w3.org/TR/SVG11/feature#Shape 1.2: false"}, + "http://www.w3.org/TR/SVG11/feature#Shape 1.1: true", + "http://www.w3.org/TR/SVG11/feature#Shape 1.2: false"}, CHROME = {"http://www.w3.org/TR/SVG11/feature#Shape 1.0: true", - "http://www.w3.org/TR/SVG11/feature#Shape 1.1: true", - "http://www.w3.org/TR/SVG11/feature#Shape 1.2: true"}) + "http://www.w3.org/TR/SVG11/feature#Shape 1.1: true", + "http://www.w3.org/TR/SVG11/feature#Shape 1.2: true"}, + FF52 = {"http://www.w3.org/TR/SVG11/feature#Shape 1.0: true", + "http://www.w3.org/TR/SVG11/feature#Shape 1.1: true", + "http://www.w3.org/TR/SVG11/feature#Shape 1.2: true"}) public void hasFeature_SVG_Shape() throws Exception { hasFeature("http://www.w3.org/TR/SVG11/feature#Shape", "['1.0', '1.1', '1.2']"); } |
From: <rb...@us...> - 2017-04-15 19:30:15
|
Revision: 14115 http://sourceforge.net/p/htmlunit/code/14115 Author: rbri Date: 2017-04-15 19:30:13 +0000 (Sat, 15 Apr 2017) Log Message: ----------- FF52 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PermissionStatus.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Permissions.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ImageBitmapRenderingContext.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGL2RenderingContext.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/WebKitCSSMatrix.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMSettableTokenList.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SpeechSynthesisEvent.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebGLContextEvent.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/moz/MozPowerManager.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisUtterance.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PermissionStatus.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PermissionStatus.java 2017-04-15 18:45:23 UTC (rev 14114) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PermissionStatus.java 2017-04-15 19:30:13 UTC (rev 14115) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -26,7 +27,7 @@ * * @author Ahmed Ashour */ -@JsxClass(browsers = @WebBrowser(CHROME)) +@JsxClass(browsers = {@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) public class PermissionStatus extends EventTarget { /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Permissions.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Permissions.java 2017-04-15 18:45:23 UTC (rev 14114) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Permissions.java 2017-04-15 19:30:13 UTC (rev 14115) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +27,7 @@ * * @author Ahmed Ashour */ -@JsxClass(browsers = @WebBrowser(CHROME)) +@JsxClass(browsers = {@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) public class Permissions extends SimpleScriptable { /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ImageBitmapRenderingContext.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ImageBitmapRenderingContext.java 2017-04-15 18:45:23 UTC (rev 14114) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ImageBitmapRenderingContext.java 2017-04-15 19:30:13 UTC (rev 14115) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +27,7 @@ * * @author Ahmed Ashour */ -@JsxClass(browsers = @WebBrowser(CHROME)) +@JsxClass(browsers = {@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) public class ImageBitmapRenderingContext extends SimpleScriptable { /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGL2RenderingContext.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGL2RenderingContext.java 2017-04-15 18:45:23 UTC (rev 14114) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGL2RenderingContext.java 2017-04-15 19:30:13 UTC (rev 14115) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -27,7 +28,7 @@ * * @author Ahmed Ashour */ -@JsxClass(browsers = @WebBrowser(CHROME)) +@JsxClass(browsers = {@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) public class WebGL2RenderingContext extends SimpleScriptable { /** The constant {@code ACTIVE_ATTRIBUTES}. */ 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 2017-04-15 18:45:23 UTC (rev 14114) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/WebKitCSSMatrix.java 2017-04-15 19:30:13 UTC (rev 14115) @@ -16,6 +16,7 @@ import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.EDGE; +import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -27,7 +28,7 @@ * * @author Ahmed Ashour */ -@JsxClass(browsers = {@WebBrowser(CHROME), @WebBrowser(EDGE)}) +@JsxClass(browsers = {@WebBrowser(CHROME), @WebBrowser(EDGE), @WebBrowser(value = FF, minVersion = 52)}) public class WebKitCSSMatrix extends SimpleScriptable { /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMSettableTokenList.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMSettableTokenList.java 2017-04-15 18:45:23 UTC (rev 14114) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMSettableTokenList.java 2017-04-15 19:30:13 UTC (rev 14115) @@ -27,7 +27,7 @@ * * @author Ahmed Ashour */ -@JsxClass(browsers = {@WebBrowser(FF), @WebBrowser(IE), @WebBrowser(EDGE)}) +@JsxClass(browsers = {@WebBrowser(value = FF, maxVersion = 45), @WebBrowser(IE), @WebBrowser(EDGE)}) public class DOMSettableTokenList extends DOMTokenList { /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SpeechSynthesisEvent.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SpeechSynthesisEvent.java 2017-04-15 18:45:23 UTC (rev 14114) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SpeechSynthesisEvent.java 2017-04-15 19:30:13 UTC (rev 14115) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -25,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass(browsers = @WebBrowser(CHROME)) +@JsxClass(browsers = {@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) public class SpeechSynthesisEvent extends Event { /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebGLContextEvent.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebGLContextEvent.java 2017-04-15 18:45:23 UTC (rev 14114) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebGLContextEvent.java 2017-04-15 19:30:13 UTC (rev 14115) @@ -16,6 +16,7 @@ import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.EDGE; +import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -27,7 +28,8 @@ * * @author Ahmed Ashour */ -@JsxClass(browsers = {@WebBrowser(CHROME), @WebBrowser(IE), @WebBrowser(EDGE)}) +@JsxClass(browsers = {@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52), + @WebBrowser(IE), @WebBrowser(EDGE)}) public class WebGLContextEvent extends Event { /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/moz/MozPowerManager.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/moz/MozPowerManager.java 2017-04-15 18:45:23 UTC (rev 14114) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/moz/MozPowerManager.java 2017-04-15 19:30:13 UTC (rev 14115) @@ -26,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass(browsers = @WebBrowser(FF)) +@JsxClass(browsers = @WebBrowser(value = FF, maxVersion = 45)) public class MozPowerManager extends SimpleScriptable { /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisUtterance.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisUtterance.java 2017-04-15 18:45:23 UTC (rev 14114) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisUtterance.java 2017-04-15 19:30:13 UTC (rev 14115) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.speech; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -26,7 +27,7 @@ * * @author Ahmed Ashour */ -@JsxClass(browsers = @WebBrowser(CHROME)) +@JsxClass(browsers = {@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) public class SpeechSynthesisUtterance extends EventTarget { /** Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java 2017-04-15 18:45:23 UTC (rev 14114) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java 2017-04-15 19:30:13 UTC (rev 14115) @@ -16,6 +16,7 @@ import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.CHROME; import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.EDGE; +import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.FF52; import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.IE; import org.junit.Test; @@ -2202,7 +2203,7 @@ */ @Test @Alerts(DEFAULT = "exception", - FF = "function SVGAltGlyphElement() {\n [native code]\n}") + FF45 = "function SVGAltGlyphElement() {\n [native code]\n}") public void svgAltGlyphElement() throws Exception { test("SVGAltGlyphElement"); } @@ -3440,7 +3441,7 @@ */ @Test @Alerts(DEFAULT = "exception", - FF = "function SVGDocument() {\n [native code]\n}") + FF45 = "function SVGDocument() {\n [native code]\n}") public void svgDocument() throws Exception { test("SVGDocument"); } @@ -3487,7 +3488,8 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function HTMLDetailsElement() { [native code] }") + CHROME = "function HTMLDetailsElement() { [native code] }", + FF52 = "function HTMLDetailsElement() {\n [native code]\n}") public void htmlDetailsElement() throws Exception { test("HTMLDetailsElement"); } @@ -3781,7 +3783,7 @@ @Test @Alerts(DEFAULT = "exception", CHROME = "function HTMLShadowElement() { [native code] }", - FF = "function HTMLShadowElement() {\n [native code]\n}") + FF45 = "function HTMLShadowElement() {\n [native code]\n}") public void htmlShadowElement() throws Exception { test("HTMLShadowElement"); } @@ -4649,7 +4651,7 @@ */ @Test @Alerts(DEFAULT = "exception", - FF = "function MozContactChangeEvent() {\n [native code]\n}") + FF45 = "function MozContactChangeEvent() {\n [native code]\n}") public void mozContactChangeEvent() throws Exception { test("MozContactChangeEvent"); } @@ -5362,9 +5364,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function CSSKeyframeRule() { [native code] }", - FF = "exception", - IE = "[object CSSKeyframeRule]") + @Alerts(DEFAULT = "[object CSSKeyframeRule]", + CHROME = "function CSSKeyframeRule() { [native code] }", + FF45 = "exception") public void cssKeyframeRule() throws Exception { test("CSSKeyframeRule"); } @@ -5816,7 +5818,8 @@ */ @Test @Alerts(DEFAULT = "function CSSKeyframesRule() { [native code] }", - FF = "exception", + FF45 = "exception", + FF52 = "[object CSSKeyframesRule]", IE = "[object CSSKeyframesRule]") public void cssKeyframesRule() throws Exception { test("CSSKeyframesRule"); @@ -6217,7 +6220,7 @@ @Test @Alerts(DEFAULT = "exception", CHROME = "function HTMLContentElement() { [native code] }", - FF = "function HTMLContentElement() {\n [native code]\n}") + FF45 = "function HTMLContentElement() {\n [native code]\n}") public void htmlContentElement() throws Exception { test("HTMLContentElement"); } @@ -6423,7 +6426,7 @@ */ @Test @Alerts(DEFAULT = "exception", - FF = "function MozSettingsEvent() {\n [native code]\n}") + FF45 = "function MozSettingsEvent() {\n [native code]\n}") public void mozSettingsEvent() throws Exception { test("MozSettingsEvent"); } @@ -7558,7 +7561,8 @@ * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF52 = "function FileSystem() {\n [native code]\n}") public void fileSystem() throws Exception { test("FileSystem"); } @@ -7968,7 +7972,8 @@ * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF52 = "function SpeechSynthesis() {\n [native code]\n}") public void speechSynthesis() throws Exception { test("SpeechSynthesis"); } @@ -7978,7 +7983,8 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function SpeechSynthesisUtterance() { [native code] }") + CHROME = "function SpeechSynthesisUtterance() { [native code] }", + FF52 = "function SpeechSynthesisUtterance() {\n [native code]\n}") public void speechSynthesisUtterance() throws Exception { test("SpeechSynthesisUtterance"); } @@ -8217,7 +8223,8 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function PermissionStatus() { [native code] }") + CHROME = "function PermissionStatus() { [native code] }", + FF52 = "function PermissionStatus() {\n [native code]\n}") public void permissionStatus() throws Exception { test("PermissionStatus"); } @@ -8312,7 +8319,8 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function Permissions() { [native code] }") + CHROME = "function Permissions() { [native code] }", + FF52 = "function Permissions() {\n [native code]\n}") public void permissions() throws Exception { test("Permissions"); } @@ -8377,7 +8385,8 @@ @Test @Alerts(DEFAULT = "function DOMSettableTokenList() {\n [native code]\n}", IE = "[object DOMSettableTokenList]", - CHROME = "exception") + CHROME = "exception", + FF52 = "exception") public void domSettableTokenList() throws Exception { test("DOMSettableTokenList"); } @@ -8387,7 +8396,8 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function DataTransferItem() { [native code] }") + CHROME = "function DataTransferItem() { [native code] }", + FF52 = "function DataTransferItem() {\n [native code]\n}") public void dataTransferItem() throws Exception { test("DataTransferItem"); } @@ -8397,7 +8407,8 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function DataTransferItemList() { [native code] }") + CHROME = "function DataTransferItemList() { [native code] }", + FF52 = "function DataTransferItemList() {\n [native code]\n}") public void dataTransferItemList() throws Exception { test("DataTransferItemList"); } @@ -8839,7 +8850,8 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function SpeechSynthesisEvent() { [native code] }") + CHROME = "function SpeechSynthesisEvent() { [native code] }", + FF52 = "function SpeechSynthesisEvent() {\n [native code]\n}") public void speechSynthesisEvent() throws Exception { test("SpeechSynthesisEvent"); } @@ -8948,8 +8960,9 @@ */ @Test @Alerts(DEFAULT = "function WebGLContextEvent() { [native code] }", - FF = "exception", - IE = "\nfunction WebGLContextEvent() {\n [native code]\n}\n") + FF45 = "exception", + IE = "\nfunction WebGLContextEvent() {\n [native code]\n}\n", + FF52 = "function WebGLContextEvent() {\n [native code]\n}") public void webGLContextEvent() throws Exception { test("WebGLContextEvent"); } @@ -9047,7 +9060,8 @@ @Test @Alerts(DEFAULT = "exception", CHROME = "function WebKitCSSMatrix() { [native code] }", - EDGE = "function WebKitCSSMatrix() { [native code] }") + EDGE = "function WebKitCSSMatrix() { [native code] }", + FF52 = "function WebKitCSSMatrix() {\n [native code]\n}") public void webKitCSSMatrix() throws Exception { test("WebKitCSSMatrix"); } @@ -9442,7 +9456,8 @@ * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF52 = "function Animation() {\n [native code]\n}") public void animation() throws Exception { test("Animation"); } @@ -9471,7 +9486,7 @@ */ @Test @Alerts(DEFAULT = "exception", - FF = "function MozPowerManager() {\n [native code]\n}") + FF45 = "function MozPowerManager() {\n [native code]\n}") public void mozPowerManager() throws Exception { test("MozPowerManager"); } @@ -9665,7 +9680,7 @@ */ @Test @Alerts(DEFAULT = "exception", - FF = "[object MozCSSKeyframesRule]") + FF45 = "[object MozCSSKeyframesRule]") public void mozCSSKeyframesRule() throws Exception { test("MozCSSKeyframesRule"); } @@ -9800,7 +9815,8 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function ImageBitmapRenderingContext() { [native code] }") + CHROME = "function ImageBitmapRenderingContext() { [native code] }", + FF52 = "function ImageBitmapRenderingContext() {\n [native code]\n}") public void imageBitmapRenderingContext() throws Exception { test("ImageBitmapRenderingContext"); } @@ -10023,7 +10039,8 @@ * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF52 = "function SpeechSynthesisVoice() {\n [native code]\n}") public void speechSynthesisVoice() throws Exception { test("SpeechSynthesisVoice"); } @@ -10164,7 +10181,8 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function WebGL2RenderingContext() { [native code] }") + CHROME = "function WebGL2RenderingContext() { [native code] }", + FF52 = "function WebGL2RenderingContext() {\n [native code]\n}") public void webGL2RenderingContext() throws Exception { test("WebGL2RenderingContext"); } @@ -10212,7 +10230,8 @@ * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF52 = "function SpeechSynthesisErrorEvent() {\n [native code]\n}") public void speechSynthesisErrorEvent() throws Exception { test("SpeechSynthesisErrorEvent"); } @@ -10268,7 +10287,8 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function IIRFilterNode() { [native code] }") + CHROME = "function IIRFilterNode() { [native code] }", + FF52 = "function IIRFilterNode() {\n [native code]\n}") public void iirFilterNode() throws Exception { test("IIRFilterNode"); } @@ -10316,8 +10336,9 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function WebGLSync() { [native code] }") - @NotYetImplemented(CHROME) + CHROME = "function WebGLSync() { [native code] }", + FF52 = "function WebGLSync() {\n [native code]\n}") + @NotYetImplemented({CHROME, FF52}) public void webGLSync() throws Exception { test("WebGLSync"); } @@ -10402,8 +10423,9 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function WebGLTransformFeedback() { [native code] }") - @NotYetImplemented(CHROME) + CHROME = "function WebGLTransformFeedback() { [native code] }", + FF52 = "function WebGLTransformFeedback() {\n [native code]\n}") + @NotYetImplemented({CHROME, FF52}) public void webGLTransformFeedback() throws Exception { test("WebGLTransformFeedback"); } @@ -10413,8 +10435,9 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function WebGLQuery() { [native code] }") - @NotYetImplemented(CHROME) + CHROME = "function WebGLQuery() { [native code] }", + FF52 = "function WebGLQuery() {\n [native code]\n}") + @NotYetImplemented({CHROME, FF52}) public void webGLQuery() throws Exception { test("WebGLQuery"); } @@ -10499,8 +10522,9 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function WebGLVertexArrayObject() { [native code] }") - @NotYetImplemented(CHROME) + CHROME = "function WebGLVertexArrayObject() { [native code] }", + FF52 = "function WebGLVertexArrayObject() {\n [native code]\n}") + @NotYetImplemented({CHROME, FF52}) public void webGLVertexArrayObject() throws Exception { test("WebGLVertexArrayObject"); } @@ -10529,8 +10553,9 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function WebGLSampler() { [native code] }") - @NotYetImplemented(CHROME) + CHROME = "function WebGLSampler() { [native code] }", + FF52 = "function WebGLSampler() {\n [native code]\n}") + @NotYetImplemented({CHROME, FF52}) public void webGLSampler() throws Exception { test("WebGLSampler"); } @@ -10617,7 +10642,8 @@ */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function ConstantSourceNode() { [native code] }") + CHROME = "function ConstantSourceNode() { [native code] }", + FF52 = "function ConstantSourceNode() {\n [native code]\n}") public void constantSourceNode() throws Exception { test("ConstantSourceNode"); } @@ -10770,7 +10796,8 @@ * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF52 = "function FileSystemEntry() {\n [native code]\n}") public void fileSystemEntry() throws Exception { test("FileSystemEntry"); } @@ -10779,7 +10806,8 @@ * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF52 = "function FileSystemFileEntry() {\n [native code]\n}") public void fileSystemFileEntry() throws Exception { test("FileSystemFileEntry"); } @@ -10996,7 +11024,8 @@ * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF52 = "function FileSystemDirectoryEntry() {\n [native code]\n}") public void fileSystemDirectoryEntry() throws Exception { test("FileSystemDirectoryEntry"); } @@ -11050,7 +11079,8 @@ * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF52 = "function FileSystemDirectoryReader() {\n [native code]\n}") public void fileSystemDirectoryReader() throws Exception { test("FileSystemDirectoryReader"); } |
From: <asa...@us...> - 2017-04-16 08:10:54
|
Revision: 14118 http://sourceforge.net/p/htmlunit/code/14118 Author: asashour Date: 2017-04-16 08:10:51 +0000 (Sun, 16 Apr 2017) Log Message: ----------- add test case Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeListTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java 2017-04-15 20:03:57 UTC (rev 14117) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java 2017-04-16 08:10:51 UTC (rev 14118) @@ -100,7 +100,7 @@ } /** - * Returns an {@link Iterator} allowing to go through all keys contained in this object. + * Returns an {@link Iterator} allowing to go through all keys contained in this object. * @return an {@link Iterator} */ @JsxFunction({@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) @@ -115,7 +115,7 @@ } /** - * Returns an {@link Iterator} allowing to go through all keys contained in this object. + * Returns an {@link Iterator} allowing to go through all keys contained in this object. * @return an {@link Iterator} */ @JsxFunction({@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeListTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeListTest.java 2017-04-15 20:03:57 UTC (rev 14117) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeListTest.java 2017-04-16 08:10:51 UTC (rev 14118) @@ -102,4 +102,39 @@ loadPageWithAlerts2(html); } + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts(DEFAULT = {"[object HTMLHtmlElement] 0 [object NodeList] undefined", + "[object HTMLHeadElement] 1 [object NodeList] undefined", + "[object HTMLTitleElement] 2 [object NodeList] undefined", + "[object HTMLScriptElement] 3 [object NodeList] undefined", + "[object HTMLBodyElement] 4 [object NodeList] undefined", + "[object HTMLDivElement] 5 [object NodeList] undefined"}, + FF45 = "no forEach", + IE = "no forEach", + EDGE = "no forEach") + @NotYetImplemented({CHROME, FF52}) + public void forEach() throws Exception { + final String html = "<html><head><title>test</title>\n" + + "<script>\n" + + " function test() {\n" + + " var nodeList = document.querySelectorAll('*');\n" + + " if (nodeList.forEach) {\n" + + " nodeList.forEach(myFunction, 'something');\n" + + " } else {\n" + + " alert('no forEach');\n" + + " }\n" + + " }\n" + + " function myFunction(value, index, list, arg) {\n" + + " alert(value + ' ' + index + ' ' + list + ' ' + arg);\n" + + " }\n" + + "</script>\n" + + "</head><body onload='test()'>\n" + + " <div></div>\n" + + "</body></html>"; + + loadPageWithAlerts2(html); + } } |
From: <asa...@us...> - 2017-04-16 08:24:22
|
Revision: 14119 http://sourceforge.net/p/htmlunit/code/14119 Author: asashour Date: 2017-04-16 08:24:19 +0000 (Sun, 16 Apr 2017) Log Message: ----------- Implement NodeList.forEach Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeListTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java 2017-04-16 08:10:51 UTC (rev 14118) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java 2017-04-16 08:24:19 UTC (rev 14119) @@ -29,6 +29,9 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.WebBrowser; import com.gargoylesoftware.htmlunit.javascript.host.Iterator; +import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.Function; +import net.sourceforge.htmlunit.corejs.javascript.Scriptable; import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; /** @@ -105,8 +108,9 @@ */ @JsxFunction({@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) public Iterator keys() { + final int length = getElements().size(); final List<Integer> list = new ArrayList<>(); - for (int i = 0; i < getLength(); i++) { + for (int i = 0; i < length; i++) { list.add(i); } final Iterator object = new Iterator("Iterator", list.iterator()); @@ -120,12 +124,30 @@ */ @JsxFunction({@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) public Iterator values() { - final List<Object> list = new ArrayList<>(); - for (int i = 0; i < getLength(); i++) { - list.add(item(i)); - } + final List<DomNode> list = getElements(); final Iterator object = new Iterator("Iterator", list.iterator()); object.setParentScope(getParentScope()); return object; } + + /** + * Calls the {@code callback} given in parameter once for each value pair in the list, in insertion order. + * @param callback function to execute for each element + */ + @JsxFunction({@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) + public void forEach(final Object callback) { + final List<DomNode> nodes = getElements(); + final Context context = Context.enter(); + try { + final Function function = (Function) callback; + final Scriptable scope = getParentScope(); + for (int i = 0; i < nodes.size(); i++) { + function.call(context, scope, this, new Object[] { + nodes.get(i).getScriptableObject(), i, this}); + } + } + finally { + Context.exit(); + } + } } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeListTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeListTest.java 2017-04-16 08:10:51 UTC (rev 14118) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeListTest.java 2017-04-16 08:24:19 UTC (rev 14119) @@ -115,7 +115,6 @@ FF45 = "no forEach", IE = "no forEach", EDGE = "no forEach") - @NotYetImplemented({CHROME, FF52}) public void forEach() throws Exception { final String html = "<html><head><title>test</title>\n" + "<script>\n" |
From: <asa...@us...> - 2017-04-16 20:55:13
|
Revision: 14121 http://sourceforge.net/p/htmlunit/code/14121 Author: asashour Date: 2017-04-16 20:55:10 +0000 (Sun, 16 Apr 2017) Log Message: ----------- JavaScript: implement NodeList.entries(), keys(), values() and forEach() Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Iterator.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeListTest.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2017-04-16 08:59:17 UTC (rev 14120) +++ trunk/htmlunit/src/changes/changes.xml 2017-04-16 20:55:10 UTC (rev 14121) @@ -8,6 +8,9 @@ <body> <release version="2.27" date="???" description="GAE broken, Bugfixes"> + <action type="add" dev="asashour"> + JavaScript: implement NodeList.entries(), keys(), values() and forEach(). + </action> <action type="fix" dev="rbri" issue="1862"> Neko: fix handling of strange comment syntax supported by browsers </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Iterator.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Iterator.java 2017-04-16 08:59:17 UTC (rev 14120) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Iterator.java 2017-04-16 20:55:10 UTC (rev 14121) @@ -90,8 +90,8 @@ value = Undefined.instance; done = true; } - object.defineProperty("done", done, ScriptableObject.DONTENUM); - object.defineProperty("value", value, ScriptableObject.DONTENUM); + object.defineProperty("done", done, ScriptableObject.EMPTY); + object.defineProperty("value", value, ScriptableObject.EMPTY); return object; } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java 2017-04-16 08:59:17 UTC (rev 14120) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java 2017-04-16 20:55:10 UTC (rev 14121) @@ -131,6 +131,24 @@ } /** + * Returns an {@link Iterator} allowing to go through all key/value pairs contained in this object. + * @return an {@link Iterator} + */ + @JsxFunction({@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) + public Iterator entries() { + final List<DomNode> elements = getElements(); + + final List<Scriptable> list = new ArrayList<>(); + for (int i = 0; i < elements.size(); i++) { + final Object[] array = new Object[] {i, elements.get(i).getScriptableObject()}; + list.add(Context.getCurrentContext().newArray(getParentScope(), array)); + } + final Iterator object = new Iterator("Iterator", list.iterator()); + object.setParentScope(getParentScope()); + return object; + } + + /** * Calls the {@code callback} given in parameter once for each value pair in the list, in insertion order. * @param callback function to execute for each element */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeListTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeListTest.java 2017-04-16 08:59:17 UTC (rev 14120) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeListTest.java 2017-04-16 20:55:10 UTC (rev 14121) @@ -14,15 +14,11 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.dom; -import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.CHROME; -import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.FF52; - 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; import com.gargoylesoftware.htmlunit.html.HtmlPageTest; @@ -79,7 +75,6 @@ FF45 = "0,1,2,3,4,5,item,length", IE = "0,1,2,3,4,5,item,length", EDGE = "0,1,2,3,4,5,item,length") - @NotYetImplemented({CHROME, FF52}) public void iterator() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "<html><head><title>test</title>\n" + "<script>\n" @@ -136,4 +131,37 @@ loadPageWithAlerts2(html); } + + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts(DEFAULT = {"done", "value", "object", "0", "[object HTMLHtmlElement]"}, + FF45 = "not defined", + IE = "not defined", + EDGE = "not defined") + public void entries() throws Exception { + final String html = "<html><head><title>test</title>\n" + + "<script>\n" + + " function test() {\n" + + " var nodeList = document.querySelectorAll('*');\n" + + " if (!nodeList.entries) {\n" + + " alert('not defined');\n" + + " return;\n" + + " }\n" + + " var i = nodeList.entries().next();\n" + + " for (var x in i) {\n" + + " alert(x);\n" + + " }\n" + + " var v = i.value;\n" + + " alert(typeof v);\n" + + " alert(v[0]);\n" + + " alert(v[1]);\n" + + " }\n" + + "</script>\n" + + "</head><body onload='test()'>\n" + + "</body></html>\n"; + + loadPageWithAlerts2(html); + } } |
From: <rb...@us...> - 2017-04-17 07:57:53
|
Revision: 14127 http://sourceforge.net/p/htmlunit/code/14127 Author: rbri Date: 2017-04-17 07:57:50 +0000 (Mon, 17 Apr 2017) Log Message: ----------- FF52 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/File.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/File.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/File.java 2017-04-17 07:47:01 UTC (rev 14126) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/File.java 2017-04-17 07:57:50 UTC (rev 14127) @@ -96,7 +96,7 @@ * Returns the {@code webkitRelativePath} property. * @return the {@code webkitRelativePath} property */ - @JsxGetter(@WebBrowser(CHROME)) + @JsxGetter({@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) public String getWebkitRelativePath() { return ""; } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileTest.java 2017-04-17 07:47:01 UTC (rev 14126) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileTest.java 2017-04-17 07:57:50 UTC (rev 14127) @@ -44,8 +44,10 @@ @Alerts(CHROME = {"1", "ScriptExceptionTest1.txt", "Sun Jul 26 2015 16:21:47 GMT+0200 (Central European Summer Time)", "1437920507000", "", "14", "text/plain"}, - FF = {"1", "ScriptExceptionTest1.txt", "Sun Jul 26 2015 16:21:47 GMT+0200", + FF45 = {"1", "ScriptExceptionTest1.txt", "Sun Jul 26 2015 16:21:47 GMT+0200", "1437920507000", "undefined", "14", "text/plain"}, + FF52 = {"1", "ScriptExceptionTest1.txt", "Sun Jul 26 2015 16:21:47 GMT+0200", + "1437920507000", "", "14", "text/plain"}, IE = {"1", "ScriptExceptionTest1.txt", "Sun Jul 26 2015 16:21:47 GMT+0200 (Central European Summer Time)", "undefined", "undefined", "14", "text/plain"}) |
From: <rb...@us...> - 2017-04-17 08:15:58
|
Revision: 14128 http://sourceforge.net/p/htmlunit/code/14128 Author: rbri Date: 2017-04-17 08:15:55 +0000 (Mon, 17 Apr 2017) Log Message: ----------- FF52 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.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 2017-04-17 07:57:50 UTC (rev 14127) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-17 08:15:55 UTC (rev 14128) @@ -876,7 +876,7 @@ JS_FORM_USABLE_AS_FUNCTION, /** Indicates that function is defined even before its declaration, inside a block. */ - @BrowserFeature({@WebBrowser(CHROME), @WebBrowser(IE)}) + @BrowserFeature({@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52), @WebBrowser(IE)}) JS_FUNCTION_DECLARED_FORWARD_IN_BLOCK, /** Indicates if the method toSource exists on the native objects. */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine2Test.java 2017-04-17 07:57:50 UTC (rev 14127) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine2Test.java 2017-04-17 08:15:55 UTC (rev 14128) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript; import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.CHROME; +import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.FF52; import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.IE; import static org.junit.Assert.fail; @@ -130,7 +131,7 @@ */ @Test @Alerts(DEFAULT = {"in goo", "in hoo", "in foo"}, - FF = {"in goo", "in hoo", "foo error"}) + FF45 = {"in goo", "in hoo", "foo error"}) public void functionDeclaredForwardInBlock() throws Exception { final String html = "<html><head></head><body>\n" + "<script>\n" @@ -158,8 +159,9 @@ @Test @Alerts(DEFAULT = {"function foo() {}", "function foo() {}"}, CHROME = {"undefined", "function foo() {}"}, - FF = {"undefined", "foo error"}) - @NotYetImplemented({IE, CHROME}) + FF52 = {"undefined", "function foo() {}"}, + FF45 = {"undefined", "foo error"}) + @NotYetImplemented({IE, CHROME, FF52}) public void variableNotDefined() throws Exception { final String html = "<html><head></head><body>\n" + "<script>\n" |
From: <rb...@us...> - 2017-04-17 08:26:47
|
Revision: 14129 http://sourceforge.net/p/htmlunit/code/14129 Author: rbri Date: 2017-04-17 08:26:44 +0000 (Mon, 17 Apr 2017) Log Message: ----------- FF52 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/MessageEventTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-17 08:15:55 UTC (rev 14128) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-17 08:26:44 UTC (rev 14129) @@ -220,7 +220,7 @@ EVENT_ONLOAD_INTERNAL_JAVASCRIPT, /** MessageEvent default data value is null. */ - @BrowserFeature(@WebBrowser(CHROME)) + @BrowserFeature({@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) EVENT_ONMESSAGE_DEFAULT_DATA_NULL, /** Does not trigger "onmousedown" event handler for the select options. */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/MessageEventTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/MessageEventTest.java 2017-04-17 08:15:55 UTC (rev 14128) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/MessageEventTest.java 2017-04-17 08:26:44 UTC (rev 14129) @@ -52,7 +52,7 @@ */ @Test @Alerts(DEFAULT = {"[object MessageEvent]", "type-message", "false", "false", "null", "", "", "null"}, - FF = {"[object MessageEvent]", "type-message", "false", "false", "undefined", "", "", "null"}, + FF45 = {"[object MessageEvent]", "type-message", "false", "false", "undefined", "", "", "null"}, IE = "exception") public void create_ctor() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ |
From: <rb...@us...> - 2017-04-17 09:30:08
|
Revision: 14132 http://sourceforge.net/p/htmlunit/code/14132 Author: rbri Date: 2017-04-17 09:30:06 +0000 (Mon, 17 Apr 2017) Log Message: ----------- FF52 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTypeTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-17 09:20:53 UTC (rev 14131) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-17 09:30:06 UTC (rev 14132) @@ -151,7 +151,7 @@ DIALOGWINDOW_REFERER, /** DOCTYPE has undefined value for 'prefix'. */ - @BrowserFeature(@WebBrowser(CHROME)) + @BrowserFeature({@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) DOCTYPE_PREFIX_UNDEFINED, /** IE removes all child text nodes, but FF preserves the first. */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTypeTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTypeTest.java 2017-04-17 09:20:53 UTC (rev 14131) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTypeTest.java 2017-04-17 09:30:06 UTC (rev 14132) @@ -39,9 +39,12 @@ @Alerts(CHROME = {"[object DocumentType]", "true", "html,10,null,undefined,undefined,undefined", "html,-//W3C//DTD XHTML 1.0 Strict//EN,http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd," + "undefined,undefined,undefined"}, - FF = {"[object DocumentType]", "true", "html,10,null,null,null,null", + FF45 = {"[object DocumentType]", "true", "html,10,null,null,null,null", "html,-//W3C//DTD XHTML 1.0 Strict//EN,http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd," + "undefined,undefined,undefined"}, + FF52 = {"[object DocumentType]", "true", "html,10,null,undefined,undefined,undefined", + "html,-//W3C//DTD XHTML 1.0 Strict//EN,http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd," + + "undefined,undefined,undefined"}, IE = {"[object DocumentType]", "true", "html,10,null,null,null,null", "html,-//W3C//DTD XHTML 1.0 Strict//EN,http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd," + "null,null,null"}) @@ -78,8 +81,10 @@ @Test @Alerts(DEFAULT = {"[object DocumentType]", "greeting,10,null,undefined,undefined,undefined", "greeting,MyIdentifier,hello.dtd,undefined,undefined,undefined"}, - FF = {"[object DocumentType]", "greeting,10,null,null,null,null", + FF45 = {"[object DocumentType]", "greeting,10,null,null,null,null", "greeting,MyIdentifier,hello.dtd,undefined,undefined,undefined"}, + FF52 = {"[object DocumentType]", "greeting,10,null,undefined,undefined,undefined", + "greeting,MyIdentifier,hello.dtd,undefined,undefined,undefined"}, IE = {"[object DocumentType]", "greeting,10,null,null,null,null", "greeting,MyIdentifier,hello.dtd,null,null,null"}) public void doctype_xml() throws Exception { |
From: <rb...@us...> - 2017-04-17 15:45:11
|
Revision: 14137 http://sourceforge.net/p/htmlunit/code/14137 Author: rbri Date: 2017-04-17 15:45:08 +0000 (Mon, 17 Apr 2017) Log Message: ----------- next test is ready for real browsers (incl. IE11) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLSerializer.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEventTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLSerializerTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-17 14:53:55 UTC (rev 14136) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-17 15:45:08 UTC (rev 14137) @@ -1379,10 +1379,6 @@ @BrowserFeature(@WebBrowser(IE)) JS_XML_SERIALIZER_HTML_DOCUMENT_FRAGMENT_ALWAYS_EMPTY, - /** Indicates that new XMLSerializer().serializeToString(..) respects the XHTML definition for non empty tags. */ - @BrowserFeature({@WebBrowser(FF), @WebBrowser(CHROME)}) - JS_XML_SERIALIZER_NON_EMPTY_TAGS, - /** Indicates that <code>XMLSerializer.serializeToString(..)</code> serializes a single CDataSection as escaped * text instead of <code><![CDATA[xxx]]></code>. */ @BrowserFeature(@WebBrowser(IE)) Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLSerializer.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLSerializer.java 2017-04-17 14:53:55 UTC (rev 14136) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLSerializer.java 2017-04-17 15:45:08 UTC (rev 14137) @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML_SERIALIZER_BLANK_BEFORE_SELF_CLOSING; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML_SERIALIZER_HTML_DOCUMENT_FRAGMENT_ALWAYS_EMPTY; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML_SERIALIZER_NON_EMPTY_TAGS; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML_SERIALIZER_ROOT_CDATA_AS_ESCAPED_TEXT; import java.util.Arrays; @@ -207,8 +206,7 @@ } if (!startTagClosed) { final String tagName = nodeName.toLowerCase(Locale.ROOT); - final boolean nonEmptyTagsSupported = getBrowserVersion().hasFeature(JS_XML_SERIALIZER_NON_EMPTY_TAGS); - if (nonEmptyTagsSupported && NON_EMPTY_TAGS.contains(tagName)) { + if (NON_EMPTY_TAGS.contains(tagName)) { builder.append('>'); builder.append("</").append(nodeName).append('>'); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEventTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEventTest.java 2017-04-17 14:53:55 UTC (rev 14136) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEventTest.java 2017-04-17 15:45:08 UTC (rev 14137) @@ -16,6 +16,7 @@ import org.junit.Test; import org.junit.runner.RunWith; +import org.openqa.selenium.WebDriver; import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; @@ -32,13 +33,13 @@ private static final String DUMP_EVENT_FUNCTION = " function dump(event) {\n" + " if (event) {\n" - + " alert(event);\n" - + " alert(event.type);\n" - + " alert(event.bubbles);\n" - + " alert(event.cancelable);\n" - + " alert(event.returnValue);\n" + + " document.title += ' -' + event;\n" + + " document.title += ' -' + event.type;\n" + + " document.title += ' -' + event.bubbles;\n" + + " document.title += ' -' + event.cancelable;\n" + + " document.title += ' -' + event.returnValue;\n" + " } else {\n" - + " alert('no event');\n" + + " document.title += ' ' + 'no event';\n" + " }\n" + " }\n"; @@ -65,24 +66,25 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"[object BeforeUnloadEvent]", "", "true", "true", ""}, - FF = {"[object BeforeUnloadEvent]", "", "false", "false", ""}, - CHROME = {"[object BeforeUnloadEvent]", "beforeunload", "false", "true", ""}, + @Alerts(DEFAULT = {"-[object BeforeUnloadEvent]", "-", "-true", "-true", "-"}, + FF = {"-[object BeforeUnloadEvent]", "-", "-false", "-false", "-"}, + CHROME = {"-[object BeforeUnloadEvent]", "-beforeunload", "-false", "-true", "-"}, IE = "exception") public void create_createEvent() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "<html><head><title>foo</title><script>\n" + + "<html><head><script>\n" + " function test() {\n" + " try {\n" + " var event = document.createEvent('BeforeUnloadEvent');\n" + " dump(event);\n" - + " } catch (e) { alert('exception') }\n" + + " } catch (e) { document.title += 'exception' }\n" + " }\n" + DUMP_EVENT_FUNCTION + "</script></head><body onload='test()'>\n" + "</body></html>"; - loadPageWithAlerts2(html); + final WebDriver driver = loadPage2(html); + assertEquals(String.join(" ", getExpectedAlerts()), driver.getTitle()); } /** @@ -89,23 +91,24 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"[object BeforeUnloadEvent]", "beforeunload", "true", "false", ""}, + @Alerts(DEFAULT = {"-[object BeforeUnloadEvent]", "-beforeunload", "-true", "-false", "-"}, IE = "exception") public void initEvent() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "<html><head><title>foo</title><script>\n" + + "<html><head><script>\n" + " function test() {\n" + " try {\n" + " var event = document.createEvent('BeforeUnloadEvent');\n" + " event.initEvent('beforeunload', true, false);\n" + " dump(event);\n" - + " } catch (e) { alert('exception') }\n" + + " } catch (e) { document.title += 'exception' }\n" + " }\n" + DUMP_EVENT_FUNCTION + "</script></head><body onload='test()'>\n" + "</body></html>"; - loadPageWithAlerts2(html); + final WebDriver driver = loadPage2(html); + assertEquals(String.join(" ", getExpectedAlerts()), driver.getTitle()); } /** @@ -112,17 +115,17 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"[object BeforeUnloadEvent]", "beforeunload", "true", "false", ""}, + @Alerts(DEFAULT = {"-[object BeforeUnloadEvent]", "-beforeunload", "-true", "-false", "-"}, IE = "exception") public void dispatchEvent() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "<html><head><title>foo</title><script>\n" + + "<html><head><script>\n" + " function test() {\n" + " try {\n" + " var event = document.createEvent('BeforeUnloadEvent');\n" + " event.initEvent('beforeunload', true, false);\n" + " dispatchEvent(event);\n" - + " } catch (e) { alert('exception') }\n" + + " } catch (e) { document.title += 'exception' }\n" + " }\n" + DUMP_EVENT_FUNCTION + " window.onbeforeunload = dump;\n" @@ -129,7 +132,8 @@ + "</script></head><body onload='test()'>\n" + "</body></html>"; - loadPageWithAlerts2(html); + final WebDriver driver = loadPage2(html); + assertEquals(String.join(" ", getExpectedAlerts()), driver.getTitle()); } /** @@ -136,11 +140,11 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"[object Event]", "beforeunload", "true", "false", "undefined"}, - CHROME = {"[object Event]", "beforeunload", "true", "false", "true"}) + @Alerts(DEFAULT = {"-[object Event]", "-beforeunload", "-true", "-false", "-undefined"}, + CHROME = {"-[object Event]", "-beforeunload", "-true", "-false", "-true"}) public void dispatchEvent_event() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "<html><head><title>foo</title><script>\n" + + "<html><head><script>\n" + " function test() {\n" + " try {\n" + " var event = document.createEvent('Event');\n" @@ -153,7 +157,8 @@ + "</script></head><body onload='test()'>\n" + "</body></html>"; - loadPageWithAlerts2(html); + final WebDriver driver = loadPage2(html); + assertEquals(String.join(" ", getExpectedAlerts()), driver.getTitle()); } /** Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLSerializerTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLSerializerTest.java 2017-04-17 14:53:55 UTC (rev 14136) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLSerializerTest.java 2017-04-17 15:45:08 UTC (rev 14137) @@ -14,6 +14,8 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.xml; +import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.IE; + import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.By; @@ -281,8 +283,7 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "<textarea xmlns=\"http://www.w3.org/1999/xhtml\"></textarea>", - IE = "<textarea xmlns=\"http://www.w3.org/1999/xhtml\" />") + @Alerts("<textarea xmlns=\"http://www.w3.org/1999/xhtml\"></textarea>") public void mixedCase() throws Exception { final String html = "<html><head><title>foo</title><script>\n" + " function test() {\n" @@ -298,7 +299,7 @@ * @throws Exception if the test fails */ @Test - @Alerts({"<area xmlns=\"http://www.w3.org/1999/xhtml\" />", + @Alerts(DEFAULT = {"<area xmlns=\"http://www.w3.org/1999/xhtml\" />", "<base xmlns=\"http://www.w3.org/1999/xhtml\" />", "<basefont xmlns=\"http://www.w3.org/1999/xhtml\" />", "<br xmlns=\"http://www.w3.org/1999/xhtml\" />", @@ -305,7 +306,16 @@ "<hr xmlns=\"http://www.w3.org/1999/xhtml\" />", "<input xmlns=\"http://www.w3.org/1999/xhtml\" />", "<link xmlns=\"http://www.w3.org/1999/xhtml\" />", + "<meta xmlns=\"http://www.w3.org/1999/xhtml\" />"}, + IE = {"<area xmlns=\"http://www.w3.org/1999/xhtml\" />", + "<base xmlns=\"http://www.w3.org/1999/xhtml\" />", + "<basefont xmlns=\"http://www.w3.org/1999/xhtml\"></basefont>", + "<br xmlns=\"http://www.w3.org/1999/xhtml\" />", + "<hr xmlns=\"http://www.w3.org/1999/xhtml\" />", + "<input xmlns=\"http://www.w3.org/1999/xhtml\" />", + "<link xmlns=\"http://www.w3.org/1999/xhtml\" />", "<meta xmlns=\"http://www.w3.org/1999/xhtml\" />"}) + @NotYetImplemented(IE) public void noClosingTag() throws Exception { final String html = "<html><head><title>foo</title><script>\n" + " function test() {\n" @@ -359,16 +369,11 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"<div xmlns=\"http://www.w3.org/1999/xhtml\"></div>", + @Alerts({"<div xmlns=\"http://www.w3.org/1999/xhtml\"></div>", "<h1 xmlns=\"http://www.w3.org/1999/xhtml\"></h1>", "<p xmlns=\"http://www.w3.org/1999/xhtml\"></p>", "<li xmlns=\"http://www.w3.org/1999/xhtml\"></li>", - "<textarea xmlns=\"http://www.w3.org/1999/xhtml\"></textarea>"}, - IE = {"<div xmlns=\"http://www.w3.org/1999/xhtml\" />", - "<h1 xmlns=\"http://www.w3.org/1999/xhtml\" />", - "<p xmlns=\"http://www.w3.org/1999/xhtml\" />", - "<li xmlns=\"http://www.w3.org/1999/xhtml\" />", - "<textarea xmlns=\"http://www.w3.org/1999/xhtml\" />"}) + "<textarea xmlns=\"http://www.w3.org/1999/xhtml\"></textarea>"}) public void otherTags() throws Exception { final String html = "<html><head><title>foo</title><script>\n" + " function test() {\n" |
From: <asa...@us...> - 2017-04-20 06:46:06
|
Revision: 14138 http://sourceforge.net/p/htmlunit/code/14138 Author: asashour Date: 2017-04-20 06:46:04 +0000 (Thu, 20 Apr 2017) Log Message: ----------- JavaScript: fix setting .innerHTML Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2017-04-17 15:45:08 UTC (rev 14137) +++ trunk/htmlunit/src/changes/changes.xml 2017-04-20 06:46:04 UTC (rev 14138) @@ -8,6 +8,9 @@ <body> <release version="2.27" date="???" description="GAE broken, Bugfixes"> + <action type="fix" dev="asashour" issue="43482935" system="stackoverflow"> + JavaScript: fix setting .innerHTML. + </action> <action type="add" dev="asashour"> JavaScript: implement NodeList.entries(), keys(), values() and forEach(). </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java 2017-04-17 15:45:08 UTC (rev 14137) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java 2017-04-20 06:46:04 UTC (rev 14138) @@ -393,6 +393,8 @@ private Locator locator_; private final Deque<DomNode> stack_ = new ArrayDeque<>(); + /** Did the snippet tried to overwrite the start node? */ + private boolean snippetStartNodeOverwritten_; private DomNode currentNode_; private StringBuilder characters_; private HeadParsed headParsed_ = HeadParsed.NO; @@ -525,6 +527,10 @@ public void startElement(String namespaceURI, final String localName, String qName, final Attributes atts) throws SAXException { + if (snippetStartNodeOverwritten_) { + snippetStartNodeOverwritten_ = false; + return; + } handleCharacters(); String tagLower = localName.toLowerCase(Locale.ROOT); @@ -747,8 +753,15 @@ final String tagLower = localName.toLowerCase(Locale.ROOT); - if (page_.isParsingHtmlSnippet() && ("html".equals(tagLower) || "body".equals(tagLower))) { - return; + if (page_.isParsingHtmlSnippet()) { + if ("html".equals(tagLower) || "body".equals(tagLower)) { + return; + } + // stack_ size is 4 for snippet + if (stack_.size() < 5) { + snippetStartNodeOverwritten_ = true; + return; + } } if (parsingInnerHead_) { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java 2017-04-17 15:45:08 UTC (rev 14137) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java 2017-04-20 06:46:04 UTC (rev 14138) @@ -4671,4 +4671,30 @@ assertEquals(getExpectedAlerts()[0], webDriver.findElement(By.id("log")).getText()); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"<select id=\"myId\"><option>Two</option></select>"}) + public void innerHTML() throws Exception { + final String html = + HtmlPageTest.STANDARDS_MODE_PREFIX_ + + "<html>\n" + + "<head>\n" + + " <script>\n" + + " function test() {\n" + + " var select = document.getElementById('myId');\n" + + " select.innerHTML = \"<select id='myId2'><option>Two</option></select>\";\n" + + " alert(document.body.innerHTML.trim());\n" + + " }\n" + + " </script>\n" + + "</head>\n" + + "<body onload='test()'>\n" + + " <select id='myId'><option>One</option></select>\n" + + "</body>\n" + + "</html>"; + + loadPageWithAlerts2(html); + } + } |
From: <asa...@us...> - 2017-04-20 09:14:39
|
Revision: 14139 http://sourceforge.net/p/htmlunit/code/14139 Author: asashour Date: 2017-04-20 09:14:37 +0000 (Thu, 20 Apr 2017) Log Message: ----------- Fix build Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMImplementationTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java 2017-04-20 06:46:04 UTC (rev 14138) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java 2017-04-20 09:14:37 UTC (rev 14139) @@ -395,6 +395,7 @@ /** Did the snippet tried to overwrite the start node? */ private boolean snippetStartNodeOverwritten_; + private final int initialSize_; private DomNode currentNode_; private StringBuilder characters_; private HeadParsed headParsed_ = HeadParsed.NO; @@ -467,6 +468,7 @@ catch (final SAXException e) { throw new ObjectInstantiationException("unable to create HTML parser", e); } + initialSize_ = stack_.size(); } /** @@ -757,8 +759,7 @@ if ("html".equals(tagLower) || "body".equals(tagLower)) { return; } - // stack_ size is 4 for snippet - if (stack_.size() < 5) { + if (stack_.size() == initialSize_) { snippetStartNodeOverwritten_ = true; return; } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMImplementationTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMImplementationTest.java 2017-04-20 06:46:04 UTC (rev 14138) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMImplementationTest.java 2017-04-20 09:14:37 UTC (rev 14139) @@ -410,10 +410,6 @@ + " <title>foo</title>\n" + " <script>\n" + " function test() {\n" - + " if (!document.implementation.createHTMLDocument) {\n" - + " alert('createHTMLDocument not available'); return;\n" - + " }\n" - + " try {\n" + " var doc = document.implementation.createHTMLDocument();\n" + " alert(doc);\n" @@ -440,10 +436,6 @@ + " <title>foo</title>\n" + " <script>\n" + " function test() {\n" - + " if (!document.implementation.createHTMLDocument) {\n" - + " alert('createHTMLDocument not available'); return;\n" - + " }\n" - + " try {\n" + " var doc = document.implementation.createHTMLDocument('newdoctitle');\n" + " alert(doc);\n" @@ -470,10 +462,6 @@ + " <title>foo</title>\n" + " <script>\n" + " function test() {\n" - + " if (!document.implementation.createHTMLDocument) {\n" - + " alert('createHTMLDocument not available'); return;\n" - + " }\n" - + " try {\n" + " var doc = document.implementation.createHTMLDocument('');\n" + " alert(doc);\n" @@ -500,10 +488,6 @@ + " <title>foo</title>\n" + " <script>\n" + " function test() {\n" - + " if (!document.implementation.createHTMLDocument) {\n" - + " alert('createHTMLDocument not available'); return;\n" - + " }\n" - + " try {\n" + " var doc = document.implementation.createHTMLDocument('');\n" + " doc.body.innerHTML = '<form></form><form></form>';\n" @@ -530,10 +514,6 @@ + " <title>foo</title>\n" + " <script>\n" + " function test() {\n" - + " if (!document.implementation.createHTMLDocument) {\n" - + " alert('createHTMLDocument not available'); return;\n" - + " }\n" - + " try {\n" + " var doc = document.implementation.createHTMLDocument('');\n" + " var p = doc.createElement('p');\n" @@ -566,10 +546,6 @@ + " <title>foo</title>\n" + " <script>\n" + " function test() {\n" - + " if (!document.implementation.createHTMLDocument) {\n" - + " alert('createHTMLDocument not available'); return;\n" - + " }\n" - + " try {\n" + " var doc = document.implementation.createHTMLDocument();\n" + " alert(doc.documentElement.outerHTML);\n" Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java 2017-04-20 06:46:04 UTC (rev 14138) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java 2017-04-20 09:14:37 UTC (rev 14139) @@ -4675,7 +4675,7 @@ * @throws Exception if the test fails */ @Test - @Alerts({"<select id=\"myId\"><option>Two</option></select>"}) + @Alerts("<select id=\"myId\"><option>Two</option></select>") public void innerHTML() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ @@ -4697,4 +4697,29 @@ loadPageWithAlerts2(html); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("1") + public void innerHTMLGetElementsByTagName() throws Exception { + final String html = + HtmlPageTest.STANDARDS_MODE_PREFIX_ + + "<html>\n" + + "<head>\n" + + " <script>\n" + + " function test() {\n" + + " var div = document.createElement('div');\n" + + " div.innerHTML = \"<table></table><a href='/a'>a</a>\";\n" + + " alert(div.getElementsByTagName('a').length);\n" + + " }\n" + + " </script>\n" + + "</head>\n" + + "<body onload='test()'>\n" + + "</body>\n" + + "</html>"; + + loadPageWithAlerts2(html); + } + } |
From: <asa...@us...> - 2017-04-20 13:11:45
|
Revision: 14142 http://sourceforge.net/p/htmlunit/code/14142 Author: asashour Date: 2017-04-20 13:11:42 +0000 (Thu, 20 Apr 2017) Log Message: ----------- code style Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlScript.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlScript.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlScript.java 2017-04-20 11:37:57 UTC (rev 14141) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlScript.java 2017-04-20 13:11:42 UTC (rev 14142) @@ -250,7 +250,6 @@ jsDoc = (HTMLDocument2) Window2.getDocument(getPage().getEnclosingWindow().getGlobal()); ((HTMLDocument2) jsDoc).setExecutingDynamicExternalPosponed(getStartLineNumber() == -1 && getSrcAttribute() != ATTRIBUTE_NOT_DEFINED); - } try { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2017-04-20 11:37:57 UTC (rev 14141) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2017-04-20 13:11:42 UTC (rev 14142) @@ -129,7 +129,6 @@ /** * Verifies that properties added to <tt>Function.prototype</tt> are visible on <tt>window.onload</tt>. - * See bug 2318508. * @throws Exception if an error occurs */ @Test |
From: <rb...@us...> - 2017-04-20 20:24:36
|
Revision: 14143 http://sourceforge.net/p/htmlunit/code/14143 Author: rbri Date: 2017-04-20 20:24:33 +0000 (Thu, 20 Apr 2017) Log Message: ----------- document.baseURI calculation fixed for relative href Issue 1870 Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2017-04-20 13:11:42 UTC (rev 14142) +++ trunk/htmlunit/src/changes/changes.xml 2017-04-20 20:24:33 UTC (rev 14143) @@ -8,6 +8,9 @@ <body> <release version="2.27" date="???" description="GAE broken, Bugfixes"> + <action type="fix" dev="rbri" issue="1870" due-to="Joerg Werner"> + JavaScript: document.baseURI calculation fixed for relative href. + </action> <action type="fix" dev="asashour" issue="43482935" system="stackoverflow"> JavaScript: fix setting .innerHTML. </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2017-04-20 13:11:42 UTC (rev 14142) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2017-04-20 20:24:33 UTC (rev 14143) @@ -91,6 +91,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.event.Event2; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; import com.gargoylesoftware.htmlunit.protocol.javascript.JavaScriptURLConnection; +import com.gargoylesoftware.htmlunit.util.UrlUtils; import com.gargoylesoftware.js.nashorn.api.scripting.ScriptObjectMirror; import com.gargoylesoftware.js.nashorn.internal.objects.Global; import com.gargoylesoftware.js.nashorn.internal.runtime.ScriptFunction; @@ -2376,7 +2377,7 @@ baseUrl = new URL(String.format("%s%s", url.toString(), href)); } else { - baseUrl = new URL(String.format("%s/%s", url.toString(), href)); + baseUrl = new URL(UrlUtils.resolveUrl(url, href)); } } catch (final MalformedURLException e) { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java 2017-04-20 13:11:42 UTC (rev 14142) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java 2017-04-20 20:24:33 UTC (rev 14143) @@ -21,6 +21,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.fail; +import java.net.URL; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -2325,9 +2326,12 @@ @Alerts(DEFAULT = "§§URL§§", IE = "undefined") public void baseURI_noBaseTag() throws Exception { - final String html = "<html><body><script>\n" - + "alert(document.baseURI);\n" - + "</script></body></html>"; + final String html = "<html>\n" + + "<body>\n" + + "<script>\n" + + " alert(document.baseURI);\n" + + "</script>\n" + + "</body></html>"; loadPageWithAlerts2(html); } @@ -2339,12 +2343,14 @@ @Alerts(DEFAULT = "http://myotherwebsite.com/foo", IE = "undefined") public void baseURI_withBaseTag() throws Exception { - final String html = "<html><head>\n" - + "<base href='http://myotherwebsite.com/foo'>\n" - + "</head>\n" - + "<body><script>\n" - + "alert(document.baseURI);\n" - + "</script></body></html>"; + final String html = "<html>\n" + + "<head>\n" + + " <base href='http://myotherwebsite.com/foo'>\n" + + "</head>\n" + + "<body>\n" + + "<script>\n" + + " alert(document.baseURI);\n" + + "</script></body></html>"; loadPageWithAlerts2(html); } @@ -2356,11 +2362,13 @@ @Alerts(DEFAULT = "http://myotherwebsite.com/foo", IE = "undefined") public void baseURI_withBaseTagInBody() throws Exception { - final String html = "<html><body>\n" - + "<base href='http://myotherwebsite.com/foo'>\n" - + "<script>\n" - + "alert(document.baseURI);\n" - + "</script></body></html>"; + final String html = "<html>\n" + + "<body>\n" + + "<base href='http://myotherwebsite.com/foo'>\n" + + "<script>\n" + + " alert(document.baseURI);\n" + + "</script>\n" + + "</body></html>"; loadPageWithAlerts2(html); } @@ -2369,6 +2377,106 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = "http://localhost:12345/img/", + IE = "undefined") + public void baseURI_withBaseTag_absolutePath() throws Exception { + final String html = "<html>\n" + + "<head>\n" + + " <base href='/img/'>\n" + + "</head>\n" + + "<body>\n" + + "<script>\n" + + " alert(document.baseURI);\n" + + "</script>\n" + + "</body></html>"; + + loadPageWithAlerts2(html, new URL("http://localhost:12345/path/to/page.html")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "http://localhost:12345/path/to/img", + IE = "undefined") + public void baseURI_withBaseTag_relativePath() throws Exception { + final String html = "<html>\n" + + "<head>\n" + + " <base href='img'>\n" + + "</head>\n" + + "<body>\n" + + "<script>\n" + + " alert(document.baseURI);\n" + + "</script>\n" + + "</body></html>"; + + loadPageWithAlerts2(html, new URL("http://localhost:12345/path/to/page.html")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "http://localhost:12345/path/to/img/", + IE = "undefined") + public void baseURI_withBaseTag_relativePath_slash() throws Exception { + final String html = "<html>\n" + + "<head>\n" + + " <base href='img/'>\n" + + "</head>\n" + + "<body>\n" + + "<script>\n" + + " alert(document.baseURI);\n" + + "</script>\n" + + "</body></html>"; + + loadPageWithAlerts2(html, new URL("http://localhost:12345/path/to/page.html")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "http://localhost:12345/path/img", + IE = "undefined") + public void baseURI_withBaseTag_relativePath_parent() throws Exception { + final String html = "<html>\n" + + "<head>\n" + + " <base href='../img'>\n" + + "</head>\n" + + "<body>\n" + + "<script>\n" + + " alert(document.baseURI);\n" + + "</script>\n" + + "</body></html>"; + + loadPageWithAlerts2(html, new URL("http://localhost:12345/path/to/page.html")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "http://localhost:12345/img", + IE = "undefined") + public void baseURI_withBaseTag_relativePath_strange() throws Exception { + final String html = "<html>\n" + + "<head>\n" + + " <base href='../../../../img'>\n" + + "</head>\n" + + "<body>\n" + + "<script>\n" + + " alert(document.baseURI);\n" + + "</script>\n" + + "</body></html>"; + + loadPageWithAlerts2(html, new URL("http://localhost:12345/path/to/page.html")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts("true") @NotYetImplemented public void hasFocus() throws Exception { |
From: <asa...@us...> - 2017-04-21 09:24:00
|
Revision: 14145 http://sourceforge.net/p/htmlunit/code/14145 Author: asashour Date: 2017-04-21 09:23:57 +0000 (Fri, 21 Apr 2017) Log Message: ----------- hu3: fix 'this' Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DomNamespaceNode.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptionsCollection.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFormTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElementTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DomNamespaceNode.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DomNamespaceNode.java 2017-04-20 20:35:59 UTC (rev 14144) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DomNamespaceNode.java 2017-04-21 09:23:57 UTC (rev 14145) @@ -118,9 +118,9 @@ return qualifiedName_; } - /** - * {@inheritDoc} - */ + /** + * {@inheritDoc} + */ @Override public void processImportNode(final Document doc) { super.processImportNode(doc); Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2017-04-20 20:35:59 UTC (rev 14144) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2017-04-21 09:23:57 UTC (rev 14145) @@ -83,6 +83,7 @@ import com.gargoylesoftware.htmlunit.javascript.PostponedAction; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.host.Window; +import com.gargoylesoftware.htmlunit.javascript.host.Window2; import com.gargoylesoftware.htmlunit.javascript.host.dom.Node; import com.gargoylesoftware.htmlunit.javascript.host.dom.Node2; import com.gargoylesoftware.htmlunit.javascript.host.event.BeforeUnloadEvent; @@ -731,33 +732,33 @@ return Collections.unmodifiableList(list); } - /** - * Returns a list of all elements that are tabbable in the order that will - * be used for tabbing.<p> - * - * The rules for determining tab order are as follows: - * <ol> - * <li>Those elements that support the tabindex attribute and assign a - * positive value to it are navigated first. Navigation proceeds from the - * element with the lowest tabindex value to the element with the highest - * value. Values need not be sequential nor must they begin with any - * particular value. Elements that have identical tabindex values should - * be navigated in the order they appear in the character stream. - * <li>Those elements that do not support the tabindex attribute or - * support it and assign it a value of "0" are navigated next. These - * elements are navigated in the order they appear in the character - * stream. - * <li>Elements that are disabled do not participate in the tabbing - * order. - * </ol> - * Additionally, the value of tabindex must be within 0 and 32767. Any - * values outside this range will be ignored.<p> - * - * The following elements support the <tt>tabindex</tt> attribute: A, AREA, BUTTON, - * INPUT, OBJECT, SELECT, and TEXTAREA.<p> - * - * @return all the tabbable elements in proper tab order - */ + /** + * Returns a list of all elements that are tabbable in the order that will + * be used for tabbing.<p> + * + * The rules for determining tab order are as follows: + * <ol> + * <li>Those elements that support the tabindex attribute and assign a + * positive value to it are navigated first. Navigation proceeds from the + * element with the lowest tabindex value to the element with the highest + * value. Values need not be sequential nor must they begin with any + * particular value. Elements that have identical tabindex values should + * be navigated in the order they appear in the character stream. + * <li>Those elements that do not support the tabindex attribute or + * support it and assign it a value of "0" are navigated next. These + * elements are navigated in the order they appear in the character + * stream. + * <li>Elements that are disabled do not participate in the tabbing + * order. + * </ol> + * Additionally, the value of tabindex must be within 0 and 32767. Any + * values outside this range will be ignored.<p> + * + * The following elements support the <tt>tabindex</tt> attribute: A, AREA, BUTTON, + * INPUT, OBJECT, SELECT, and TEXTAREA.<p> + * + * @return all the tabbable elements in proper tab order + */ public List<HtmlElement> getTabbableElements() { final List<HtmlElement> tabbableElements = new ArrayList<>(); for (final HtmlElement element : getHtmlElementDescendants()) { @@ -2599,8 +2600,11 @@ } private ScriptResult executeJavaScriptFunction(final ScriptFunction function, - final ScriptObject thisObject, final Object[] args, final DomNode htmlElementScope) { + ScriptObject thisObject, final Object[] args, final DomNode htmlElementScope) { + if (thisObject instanceof Window2) { + thisObject = ((Window2) thisObject).getGlobal(); + } final ScriptFunction functionToCall; if (":program".equals(function.getName()) && args.length != 0) { ScriptRuntime.apply(function, thisObject); @@ -2617,7 +2621,9 @@ if (globalChanged) { com.gargoylesoftware.js.nashorn.internal.runtime.Context.setGlobal(global); } - thisObject.addBoundProperties(global); + if (!(thisObject instanceof Global)) { + thisObject.addBoundProperties(global); + } final Object result = ScriptRuntime.apply(functionToCall, thisObject, args); getWebClient().getJavaScriptEngine().processPostponedActions(); return new ScriptResult(result, getWebClient().getCurrentWindow().getEnclosedPage()); Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptionsCollection.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptionsCollection.java 2017-04-20 20:35:59 UTC (rev 14144) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptionsCollection.java 2017-04-21 09:23:57 UTC (rev 14145) @@ -194,11 +194,11 @@ } } - /** - * Returns the number of elements in this array. - * - * @return the number of elements in the array - */ + /** + * Returns the number of elements in this array. + * + * @return the number of elements in the array + */ @JsxGetter public int getLength() { return htmlSelect_.getOptionSize(); Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFormTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFormTest.java 2017-04-20 20:35:59 UTC (rev 14144) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFormTest.java 2017-04-21 09:23:57 UTC (rev 14145) @@ -652,9 +652,9 @@ assertEquals(expectedParameters, collectedParameters); } - /** - * @throws Exception if the test fails - */ + /** + * @throws Exception if the test fails + */ @Test public void submit_IgnoresDisabledControls() throws Exception { final String html Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java 2017-04-20 20:35:59 UTC (rev 14144) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java 2017-04-21 09:23:57 UTC (rev 14145) @@ -914,7 +914,7 @@ loadPageWithAlerts2(html); } - /** + /** * @throws Exception if the test fails */ @Test @@ -1237,7 +1237,7 @@ } /** - * Verifies that the onload handler is executed with "this" referring to the window. + * Verifies that the {@code onload} handler is executed with {@code this} referring to the window. * * @throws Exception if an error occurs */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java 2017-04-20 20:35:59 UTC (rev 14144) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java 2017-04-21 09:23:57 UTC (rev 14145) @@ -1688,7 +1688,7 @@ loadPageWithAlerts2(html); } - /** + /** * Test the removal of behaviors. * * @throws Exception if the test fails Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElementTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElementTest.java 2017-04-20 20:35:59 UTC (rev 14144) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElementTest.java 2017-04-21 09:23:57 UTC (rev 14145) @@ -424,7 +424,7 @@ loadPageWithAlerts2(html); } - /** + /** * Test that image's width and height are numbers. * @throws Exception if the test fails */ |
From: <asa...@us...> - 2017-04-21 10:31:29
|
Revision: 14146 http://sourceforge.net/p/htmlunit/code/14146 Author: asashour Date: 2017-04-21 10:31:27 +0000 (Fri, 21 Apr 2017) Log Message: ----------- trivial Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window2.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2017-04-21 09:23:57 UTC (rev 14145) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2017-04-21 10:31:27 UTC (rev 14146) @@ -1101,7 +1101,6 @@ public Object getOnload() { final Object onload = getHandlerForJavaScript("load"); if (onload == null) { - // NB: for IE, the onload of window is the one of the body element but not for Mozilla. final HtmlPage page = (HtmlPage) getWebWindow().getEnclosedPage(); final HtmlElement body = page.getBody(); if (body != null) { Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window2.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window2.java 2017-04-21 09:23:57 UTC (rev 14145) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window2.java 2017-04-21 10:31:27 UTC (rev 14146) @@ -356,7 +356,6 @@ final Window2 window = getWindow(self); final Object onload = window.getHandlerForJavaScript("load"); if (onload == null) { - // NB: for IE, the onload of window is the one of the body element but not for Mozilla. final HtmlPage page = (HtmlPage) window.getWebWindow().getEnclosedPage(); final HtmlElement body = page.getBody(); if (body != null) { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java 2017-04-21 09:23:57 UTC (rev 14145) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java 2017-04-21 10:31:27 UTC (rev 14146) @@ -948,7 +948,7 @@ /** * Verifies that you can set window.onload to something else than a function. - * See bug 1708532 & 1201561. + * * @throws Exception if an error occurs */ @Test |
From: <rb...@us...> - 2017-04-21 19:49:35
|
Revision: 14154 http://sourceforge.net/p/htmlunit/code/14154 Author: rbri Date: 2017-04-21 19:49:33 +0000 (Fri, 21 Apr 2017) Log Message: ----------- next test is ready for real browsers Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormatTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java 2017-04-21 18:47:03 UTC (rev 14153) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java 2017-04-21 19:49:33 UTC (rev 14154) @@ -44,6 +44,7 @@ public class DateTimeFormat extends SimpleScriptable { private static Map<String, String> FF_45_FORMATS_ = new HashMap<>(); + private static Map<String, String> FF_52_FORMATS_ = new HashMap<>(); private static Map<String, String> CHROME_FORMATS_ = new HashMap<>(); private static Map<String, String> IE_FORMATS_ = new HashMap<>(); @@ -66,6 +67,7 @@ FF_45_FORMATS_.put("", mmSlash); FF_45_FORMATS_.put("ar", "dd\u200F/MM\u200F/YYYY"); + FF_45_FORMATS_.put("ban", ddDot); FF_45_FORMATS_.put("be", ddDot); FF_45_FORMATS_.put("bg", ddDot + "\u200E \u0433."); FF_45_FORMATS_.put("ca", ddSlash); @@ -140,6 +142,14 @@ FF_45_FORMATS_.put("sr", ddDotDot); FF_45_FORMATS_.put("sq", ddDot); + FF_52_FORMATS_.putAll(FF_45_FORMATS_); + FF_52_FORMATS_.put("fr", ddSlash); + FF_52_FORMATS_.put("hr", ddDotBlankDot); + FF_52_FORMATS_.put("fr-CH", ddDot); + FF_52_FORMATS_.put("lv", yyyyDotDot); + FF_52_FORMATS_.put("mt", ddSlash); + FF_52_FORMATS_.put("nl-BE", ddSlash); + CHROME_FORMATS_.put("be", yyyyDash); CHROME_FORMATS_.put("en-CA", yyyyDash); CHROME_FORMATS_.put("en-IE", mmSlash); @@ -149,14 +159,15 @@ CHROME_FORMATS_.put("es-PA", ddSlash); CHROME_FORMATS_.put("es-PR", ddSlash); CHROME_FORMATS_.put("es-US", ddSlash); - CHROME_FORMATS_.put("hr", ddDotDot); - CHROME_FORMATS_.put("in", mmSlash); + CHROME_FORMATS_.put("fr", ddSlash); + CHROME_FORMATS_.put("fr-CH", ddDot); + CHROME_FORMATS_.put("hr", ddDotBlankDot); + CHROME_FORMATS_.put("in", ddDot); CHROME_FORMATS_.put("in-ID", ddSlash); - CHROME_FORMATS_.put("in", mmSlash); CHROME_FORMATS_.put("is", yyyyDash); - CHROME_FORMATS_.put("iw", mmSlash); - CHROME_FORMATS_.put("iw-IL", ddDot); + CHROME_FORMATS_.put("iw", ddDot); CHROME_FORMATS_.put("ja-JP-u-ca-japanese", "平成yy/MM/dd"); + CHROME_FORMATS_.put("lv", yyyyDotDot); CHROME_FORMATS_.put("sk", ddDotBlank); CHROME_FORMATS_.put("sq", yyyyDash); CHROME_FORMATS_.put("sr", ddDotDot); @@ -180,6 +191,7 @@ IE_FORMATS_.put("ar-SD", rightToLeft); IE_FORMATS_.put("ar-SY", rightToLeft); IE_FORMATS_.put("ar-YE", rightToLeft); + IE_FORMATS_.put("ban", mmSlash); IE_FORMATS_.put("cs", ddDot); IE_FORMATS_.put("da", ddDash); IE_FORMATS_.put("en-IN", ddDash); @@ -230,6 +242,9 @@ else if (browserVersion.isIE()) { formats = IE_FORMATS_; } + else if (browserVersion.isFirefox() && browserVersion.getBrowserVersionNumeric() > 45) { + formats = FF_52_FORMATS_; + } else { formats = FF_45_FORMATS_; } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormatTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormatTest.java 2017-04-21 18:47:03 UTC (rev 14153) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormatTest.java 2017-04-21 19:49:33 UTC (rev 14154) @@ -102,7 +102,7 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "12/20/2012", + @Alerts(DEFAULT = "20.12.2012", IE = "\u200E12\u200E/\u200E20\u200E/\u200E2012") public void format_ban() throws Exception { test("new Intl.DateTimeFormat('ban').format(date)"); @@ -172,7 +172,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "", + @Alerts(DEFAULT = "n. Chr. Donnerstag", + FF45 = "", IE = "\u200EDonnerstag") @NotYetImplemented public void format_weekday_long_weekday_era() throws Exception { @@ -196,7 +197,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "", + @Alerts(DEFAULT = "2012 n. Chr. Donnerstag", + FF45 = "", IE = "\u200EDonnerstag\u200E," + " \u200E20\u200E. \u200EDezember\u200E \u200E2012\u200E \u200E04\u200E:\u200E00\u200E:\u200E00") @NotYetImplemented @@ -209,7 +211,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "", + @Alerts(DEFAULT = "Dezember 2012 n. Chr. Donnerstag", + FF45 = "", IE = "\u200EDonnerstag\u200E," + " \u200E20\u200E. \u200EDezember\u200E \u200E2012\u200E \u200E04\u200E:\u200E00\u200E:\u200E00") @NotYetImplemented @@ -1060,7 +1063,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "20/12/2012", + @Alerts(DEFAULT = "20.12.2012", + FF45 = "20/12/2012", IE = "\u200E20\u200E.\u200E12\u200E.\u200E2012") public void format_fr_ch() throws Exception { test("new Intl.DateTimeFormat('fr-CH').format(date)"); @@ -1122,7 +1126,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "20.12.2012.", + @Alerts(DEFAULT = "20. 12. 2012.", + FF45 = "20.12.2012.", IE = "\u200E20\u200E.\u200E12\u200E.\u200E2012\u200E.") public void format_hr() throws Exception { test("new Intl.DateTimeFormat('hr').format(date)"); @@ -1132,7 +1137,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "20.12.2012.", + @Alerts(DEFAULT = "20. 12. 2012.", + FF45 = "20.12.2012.", IE = "\u200E20\u200E.\u200E12\u200E.\u200E2012\u200E.") public void format_hr_hr() throws Exception { test("new Intl.DateTimeFormat('hr-HR').format(date)"); @@ -1163,7 +1169,7 @@ */ @Test @Alerts(DEFAULT = "20/12/2012", - CHROME = "12/20/2012", + CHROME = "20.12.2012", IE = "\u200E20\u200E/\u200E12\u200E/\u200E2012") public void format_in() throws Exception { test("new Intl.DateTimeFormat('in').format(date)"); @@ -1235,8 +1241,7 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "12/20/2012", - FF = "20.12.2012", + @Alerts(DEFAULT = "20.12.2012", IE = "\u200E20\u200E/\u200E12\u200E/\u200E2012") public void format_iw() throws Exception { test("new Intl.DateTimeFormat('iw').format(date)"); @@ -1316,7 +1321,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "20.12.2012.", + @Alerts(DEFAULT = "2012.12.20.", + FF45 = "20.12.2012.", IE = "\u200E2012\u200E.\u200E12\u200E.\u200E20\u200E.") public void format_lv() throws Exception { test("new Intl.DateTimeFormat('lv').format(date)"); @@ -1326,7 +1332,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "20.12.2012.", + @Alerts(DEFAULT = "2012.12.20.", + FF45 = "20.12.2012.", IE = "\u200E2012\u200E.\u200E12\u200E.\u200E20\u200E.") public void format_lv_lv() throws Exception { test("new Intl.DateTimeFormat('lv-LV').format(date)"); @@ -1379,6 +1386,7 @@ */ @Test @Alerts(DEFAULT = "2012-12-20", + FF52 = "20/12/2012", IE = "\u200E20\u200E/\u200E12\u200E/\u200E2012") public void format_mt() throws Exception { test("new Intl.DateTimeFormat('mt').format(date)"); @@ -1389,6 +1397,7 @@ */ @Test @Alerts(DEFAULT = "2012-12-20", + FF52 = "20/12/2012", IE = "\u200E20\u200E/\u200E12\u200E/\u200E2012") public void format_mt_mt() throws Exception { test("new Intl.DateTimeFormat('mt-MT').format(date)"); @@ -1409,6 +1418,7 @@ */ @Test @Alerts(DEFAULT = "20-12-2012", + FF52 = "20/12/2012", IE = "\u200E20\u200E/\u200E12\u200E/\u200E2012") public void format_nl_be() throws Exception { test("new Intl.DateTimeFormat('nl-BE').format(date)"); |
From: <asa...@us...> - 2017-04-21 22:39:03
|
Revision: 14160 http://sourceforge.net/p/htmlunit/code/14160 Author: asashour Date: 2017-04-21 22:39:00 +0000 (Fri, 21 Apr 2017) Log Message: ----------- Latest Chrome Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java 2017-04-21 22:28:24 UTC (rev 14159) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java 2017-04-21 22:39:00 UTC (rev 14160) @@ -67,7 +67,7 @@ numeric = 13; } else if (isChrome) { - numeric = 57; + numeric = 58; } pre.innerHTML = pre.innerHTML.replace('NUMERIC', numeric); var browser = "FIREFOX_52"; @@ -141,10 +141,10 @@ /** Latest Chrome. */ public static final BrowserVersion CHROME = new BrowserVersion( NETSCAPE, "5.0 (Windows NT 6.1) AppleWebKit/537.36" - + " (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36", + + " (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36" - + " (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36", - 57, "Chrome", null); + + " (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36", + 58, "Chrome", null); /** Microsoft Edge. Work In Progress!!! */ public static final BrowserVersion EDGE = new BrowserVersion( Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionTest.java 2017-04-21 22:28:24 UTC (rev 14159) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionTest.java 2017-04-21 22:39:00 UTC (rev 14160) @@ -34,7 +34,7 @@ assertEquals(45, BrowserVersion.FIREFOX_45.getBrowserVersionNumeric()); assertEquals(52, BrowserVersion.FIREFOX_52.getBrowserVersionNumeric()); assertEquals(11, BrowserVersion.INTERNET_EXPLORER.getBrowserVersionNumeric()); - assertEquals(57, BrowserVersion.CHROME.getBrowserVersionNumeric()); + assertEquals(58, BrowserVersion.CHROME.getBrowserVersionNumeric()); assertEquals(13, BrowserVersion.EDGE.getBrowserVersionNumeric()); } |
From: Ronald B. <rb...@rb...> - 2017-04-22 07:12:16
|
>Latest Chrome Working on this already - again a lot of changes required to be back in sync RBRi -------------------------- WETATOR Smart web application testing http://www.wetator.org |
From: <rb...@us...> - 2017-04-22 09:21:44
|
Revision: 14164 http://sourceforge.net/p/htmlunit/code/14164 Author: rbri Date: 2017-04-22 09:21:42 +0000 (Sat, 22 Apr 2017) Log Message: ----------- latest CHROME Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEvent.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEventTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-22 09:06:39 UTC (rev 14163) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-22 09:21:42 UTC (rev 14164) @@ -158,10 +158,6 @@ @BrowserFeature(@WebBrowser(IE)) DOM_NORMALIZE_REMOVE_CHILDREN, - /** <code>BeforeUnloadEvent</code> automatically gets the <code>type</code> 'beforeunload'. */ - @BrowserFeature(@WebBrowser(CHROME)) - EVENT_BEFOREUNLOAD_AUTO_TYPE, - /** Chrome maintains a separate state for this. */ @BrowserFeature(@WebBrowser(CHROME)) EVENT_CANCEL_BUBBLE, Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEvent.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEvent.java 2017-04-22 09:06:39 UTC (rev 14163) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEvent.java 2017-04-22 09:21:42 UTC (rev 14164) @@ -14,7 +14,6 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.event; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_BEFOREUNLOAD_AUTO_TYPE; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; @@ -70,19 +69,6 @@ } /** - * {@inheritDoc} - */ - @Override - public void eventCreated() { - super.eventCreated(); - - if (getBrowserVersion().hasFeature(EVENT_BEFOREUNLOAD_AUTO_TYPE)) { - setEventType(TYPE_BEFORE_UNLOAD); - setCancelable(true); - } - } - - /** * Returns the return value associated with the event. * @return the return value associated with the event */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEventTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEventTest.java 2017-04-22 09:06:39 UTC (rev 14163) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEventTest.java 2017-04-22 09:21:42 UTC (rev 14164) @@ -66,9 +66,7 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"-[object BeforeUnloadEvent]", "-", "-true", "-true", "-"}, - FF = {"-[object BeforeUnloadEvent]", "-", "-false", "-false", "-"}, - CHROME = {"-[object BeforeUnloadEvent]", "-beforeunload", "-false", "-true", "-"}, + @Alerts(DEFAULT = {"-[object BeforeUnloadEvent]", "-", "-false", "-false", "-"}, IE = "exception") public void create_createEvent() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ |
From: <rb...@us...> - 2017-04-22 09:35:16
|
Revision: 14166 http://sourceforge.net/p/htmlunit/code/14166 Author: rbri Date: 2017-04-22 09:35:14 +0000 (Sat, 22 Apr 2017) Log Message: ----------- latest CHROME Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-22 09:26:40 UTC (rev 14165) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-22 09:35:14 UTC (rev 14166) @@ -147,7 +147,7 @@ CSS_ZINDEX_TYPE_INTEGER, /** Add the 'Referer' header to a request triggered by window.showModalDialog. */ - @BrowserFeature(@WebBrowser(FF)) + @BrowserFeature({@WebBrowser(CHROME), @WebBrowser(FF)}) DIALOGWINDOW_REFERER, /** DOCTYPE has undefined value for 'prefix'. */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java 2017-04-22 09:26:40 UTC (rev 14165) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window3Test.java 2017-04-22 09:35:14 UTC (rev 14166) @@ -1093,7 +1093,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(FF = "§§URL§§") + @Alerts(DEFAULT = "§§URL§§", + IE = {}) public void openWindow_refererHeader() throws Exception { final String firstContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "<html><head></head>\n" |
From: <rb...@us...> - 2017-04-22 09:38:16
|
Revision: 14167 http://sourceforge.net/p/htmlunit/code/14167 Author: rbri Date: 2017-04-22 09:38:13 +0000 (Sat, 22 Apr 2017) Log Message: ----------- latest CHROME Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCStatsReport.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCStatsReport.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCStatsReport.java 2017-04-22 09:35:14 UTC (rev 14166) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCStatsReport.java 2017-04-22 09:38:13 UTC (rev 14167) @@ -14,6 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.media.rtc; +import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -26,7 +27,7 @@ * * @author Ahmed Ashour */ -@JsxClass(browsers = @WebBrowser(FF)) +@JsxClass(browsers = {@WebBrowser(CHROME), @WebBrowser(FF)}) public class RTCStatsReport extends SimpleScriptable { /** Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java 2017-04-22 09:35:14 UTC (rev 14166) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java 2017-04-22 09:38:13 UTC (rev 14167) @@ -10375,6 +10375,7 @@ */ @Test @Alerts(DEFAULT = "exception", + CHROME = "function RTCStatsReport() { [native code] }", FF = "function RTCStatsReport() {\n [native code]\n}") public void rtcStatsReport() throws Exception { test("RTCStatsReport"); |
From: <rb...@us...> - 2017-04-22 10:29:50
|
Revision: 14168 http://sourceforge.net/p/htmlunit/code/14168 Author: rbri Date: 2017-04-22 10:29:47 +0000 (Sat, 22 Apr 2017) Log Message: ----------- latest CHROME Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectableTextSelectionDelegate.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInputTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea2Test.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextInputTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/SelectionTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-22 09:38:13 UTC (rev 14167) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-22 10:29:47 UTC (rev 14168) @@ -957,6 +957,10 @@ @BrowserFeature({@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) JS_INNER_TEXT_VALUE_NULL, + /** Chrome ignores negative selection starts. */ + @BrowserFeature(@WebBrowser(CHROME)) + JS_INPUT_IGNORE_NEGATIVE_SELECTION_START, + /** Chrome throws an error if using selectionStart/selectionEnd. */ @BrowserFeature(@WebBrowser(CHROME)) JS_INPUT_NUMBER_NO_SELECTION, Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectableTextSelectionDelegate.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectableTextSelectionDelegate.java 2017-04-22 09:38:13 UTC (rev 14167) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectableTextSelectionDelegate.java 2017-04-22 10:29:47 UTC (rev 14168) @@ -14,6 +14,8 @@ */ package com.gargoylesoftware.htmlunit.html.impl; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_IGNORE_NEGATIVE_SELECTION_START; + import org.w3c.dom.ranges.Range; /** @@ -75,6 +77,12 @@ */ @Override public void setSelectionStart(int selectionStart) { + if (selectionStart < 0 + && element_.getPage().getEnclosingWindow().getWebClient() + .getBrowserVersion().hasFeature(JS_INPUT_IGNORE_NEGATIVE_SELECTION_START)) { + return; + } + final int length = element_.getText().length(); selectionStart = Math.max(0, Math.min(selectionStart, length)); selection_.setStart(element_, selectionStart); Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInputTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInputTest.java 2017-04-22 09:38:13 UTC (rev 14167) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInputTest.java 2017-04-22 10:29:47 UTC (rev 14168) @@ -529,6 +529,7 @@ */ @Test @Alerts(DEFAULT = {"0,0", "11,11", "0,11", "0,11"}, + CHROME = {"0,0", "11,11", "11,11", "11,11"}, IE = {"0,0", "0,0", "0,0", "0,11"}) public void selection2_2() throws Exception { selection2(-3, 15); Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea2Test.java 2017-04-22 09:38:13 UTC (rev 14167) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea2Test.java 2017-04-22 10:29:47 UTC (rev 14168) @@ -203,6 +203,7 @@ */ @Test @Alerts(DEFAULT = {"0,0", "11,11", "0,11", "0,11"}, + CHROME = {"0,0", "11,11", "11,11", "11,11"}, FF52 = {"7,7", "11,11", "0,11", "0,11"}, IE = {"0,0", "0,0", "0,0", "0,11"}) public void selection2_2() throws Exception { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextInputTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextInputTest.java 2017-04-22 09:38:13 UTC (rev 14167) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextInputTest.java 2017-04-22 10:29:47 UTC (rev 14168) @@ -528,6 +528,7 @@ */ @Test @Alerts(DEFAULT = {"0,0", "11,11", "0,11", "0,11"}, + CHROME = {"0,0", "11,11", "11,11", "11,11"}, IE = {"0,0", "0,0", "0,0", "0,11"}) public void selection2_2() throws Exception { selection2(-3, 15); 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 2017-04-22 09:38:13 UTC (rev 14167) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/SelectionTest.java 2017-04-22 10:29:47 UTC (rev 14168) @@ -91,7 +91,7 @@ "2:s2/0/s2/1/false/undefined/1/xyz/xyz"}, CHROME = { "1:null/0/null/0/true/None/0/", - "2:[object Text]/0/[object Text]/3/false/Range/1/xyz/xyz"}) + "2:s2/0/s2/1/false/Range/1/xyz/xyz"}) @NotYetImplemented(CHROME) public void selectAllChildren() throws Exception { final String jsSnippet = "" @@ -112,10 +112,10 @@ "3:s2/0/s3/2/false/undefined/1/xyzfoo---/xyzfoo---", "4:s2/0/s3/3/false/undefined/1/xyzfoo---foo/xyzfoo---foo"}, CHROME = { - "1:[object Text]/0/[object Text]/3/false/Range/1/xyz/xyz", - "2:[object Text]/0/[object Text]/3/false/Range/1/xyzfoo/xyzfoo", - "3:[object Text]/0/[object Text]/3/false/Range/1/xyzfoo---/xyzfoo---", - "4:[object Text]/0/[object Text]/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"}, IE = {"1:s2/0/s2/1/false/undefined/1/xyz/xyz", "selection.extend not available"}) @NotYetImplemented(CHROME) @@ -143,8 +143,8 @@ "1:s2/0/s2/1/false/undefined/1/xyz/xyz", "2:s2/0/s2/0/true/undefined/1//"}, CHROME = { - "1:[object Text]/0/[object Text]/3/false/Range/1/xyz/xyz", - "2:[object Text]/3/[object Text]/3/true/Caret/1//"}) + "1:s2/0/s2/1/false/Range/1/xyz/xyz", + "2:s2/0/s2/0/true/Caret/1//"}) @NotYetImplemented(CHROME) public void collapseToStart() throws Exception { final String jsSnippet = "" @@ -164,8 +164,8 @@ "1:s2/0/s2/1/false/undefined/1/xyz/xyz", "2:s2/1/s2/1/true/undefined/1//"}, CHROME = { - "1:[object Text]/0/[object Text]/3/false/Range/1/xyz/xyz", - "2:[object Text]/3/[object Text]/3/true/Caret/1//"}) + "1:s2/0/s2/1/false/Range/1/xyz/xyz", + "2:s2/1/s2/1/true/Caret/1//"}) @NotYetImplemented(CHROME) public void collapseToEnd() throws Exception { final String jsSnippet = "" @@ -189,7 +189,7 @@ CHROME = { "1:null/0/null/0/true/None/0/", "2:null/0/null/0/true/None/0/", - "3:[object Text]/0/[object Text]/3/false/Range/1/foo/foo", + "3:s2/1/s3/1/false/Range/1/foo/foo", "4:null/0/null/0/true/None/0/"}) @NotYetImplemented(CHROME) public void range() throws Exception { @@ -219,7 +219,8 @@ "false", "true"}, CHROME = { "1:[object Text]/1/[object Text]/2/false/Range/1/yzfo/yzfo", - "exception"}) + "2:null/0/null/0/true/None/0/", + "false", "true"}) @NotYetImplemented(CHROME) public void aLittleBitOfEverything_removeRange() throws Exception { final String jsSnippet = "" |
From: <rb...@us...> - 2017-04-22 11:47:07
|
Revision: 14170 http://sourceforge.net/p/htmlunit/code/14170 Author: rbri Date: 2017-04-22 11:47:04 +0000 (Sat, 22 Apr 2017) Log Message: ----------- Selection.type implementation fixed for Chrome Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/SelectionTest.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2017-04-22 10:55:12 UTC (rev 14169) +++ trunk/htmlunit/src/changes/changes.xml 2017-04-22 11:47:04 UTC (rev 14170) @@ -8,6 +8,9 @@ <body> <release version="2.27" date="???" description="GAE broken, Bugfixes"> + <action type="fix" dev="rbri"> + JavaScript: Selection.type implementation fixed for Chrome. + </action> <action type="fix" dev="rbri" issue="1870" due-to="Joerg Werner"> JavaScript: document.baseURI calculation fixed for relative href. </action> 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 2017-04-22 10:55:12 UTC (rev 14169) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection.java 2017-04-22 11:47:04 UTC (rev 14170) @@ -17,7 +17,6 @@ import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.IE; import java.util.ArrayList; import java.util.List; @@ -46,8 +45,11 @@ */ @JsxClass public class Selection extends SimpleScriptable { + private static final String TYPE_NONE = "None"; + private static final String TYPE_CARET = "Caret"; + private static final String TYPE_RANGE = "Range"; - private String type_ = "None"; + private String type_ = TYPE_NONE; /** * Creates an instance. @@ -157,7 +159,13 @@ */ @JsxFunction public void addRange(final com.gargoylesoftware.htmlunit.javascript.host.dom.Range range) { - getRanges().add(range.toW3C()); + final SimpleRange rg = range.toW3C(); + getRanges().add(rg); + + if (TYPE_CARET.equals(type_) && rg.getCollapsed()) { + return; + } + type_ = TYPE_RANGE; } /** @@ -164,9 +172,13 @@ * Removes a range from the selection. * @param range the range to remove */ - @JsxFunction({@WebBrowser(FF), @WebBrowser(IE)}) + @JsxFunction public void removeRange(final com.gargoylesoftware.htmlunit.javascript.host.dom.Range range) { getRanges().remove(range.toW3C()); + + if (getRangeCount() < 1) { + type_ = TYPE_NONE; + } } /** @@ -175,6 +187,8 @@ @JsxFunction public void removeAllRanges() { getRanges().clear(); + + type_ = TYPE_NONE; } /** @@ -208,6 +222,8 @@ final List<Range> ranges = getRanges(); ranges.clear(); ranges.add(new SimpleRange(parentNode.getDomNodeOrDie(), offset)); + + type_ = TYPE_CARET; } /** @@ -222,6 +238,8 @@ ranges.add(last); last.collapse(false); } + + type_ = TYPE_CARET; } /** @@ -236,14 +254,16 @@ ranges.add(first); first.collapse(true); } + + type_ = TYPE_CARET; } /** - * Cancels the current selection, sets the selection type to none, and sets the item property to null (IE only). + * Cancels the current selection, sets the selection type to none. */ @JsxFunction(@WebBrowser(CHROME)) public void empty() { - type_ = "None"; + removeAllRanges(); } /** @@ -256,6 +276,8 @@ final Range last = getLastRange(); if (last != null) { last.setEnd(parentNode.getDomNodeOrDie(), offset); + + type_ = TYPE_RANGE; } } @@ -267,7 +289,15 @@ public void selectAllChildren(final Node parentNode) { final List<Range> ranges = getRanges(); ranges.clear(); - ranges.add(new SimpleRange(parentNode.getDomNodeOrDie())); + final SimpleRange rg = new SimpleRange(parentNode.getDomNodeOrDie()); + ranges.add(rg); + + if (rg.getCollapsed()) { + type_ = TYPE_CARET; + } + else { + type_ = TYPE_RANGE; + } } /** @@ -343,5 +373,4 @@ } return scriptable; } - } 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 2017-04-22 10:55:12 UTC (rev 14169) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/SelectionTest.java 2017-04-22 11:47:04 UTC (rev 14170) @@ -14,14 +14,11 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.dom; -import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.CHROME; - 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; /** @@ -92,7 +89,6 @@ CHROME = { "1:null/0/null/0/true/None/0/", "2:s2/0/s2/1/false/Range/1/xyz/xyz"}) - @NotYetImplemented(CHROME) public void selectAllChildren() throws Exception { final String jsSnippet = "" + " alertSelection(selection);\n" @@ -118,7 +114,6 @@ "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"}) - @NotYetImplemented(CHROME) public void extend() throws Exception { final String jsSnippet = "" + " selection.selectAllChildren(s2);\n" @@ -145,7 +140,6 @@ CHROME = { "1:s2/0/s2/1/false/Range/1/xyz/xyz", "2:s2/0/s2/0/true/Caret/1//"}) - @NotYetImplemented(CHROME) public void collapseToStart() throws Exception { final String jsSnippet = "" + " selection.selectAllChildren(s2);\n" @@ -166,7 +160,6 @@ CHROME = { "1:s2/0/s2/1/false/Range/1/xyz/xyz", "2:s2/1/s2/1/true/Caret/1//"}) - @NotYetImplemented(CHROME) public void collapseToEnd() throws Exception { final String jsSnippet = "" + " selection.selectAllChildren(s2);\n" @@ -191,7 +184,6 @@ "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/"}) - @NotYetImplemented(CHROME) public void range() throws Exception { final String jsSnippet = "" + " alertSelection(selection);\n" @@ -221,7 +213,6 @@ "1:[object Text]/1/[object Text]/2/false/Range/1/yzfo/yzfo", "2:null/0/null/0/true/None/0/", "false", "true"}) - @NotYetImplemented(CHROME) public void aLittleBitOfEverything_removeRange() throws Exception { final String jsSnippet = "" + " var range = document.createRange();\n" @@ -306,5 +297,4 @@ + "</body></html>"; loadPageWithAlerts2(html); } - } |
From: <rb...@us...> - 2017-04-22 12:18:13
|
Revision: 14172 http://sourceforge.net/p/htmlunit/code/14172 Author: rbri Date: 2017-04-22 12:18:10 +0000 (Sat, 22 Apr 2017) Log Message: ----------- latest CHROME Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableRowElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableSectionElement.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableElementTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableRowElementTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableSectionElementTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-22 12:13:47 UTC (rev 14171) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2017-04-22 12:18:10 UTC (rev 14172) @@ -949,10 +949,6 @@ @BrowserFeature(@WebBrowser(IE)) JS_INNER_TEXT_CR_NL, - /** Indicates that innerText is readonly for tables. */ - @BrowserFeature(@WebBrowser(CHROME)) - JS_INNER_TEXT_READONLY_FOR_TABLE, - /** Indicates that innerText setter supports null values. */ @BrowserFeature({@WebBrowser(CHROME), @WebBrowser(value = FF, minVersion = 52)}) JS_INNER_TEXT_VALUE_NULL, Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableElement.java 2017-04-22 12:13:47 UTC (rev 14171) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableElement.java 2017-04-22 12:18:10 UTC (rev 14172) @@ -14,7 +14,6 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.html; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INNER_TEXT_READONLY_FOR_TABLE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TABLE_VALIGN_SUPPORTS_IE_VALUES; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.EDGE; @@ -420,17 +419,6 @@ * {@inheritDoc} */ @Override - public void setInnerText(final Object value) { - if (getBrowserVersion().hasFeature(JS_INNER_TEXT_READONLY_FOR_TABLE)) { - throw Context.reportRuntimeError("innerText is read-only for tag 'table'"); - } - super.setInnerText(value); - } - - /** - * {@inheritDoc} - */ - @Override public String getInnerText() { return getDomNodeOrDie().asText(); } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableRowElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableRowElement.java 2017-04-22 12:13:47 UTC (rev 14171) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableRowElement.java 2017-04-22 12:18:10 UTC (rev 14172) @@ -14,7 +14,6 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.html; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INNER_TEXT_READONLY_FOR_TABLE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TABLE_ROW_DELETE_CELL_REQUIRES_INDEX; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.EDGE; @@ -203,18 +202,6 @@ } /** - * Overwritten to throw an exception because this is readonly. - * @param value the new value for the contents of this node - */ - @Override - public void setInnerText(final Object value) { - if (getBrowserVersion().hasFeature(JS_INNER_TEXT_READONLY_FOR_TABLE)) { - throw Context.reportRuntimeError("innerText is read-only for tag 'tr'"); - } - super.setInnerText(value); - } - - /** * Gets the {@code borderColor} attribute. * @return the attribute */ Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableSectionElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableSectionElement.java 2017-04-22 12:13:47 UTC (rev 14171) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableSectionElement.java 2017-04-22 12:18:10 UTC (rev 14172) @@ -14,7 +14,6 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.html; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INNER_TEXT_READONLY_FOR_TABLE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TABLE_VALIGN_SUPPORTS_IE_VALUES; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.EDGE; @@ -165,10 +164,6 @@ @Override @JsxSetter({@WebBrowser(IE), @WebBrowser(CHROME)}) public void setInnerText(final Object value) { - if (getBrowserVersion().hasFeature(JS_INNER_TEXT_READONLY_FOR_TABLE)) { - throw Context.reportRuntimeError("innerText is read-only for tag '" - + getDomNodeOrDie().getNodeName() + "'"); - } super.setInnerText(value); } } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableElementTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableElementTest.java 2017-04-22 12:13:47 UTC (rev 14171) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableElementTest.java 2017-04-22 12:18:10 UTC (rev 14172) @@ -719,8 +719,7 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"cell1", "[object Text]", "abc", "[object Text]", ""}, - CHROME = {"cell1", "[object Text]", "ex", "cell1", "[object Text]", "ex", "cell1"}) + @Alerts({"cell1", "[object Text]", "abc", "[object Text]", ""}) public void innerText() throws Exception { final String html = "<html><body>\n" Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableRowElementTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableRowElementTest.java 2017-04-22 12:13:47 UTC (rev 14171) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableRowElementTest.java 2017-04-22 12:18:10 UTC (rev 14172) @@ -349,10 +349,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"cell1", "[object HTMLTableDataCellElement]", "abc", "[object Text]", ""}, - CHROME = {"cell1", "[object HTMLTableCellElement]", - "ex", "cell1", "[object HTMLTableCellElement]", "ex", "cell1"}, - FF = {"cell1", "[object HTMLTableCellElement]", "abc", "[object Text]", ""}) + @Alerts(DEFAULT = {"cell1", "[object HTMLTableCellElement]", "abc", "[object Text]", ""}, + IE = {"cell1", "[object HTMLTableDataCellElement]", "abc", "[object Text]", ""}) public void innerText() throws Exception { final String html = "<html><body>\n" Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableSectionElementTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableSectionElementTest.java 2017-04-22 12:13:47 UTC (rev 14171) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableSectionElementTest.java 2017-04-22 12:18:10 UTC (rev 14172) @@ -364,9 +364,7 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"cell1", "[object HTMLTableRowElement]", "abc", "[object Text]", ""}, - CHROME = {"cell1", "[object HTMLTableRowElement]", - "ex", "cell1", "[object HTMLTableRowElement]", "ex", "cell1"}) + @Alerts({"cell1", "[object HTMLTableRowElement]", "abc", "[object Text]", ""}) public void innerText_body() throws Exception { final String html = "<html><body>\n" @@ -392,9 +390,7 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"cell1", "[object HTMLTableRowElement]", "abc", "[object Text]", ""}, - CHROME = {"cell1", "[object HTMLTableRowElement]", - "ex", "cell1", "[object HTMLTableRowElement]", "ex", "cell1"}) + @Alerts({"cell1", "[object HTMLTableRowElement]", "abc", "[object Text]", ""}) public void innerText_header() throws Exception { final String html = "<html><body>\n" @@ -420,9 +416,7 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"cell1", "[object HTMLTableRowElement]", "abc", "[object Text]", ""}, - CHROME = {"cell1", "[object HTMLTableRowElement]", - "ex", "cell1", "[object HTMLTableRowElement]", "ex", "cell1"}) + @Alerts({"cell1", "[object HTMLTableRowElement]", "abc", "[object Text]", ""}) public void innerText_footer() throws Exception { final String html = "<html><body>\n" |