Commit 8d97a7b3 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Implement ProgressEvent's lengthComputable prop.

parent f0806c52
......@@ -2498,8 +2498,17 @@ static HRESULT WINAPI DOMProgressEvent_Invoke(IDOMProgressEvent *iface, DISPID d
static HRESULT WINAPI DOMProgressEvent_get_lengthComputable(IDOMProgressEvent *iface, VARIANT_BOOL *p)
{
DOMProgressEvent *This = impl_from_IDOMProgressEvent(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsresult nsres;
cpp_bool b;
TRACE("(%p)->(%p)\n", This, p);
nsres = nsIDOMProgressEvent_GetLengthComputable(This->nsevent, &b);
if(NS_FAILED(nsres))
return map_nsresult(nsres);
*p = b ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
static HRESULT WINAPI DOMProgressEvent_get_loaded(IDOMProgressEvent *iface, ULONGLONG *p)
......
......@@ -47,6 +47,7 @@ function test_xhr() {
var props = [ "initProgressEvent", "lengthComputable", "loaded", "total" ];
for(var i = 0; i < props.length; i++)
ok(props[i] in e, props[i] + " not available in loadstart");
ok(e.lengthComputable === false, "lengthComputable in loadstart = " + e.lengthComputable);
loadstart = true;
};
xhr.onloadend = function(e) {
......@@ -55,6 +56,7 @@ function test_xhr() {
var props = [ "initProgressEvent", "lengthComputable", "loaded", "total" ];
for(var i = 0; i < props.length; i++)
ok(props[i] in e, props[i] + " not available in loadend");
ok(e.lengthComputable === true, "lengthComputable in loadend = " + e.lengthComputable);
next_test();
};
}
......@@ -171,6 +173,9 @@ function test_timeout() {
else
ok(props[r] in e, props[r] + " not available");
}
if(v >= 10) {
ok(e.lengthComputable === false, "lengthComputable = " + e.lengthComputable);
}
next_test();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment