As per the spec, XMLHttpRequest should emit one LOADING state change event. Currently, it is sending one for each received chunk as a way to keep track of progress. Now that progress events are available, we can probably safely remove the emition of several LOADING events. Firefox and Chrome are passing http://www.w3c-test.org/XMLHttpRequest/event-readystatechange-loaded.htm
Created attachment 265386 [details] Patch
Comment on attachment 265386 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=265386&action=review > Source/WebCore/ChangeLog:11 > + (WebCore::XMLHttpRequest::didReceiveData): Removing emition of LOADING state change event for each receiving chunk. Do you know when this behavior changed in Chrome and Firefox? Progress events are a relatively new feature, so I suspect that many web pages could still rely on getting state change.
(In reply to comment #2) > Comment on attachment 265386 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=265386&action=review > > > Source/WebCore/ChangeLog:11 > > + (WebCore::XMLHttpRequest::didReceiveData): Removing emition of LOADING state change event for each receiving chunk. > > Do you know when this behavior changed in Chrome and Firefox? Progress > events are a relatively new feature, so I suspect that many web pages could > still rely on getting state change. I was also surprised to see that test actually passing as it was not beginning of this year. Just looking at blink source code, it seems that LOADING events are still emitted though. I am not sure why http://www.w3c-test.org/XMLHttpRequest/event-readystatechange-loaded.htm is passing. I will do further investigations.
(In reply to comment #3) > (In reply to comment #2) > > Comment on attachment 265386 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=265386&action=review > > > > > Source/WebCore/ChangeLog:11 > > > + (WebCore::XMLHttpRequest::didReceiveData): Removing emition of LOADING state change event for each receiving chunk. > > > > Do you know when this behavior changed in Chrome and Firefox? Progress > > events are a relatively new feature, so I suspect that many web pages could > > still rely on getting state change. > > I was also surprised to see that test actually passing as it was not > beginning of this year. Just looking at blink source code, it seems that > LOADING events are still emitted though. > > I am not sure why > http://www.w3c-test.org/XMLHttpRequest/event-readystatechange-loaded.htm is > passing. I will do further investigations. I confirmed that Chrome and Firefox are emiting several LOADING events for http/tests/xmlhttprequest/interactive-state.html and http/tests/xmlhttprequest/small-chunks-response-text.html. I did not have time to check why http://www.w3c-test.org/XMLHttpRequest/event-readystatechange-loaded.htm is passing though. I wonder whether we should not mark this test and this bug as WONTFIX, given XHR being freezing/stabilizing.
Following test case is now moved to WPT (Web Platform Tests) and Safari is passing this: https://wpt.fyi/results/xhr/event-readystatechange-loaded.any.html?label=master&label=experimental&aligned Although - Chrome is failing it now and they are tracking it via following bug (not updated in a year) - https://bugs.chromium.org/p/chromium/issues/detail?id=651750 Just wanted to share updated status.
Closing as config changed since the test is passing for WebKit / Safari now.