From: <rb...@us...> - 2013-03-24 16:41:11
|
Revision: 8197 http://sourceforge.net/p/htmlunit/code/8197 Author: rbri Date: 2013-03-24 16:41:07 +0000 (Sun, 24 Mar 2013) Log Message: ----------- DOMTokenList implementation fixed and enhanced Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMTokenListTest.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2013-03-24 15:07:09 UTC (rev 8196) +++ trunk/htmlunit/src/changes/changes.xml 2013-03-24 16:41:07 UTC (rev 8197) @@ -8,6 +8,10 @@ <body> <release version="2.13" date="???" description="Bugfixes"> + <action type="fix" dev="rbri"> + JavaScript: DOMTokenList now works like in FF (different from spec). Some NPE exceptions + are fixed, separator chars are fixed, and we are able to create an attribute if needed. + </action> <action type="fix" dev="rbri" issue="1497"> JavaScript: Removing frame tag removes the associated FrameWindow also. </action> Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMTokenListTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMTokenListTest.java 2013-03-24 15:07:09 UTC (rev 8196) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMTokenListTest.java 2013-03-24 16:41:07 UTC (rev 8197) @@ -215,6 +215,29 @@ * @throws Exception if the test fails */ @Test + @Alerts(FF = { "false", "false", "false" }) + public void containsSubstring() throws Exception { + final String html + = "<html><head><title>First</title><script>\n" + + "function test() {\n" + + " var list = document.getElementById('d1').classList;\n" + + " if (list) {\n" + + " alert(list.contains('a'));\n" + + " alert(list.contains('d'));\n" + + " alert(list.contains('f'));\n" + + " }\n" + + "}\n" + + "</script></head><body onload='test()'>\n" + + " <div id='d1' class='ab cde ef'></div>\n" + + "</body></html>"; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(FF = { "true", "true", "true", "true" }) public void containsBorderCheck() throws Exception { final String html |