winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
November 2022
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
1171 discussions
Start a n
N
ew thread
Gabriel Ivăncescu : mshtml: Implement performance.timing.domContentLoadedEventStart & End.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: 35ee1081812f3e623946343e81de87e0a5e15419 URL:
https://gitlab.winehq.org/wine/wine/-/commit/35ee1081812f3e623946343e81de87…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Nov 22 18:26:22 2022 +0200 mshtml: Implement performance.timing.domContentLoadedEventStart & End. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmlevent.c | 2 +- dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/nsevents.c | 43 +++++++++++++++++++++++++++++++-------- dlls/mshtml/omnavigator.c | 8 ++++---- dlls/mshtml/tests/documentmode.js | 6 +++++- 5 files changed, 47 insertions(+), 14 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 01a385130b1..fec280d9a70 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -117,7 +117,7 @@ typedef struct { /* Keep these sorted case sensitively */ static const event_info_t event_info[] = { {L"DOMContentLoaded", EVENT_TYPE_EVENT, 0, - EVENT_DEFAULTLISTENER | EVENT_BUBBLES | EVENT_CANCELABLE}, + EVENT_BUBBLES | EVENT_CANCELABLE}, {L"abort", EVENT_TYPE_EVENT, DISPID_EVMETH_ONABORT, EVENT_BIND_TO_TARGET}, {L"animationend", EVENT_TYPE_EVENT, DISPID_EVPROP_ONANIMATIONEND, diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 45532902bd4..c0197195ad4 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -520,6 +520,8 @@ typedef struct { ULONGLONG response_end_time; ULONGLONG dom_interactive_time; ULONGLONG dom_complete_time; + ULONGLONG dom_content_loaded_event_start_time; + ULONGLONG dom_content_loaded_event_end_time; } HTMLPerformanceTiming; typedef struct nsChannelBSC nsChannelBSC; diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index 1fc7ccca377..6ae34321573 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -56,6 +56,7 @@ typedef struct { static nsresult NSAPI handle_blur(nsIDOMEventListener*,nsIDOMEvent*); static nsresult NSAPI handle_focus(nsIDOMEventListener*,nsIDOMEvent*); static nsresult NSAPI handle_keypress(nsIDOMEventListener*,nsIDOMEvent*); +static nsresult NSAPI handle_dom_content_loaded(nsIDOMEventListener*,nsIDOMEvent*); static nsresult NSAPI handle_pageshow(nsIDOMEventListener*,nsIDOMEvent*); static nsresult NSAPI handle_pagehide(nsIDOMEventListener*,nsIDOMEvent*); static nsresult NSAPI handle_load(nsIDOMEventListener*,nsIDOMEvent*); @@ -72,14 +73,15 @@ static const struct { enum doc_event_listener_flags flags; nsIDOMEventListenerVtbl vtbl; } doc_event_listeners[] = { - { EVENTID_BLUR, 0, EVENTLISTENER_VTBL(handle_blur) }, - { EVENTID_FOCUS, 0, EVENTLISTENER_VTBL(handle_focus) }, - { EVENTID_KEYPRESS, BUBBLES, EVENTLISTENER_VTBL(handle_keypress) }, - { EVENTID_PAGESHOW, OVERRIDE, EVENTLISTENER_VTBL(handle_pageshow), }, - { EVENTID_PAGEHIDE, OVERRIDE, EVENTLISTENER_VTBL(handle_pagehide), }, - { EVENTID_LOAD, OVERRIDE, EVENTLISTENER_VTBL(handle_load), }, - { EVENTID_BEFOREUNLOAD, OVERRIDE, EVENTLISTENER_VTBL(handle_beforeunload), }, - { EVENTID_UNLOAD, OVERRIDE, EVENTLISTENER_VTBL(handle_unload) }, + { EVENTID_BLUR, 0, EVENTLISTENER_VTBL(handle_blur) }, + { EVENTID_FOCUS, 0, EVENTLISTENER_VTBL(handle_focus) }, + { EVENTID_KEYPRESS, BUBBLES, EVENTLISTENER_VTBL(handle_keypress) }, + { EVENTID_DOMCONTENTLOADED, OVERRIDE, EVENTLISTENER_VTBL(handle_dom_content_loaded) }, + { EVENTID_PAGESHOW, OVERRIDE, EVENTLISTENER_VTBL(handle_pageshow) }, + { EVENTID_PAGEHIDE, OVERRIDE, EVENTLISTENER_VTBL(handle_pagehide) }, + { EVENTID_LOAD, OVERRIDE, EVENTLISTENER_VTBL(handle_load) }, + { EVENTID_BEFOREUNLOAD, OVERRIDE, EVENTLISTENER_VTBL(handle_beforeunload) }, + { EVENTID_UNLOAD, OVERRIDE, EVENTLISTENER_VTBL(handle_unload) }, }; struct nsDocumentEventListener { @@ -216,6 +218,31 @@ static nsresult NSAPI handle_keypress(nsIDOMEventListener *iface, return NS_OK; } +static nsresult NSAPI handle_dom_content_loaded(nsIDOMEventListener *iface, nsIDOMEvent *nsevent) +{ + nsEventListener *This = impl_from_nsIDOMEventListener(iface); + HTMLDocumentNode *doc = This->This->doc; + DOMEvent *event; + HRESULT hres; + + if(!doc) + return NS_OK; + + if(doc->window) + doc->window->performance_timing->dom_content_loaded_event_start_time = get_time_stamp(); + + hres = create_event_from_nsevent(nsevent, dispex_compat_mode(&doc->node.event_target.dispex), &event); + if(SUCCEEDED(hres)) { + dispatch_event(&doc->node.event_target, event); + IDOMEvent_Release(&event->IDOMEvent_iface); + } + + if(doc->window) + doc->window->performance_timing->dom_content_loaded_event_end_time = get_time_stamp(); + + return NS_OK; +} + static nsresult NSAPI handle_pageshow(nsIDOMEventListener *iface, nsIDOMEvent *nsevent) { nsEventListener *This = impl_from_nsIDOMEventListener(iface); diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 24d66473f7b..6b5555bcf44 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1766,9 +1766,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_domContentLoadedEventStart(IHTML { 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->dom_content_loaded_event_start_time; return S_OK; } @@ -1776,9 +1776,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_domContentLoadedEventEnd(IHTMLPe { 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->dom_content_loaded_event_end_time; return S_OK; } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 72311d5903b..237ac224cbb 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -31,6 +31,8 @@ ok(performance.timing.responseEnd >= performance.timing.responseStart, "response ok(performance.timing.domLoading >= performance.timing.responseEnd, "domLoading < responseEnd"); ok(performance.timing.domInteractive === 0, "domInteractive != 0"); ok(performance.timing.domComplete === 0, "domComplete != 0"); +ok(performance.timing.domContentLoadedEventStart === 0, "domContentLoadedEventStart != 0"); +ok(performance.timing.domContentLoadedEventEnd === 0, "domContentLoadedEventEnd != 0"); ok(performance.timing.unloadEventStart === 0, "unloadEventStart != 0"); ok(performance.timing.unloadEventEnd === 0, "unloadEventEnd != 0"); ok(performance.timing.redirectStart === 0, "redirectStart != 0"); @@ -79,7 +81,9 @@ if(window.addEventListener) { sync_test("performance timing", function() { ok(performance.timing.domInteractive >= performance.timing.domLoading, "domInteractive < domLoading"); - ok(performance.timing.domComplete >= performance.timing.domInteractive, "domComplete < domInteractive"); + ok(performance.timing.domContentLoadedEventStart >= performance.timing.domInteractive, "domContentLoadedEventStart < domInteractive"); + ok(performance.timing.domContentLoadedEventEnd >= performance.timing.domContentLoadedEventStart, "domContentLoadedEventEnd < domContentLoadedEventStart"); + ok(performance.timing.domComplete >= performance.timing.domContentLoadedEventEnd, "domComplete < domContentLoadedEventEnd"); }); sync_test("page transition events", function() {
1
0
0
0
Gabriel Ivăncescu : mshtml: Implement performance.timing.domComplete.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: e0cda0e1474f6e1ec5ca15760f27c2d699e406fd URL:
https://gitlab.winehq.org/wine/wine/-/commit/e0cda0e1474f6e1ec5ca15760f27c2…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Nov 22 18:26:22 2022 +0200 mshtml: Implement performance.timing.domComplete. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/nsevents.c | 1 + dlls/mshtml/omnavigator.c | 4 ++-- dlls/mshtml/tests/documentmode.js | 2 ++ dlls/mshtml/tests/htmldoc.c | 3 +++ 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 7d50a3b962f..45532902bd4 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -519,6 +519,7 @@ typedef struct { ULONGLONG response_start_time; ULONGLONG response_end_time; ULONGLONG dom_interactive_time; + ULONGLONG dom_complete_time; } HTMLPerformanceTiming; typedef struct nsChannelBSC nsChannelBSC; diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index 1c4bdee4e1d..1fc7ccca377 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -319,6 +319,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event if(doc_obj) handle_docobj_load(doc_obj); + doc->window->performance_timing->dom_complete_time = get_time_stamp(); set_ready_state(doc->outer_window, READYSTATE_COMPLETE); if(doc_obj) { diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index a8832792359..24d66473f7b 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1786,9 +1786,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_domComplete(IHTMLPerformanceTimi { 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->dom_complete_time; return S_OK; } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 2c6a800d8cf..72311d5903b 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -30,6 +30,7 @@ ok(performance.timing.responseStart >= performance.timing.requestStart, "respons ok(performance.timing.responseEnd >= performance.timing.responseStart, "responseEnd < responseStart"); ok(performance.timing.domLoading >= performance.timing.responseEnd, "domLoading < responseEnd"); ok(performance.timing.domInteractive === 0, "domInteractive != 0"); +ok(performance.timing.domComplete === 0, "domComplete != 0"); ok(performance.timing.unloadEventStart === 0, "unloadEventStart != 0"); ok(performance.timing.unloadEventEnd === 0, "unloadEventEnd != 0"); ok(performance.timing.redirectStart === 0, "redirectStart != 0"); @@ -78,6 +79,7 @@ if(window.addEventListener) { sync_test("performance timing", function() { ok(performance.timing.domInteractive >= performance.timing.domLoading, "domInteractive < domLoading"); + ok(performance.timing.domComplete >= performance.timing.domInteractive, "domComplete < domInteractive"); }); sync_test("page transition events", function() { diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index c530452f50b..b496d562fb1 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -2986,6 +2986,7 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID ok(nCmdexecopt == 0, "nCmdexecopts=%08lx\n", nCmdexecopt); ok(pvaOut == NULL, "pvaOut=%p\n", pvaOut); ok(pvaIn == NULL, "pvaIn=%p\n", pvaIn); + test_performance_timing(doc_unk, L"domComplete"); readystate_set_loading = FALSE; readystate_set_interactive = FALSE; load_state = LD_COMPLETE; @@ -3133,6 +3134,7 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID ok(pvaOut == NULL, "pvaOut != NULL\n"); test_readyState(NULL); + test_performance_timing(doc_unk, L"domComplete"); return E_NOTIMPL; case 105: @@ -3195,6 +3197,7 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID CHECK_EXPECT(Exec_MSHTML_PARSECOMPLETE); ok(pvaIn == NULL, "pvaIn != NULL\n"); ok(pvaOut == NULL, "pvaOut != NULL\n"); + test_performance_timing(doc_unk, L"domComplete"); return S_OK; default: ok(0, "unexpected command %ld\n", nCmdID);
1
0
0
0
Gabriel Ivăncescu : mshtml: Implement performance.timing.domInteractive.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: ac7a3de155a94235b91a1578858765309983943b URL:
https://gitlab.winehq.org/wine/wine/-/commit/ac7a3de155a94235b91a1578858765…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Nov 22 18:26:22 2022 +0200 mshtml: Implement performance.timing.domInteractive. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/mutation.c | 2 + dlls/mshtml/omnavigator.c | 4 +- dlls/mshtml/tests/documentmode.js | 5 +++ dlls/mshtml/tests/htmldoc.c | 84 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 94 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 96042e60ff8..7d50a3b962f 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -518,6 +518,7 @@ typedef struct { ULONGLONG request_time; ULONGLONG response_start_time; ULONGLONG response_end_time; + ULONGLONG dom_interactive_time; } HTMLPerformanceTiming; typedef struct nsChannelBSC nsChannelBSC; diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index 7166d74cf0c..a311c2a0ba8 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -305,6 +305,8 @@ static nsresult run_end_load(HTMLDocumentNode *This, nsISupports *arg1, nsISuppo } bind_event_scripts(This); + + This->window->performance_timing->dom_interactive_time = get_time_stamp(); set_ready_state(This->outer_window, READYSTATE_INTERACTIVE); return NS_OK; } diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index b0f74881f9a..a8832792359 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1756,9 +1756,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_domInteractive(IHTMLPerformanceT { 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->dom_interactive_time; return S_OK; } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index c09f10ae54a..2c6a800d8cf 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -29,6 +29,7 @@ ok(performance.timing.requestStart >= performance.timing.connectEnd, "requestSta ok(performance.timing.responseStart >= performance.timing.requestStart, "responseStart < requestStart"); ok(performance.timing.responseEnd >= performance.timing.responseStart, "responseEnd < responseStart"); ok(performance.timing.domLoading >= performance.timing.responseEnd, "domLoading < responseEnd"); +ok(performance.timing.domInteractive === 0, "domInteractive != 0"); ok(performance.timing.unloadEventStart === 0, "unloadEventStart != 0"); ok(performance.timing.unloadEventEnd === 0, "unloadEventEnd != 0"); ok(performance.timing.redirectStart === 0, "redirectStart != 0"); @@ -75,6 +76,10 @@ if(window.addEventListener) { document.attachEvent("onunload", function() { ok(false, "unload fired on document"); }); } +sync_test("performance timing", function() { + ok(performance.timing.domInteractive >= performance.timing.domLoading, "domInteractive < domLoading"); +}); + sync_test("page transition events", function() { if(document.documentMode < 11) ok(pageshow_fired === false, "pageshow fired"); diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index 49c0ddfe5c4..c530452f50b 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -450,6 +450,85 @@ static void _test_current_url(unsigned line, IUnknown *unk, const WCHAR *exurl) IHTMLDocument2_Release(doc); } +#define test_performance_timing(a,b) _test_performance_timing(__LINE__,a,b) +static void _test_performance_timing(unsigned line, IUnknown *unk, const WCHAR *prop) +{ + BOOL expect_non_zero = FALSE; + DISPPARAMS dp = { 0 }; + IHTMLWindow2 *window; + IHTMLDocument2 *doc; + IDispatchEx *dispex; + DISPID dispid; + HRESULT hres; + VARIANT var; + BSTR bstr; + + hres = IUnknown_QueryInterface(unk, &IID_IHTMLDocument2, (void**)&doc); + ok_(__FILE__,line)(hres == S_OK, "QueryInterface(IID_IHTMLDocument2) failed: %08lx\n", hres); + + hres = IHTMLDocument2_get_readyState(doc, &bstr); + ok_(__FILE__,line)(hres == S_OK, "get_readyState failed: %08lx\n", hres); + if(!wcscmp(bstr, L"interactive")) + expect_non_zero = !wcscmp(prop, L"domInteractive"); + else if(!wcscmp(bstr, L"complete")) + expect_non_zero = TRUE; + SysFreeString(bstr); + + hres = IHTMLDocument2_get_parentWindow(doc, &window); + ok_(__FILE__,line)(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); + IHTMLDocument2_Release(doc); + + hres = IHTMLWindow2_QueryInterface(window, &IID_IDispatchEx, (void**)&dispex); + ok_(__FILE__,line)(hres == S_OK, "QueryInterface(IID_IDispatchEx) failed: %08lx\n", hres); + IHTMLWindow2_Release(window); + + bstr = SysAllocString(L"performance"); + hres = IDispatchEx_GetDispID(dispex, bstr, fdexNameCaseSensitive, &dispid); + ok_(__FILE__,line)(hres == S_OK, "GetDispID(performance) failed: %08lx\n", hres); + SysFreeString(bstr); + + V_VT(&var) = VT_EMPTY; + hres = IDispatchEx_InvokeEx(dispex, dispid, 0, DISPATCH_PROPERTYGET, &dp, &var, NULL, NULL); + ok_(__FILE__,line)(hres == S_OK, "InvokeEx(performance) failed: %08lx\n", hres); + ok_(__FILE__,line)(V_VT(&var) == VT_DISPATCH, "V_VT(performance) = %d\n", V_VT(&var)); + ok_(__FILE__,line)(V_DISPATCH(&var) != NULL, "V_DISPATCH(performance) = NULL\n"); + IDispatchEx_Release(dispex); + + hres = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IDispatchEx, (void**)&dispex); + ok_(__FILE__,line)(hres == S_OK, "QueryInterface(IID_IDispatchEx) failed: %08lx\n", hres); + VariantClear(&var); + + bstr = SysAllocString(L"timing"); + hres = IDispatchEx_GetDispID(dispex, bstr, fdexNameCaseSensitive, &dispid); + ok_(__FILE__,line)(hres == S_OK, "GetDispID(timing) failed: %08lx\n", hres); + SysFreeString(bstr); + + hres = IDispatchEx_InvokeEx(dispex, dispid, 0, DISPATCH_PROPERTYGET, &dp, &var, NULL, NULL); + ok_(__FILE__,line)(hres == S_OK, "InvokeEx(timing) failed: %08lx\n", hres); + ok_(__FILE__,line)(V_VT(&var) == VT_DISPATCH, "V_VT(timing) = %d\n", V_VT(&var)); + ok_(__FILE__,line)(V_DISPATCH(&var) != NULL, "V_DISPATCH(timing) = NULL\n"); + IDispatchEx_Release(dispex); + + hres = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IDispatchEx, (void**)&dispex); + ok_(__FILE__,line)(hres == S_OK, "QueryInterface(IID_IDispatchEx) failed: %08lx\n", hres); + VariantClear(&var); + + bstr = SysAllocString(prop); + hres = IDispatchEx_GetDispID(dispex, bstr, fdexNameCaseSensitive, &dispid); + ok_(__FILE__,line)(hres == S_OK, "GetDispID(%s) failed: %08lx\n", wine_dbgstr_w(prop), hres); + SysFreeString(bstr); + + hres = IDispatchEx_InvokeEx(dispex, dispid, 0, DISPATCH_PROPERTYGET, &dp, &var, NULL, NULL); + ok_(__FILE__,line)(hres == S_OK, "InvokeEx(%s) failed: %08lx\n", wine_dbgstr_w(prop), hres); + ok_(__FILE__,line)(V_VT(&var) == VT_UI8, "V_VT(%s) = %d\n", wine_dbgstr_w(prop), V_VT(&var)); + IDispatchEx_Release(dispex); + + if(expect_non_zero) + ok_(__FILE__,line)(V_UI8(&var) != 0, "%s is 0\n", wine_dbgstr_w(prop)); + else + ok_(__FILE__,line)(V_UI8(&var) == 0, "%s is not 0\n", wine_dbgstr_w(prop)); +} + static BSTR get_mime_type_display_name(const WCHAR *content_type) { WCHAR buffer[128], ext[128], *str, *progid; @@ -1039,6 +1118,10 @@ static HRESULT WINAPI PropertyNotifySink_OnChanged(IPropertyNotifySink *iface, D if(!editmode) test_readyState(NULL); readystate_set_interactive = (load_state != LD_INTERACTIVE); + + /* w10pro64_ja has it set to zero despite readyState being interactive, for whatever reason */ + if(!is_mhtml) + test_performance_timing(doc_unk, L"domInteractive"); return S_OK; case 1012: CHECK_EXPECT2(OnChanged_1012); @@ -3574,6 +3657,7 @@ static HRESULT WINAPI DocObjectService_FireNavigateComplete2( { CHECK_EXPECT(FireNavigateComplete2); test_readyState(NULL); + test_performance_timing(doc_unk, L"domInteractive"); if(loading_hash) ok(dwFlags == 0x10 || broken(!dwFlags), "dwFlags = %lx, expected 0x10\n", dwFlags);
1
0
0
0
Gabriel Ivăncescu : mshtml: Implement performance.timing.domLoading.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: d0165504befa60e4b5d12fd9248781093d390af5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d0165504befa60e4b5d12fd9248781…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Nov 22 18:26:22 2022 +0200 mshtml: Implement performance.timing.domLoading. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/omnavigator.c | 5 +++-- dlls/mshtml/tests/documentmode.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 1be3d2f246c..b0f74881f9a 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1745,9 +1745,10 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_domLoading(IHTMLPerformanceTimin { 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; + /* Make sure this is after responseEnd, when the Gecko parser starts */ + *p = This->response_end_time; return S_OK; } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 881a08e9a54..c09f10ae54a 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -28,6 +28,7 @@ ok(performance.timing.connectEnd >= performance.timing.connectStart, "connectEnd ok(performance.timing.requestStart >= performance.timing.connectEnd, "requestStart < connectEnd"); ok(performance.timing.responseStart >= performance.timing.requestStart, "responseStart < requestStart"); ok(performance.timing.responseEnd >= performance.timing.responseStart, "responseEnd < responseStart"); +ok(performance.timing.domLoading >= performance.timing.responseEnd, "domLoading < responseEnd"); ok(performance.timing.unloadEventStart === 0, "unloadEventStart != 0"); ok(performance.timing.unloadEventEnd === 0, "unloadEventEnd != 0"); ok(performance.timing.redirectStart === 0, "redirectStart != 0");
1
0
0
0
Gabriel Ivăncescu : mshtml: Implement performance.timing.responseStart & responseEnd.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: 3de9f679d638e3e245f69b24ab9794e5e961fd69 URL:
https://gitlab.winehq.org/wine/wine/-/commit/3de9f679d638e3e245f69b24ab9794…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Nov 22 18:26:22 2022 +0200 mshtml: Implement performance.timing.responseStart & responseEnd. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/navigate.c | 23 ++++++++++++++++------- dlls/mshtml/omnavigator.c | 8 ++++---- dlls/mshtml/tests/documentmode.js | 2 ++ 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 6fe28252f64..96042e60ff8 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -516,6 +516,8 @@ typedef struct { ULONGLONG dns_lookup_time; ULONGLONG connect_time; ULONGLONG request_time; + ULONGLONG response_start_time; + ULONGLONG response_end_time; } HTMLPerformanceTiming; typedef struct nsChannelBSC nsChannelBSC; diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index fe3c823d508..469bd0d1e07 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -1107,6 +1107,9 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream) if(!This->response_processed) { IWinInetHttpInfo *wininet_info; + if(This->is_doc_channel) + This->bsc.window->performance_timing->response_start_time = get_time_stamp(); + This->response_processed = TRUE; if(This->bsc.binding) { hres = IBinding_QueryInterface(This->bsc.binding, &IID_IWinInetHttpInfo, (void**)&wininet_info); @@ -1522,13 +1525,16 @@ static HRESULT nsChannelBSC_stop_binding(BSCallback *bsc, HRESULT result) { nsChannelBSC *This = nsChannelBSC_from_BSCallback(bsc); - if(result != E_ABORT && This->is_doc_channel && This->bsc.window) { - if(FAILED(result)) - handle_navigation_error(This, result); - else if(This->nschannel) { - result = async_stop_request(This); - if(SUCCEEDED(result)) - return S_OK; + if(This->is_doc_channel && This->bsc.window) { + This->bsc.window->performance_timing->response_end_time = get_time_stamp(); + if(result != E_ABORT) { + if(FAILED(result)) + handle_navigation_error(This, result); + else if(This->nschannel) { + result = async_stop_request(This); + if(SUCCEEDED(result)) + return S_OK; + } } } @@ -1786,6 +1792,9 @@ static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code, char *str; HRESULT hres; + if(This->is_doc_channel) + This->bsc.window->performance_timing->response_start_time = get_time_stamp(); + This->response_processed = TRUE; This->nschannel->response_status = response_code; diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 630ba7fad27..1be3d2f246c 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1725,9 +1725,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_responseStart(IHTMLPerformanceTi { 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->response_start_time; return S_OK; } @@ -1735,9 +1735,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_responseEnd(IHTMLPerformanceTimi { 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->response_end_time; return S_OK; } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index e933ea0ff54..881a08e9a54 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -26,6 +26,8 @@ ok(performance.timing.domainLookupEnd >= performance.timing.domainLookupStart, " ok(performance.timing.connectStart >= performance.timing.domainLookupEnd, "connectStart < domainLookupEnd"); ok(performance.timing.connectEnd >= performance.timing.connectStart, "connectEnd < connectStart"); ok(performance.timing.requestStart >= performance.timing.connectEnd, "requestStart < connectEnd"); +ok(performance.timing.responseStart >= performance.timing.requestStart, "responseStart < requestStart"); +ok(performance.timing.responseEnd >= performance.timing.responseStart, "responseEnd < responseStart"); ok(performance.timing.unloadEventStart === 0, "unloadEventStart != 0"); ok(performance.timing.unloadEventEnd === 0, "unloadEventEnd != 0"); ok(performance.timing.redirectStart === 0, "redirectStart != 0");
1
0
0
0
Gabriel Ivăncescu : mshtml: Implement the remaining pre-response performance.timing props.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: 0118f3608fbbe7d4a80392be844cfa84711acefb URL:
https://gitlab.winehq.org/wine/wine/-/commit/0118f3608fbbe7d4a80392be844cfa…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Nov 22 18:26:22 2022 +0200 mshtml: Implement the remaining pre-response performance.timing props. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/mshtml_private.h | 3 +++ dlls/mshtml/navigate.c | 12 +++++++++ dlls/mshtml/omnavigator.c | 52 ++++++++++++++++++++++++++++----------- dlls/mshtml/tests/documentmode.js | 7 ++++++ 4 files changed, 60 insertions(+), 14 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index ef21507d553..6fe28252f64 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -513,6 +513,9 @@ typedef struct { ULONGLONG unload_event_start_time; ULONGLONG unload_event_end_time; ULONGLONG redirect_time; + ULONGLONG dns_lookup_time; + ULONGLONG connect_time; + ULONGLONG request_time; } HTMLPerformanceTiming; typedef struct nsChannelBSC nsChannelBSC; diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index f53348b7721..fe3c823d508 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -1720,6 +1720,18 @@ static HRESULT nsChannelBSC_on_progress(BSCallback *bsc, ULONG progress, ULONG t if(This->is_doc_channel && !This->bsc.window->performance_timing->redirect_time) This->bsc.window->performance_timing->redirect_time = get_time_stamp(); return handle_redirect(This, status_text); + case BINDSTATUS_FINDINGRESOURCE: + if(This->is_doc_channel && !This->bsc.window->performance_timing->dns_lookup_time) + This->bsc.window->performance_timing->dns_lookup_time = get_time_stamp(); + break; + case BINDSTATUS_CONNECTING: + if(This->is_doc_channel) + This->bsc.window->performance_timing->connect_time = get_time_stamp(); + break; + case BINDSTATUS_SENDINGREQUEST: + if(This->is_doc_channel) + This->bsc.window->performance_timing->request_time = get_time_stamp(); + break; case BINDSTATUS_BEGINDOWNLOADDATA: { IWinInetHttpInfo *http_info; DWORD status, size = sizeof(DWORD); diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 194d3a7a931..630ba7fad27 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1587,6 +1587,24 @@ static HRESULT WINAPI HTMLPerformanceTiming_Invoke(IHTMLPerformanceTiming *iface #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 */ + if(!This->unload_event_end_time && !This->redirect_time) + return This->navigation_start_time; + + if(This->dns_lookup_time) + return This->dns_lookup_time; + if(This->connect_time) + return This->connect_time; + if(This->request_time) + return This->request_time; + if(This->unload_event_end_time) + return This->unload_event_end_time; + + return This->redirect_time; +} + static HRESULT WINAPI HTMLPerformanceTiming_get_navigationStart(IHTMLPerformanceTiming *iface, ULONGLONG *p) { HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface); @@ -1631,9 +1649,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_redirectEnd(IHTMLPerformanceTimi { 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->redirect_time ? get_fetch_time(This) : 0; return S_OK; } @@ -1641,9 +1659,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_fetchStart(IHTMLPerformanceTimin { 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 = get_fetch_time(This); return S_OK; } @@ -1651,9 +1669,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_domainLookupStart(IHTMLPerforman { 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->dns_lookup_time ? This->dns_lookup_time : get_fetch_time(This); return S_OK; } @@ -1661,9 +1679,10 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_domainLookupEnd(IHTMLPerformance { 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->connect_time ? This->connect_time : + This->dns_lookup_time ? This->dns_lookup_time : get_fetch_time(This); return S_OK; } @@ -1671,9 +1690,10 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_connectStart(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->connect_time ? This->connect_time : + This->dns_lookup_time ? This->dns_lookup_time : get_fetch_time(This); return S_OK; } @@ -1681,9 +1701,11 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_connectEnd(IHTMLPerformanceTimin { 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->request_time ? This->request_time : + This->connect_time ? This->connect_time : + This->dns_lookup_time ? This->dns_lookup_time : get_fetch_time(This); return S_OK; } @@ -1691,9 +1713,11 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_requestStart(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->request_time ? This->request_time : + This->connect_time ? This->connect_time : + This->dns_lookup_time ? This->dns_lookup_time : get_fetch_time(This); return S_OK; } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index a9c2b36ceee..e933ea0ff54 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -20,9 +20,16 @@ var compat_version; var tests = []; ok(performance.timing.navigationStart > 0, "navigationStart <= 0"); +ok(performance.timing.fetchStart == performance.timing.navigationStart, "fetchStart != navigationStart"); +ok(performance.timing.domainLookupStart >= performance.timing.fetchStart, "domainLookupStart < fetchStart"); +ok(performance.timing.domainLookupEnd >= performance.timing.domainLookupStart, "domainLookupEnd < domainLookupStart"); +ok(performance.timing.connectStart >= performance.timing.domainLookupEnd, "connectStart < domainLookupEnd"); +ok(performance.timing.connectEnd >= performance.timing.connectStart, "connectEnd < connectStart"); +ok(performance.timing.requestStart >= performance.timing.connectEnd, "requestStart < connectEnd"); 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"); var pageshow_fired = false, pagehide_fired = false; document.doc_unload_events_called = false;
1
0
0
0
Gabriel Ivăncescu : mshtml: Implement performance.timing.unloadEventStart & unloadEventEnd.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: 020a020df1a944985c6341726f4daf5acd85a7e1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/020a020df1a944985c6341726f4daf…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Nov 22 18:26:22 2022 +0200 mshtml: Implement performance.timing.unloadEventStart & unloadEventEnd. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmlwindow.c | 3 +++ dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/nsevents.c | 10 ++++++++++ dlls/mshtml/omnavigator.c | 8 ++++---- dlls/mshtml/tests/documentmode.js | 2 ++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 9f64e3526c6..ec7fc0d43f2 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -4125,6 +4125,9 @@ HRESULT create_outer_window(GeckoBrowser *browser, mozIDOMWindowProxy *mozwindow return hres; } + /* Initial empty doc does not have unload events or timings */ + window->base.inner_window->doc->unload_sent = TRUE; + if(parent) { IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index db72f29e1a3..ef21507d553 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -510,6 +510,8 @@ typedef struct { LONG ref; ULONGLONG navigation_start_time; + ULONGLONG unload_event_start_time; + ULONGLONG unload_event_end_time; ULONGLONG redirect_time; } HTMLPerformanceTiming; diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index 0248737b012..1c4bdee4e1d 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -384,6 +384,7 @@ static nsresult NSAPI handle_unload(nsIDOMEventListener *iface, nsIDOMEvent *nse { nsEventListener *This = impl_from_nsIDOMEventListener(iface); HTMLDocumentNode *doc = This->This->doc; + HTMLPerformanceTiming *timing = NULL; HTMLInnerWindow *window; DOMEvent *event; HRESULT hres; @@ -392,12 +393,21 @@ static nsresult NSAPI handle_unload(nsIDOMEventListener *iface, nsIDOMEvent *nse return NS_OK; doc->unload_sent = TRUE; + if(window->base.outer_window->pending_window) + timing = window->base.outer_window->pending_window->performance_timing; + + if(timing) + timing->unload_event_start_time = get_time_stamp(); + hres = create_event_from_nsevent(nsevent, dispex_compat_mode(&doc->node.event_target.dispex), &event); if(SUCCEEDED(hres)) { dispatch_event(&window->event_target, event); IDOMEvent_Release(&event->IDOMEvent_iface); } + if(timing) + timing->unload_event_end_time = get_time_stamp(); + return NS_OK; } diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 57c59eaddca..194d3a7a931 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1601,9 +1601,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_unloadEventStart(IHTMLPerformanc { 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->unload_event_start_time; return S_OK; } @@ -1611,9 +1611,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_unloadEventEnd(IHTMLPerformanceT { 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->unload_event_end_time; return S_OK; } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index f0a91fea545..a9c2b36ceee 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -20,6 +20,8 @@ var compat_version; var tests = []; ok(performance.timing.navigationStart > 0, "navigationStart <= 0"); +ok(performance.timing.unloadEventStart === 0, "unloadEventStart != 0"); +ok(performance.timing.unloadEventEnd === 0, "unloadEventEnd != 0"); ok(performance.timing.redirectStart === 0, "redirectStart != 0"); var pageshow_fired = false, pagehide_fired = false;
1
0
0
0
Gabriel Ivăncescu : mshtml: Implement performance.timing.redirectStart.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: 5db7d0d0ead3247bae3659d4bbff9ebbf2ddb220 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5db7d0d0ead3247bae3659d4bbff9e…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Nov 22 18:26:21 2022 +0200 mshtml: Implement performance.timing.redirectStart. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/navigate.c | 2 ++ dlls/mshtml/omnavigator.c | 4 ++-- dlls/mshtml/tests/documentmode.js | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index d80c9284168..db72f29e1a3 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -510,6 +510,7 @@ typedef struct { LONG ref; ULONGLONG navigation_start_time; + ULONGLONG redirect_time; } HTMLPerformanceTiming; typedef struct nsChannelBSC nsChannelBSC; diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 241d790f9e6..f53348b7721 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -1717,6 +1717,8 @@ static HRESULT nsChannelBSC_on_progress(BSCallback *bsc, ULONG progress, ULONG t This->nschannel->content_type = heap_strdupWtoA(status_text); break; case BINDSTATUS_REDIRECTING: + if(This->is_doc_channel && !This->bsc.window->performance_timing->redirect_time) + This->bsc.window->performance_timing->redirect_time = get_time_stamp(); return handle_redirect(This, status_text); case BINDSTATUS_BEGINDOWNLOADDATA: { IWinInetHttpInfo *http_info; diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 128f9d700eb..57c59eaddca 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1621,9 +1621,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_redirectStart(IHTMLPerformanceTi { 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->redirect_time; return S_OK; } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index f83597d305a..f0a91fea545 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -20,6 +20,7 @@ var compat_version; var tests = []; ok(performance.timing.navigationStart > 0, "navigationStart <= 0"); +ok(performance.timing.redirectStart === 0, "redirectStart != 0"); var pageshow_fired = false, pagehide_fired = false; document.doc_unload_events_called = false;
1
0
0
0
Gabriel Ivăncescu : mshtml: Implement performance.timing.navigationStart.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: fe66c7240a0f722a7368b4b2c9fd96674545aa91 URL:
https://gitlab.winehq.org/wine/wine/-/commit/fe66c7240a0f722a7368b4b2c9fd96…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Nov 22 18:26:21 2022 +0200 mshtml: Implement performance.timing.navigationStart. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/navigate.c | 4 +++- dlls/mshtml/omnavigator.c | 4 ++-- dlls/mshtml/tests/documentmode.js | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 744dc4c7801..d80c9284168 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -508,6 +508,8 @@ typedef struct { IHTMLPerformanceTiming IHTMLPerformanceTiming_iface; LONG ref; + + ULONGLONG navigation_start_time; } HTMLPerformanceTiming; typedef struct nsChannelBSC nsChannelBSC; diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 5825e0f27c0..241d790f9e6 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -1357,8 +1357,10 @@ static HRESULT nsChannelBSC_start_binding(BSCallback *bsc) { nsChannelBSC *This = nsChannelBSC_from_BSCallback(bsc); - if(This->is_doc_channel) + if(This->is_doc_channel) { This->bsc.window->base.outer_window->base.inner_window->doc->skip_mutation_notif = FALSE; + This->bsc.window->performance_timing->navigation_start_time = get_time_stamp(); + } return S_OK; } diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 4551f4e2dc3..128f9d700eb 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1591,9 +1591,9 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_navigationStart(IHTMLPerformance { 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->navigation_start_time; return S_OK; } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 33d60f7e835..f83597d305a 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -19,6 +19,8 @@ var compat_version; var tests = []; +ok(performance.timing.navigationStart > 0, "navigationStart <= 0"); + var pageshow_fired = false, pagehide_fired = false; document.doc_unload_events_called = false; window.onbeforeunload = function() { ok(false, "beforeunload fired"); };
1
0
0
0
Gabriel Ivăncescu : mshtml: Link the performance.timing from the window at creation.
by Alexandre Julliard
22 Nov '22
22 Nov '22
Module: wine Branch: master Commit: 1dc507d33c43660f1b6edd1f238f48f69cea5a98 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1dc507d33c43660f1b6edd1f238f48…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Nov 22 18:26:21 2022 +0200 mshtml: Link the performance.timing from the window at creation. This avoids having to keep refs to the window from the performance timing. The dispex initialization is deferred until it's actually used, however, so it has the proper compat mode. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmlwindow.c | 10 ++++++++- dlls/mshtml/mshtml_private.h | 11 ++++++++- dlls/mshtml/omnavigator.c | 53 ++++++++++++++++++++++---------------------- 3 files changed, 46 insertions(+), 28 deletions(-) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 5c5f0542ddd..9f64e3526c6 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -308,6 +308,7 @@ static void release_inner_window(HTMLInnerWindow *This) IHTMLStorage_Release(This->local_storage); } + IHTMLPerformanceTiming_Release(&This->performance_timing->IHTMLPerformanceTiming_iface); VariantClear(&This->performance); if(This->mon) @@ -2434,7 +2435,7 @@ static HRESULT WINAPI HTMLWindow7_get_performance(IHTMLWindow7 *iface, VARIANT * if(!This->performance_initialized) { IHTMLPerformance *performance; - hres = create_performance(dispex_compat_mode(&This->event_target.dispex), &performance); + hres = create_performance(This, &performance); if(FAILED(hres)) return hres; @@ -4056,11 +4057,18 @@ static void *alloc_window(size_t size) static HRESULT create_inner_window(HTMLOuterWindow *outer_window, IMoniker *mon, HTMLInnerWindow **ret) { HTMLInnerWindow *window; + HRESULT hres; window = alloc_window(sizeof(HTMLInnerWindow)); if(!window) return E_OUTOFMEMORY; + hres = create_performance_timing(&window->performance_timing); + if(FAILED(hres)) { + heap_free(window); + return hres; + } + list_init(&window->children); list_init(&window->script_hosts); list_init(&window->bindings); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index d9e2d93d220..744dc4c7801 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -503,6 +503,13 @@ typedef struct { HTMLInnerWindow *window; } OmHistory; +typedef struct { + DispatchEx dispex; + IHTMLPerformanceTiming IHTMLPerformanceTiming_iface; + + LONG ref; +} HTMLPerformanceTiming; + typedef struct nsChannelBSC nsChannelBSC; struct HTMLWindow { @@ -579,6 +586,7 @@ struct HTMLInnerWindow { BOOL performance_initialized; VARIANT performance; + HTMLPerformanceTiming *performance_timing; unsigned parser_callback_cnt; struct list script_queue; @@ -966,7 +974,8 @@ HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow*,HTMLXMLHttpRequestFact HRESULT HTMLLocation_Create(HTMLInnerWindow*,HTMLLocation**) DECLSPEC_HIDDEN; HRESULT create_navigator(compat_mode_t,IOmNavigator**) DECLSPEC_HIDDEN; HRESULT create_html_screen(compat_mode_t,IHTMLScreen**) DECLSPEC_HIDDEN; -HRESULT create_performance(compat_mode_t,IHTMLPerformance**) DECLSPEC_HIDDEN; +HRESULT create_performance(HTMLInnerWindow*,IHTMLPerformance**) DECLSPEC_HIDDEN; +HRESULT create_performance_timing(HTMLPerformanceTiming**) DECLSPEC_HIDDEN; HRESULT create_history(HTMLInnerWindow*,OmHistory**) DECLSPEC_HIDDEN; HRESULT create_namespace_collection(compat_mode_t,IHTMLNamespaceCollection**) DECLSPEC_HIDDEN; HRESULT create_dom_implementation(HTMLDocumentNode*,IHTMLDOMImplementation**) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index db48cc6213b..4551f4e2dc3 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1497,13 +1497,6 @@ HRESULT create_navigator(compat_mode_t compat_mode, IOmNavigator **navigator) return S_OK; } -typedef struct { - DispatchEx dispex; - IHTMLPerformanceTiming IHTMLPerformanceTiming_iface; - - LONG ref; -} HTMLPerformanceTiming; - static inline HTMLPerformanceTiming *impl_from_IHTMLPerformanceTiming(IHTMLPerformanceTiming *iface) { return CONTAINING_RECORD(iface, HTMLPerformanceTiming, IHTMLPerformanceTiming_iface); @@ -1549,7 +1542,8 @@ static ULONG WINAPI HTMLPerformanceTiming_Release(IHTMLPerformanceTiming *iface) TRACE("(%p) ref=%ld\n", This, ref); if(!ref) { - release_dispex(&This->dispex); + if(This->dispex.outer) + release_dispex(&This->dispex); heap_free(This); } @@ -1863,6 +1857,22 @@ static dispex_static_data_t HTMLPerformanceTiming_dispex = { HTMLPerformanceTiming_iface_tids }; +HRESULT create_performance_timing(HTMLPerformanceTiming **ret) +{ + HTMLPerformanceTiming *timing; + + timing = heap_alloc_zero(sizeof(*timing)); + if(!timing) + return E_OUTOFMEMORY; + + timing->IHTMLPerformanceTiming_iface.lpVtbl = &HTMLPerformanceTimingVtbl; + timing->ref = 1; + + /* Defer initializing the dispex until it's actually needed (for compat mode) */ + *ret = timing; + return S_OK; +} + typedef struct { DispatchEx dispex; IHTMLPerformanceNavigation IHTMLPerformanceNavigation_iface; @@ -2070,8 +2080,7 @@ static ULONG WINAPI HTMLPerformance_Release(IHTMLPerformance *iface) TRACE("(%p) ref=%ld\n", This, ref); if(!ref) { - if(This->timing) - IHTMLPerformanceTiming_Release(This->timing); + IHTMLPerformanceTiming_Release(This->timing); if(This->navigation) IHTMLPerformanceNavigation_Release(This->navigation); release_dispex(&This->dispex); @@ -2148,21 +2157,6 @@ static HRESULT WINAPI HTMLPerformance_get_timing(IHTMLPerformance *iface, IHTMLP TRACE("(%p)->(%p)\n", This, p); - if(!This->timing) { - HTMLPerformanceTiming *timing; - - timing = heap_alloc_zero(sizeof(*timing)); - if(!timing) - return E_OUTOFMEMORY; - - timing->IHTMLPerformanceTiming_iface.lpVtbl = &HTMLPerformanceTimingVtbl; - timing->ref = 1; - init_dispatch(&timing->dispex, (IUnknown*)&timing->IHTMLPerformanceTiming_iface, - &HTMLPerformanceTiming_dispex, dispex_compat_mode(&This->dispex)); - - This->timing = &timing->IHTMLPerformanceTiming_iface; - } - IHTMLPerformanceTiming_AddRef(*p = This->timing); return S_OK; } @@ -2208,8 +2202,9 @@ static dispex_static_data_t HTMLPerformance_dispex = { HTMLPerformance_iface_tids }; -HRESULT create_performance(compat_mode_t compat_mode, IHTMLPerformance **ret) +HRESULT create_performance(HTMLInnerWindow *window, IHTMLPerformance **ret) { + compat_mode_t compat_mode = dispex_compat_mode(&window->event_target.dispex); HTMLPerformance *performance; performance = heap_alloc_zero(sizeof(*performance)); @@ -2222,6 +2217,12 @@ HRESULT create_performance(compat_mode_t compat_mode, IHTMLPerformance **ret) init_dispatch(&performance->dispex, (IUnknown*)&performance->IHTMLPerformance_iface, &HTMLPerformance_dispex, compat_mode); + performance->timing = &window->performance_timing->IHTMLPerformanceTiming_iface; + IHTMLPerformanceTiming_AddRef(performance->timing); + + init_dispatch(&window->performance_timing->dispex, (IUnknown*)&window->performance_timing->IHTMLPerformanceTiming_iface, + &HTMLPerformanceTiming_dispex, compat_mode); + *ret = &performance->IHTMLPerformance_iface; return S_OK; }
1
0
0
0
← Newer
1
...
31
32
33
34
35
36
37
...
118
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Results per page:
10
25
50
100
200