Module: wine Branch: master Commit: 1571c12129756e2fd35c80a7452d791e7edc8b65 URL: https://gitlab.winehq.org/wine/wine/-/commit/1571c12129756e2fd35c80a7452d791...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Tue Jan 23 17:54:26 2024 +0200
mshtml: Implement document.lastModified.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
---
dlls/mshtml/htmldoc.c | 10 ++++++++-- dlls/mshtml/tests/dom.js | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index e7eca058c23..4267b13ffab 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -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) diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index 0cbcb95e578..325cacf4823 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -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;