mshtml: Implement document.lastModified.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
This commit is contained in:
Gabriel Ivăncescu 2024-01-23 17:54:26 +02:00 committed by Alexandre Julliard
parent 5113e55139
commit 1571c12129
2 changed files with 14 additions and 2 deletions

View file

@ -1086,8 +1086,14 @@ static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLoca
static HRESULT WINAPI HTMLDocument_get_lastModified(IHTMLDocument2 *iface, BSTR *p)
{
HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsAString nsstr;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsAString_Init(&nsstr, NULL);
nsres = nsIDOMDocument_GetLastModified(This->dom_document, &nsstr);
return return_nsstr(nsres, &nsstr, p);
}
static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v)

View file

@ -339,6 +339,12 @@ sync_test("rects", function() {
ok(rects.length === 0, "rect.length = " + rects.length);
});
sync_test("document_lastModified", function() {
// actually it seems to be rounded up from about ~250ms above a sec, but be more conservative with the check
var diff = Date.parse(document.lastModified) - performance.timing.navigationStart;
ok(diff > -1000 && diff < 1000, "lastModified too far from navigationStart: " + diff);
});
sync_test("document_owner", function() {
var node;