Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
000321b2
Commit
000321b2
authored
Mar 15, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use single navigator instance per inner window.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4cfac484
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
8 deletions
+32
-8
htmlwindow.c
dlls/mshtml/htmlwindow.c
+12
-2
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-1
omnavigator.c
dlls/mshtml/omnavigator.c
+5
-4
dom.c
dlls/mshtml/tests/dom.c
+3
-1
dom.js
dlls/mshtml/tests/dom.js
+10
-0
No files found.
dlls/mshtml/htmlwindow.c
View file @
000321b2
...
...
@@ -294,6 +294,8 @@ static void release_inner_window(HTMLInnerWindow *This)
IOmHistory_Release
(
&
This
->
history
->
IOmHistory_iface
);
}
if
(
This
->
navigator
)
IOmNavigator_Release
(
This
->
navigator
);
if
(
This
->
session_storage
)
IHTMLStorage_Release
(
This
->
session_storage
);
if
(
This
->
local_storage
)
...
...
@@ -918,11 +920,19 @@ static HRESULT WINAPI HTMLWindow2_get_opener(IHTMLWindow2 *iface, VARIANT *p)
static
HRESULT
WINAPI
HTMLWindow2_get_navigator
(
IHTMLWindow2
*
iface
,
IOmNavigator
**
p
)
{
HTMLWindow
*
This
=
impl_from_IHTMLWindow2
(
iface
);
HTMLInnerWindow
*
window
=
This
->
inner_window
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
*
p
=
OmNavigator_Create
();
return
*
p
?
S_OK
:
E_OUTOFMEMORY
;
if
(
!
window
->
navigator
)
{
HRESULT
hres
;
hres
=
create_navigator
(
dispex_compat_mode
(
&
window
->
event_target
.
dispex
),
&
window
->
navigator
);
if
(
FAILED
(
hres
))
return
hres
;
}
IOmNavigator_AddRef
(
*
p
=
window
->
navigator
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLWindow2_put_name
(
IHTMLWindow2
*
iface
,
BSTR
v
)
...
...
dlls/mshtml/mshtml_private.h
View file @
000321b2
...
...
@@ -535,6 +535,7 @@ struct HTMLInnerWindow {
HTMLXMLHttpRequestFactory
*
xhr_factory
;
IHTMLScreen
*
screen
;
OmHistory
*
history
;
IOmNavigator
*
navigator
;
IHTMLStorage
*
session_storage
;
IHTMLStorage
*
local_storage
;
...
...
@@ -910,7 +911,7 @@ HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow*,HTMLOptionElementFactor
HRESULT
HTMLImageElementFactory_Create
(
HTMLInnerWindow
*
,
HTMLImageElementFactory
**
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLXMLHttpRequestFactory_Create
(
HTMLInnerWindow
*
,
HTMLXMLHttpRequestFactory
**
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLLocation_Create
(
HTMLInnerWindow
*
,
HTMLLocation
**
)
DECLSPEC_HIDDEN
;
IOmNavigator
*
OmNavigator_Create
(
void
)
DECLSPEC_HIDDEN
;
HRESULT
create_navigator
(
compat_mode_t
,
IOmNavigator
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_html_screen
(
compat_mode_t
,
IHTMLScreen
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_performance
(
IHTMLPerformance
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_history
(
HTMLInnerWindow
*
,
OmHistory
**
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/omnavigator.c
View file @
000321b2
...
...
@@ -1453,20 +1453,21 @@ static dispex_static_data_t OmNavigator_dispex = {
OmNavigator_iface_tids
};
IOmNavigator
*
OmNavigator_Create
(
void
)
HRESULT
create_navigator
(
compat_mode_t
compat_mode
,
IOmNavigator
**
navigator
)
{
OmNavigator
*
ret
;
ret
=
heap_alloc_zero
(
sizeof
(
*
ret
));
if
(
!
ret
)
return
NULL
;
return
E_OUTOFMEMORY
;
ret
->
IOmNavigator_iface
.
lpVtbl
=
&
OmNavigatorVtbl
;
ret
->
ref
=
1
;
init_dispex
(
&
ret
->
dispex
,
(
IUnknown
*
)
&
ret
->
IOmNavigator_iface
,
&
OmNavigator_dispex
);
init_dispex
_with_compat_mode
(
&
ret
->
dispex
,
(
IUnknown
*
)
&
ret
->
IOmNavigator_iface
,
&
OmNavigator_dispex
,
compat_mode
);
return
&
ret
->
IOmNavigator_iface
;
*
navigator
=
&
ret
->
IOmNavigator_iface
;
return
S_OK
;
}
typedef
struct
{
...
...
dlls/mshtml/tests/dom.c
View file @
000321b2
...
...
@@ -6296,12 +6296,13 @@ static void test_navigator(IHTMLDocument2 *doc)
hres
=
IHTMLWindow2_get_navigator
(
window
,
&
navigator2
);
ok
(
hres
==
S_OK
,
"get_navigator failed: %08x
\n
"
,
hres
);
todo_wine
ok
(
navigator
!=
navigator2
,
"navigator2 != navigator
\n
"
);
IOmNavigator_Release
(
navigator2
);
hres
=
IHTMLWindow2_get_clientInformation
(
window
,
&
navigator2
);
ok
(
hres
==
S_OK
,
"get_clientInformation failed: %08x
\n
"
,
hres
);
todo_wine
ok
(
iface_cmp
((
IUnknown
*
)
navigator
,
(
IUnknown
*
)
navigator2
),
"navigator2 != navigator
\n
"
);
ok
(
iface_cmp
((
IUnknown
*
)
navigator
,
(
IUnknown
*
)
navigator2
),
"navigator2 != navigator
\n
"
);
IOmNavigator_Release
(
navigator2
);
IHTMLWindow2_Release
(
window
);
...
...
@@ -6416,6 +6417,7 @@ static void test_navigator(IHTMLDocument2 *doc)
test_mime_types_col
(
navigator
);
ref
=
IOmNavigator_Release
(
navigator
);
todo_wine
ok
(
!
ref
,
"navigator should be destroyed here
\n
"
);
}
...
...
dlls/mshtml/tests/dom.js
View file @
000321b2
...
...
@@ -415,3 +415,13 @@ async_test("animation", function() {
document
.
body
.
appendChild
(
div
);
div
.
className
=
"testAnimation"
;
});
sync_test
(
"navigator"
,
function
()
{
ok
(
typeof
(
window
.
navigator
)
===
"object"
,
"typeof(window.navigator) = "
+
typeof
(
window
.
navigator
));
var
v
=
window
.
navigator
;
ok
(
v
===
window
.
navigator
,
"v != window.navigator"
);
v
.
testProp
=
true
;
ok
(
window
.
navigator
.
testProp
,
"window.navigator.testProp = "
+
window
.
navigator
.
testProp
);
});
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