From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlevent.c | 12 ++++++++++-- dlls/mshtml/tests/xhr.js | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 0c66430b386..42f687bdf84 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -2490,8 +2490,16 @@ static HRESULT WINAPI DOMProgressEvent_get_loaded(IDOMProgressEvent *iface, ULON static HRESULT WINAPI DOMProgressEvent_get_total(IDOMProgressEvent *iface, ULONGLONG *p) { DOMProgressEvent *This = impl_from_IDOMProgressEvent(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + cpp_bool b; + + TRACE("(%p)->(%p)\n", This, p); + + if(NS_FAILED(nsIDOMProgressEvent_GetLengthComputable(This->nsevent, &b)) || !b) { + *p = ~0; + return S_OK; + } + + return map_nsresult(nsIDOMProgressEvent_GetTotal(This->nsevent, p)); }
static HRESULT WINAPI DOMProgressEvent_initProgressEvent(IDOMProgressEvent *iface, BSTR type, VARIANT_BOOL can_bubble, diff --git a/dlls/mshtml/tests/xhr.js b/dlls/mshtml/tests/xhr.js index c60107c556f..cc8a03dadb4 100644 --- a/dlls/mshtml/tests/xhr.js +++ b/dlls/mshtml/tests/xhr.js @@ -49,6 +49,7 @@ function test_xhr() { ok(props[i] in e, props[i] + " not available in loadstart"); ok(e.lengthComputable === false, "lengthComputable in loadstart = " + e.lengthComputable); ok(e.loaded === 0, "loaded in loadstart = " + e.loaded); + ok(e.total === 18446744073709552000, "total in loadstart = " + e.total); loadstart = true; }; xhr.onloadend = function(e) { @@ -60,6 +61,8 @@ function test_xhr() { ok(e.lengthComputable === true, "lengthComputable in loadend = " + e.lengthComputable); todo_wine. ok(e.loaded === xml.length, "loaded in loadend = " + e.loaded); + todo_wine. + ok(e.total === xml.length, "total in loadend = " + e.total); next_test(); }; } @@ -179,6 +182,7 @@ function test_timeout() { if(v >= 10) { ok(e.lengthComputable === false, "lengthComputable = " + e.lengthComputable); ok(e.loaded === 0, "loaded = " + e.loaded); + ok(e.total === 18446744073709552000, "total = " + e.total); } next_test(); }