From: <rb...@us...> - 2018-07-21 12:37:14
|
Revision: 15491 http://sourceforge.net/p/htmlunit/code/15491 Author: rbri Date: 2018-07-21 12:36:53 +0000 (Sat, 21 Jul 2018) Log Message: ----------- setting window.clientInformation is ignored in IE Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2018-07-21 12:09:18 UTC (rev 15490) +++ trunk/htmlunit/src/changes/changes.xml 2018-07-21 12:36:53 UTC (rev 15491) @@ -8,6 +8,9 @@ <body> <release version="2.32" date="xx 2018" description="Bugfixes, FIREFOX_45 removed, FIREFOX_60 added"> + <action type="fix" dev="rbri"> + Setting window.clientInformation is ignored in IE. + </action> <action type="fix" dev="rbri" issue="1969"> HTMLxxxInput.reset() results in a wrong state of the selection delegate. </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-07-21 12:09:18 UTC (rev 15490) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-07-21 12:36:53 UTC (rev 15491) @@ -624,6 +624,14 @@ } /** + * special setter for IE to ignore this call. + * @param ignore parame gets ignored + */ + @JsxSetter(IE) + public void setClientInformation(final Object ignore) { + } + + /** * Returns the JavaScript property {@code clipboardData}. * @return the {@link DataTransfer} */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2018-07-21 12:09:18 UTC (rev 15490) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2018-07-21 12:36:53 UTC (rev 15491) @@ -2385,4 +2385,25 @@ loadPageWithAlerts2(html); } + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts(DEFAULT = {"[object Navigator]", "##test##"}, + IE = {"[object Navigator]", "[object Navigator]"}, + FF = {"undefined", "##test##"}) + public void clientInformation() throws Exception { + final String html = "<html><head>\n" + + "<script>\n" + + " function test() {\n" + + " alert(window.clientInformation);\n" + + " window.clientInformation = '##test##';\n" + + " alert(window.clientInformation);\n" + + " }\n" + + "</script>\n" + + "</head>\n" + + "<body onload='test()'>\n" + + "</body></html>"; + loadPageWithAlerts2(html); + } } |