osdir.com
mailing list archive

Subject: [HtmlUnit] [ htmlunit-Bugs-1231509 ] XMLHttpRequest shouldn't call onreadystatechange in sync mod - msg#00118

List: java.htmlunit.devel

Date: Prev Next Index Thread: Prev Next Index
Bugs item #1231509, was opened at 2005-07-02 23:07
Message generated for change (Comment added) made by freemant
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1231509&group_id=47038

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: 1.6
Status: Open
Resolution: None
Priority: 5
Submitted By: Kent Tong (freemant)
Assigned to: Nobody/Anonymous (nobody)
Summary: XMLHttpRequest shouldn't call onreadystatechange in sync mod

Initial Comment:
XMLHttpRequest shouldn't call the onreadystatechange
handler when it is in sync mode. Suggest changing:

private void setState( final int state, Context
context ) {
state_ = state;
if( stateChangeHandler_ != null ) {
if( context == null ) {
context = Context.getCurrentContext();
}
final Scriptable scope =
stateChangeHandler_.getParentScope();
final Object[] args = new Object[ 0 ];
stateChangeHandler_.call( context, scope,
this, args );
}
}

To:

private void setState( final int state, Context
context ) {
state_ = state;
if( async_ && stateChangeHandler_ != null ) {
if( context == null ) {
context = Context.getCurrentContext();
}
final Scriptable scope =
stateChangeHandler_.getParentScope();
final Object[] args = new Object[ 0 ];
stateChangeHandler_.call( context, scope,
this, args );
}
}

----------------------------------------------------------------------

>Comment By: Kent Tong (freemant)
Date: 2005-07-27 09:35

Message:
Logged In: YES
user_id=980774

Please see
http://lxr.mozilla.org/mozilla/source/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp#38
in particular the ChangeState function starting from line
1751. It is
calling the listener only if it's async (ie, mState &
XML_HTTP_REQUEST_ASYNC is non-zero).

Of course, this is just an implementation as there is no
commonly accepted standard on XMLHttpRequest.

----------------------------------------------------------------------

Comment By: Daniel Gredler (sdanig)
Date: 2005-07-27 01:50

Message:
Logged In: YES
user_id=1109422

Can you post a link to a page that documents this behavior?
The example on the following page seems to indicate that
onreadystatechange gets fired even when async = false:

http://msdn.microsoft.com/library/en-us/xmlsdk/html/ab1b76cf-7dd9-46b5-b782-cc04823df117.asp

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1231509&group_id=47038


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf


Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

[HtmlUnit] [ htmlunit-Bugs-1159709 ] Javascript submission of form returns iframe content

Bugs item #1159709, was opened at 2005-03-09 11:39 Message generated for change (Settings changed) made by mguillem You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1159709&group_id=47038 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: 1.4 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Grant Forrester (grantjforrester) >Assigned to: Marc Guillemot (mguillem) Summary: Javascript submission of form returns iframe content Initial Comment: Given an html page <iframe src="inlinePageURL"/> <form name="someForm" action="someAction"> <select name="someSelect" onchange="this.form.submit()"> <option value="1" selected="selected">foo</option> <option value="2">bar</option> </select> </form> And given htmlunit code... HtmlForm form = currentPage.getFormByName("someForm"); HtmlSelect select = form.getSelectByName("someSelect"); currentPage = (HtmlPage) select.setSelectedAttribute("2", true); Running the htmlunit code, the value of currentPage is the content of 'inlinePageURL' rather than the output of someAction. ---------------------------------------------------------------------- >Comment By: Marc Guillemot (mguillem) Date: 2005-07-27 11:51 Message: Logged In: YES user_id=402164 now fixed in CVS ---------------------------------------------------------------------- Comment By: Marc Guillemot (mguillem) Date: 2005-06-01 15:29 Message: Logged In: YES user_id=402164 After some investigation, I've found that it only happens if the page loaded as result of the submit contains an iframe (frame would possibly cause the same problem). It probably doesn't matter if the origin page contains a frame or not. I don't have any quick solution currently and have only added a unit test as notYetImplemented: com.gargoylesoftware.htmlunit.javascript.host.SelectTest.testRightPageAfterOnchange() ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1159709&group_id=47038 ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

Next Message by Date: click to view message preview

[HtmlUnit] [ htmlunit-Patches-1245468 ] XMLHttpRequest bug fixes / enhancements

