From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/omnavigator.c | 6 ++---- dlls/mshtml/tests/documentmode.js | 1 + dlls/mshtml/view.c | 3 +++ 4 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 76ddb80f317..5fe503a730d 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -610,6 +610,7 @@ struct HTMLInnerWindow { ULONGLONG dom_content_loaded_event_end_time; ULONGLONG load_event_start_time; ULONGLONG load_event_end_time; + ULONGLONG first_paint_time; };
#define NO_PERFORMANCE_OBJ ((IHTMLPerformance*)IntToPtr(-1)) diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index db53958f258..fd35af28f44 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1593,8 +1593,6 @@ static HRESULT WINAPI HTMLPerformanceTiming_Invoke(IHTMLPerformanceTiming *iface pDispParams, pVarResult, pExcepInfo, puArgErr); }
-#define TIMING_FAKE_TIMESTAMP 0xdeadbeef - static ULONGLONG get_fetch_time(HTMLPerformanceTiming *This) { /* If there's no prior doc unloaded and no redirects, fetch time == navigationStart time */ @@ -1824,9 +1822,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_msFirstPaint(IHTMLPerformanceTim { HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
- FIXME("(%p)->(%p) returning fake value\n", This, p); + TRACE("(%p)->(%p)\n", This, p);
- *p = TIMING_FAKE_TIMESTAMP; + *p = This->window->first_paint_time; return S_OK; }
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 30d4a790261..157a7337c04 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -39,6 +39,7 @@ ok(performance.timing.unloadEventStart === 0, "unloadEventStart != 0"); ok(performance.timing.unloadEventEnd === 0, "unloadEventEnd != 0"); ok(performance.timing.redirectStart === 0, "redirectStart != 0"); ok(performance.timing.redirectEnd === 0, "redirectEnd != 0"); +ok(performance.timing.msFirstPaint === 0, "msFirstPaint != 0");
var pageshow_fired = false, pagehide_fired = false; document.doc_unload_events_called = false; diff --git a/dlls/mshtml/view.c b/dlls/mshtml/view.c index 063f7afab9d..deb640fd8e3 100644 --- a/dlls/mshtml/view.c +++ b/dlls/mshtml/view.c @@ -50,6 +50,9 @@ static void paint_document(HTMLDocumentObj *This) RECT rect; HDC hdc;
+ if(This->window && This->window->base.inner_window && !This->window->base.inner_window->first_paint_time) + This->window->base.inner_window->first_paint_time = get_time_stamp(); + GetClientRect(This->hwnd, &rect);
hdc = BeginPaint(This->hwnd, &ps);