Gabriel Ivăncescu : mshtml: Implement ProgressEvent's total prop.
Alexandre Julliard
julliard at winehq.org
Tue Jul 26 15:35:16 CDT 2022
Module: wine
Branch: master
Commit: 228c824d483c6a9b782f02a56ff0ff28bfdfc6ad
URL: https://gitlab.winehq.org/wine/wine/-/commit/228c824d483c6a9b782f02a56ff0ff28bfdfc6ad
Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date: Mon Jul 25 21:54:04 2022 +0300
mshtml: Implement ProgressEvent's total prop.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode at 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 55511f3ac79..24c107487af 100644
--- a/dlls/mshtml/htmlevent.c
+++ b/dlls/mshtml/htmlevent.c
@@ -2523,8 +2523,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();
}
More information about the wine-cvs
mailing list