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
ac7a3de1
Commit
ac7a3de1
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.domInteractive.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
d0165504
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
2 deletions
+94
-2
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
mutation.c
dlls/mshtml/mutation.c
+2
-0
omnavigator.c
dlls/mshtml/omnavigator.c
+2
-2
documentmode.js
dlls/mshtml/tests/documentmode.js
+5
-0
htmldoc.c
dlls/mshtml/tests/htmldoc.c
+84
-0
No files found.
dlls/mshtml/mshtml_private.h
View file @
ac7a3de1
...
...
@@ -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
;
...
...
dlls/mshtml/mutation.c
View file @
ac7a3de1
...
...
@@ -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
;
}
...
...
dlls/mshtml/omnavigator.c
View file @
ac7a3de1
...
...
@@ -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
=
T
IMING_FAKE_TIMESTAMP
;
*
p
=
T
his
->
dom_interactive_time
;
return
S_OK
;
}
...
...
dlls/mshtml/tests/documentmode.js
View file @
ac7a3de1
...
...
@@ -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"
);
...
...
dlls/mshtml/tests/htmldoc.c
View file @
ac7a3de1
...
...
@@ -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
);
...
...
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