From: <rb...@us...> - 2013-12-31 15:38:52
|
Revision: 8924 http://sourceforge.net/p/htmlunit/code/8924 Author: rbri Date: 2013-12-31 15:38:50 +0000 (Tue, 31 Dec 2013) Log Message: ----------- XMLHttpRequest event processing fixed for FF24 Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2013-12-31 14:18:16 UTC (rev 8923) +++ trunk/htmlunit/src/changes/changes.xml 2013-12-31 15:38:50 UTC (rev 8924) @@ -7,7 +7,13 @@ </properties> <body> - <release version="2.14" date="???" description="Bugfixes"> + <release version="2.14" date="???" description="Bugfixes, initial work on FF24 and IE11"> + <action type="fix" dev="rbri"> + JavaScript: XMLHttpRequest event processing fixed for FF24. + </action> + <action type="fix" dev="rbri"> + Return value fixed for element.height and element.width when element is not attached to the page. + </action> <action type="add" dev="rbri"> JavaScript: String.contains() added for FF18 and later. </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2013-12-31 14:18:16 UTC (rev 8923) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2013-12-31 15:38:50 UTC (rev 8924) @@ -1494,6 +1494,12 @@ @BrowserFeature(@WebBrowser(IE)) XHR_ERRORHANDLER_NOT_SUPPORTED, + /** XMLHttpRequest triggers the opened event at the beginning of the send + * method again. + */ + @BrowserFeature({ @WebBrowser(IE), @WebBrowser(value = FF, maxVersion = 17) }) + XHR_FIRE_STATE_OPENED_AGAIN_IN_ASYNC_MODE, + /** Indicates if a same origin check should be skipped. */ @BrowserFeature({ @WebBrowser(FF), @WebBrowser(CHROME), @WebBrowser(value = IE, minVersion = 8) }) XHR_IGNORE_SAME_ORIGIN, Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java 2013-12-31 14:18:16 UTC (rev 8923) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java 2013-12-31 15:38:50 UTC (rev 8924) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.xml; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_ERRORHANDLER_NOT_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_FIRE_STATE_OPENED_AGAIN_IN_ASYNC_MODE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_IGNORE_SAME_ORIGIN; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_IGNORE_SAME_ORIGIN_TO_ABOUT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_ONREADYSTATECANGE_SYNC_REQUESTS_COMPLETED; @@ -586,9 +587,11 @@ doSend(Context.getCurrentContext()); } else { - // quite strange but IE and FF seem both to fire state loading twice - // in async mode (at least with HTML of the unit tests) - setState(STATE_OPENED, Context.getCurrentContext()); + if (getBrowserVersion().hasFeature(XHR_FIRE_STATE_OPENED_AGAIN_IN_ASYNC_MODE)) { + // quite strange but IE and FF seem both to fire state loading twice + // in async mode (at least with HTML of the unit tests) + setState(STATE_OPENED, Context.getCurrentContext()); + } // Create and start a thread in which to execute the request. final Scriptable startingScope = getWindow(); |