RESOLVED FIXED7392
GMAIL: XMLHttpRequest does not correctly report "Interactive" state on receipt of load data
https://bugs.webkit.org/show_bug.cgi?id=7392
Summary GMAIL: XMLHttpRequest does not correctly report "Interactive" state on receip...
Eric Seidel (no email)
Reported 2006-02-20 11:34:28 PST
GMAIL: XMLHttpRequest does not correctly report "Interactive" state on receipt of load data Simple fix (and cleanup) attached. This blocks GMail chat in Safari.
Attachments
simple fix (and a little cleanup) (5.20 KB, patch)
2006-02-20 11:35 PST, Eric Seidel (no email)
darin: review-
Addressing Darin's concerns (5.27 KB, patch)
2006-02-20 11:55 PST, Eric Seidel (no email)
darin: review+
Eric Seidel (no email)
Comment 1 2006-02-20 11:35:04 PST
Created attachment 6627 [details] simple fix (and a little cleanup)
Darin Adler
Comment 2 2006-02-20 11:42:03 PST
Comment on attachment 6627 [details] simple fix (and a little cleanup) I think it's awkward to have changeState have a side effect of always calling the listener if the passed state is Interactive. Seems like the wrong name for a function that will both change state and have this particular side effect. I'd suggest instead doing something different at the caller in XMLHttpRequest::slotData; maybe code that detects the state and calls callReadyStateChangeListener explicitly if we're already in "interactive" state? Also, I think that putting this code into a separate function makes the logic a little weaker, because now the guarantee that the load event is sent exactly once is pretty subtle. If anyone called callReadyStateChangeListener an extra time when the state was already Completed, we'd fire a separate load event. The fix looks good, but I think it can be done in a way that's slightly clearer.
Darin Adler
Comment 3 2006-02-20 11:47:32 PST
Sorry, I see now that you already went one round with John Sullivan on trying to make this clearer. However, even given that I still think there's room for improvement.
Eric Seidel (no email)
Comment 4 2006-02-20 11:55:14 PST
Created attachment 6628 [details] Addressing Darin's concerns
Eric Seidel (no email)
Comment 5 2006-02-20 11:56:21 PST
This is also in Radar: <rdar://problem/4449442> GMAIL: XMLHttpRequest does not correctly report "Interactive" state on receipt of load data
Alexey Proskuryakov
Comment 6 2006-02-20 12:00:23 PST
Just for the record: the current version of Web Applications spec says "A readystatechange event shall immediately be dispatched at the object whenever the readyState attribute changes value. The readystatechange event must never be dispatched by the UA if the readyState attribute did not change." But I agree that such behavior doesn't sound right.
Darin Adler
Comment 7 2006-02-20 12:19:23 PST
Comment on attachment 6628 [details] Addressing Darin's concerns Typo, "recieves" instead of "receives". Looks fine, r=me.
Alexey Proskuryakov
Comment 8 2006-02-24 01:19:05 PST
A test for this is http/tests/xmlhttprequest/interactive-state.html
Lucas Forschler
Comment 9 2019-02-06 09:03:42 PST
Mass moving XML DOM bugs to the "DOM" Component.
Note You need to log in before you can comment on or make changes to this bug.