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
fded20df
Commit
fded20df
authored
Oct 13, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Oct 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Don't create dynamic prop before checking if elem prop even exists.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
d5c764e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
7 deletions
+54
-7
htmldoc.c
dlls/mshtml/htmldoc.c
+6
-5
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
documentmode.js
dlls/mshtml/tests/documentmode.js
+47
-2
No files found.
dlls/mshtml/htmldoc.c
View file @
fded20df
...
...
@@ -4981,7 +4981,7 @@ static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName,
HTMLDocument
*
This
=
impl_from_IDispatchEx
(
iface
);
HRESULT
hres
;
hres
=
IDispatchEx_GetDispID
(
This
->
dispex
,
bstrName
,
grfdex
,
pid
);
hres
=
IDispatchEx_GetDispID
(
This
->
dispex
,
bstrName
,
grfdex
&
~
fdexNameEnsure
,
pid
);
if
(
hres
!=
DISP_E_UNKNOWNNAME
)
return
hres
;
...
...
@@ -4990,6 +4990,9 @@ static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName,
if
(
SUCCEEDED
(
hres
))
hres
=
dispid_from_elem_name
(
This
->
doc_node
,
bstrName
,
pid
);
}
if
(
hres
==
DISP_E_UNKNOWNNAME
&&
(
grfdex
&
fdexNameEnsure
))
hres
=
IDispatchEx_GetDispID
(
This
->
dispex
,
bstrName
,
grfdex
,
pid
);
return
hres
;
}
...
...
@@ -5899,10 +5902,8 @@ static HRESULT HTMLDocumentNode_invoke(DispatchEx *dispex, DISPID id, LCID lcid,
unsigned
i
;
HRESULT
hres
;
if
(
flags
!=
DISPATCH_PROPERTYGET
&&
flags
!=
(
DISPATCH_METHOD
|
DISPATCH_PROPERTYGET
))
{
FIXME
(
"unsupported flags %x
\n
"
,
flags
);
return
E_NOTIMPL
;
}
if
(
flags
!=
DISPATCH_PROPERTYGET
&&
flags
!=
(
DISPATCH_METHOD
|
DISPATCH_PROPERTYGET
))
return
MSHTML_E_INVALID_PROPERTY
;
i
=
id
-
MSHTML_DISPID_CUSTOM_MIN
;
...
...
dlls/mshtml/mshtml_private.h
View file @
fded20df
...
...
@@ -72,6 +72,7 @@
#define NSAPI WINAPI
#define MSHTML_E_INVALID_PROPERTY 0x800a01b6
#define MSHTML_E_INVALID_ACTION 0x800a01bd
#define MSHTML_E_NODOC 0x800a025c
...
...
dlls/mshtml/tests/documentmode.js
View file @
fded20df
...
...
@@ -669,13 +669,13 @@ sync_test("for..in", function() {
sync_test
(
"elem_by_id"
,
function
()
{
document
.
body
.
innerHTML
=
'<form id="testid" name="testname"></form>'
;
var
found
,
i
;
var
v
=
document
.
documentMode
,
found
,
i
;
var
id_elem
=
document
.
getElementById
(
"testid"
);
ok
(
id_elem
.
tagName
===
"FORM"
,
"id_elem.tagName = "
+
id_elem
.
tagName
);
var
name_elem
=
document
.
getElementById
(
"testname"
);
if
(
document
.
documentMode
<
8
)
if
(
v
<
8
)
ok
(
id_elem
===
name_elem
,
"id_elem != id_elem"
);
else
ok
(
name_elem
===
null
,
"name_elem != null"
);
...
...
@@ -705,6 +705,51 @@ sync_test("elem_by_id", function() {
}
ok
(
found
,
"testname was not enumerated in document"
);
try
{
document
.
testname
();
ok
(
false
,
"document.testname() did not throw exception"
);
}
catch
(
e
)
{
ok
(
e
.
number
===
0xa01b6
-
0x80000000
,
"document.testname() threw = "
+
e
.
number
);
}
try
{
document
.
testname
=
"foo"
;
ok
(
v
>=
9
,
"Setting document.testname did not throw exception"
);
id_elem
=
document
.
testid
;
ok
(
id_elem
.
tagName
===
"FORM"
,
"document.testid after set = "
+
id_elem
);
name_elem
=
document
.
testname
;
ok
(
name_elem
===
"foo"
,
"document.testname after set = "
+
name_elem
);
}
catch
(
e
)
{
todo_wine_if
(
v
>=
9
).
ok
(
v
<
9
&&
e
.
number
===
0xa01b6
-
0x80000000
,
"Setting document.testname threw = "
+
e
.
number
);
}
try
{
document
.
testid
=
"bar"
;
ok
(
v
>=
9
,
"Setting document.testid did not throw exception"
);
id_elem
=
document
.
testid
;
ok
(
id_elem
===
"bar"
,
"document.testid after both set = "
+
id_elem
);
name_elem
=
document
.
testname
;
ok
(
name_elem
===
"foo"
,
"document.testname after both set = "
+
name_elem
);
found
=
false
,
name_elem
=
false
;
for
(
id_elem
in
document
)
{
if
(
id_elem
===
"testid"
)
found
=
true
;
if
(
id_elem
===
"testname"
)
name_elem
=
true
;
}
ok
(
found
,
"testid was not enumerated in document after both set"
);
ok
(
name_elem
,
"testname was not enumerated in document after both set"
);
delete
document
.
testid
;
delete
document
.
testname
;
}
catch
(
e
)
{
todo_wine_if
(
v
>=
9
).
ok
(
v
<
9
&&
e
.
number
===
0xa01b6
-
0x80000000
,
"Setting document.testid threw = "
+
e
.
number
);
}
// these tags expose name as props, and id only if they have a name
var
tags
=
[
"embed"
,
"form"
,
"iframe"
,
"img"
];
for
(
i
in
tags
)
{
...
...
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