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

mshtml: Implement performance.timing.msFirstPaint.

parent 72b13c5a
......@@ -524,6 +524,7 @@ typedef struct {
ULONGLONG dom_content_loaded_event_end_time;
ULONGLONG load_event_start_time;
ULONGLONG load_event_end_time;
ULONGLONG first_paint_time;
} HTMLPerformanceTiming;
typedef struct nsChannelBSC nsChannelBSC;
......
......@@ -1585,8 +1585,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 */
......@@ -1816,9 +1814,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->first_paint_time;
return S_OK;
}
......
......@@ -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;
......
......@@ -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->performance_timing->first_paint_time)
This->window->base.inner_window->performance_timing->first_paint_time = get_time_stamp();
GetClientRect(This->hwnd, &rect);
hdc = BeginPaint(This->hwnd, &ps);
......
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