Patches item #1245468, was opened at 2005-07-26 21:09 Message generated for change (Comment added) made by mguillem You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448268&aid=1245468&group_id=47038 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Daniel Gredler (sdanig) Assigned to: Nobody/Anonymous (nobody) Summary: XMLHttpRequest bug fixes / enhancements Initial Comment: The attached patch fixes the following bugs in XMLHttpRequest: - Relative URLs (bug 1209692) - Too strict about content type (bug 1209682) - No difference between Moz and IE instantiation (part of bug 1209686) - Adds overrideMimeType( ) support (feature request 1204628) Implementation-wise, the JS host object becomes a thin wrapper to a normal Java object. This normal Java object also gets used for the ActiveX version of XMLHttpRequest. Since we now have default objects in WebClient's ActiveX object map, I deprecated setActiveXObjectMap( ) in favor of new methods addActiveXObject( ) and removeActiveXObject( ). XMLHttpRequest needed to receive content marked as "text/html" without fixing it up as a full HTML page, so I made some changes in the DefaultPageCreator#createXXXPage( ) methods that allows you to override any of these methods and delegate to any other createXXXPage( ), as well as allowing null windows. The only other big thing is that we now have two ActiveX "host" objects (I expect the number to grow, see for example feature request 1232682, "XSL Support"). I have put them in the com.gargoylesoftware.htmlunit.javascript but they may need their own package. Anyway, let me know what you guys think. ---------------------------------------------------------------------- >Comment By: Marc Guillemot (mguillem) Date: 2005-07-28 09:58 Message: Logged In: YES user_id=402164 [I've wrongly added my comment to bug 1209692] I still don't understand why the XMLHttpRequest used as ActiveX could not be configured from the configuration file. ActiveXObject uses Context.toObject what leads to the fact that reflection is used and ALL public methods are available on the js created object. With your patch, following code would bring unexpected results with htmlunit: var o = new ActiveXObject('Microsoft.XMLHTTP'); alert(o.wrapper); alert(o.toString); alert(o.hashCode); => results: window.alert("com.gargoylesoftware.htmlunit.javascript.XMLHttpRequestImpl@15212bc") window.alert("function toString() {/* java.lang.String toString() */} ") window.alert("function hashCode() {/* int hashCode() */} ") ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448268&aid=1245468&group_id=47038 ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

Previous Message by Thread: click to view message preview

[HtmlUnit] [ htmlunit-Bugs-1231509 ] XMLHttpRequest shouldn't call onreadystatechange in sync mod

Bugs item #1231509, was opened at 2005-07-02 11:07 Message generated for change (Comment added) made by sdanig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1231509&group_id=47038 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: 1.6 Status: Open Resolution: None Priority: 5 Submitted By: Kent Tong (freemant) Assigned to: Nobody/Anonymous (nobody) Summary: XMLHttpRequest shouldn't call onreadystatechange in sync mod Initial Comment: XMLHttpRequest shouldn't call the onreadystatechange handler when it is in sync mode. Suggest changing: private void setState( final int state, Context context ) { state_ = state; if( stateChangeHandler_ != null ) { if( context == null ) { context = Context.getCurrentContext(); } final Scriptable scope = stateChangeHandler_.getParentScope(); final Object[] args = new Object[ 0 ]; stateChangeHandler_.call( context, scope, this, args ); } } To: private void setState( final int state, Context context ) { state_ = state; if( async_ && stateChangeHandler_ != null ) { if( context == null ) { context = Context.getCurrentContext(); } final Scriptable scope = stateChangeHandler_.getParentScope(); final Object[] args = new Object[ 0 ]; stateChangeHandler_.call( context, scope, this, args ); } } ---------------------------------------------------------------------- Comment By: Daniel Gredler (sdanig) Date: 2005-07-26 13:50 Message: Logged In: YES user_id=1109422 Can you post a link to a page that documents this behavior? The example on the following page seems to indicate that onreadystatechange gets fired even when async = false: http://msdn.microsoft.com/library/en-us/xmlsdk/html/ab1b76cf-7dd9-46b5-b782-cc04823df117.asp ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1231509&group_id=47038 ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

Next Message by Thread: click to view message preview

[HtmlUnit] [ htmlunit-Feature Requests-1232654 ] JavaScript Prototypes

Feature Requests item #1232654, was opened at 2005-07-05 12:18 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=1232654&group_id=47038 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Priority: 5 Submitted By: alexme (olexme) Assigned to: Nobody/Anonymous (nobody) Summary: JavaScript Prototypes Initial Comment: I have errors when using prototype functions as extensions to existing objects. Is it supported ? Examples: String.prototype.tr = function(){return this.replace(/(^\s*)|(\s*$)/g, "");}; String.prototype.apos = function(){return this.replace(/(\')/g, "&apos;");}; ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=1232654&group_id=47038 ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by