Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1474)

Issue 251030043: Fix XHR argument parsing and synchronous event callbacks. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years, 10 months ago by kpreid_google
Modified:
8 years, 9 months ago
Reviewers:
MarkM
CC:
google-caja-discuss_googlegroups.com
Visibility:
Public.

Description

Derived from James Keane's patches <https://github.com/google/caja/pull/1965> -- thanks to him for spotting the problem. Issues in our tests and in onreadystatechange were spotted in testing and additionally fixed. Allegedly fixes <https://github.com/google/caja/issues/1878>. * Pass the correct number of arguments to native XMLHttpRequest, rather than one too many. Among other things, this caused us to incorrectly default to synchronous XHR. * Fixed onreadystatechange firing twice after synchronous XHR on Chrome due to using an unsound browser test rather than a feature test to decide whether to apply a workaround. * Fixed lack of argument coercion for some uses of the async parameter. (Should have no observable effects, so this is just on general code structure principles.) Supporting changes: * Fixed test-cajajs-invocation testBuilderApiNetNoFetch accidentally depending on that synchronous XHR. * Increased timeout for preliminary-meta from 10 to 30 seconds as I have experienced timeouts on that test only frequently, and it is inherently slow compared to others. @ a83ec15cf5b13ffbe482cfb31830b7eb5490ccd9

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -16 lines) Patch
M src/com/google/caja/plugin/domado.js View 6 chunks +24 lines, -12 lines 2 comments Download
M tests/com/google/caja/plugin/MainBrowserTest.java View 1 chunk +2 lines, -0 lines 0 comments Download
M tests/com/google/caja/plugin/test-cajajs-invocation.js View 2 chunks +3 lines, -3 lines 0 comments Download
M tests/com/google/caja/plugin/test-domado-events-guest.html View 1 chunk +11 lines, -1 line 0 comments Download

Messages

Total messages: 4
kpreid_google
8 years, 10 months ago (2015-07-08 21:42:39 UTC) #1
MarkM
LGTM https://codereview.appspot.com/251030043/diff/1/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/251030043/diff/1/src/com/google/caja/plugin/domado.js#newcode1052 src/com/google/caja/plugin/domado.js:1052: switch (arguments.length - 1) { Is this really ...
8 years, 10 months ago (2015-07-08 22:12:51 UTC) #2
kpreid_google
https://codereview.appspot.com/251030043/diff/1/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/251030043/diff/1/src/com/google/caja/plugin/domado.js#newcode1052 src/com/google/caja/plugin/domado.js:1052: switch (arguments.length - 1) { On 2015/07/08 22:12:51, MarkM ...
8 years, 10 months ago (2015-07-09 17:47:11 UTC) #3
MarkM
8 years, 10 months ago (2015-07-09 22:25:37 UTC) #4
On 2015/07/09 17:47:11, kpreid_google wrote:
>
https://codereview.appspot.com/251030043/diff/1/src/com/google/caja/plugin/do...
> File src/com/google/caja/plugin/domado.js (right):
> 
>
https://codereview.appspot.com/251030043/diff/1/src/com/google/caja/plugin/do...
> src/com/google/caja/plugin/domado.js:1052: switch (arguments.length - 1) {
> On 2015/07/08 22:12:51, MarkM wrote:
> > Is this really clearer than switching on argument.length and incrementing
the
> > case labels? If not, please do that.
> 
> I think that the numbers currently used are more relevant to _what we are
> implementing_ (XHR API) as opposed to the +1 numbers which contain an
> implementation detail (the privates arg).
> 
> Do you disagree?

Yes, for this case I agree. Still LGTM
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b