]
Lukáš Fryč updated ARQGRA-397:
------------------------------
Status: Resolved (was: Pull Request Sent)
Assignee: Petr Andreev (was: Lukáš Fryč)
Resolution: Done
Thanks Petr, I have merged the pull requests which is fixing guards for IE9 and lower.
Add support for host (ActiveX) objects
--------------------------------------
Key: ARQGRA-397
URL:
https://issues.jboss.org/browse/ARQGRA-397
Project: Arquillian Graphene
Issue Type: Feature Request
Components: core
Affects Versions: 2.0.0.CR2
Environment: WIn7 x64, msxml3.dll (8.110.7601.17988), msxml6.dll
(6.30.7601.17988)
IE9 (IE9 in compat mode->IE7)
Richfaces 3.3.4 (Sarissa 0.9.9.3)
Reporter: Petr Andreev
Assignee: Petr Andreev
Fix For: 2.0.1.Final
Attachments: Graphene.Page.RequestGuard.js.patch,
Graphene.xhrInterception.js.patch, IE10-ARQGRA-397.png, test_ActiveXObject.js,
test_setTimeout.js
Graphene JavaScript RequestGuard interceptors cause failure of all AJAX requests with
Richfaces 3 on InternetExplorer with ActiveXObject version of XMLHttpRequest (overriden by
Sarissa included in RF3). There are several issues:
1. While wrapping the underlying XMLHttpRequest (provided by Sarissa and being actually
the ActiveXObject) the InterceptedXMLHttpRequest accesses the response fields of XHR,
which is illegal for windows-host objects. I.e. responseText throws an error '#575:
This method cannot be called until the send method has been called.' The solution
would be to not to read the response properties in constructor of
InterceptedXMLHttpRequest since at this phase it makes no sense.
2. The bracket- style calls (xhr['send']) on host objects lead to immediate
invocation of affected functions without any parameters. Therefore it is impossible to
make any reflection-like invocations or checks for existence on them (i.e.
if(xhr['send']) or xhr['send'].apply(.....)). The proposed solution is to
wrap the host and native objects before 'apply' calls and expand argument list, in
that way avoiding failures and ugly browser detection. On the other hand, the invocation
of interceptor chain could be refactored (but there could be still problems passing
function pointers of host objects: needs to be checked).
IE9 errors: "#450: Wrong number of arguments or invalid property assignment" or
"#87: The parameter is incorrect."
3. The scoping of "this" while attaching "onreadystatchange" callback
to original (host) XHR is unspecified in contrary to the case with native JS objects.
That`s why the interceptors and RF components don`t get notified about completed AJAX
request .The solution is simple - just use the wrappers member variable.
4. Overriding the "window.setTimeout" method in RequestGuard causes JS error in
IE9 + IE compat mode since there are no 'apply' and 'call' functions
defined on window`s host object. The solution is to borrow both functions from
Function.prototype- works for native objects too.
Test cases attached (can be ran in
http://jsfiddle.net)
Proposed patches attached.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: