Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
35ee1081
Commit
35ee1081
authored
Nov 22, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Nov 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement performance.timing.domContentLoadedEventStart & End.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
e0cda0e1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
10 deletions
+43
-10
htmlevent.c
dlls/mshtml/htmlevent.c
+1
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-0
nsevents.c
dlls/mshtml/nsevents.c
+31
-4
omnavigator.c
dlls/mshtml/omnavigator.c
+4
-4
documentmode.js
dlls/mshtml/tests/documentmode.js
+5
-1
No files found.
dlls/mshtml/htmlevent.c
View file @
35ee1081
...
...
@@ -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
,
...
...
dlls/mshtml/mshtml_private.h
View file @
35ee1081
...
...
@@ -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
;
...
...
dlls/mshtml/nsevents.c
View file @
35ee1081
...
...
@@ -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
*
);
...
...
@@ -75,10 +76,11 @@ static const struct {
{
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_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
)
},
};
...
...
@@ -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
);
...
...
dlls/mshtml/omnavigator.c
View file @
35ee1081
...
...
@@ -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
=
T
IMING_FAKE_TIMESTAMP
;
*
p
=
T
his
->
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
=
T
IMING_FAKE_TIMESTAMP
;
*
p
=
T
his
->
dom_content_loaded_event_end_time
;
return
S_OK
;
}
...
...
dlls/mshtml/tests/documentmode.js
View file @
35ee1081
...
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment