Closed jugglinmike closed 5 years ago
So either you want
<b>this</b>
or<b>this</b>'s XMLHttpRequestUpload object
.
My understanding is that the appropriate target is the XMLHttpRequestEventTarget
in some cases and XMLHttpRequestUpload
in others. If that's right, then I don't know how to choose between <b>this</b>
or <b>this</b>'s XMLHttpRequestUpload object
in each case.
A subclass of XMLHttpRequestEventTarget
is <b>this</b>
in most cases.
I don't think <b>this</b>
should be cross-linked. It adds too much noise.
Also, I think this will leave the specification in a confusing state as you're not changing all dispatch callers.
I'm happy to help fix those parts, too, but my preference is to do so with a distinct commit that can be labeled as "editorial." I've added another fixup commit which will limit the first change to the normative specification of the algorithm's parameters. The following commit updates the other call sites to use this
, and the commit after that updates the preposition.
GitHub doesn't recognize fixup commits, but I can squash those first few and force push the result when/if this patch is otherwise ready.
I'm not sure how this is not editorial if the other one would be?
Prior to the commit titled "Specify target of progress events," the intended target could be interpreted as either the request object or its corresponding request upload object. I consider this change normative because it is resolving an ambiguity, and that could potentially conflict with an implementer's prior reading (and consequently, their implementation).
The following commits are editorial because they do not influence observable behavior.
Why would it not be ambiguous for other events though?
I've been focused on "fire a progress event" because that's the text which brought me here. I've only just now realized that XHR's use of "fire an event" is likewise ambiguous.
That highlights another misunderstanding in our prior discussion. When you wrote,
you're not changing all dispatch callers
I interpreted this to mean
you're not changing all instances of 'fire a progress event' to use the this keyword
Now I see that you meant,
you're not changing all instances of event dispatch to specify the target
I've pushed up another commit to specify the target for the callers of "fire an event." I believe it is this
in all cases. I'm more confident about this change because all events are "readystatechange", and the request upload object does not have a readyState
attribute.
Since this expands the scope of the patch, we'll need to update the commit message as well.
Sure do :)
The algorithm for "fire a progress event" requires a name and a target, but only half of the 14 usages specify a target. This is ambiguous because both the
XMLHttpRequestEventTarget
and theXMLHttpRequestUpload
support a "progress" event.Consistently specify the intended target with each invocation. Also modify a preposition in the algorithm's definition to match the prevailing usage.
For those more familiar with the spec than I, the intended target may be clear in context. Still, it seems like the ambiguity may have allowed discrepancies amongst implementations. I'm wondering if resolving this will require a survey on what's currently deployed.
Preview | Diff