From: <mgu...@us...> - 2013-01-08 11:21:38
|
Revision: 7968 http://sourceforge.net/p/htmlunit/code/7968 Author: mguillem Date: 2013-01-08 11:21:33 +0000 (Tue, 08 Jan 2013) Log Message: ----------- isXMLName is undefined for FF17 Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/GlobalFunctionsTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2013-01-08 11:16:28 UTC (rev 7967) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2013-01-08 11:21:33 UTC (rev 7968) @@ -872,6 +872,10 @@ @BrowserFeature(@WebBrowser(IE)) JS_FUNCTION_DECLARED_FORWARD_IN_BLOCK, + /** Indicates if the method isXmlName exists in the window scope. */ + @BrowserFeature(@WebBrowser(value = FF, maxVersion = 10)) + JS_FUNCTION_ISXMLNAME, + /** * Indicates that function can be defined as * <code>function object.property() {}</code> instead of <code>object.property = function() {}</code>. Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java 2013-01-08 11:16:28 UTC (rev 7967) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java 2013-01-08 11:21:33 UTC (rev 7968) @@ -20,6 +20,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DONT_ENUM_FUNCTIONS; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ECMA5_FUNCTIONS; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FUNCTION_BIND; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FUNCTION_ISXMLNAME; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FUNCTION_TOSOURCE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_HAS_OBJECT_WITH_PROTOTYPE_PROPERTY_IN_WINDOW_SCOPE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML; @@ -306,7 +307,7 @@ // only FF has toSource if (!browserVersion.hasFeature(JS_FUNCTION_TOSOURCE)) { - deleteProperties(window, "isXMLName", "uneval"); + deleteProperties(window, "uneval"); removePrototypeProperties(window, "Object", "toSource"); removePrototypeProperties(window, "Array", "toSource"); removePrototypeProperties(window, "Date", "toSource"); @@ -314,6 +315,9 @@ removePrototypeProperties(window, "Number", "toSource"); removePrototypeProperties(window, "String", "toSource"); } + if (!browserVersion.hasFeature(JS_FUNCTION_ISXMLNAME)) { + deleteProperties(window, "isXMLName"); + } NativeFunctionToStringFunction.installFix(window, webClient.getBrowserVersion()); Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/GlobalFunctionsTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/GlobalFunctionsTest.java 2013-01-08 11:16:28 UTC (rev 7967) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/GlobalFunctionsTest.java 2013-01-08 11:21:33 UTC (rev 7968) @@ -73,6 +73,7 @@ */ @Test @Alerts(FF = { "isXMLName: function", "uneval: function" }, + FF17 = { "isXMLName: undefined", "uneval: function" }, DEFAULT = { "isXMLName: undefined", "uneval: undefined" }) public void methods_different() throws Exception { final String[] methods = {"isXMLName", "uneval"}; |