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
13050fd9
Commit
13050fd9
authored
Mar 29, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Support deleting object properties.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
02f46d7e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
144 additions
and
6 deletions
+144
-6
dispex.c
dlls/mshtml/dispex.c
+35
-6
documentmode.js
dlls/mshtml/tests/documentmode.js
+109
-0
No files found.
dlls/mshtml/dispex.c
View file @
13050fd9
...
...
@@ -1675,14 +1675,26 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
}
}
static
HRESULT
WINAPI
DispatchEx_DeleteMemberByName
(
IDispatchEx
*
iface
,
BSTR
bstrN
ame
,
DWORD
grfdex
)
static
HRESULT
WINAPI
DispatchEx_DeleteMemberByName
(
IDispatchEx
*
iface
,
BSTR
n
ame
,
DWORD
grfdex
)
{
DispatchEx
*
This
=
impl_from_IDispatchEx
(
iface
);
DISPID
id
;
HRESULT
hres
;
TRACE
(
"(%p)->(%s %x)
\n
"
,
This
,
debugstr_w
(
bstrN
ame
),
grfdex
);
TRACE
(
"(%p)->(%s %x)
\n
"
,
This
,
debugstr_w
(
n
ame
),
grfdex
);
/* Not implemented by IE */
return
E_NOTIMPL
;
if
(
dispex_compat_mode
(
This
)
<
COMPAT_MODE_IE8
)
{
/* Not implemented by IE */
return
E_NOTIMPL
;
}
hres
=
IDispatchEx_GetDispID
(
&
This
->
IDispatchEx_iface
,
name
,
grfdex
&
~
fdexNameEnsure
,
&
id
);
if
(
FAILED
(
hres
))
{
TRACE
(
"property %s not found
\n
"
,
debugstr_w
(
name
));
return
dispex_compat_mode
(
This
)
<
COMPAT_MODE_IE9
?
hres
:
S_OK
;
}
return
IDispatchEx_DeleteMemberByDispID
(
&
This
->
IDispatchEx_iface
,
id
);
}
static
HRESULT
WINAPI
DispatchEx_DeleteMemberByDispID
(
IDispatchEx
*
iface
,
DISPID
id
)
...
...
@@ -1691,8 +1703,25 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID
TRACE
(
"(%p)->(%x)
\n
"
,
This
,
id
);
/* Not implemented by IE */
return
E_NOTIMPL
;
if
(
dispex_compat_mode
(
This
)
<
COMPAT_MODE_IE8
)
{
/* Not implemented by IE */
return
E_NOTIMPL
;
}
if
(
is_dynamic_dispid
(
id
))
{
DWORD
idx
=
id
-
DISPID_DYNPROP_0
;
dynamic_prop_t
*
prop
;
if
(
!
get_dynamic_data
(
This
)
||
idx
>
This
->
dynamic_data
->
prop_cnt
)
return
S_OK
;
prop
=
This
->
dynamic_data
->
props
+
idx
;
VariantClear
(
&
prop
->
var
);
prop
->
flags
|=
DYNPROP_DELETED
;
return
S_OK
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
DispatchEx_GetMemberProperties
(
IDispatchEx
*
iface
,
DISPID
id
,
DWORD
grfdexFetch
,
DWORD
*
pgrfdex
)
...
...
dlls/mshtml/tests/documentmode.js
View file @
13050fd9
...
...
@@ -379,3 +379,112 @@ sync_test("navigator", function() {
ok
(
navigator
.
toString
()
===
(
v
<
9
?
"[object]"
:
"[object Navigator]"
),
"navigator.toString() = "
+
navigator
.
toString
());
});
sync_test
(
"delete_prop"
,
function
()
{
var
v
=
document
.
documentMode
;
var
obj
=
document
.
createElement
(
"div"
),
r
,
obj2
;
obj
.
prop1
=
true
;
r
=
false
;
try
{
delete
obj
.
prop1
;
}
catch
(
ex
)
{
r
=
true
;
}
if
(
v
<
8
)
{
ok
(
r
,
"did not get an expected exception"
);
return
;
}
ok
(
!
r
,
"got an unexpected exception"
);
ok
(
!
(
"prop1"
in
obj
),
"prop1 is still in obj"
);
/* again, this time prop1 does not exist */
r
=
false
;
try
{
delete
obj
.
prop1
;
}
catch
(
ex
)
{
r
=
true
;
}
if
(
v
<
9
)
{
ok
(
r
,
"did not get an expected exception"
);
return
;
}
else
{
ok
(
!
r
,
"got an unexpected exception"
);
ok
(
!
(
"prop1"
in
obj
),
"prop1 is still in obj"
);
}
r
=
(
delete
obj
.
className
);
ok
(
r
,
"delete returned "
+
r
);
ok
(
"className"
in
obj
,
"className deleted from obj"
);
ok
(
obj
.
className
===
""
,
"className = "
+
obj
.
className
);
/* builtin propertiles don't throw any exception, but are not really deleted */
r
=
(
delete
obj
.
tagName
);
ok
(
r
,
"delete returned "
+
r
);
ok
(
"tagName"
in
obj
,
"tagName deleted from obj"
);
ok
(
obj
.
tagName
===
"DIV"
,
"tagName = "
+
obj
.
tagName
);
obj
=
document
.
querySelectorAll
(
"*"
);
ok
(
"0"
in
obj
,
"0 is not in obj"
);
obj2
=
obj
[
0
];
r
=
(
delete
obj
[
0
]);
ok
(
"0"
in
obj
,
"0 is not in obj"
);
ok
(
obj
[
0
]
===
obj2
,
"obj[0] != obj2"
);
/* test window object and its global scope handling */
obj
=
window
;
obj
.
globalprop1
=
true
;
ok
(
globalprop1
,
"globalprop1 = "
+
globalprop1
);
r
=
false
;
try
{
delete
obj
.
globalprop1
;
}
catch
(
ex
)
{
r
=
true
;
}
if
(
v
<
9
)
{
ok
(
r
,
"did not get an expected exception"
);
}
else
{
ok
(
!
r
,
"got an unexpected globalprop1 exception"
);
ok
(
!
(
"globalprop1"
in
obj
),
"globalprop1 is still in obj"
);
}
globalprop2
=
true
;
ok
(
obj
.
globalprop2
,
"globalprop2 = "
+
globalprop2
);
r
=
false
;
try
{
delete
obj
.
globalprop2
;
}
catch
(
ex
)
{
r
=
true
;
}
if
(
v
<
9
)
{
ok
(
r
,
"did not get an expected globalprop2 exception"
);
}
else
{
ok
(
!
r
,
"got an unexpected exception"
);
todo_wine
.
ok
(
!
(
"globalprop2"
in
obj
),
"globalprop2 is still in obj"
);
}
obj
.
globalprop3
=
true
;
ok
(
globalprop3
,
"globalprop3 = "
+
globalprop3
);
r
=
false
;
try
{
delete
globalprop3
;
}
catch
(
ex
)
{
r
=
true
;
}
if
(
v
<
9
)
{
ok
(
r
,
"did not get an expected exception"
);
ok
(
"globalprop3"
in
obj
,
"globalprop3 is not in obj"
);
}
else
{
ok
(
!
r
,
"got an unexpected globalprop3 exception"
);
ok
(
!
(
"globalprop3"
in
obj
),
"globalprop3 is still in obj"
);
}
globalprop4
=
true
;
ok
(
obj
.
globalprop4
,
"globalprop4 = "
+
globalprop4
);
r
=
(
delete
globalprop4
);
ok
(
r
,
"delete returned "
+
r
);
todo_wine
.
ok
(
!
(
"globalprop4"
in
obj
),
"globalprop4 is still in obj"
);
});
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