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
16c6c249
Commit
16c6c249
authored
Oct 10, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Oct 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Enumerate document elements with name.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
6420744c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
2 deletions
+69
-2
htmldoc.c
dlls/mshtml/htmldoc.c
+69
-1
documentmode.js
dlls/mshtml/tests/documentmode.js
+0
-1
No files found.
dlls/mshtml/htmldoc.c
View file @
16c6c249
...
@@ -5890,6 +5890,74 @@ static HRESULT HTMLDocumentNode_invoke(DispatchEx *dispex, DISPID id, LCID lcid,
...
@@ -5890,6 +5890,74 @@ static HRESULT HTMLDocumentNode_invoke(DispatchEx *dispex, DISPID id, LCID lcid,
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
HTMLDocumentNode_next_dispid
(
DispatchEx
*
dispex
,
DISPID
id
,
DISPID
*
pid
)
{
DWORD
idx
=
(
id
==
DISPID_STARTENUM
)
?
0
:
id
-
MSHTML_DISPID_CUSTOM_MIN
+
1
;
HTMLDocumentNode
*
This
=
impl_from_DispatchEx
(
dispex
);
nsIDOMNodeList
*
node_list
;
const
PRUnichar
*
name
;
nsIDOMElement
*
nselem
;
nsIDOMNode
*
nsnode
;
nsAString
nsstr
;
nsresult
nsres
;
HRESULT
hres
;
UINT32
i
;
if
(
!
This
->
nsdoc
)
return
S_FALSE
;
while
(
idx
<
This
->
elem_vars_cnt
)
{
hres
=
has_elem_name
(
This
->
nsdoc
,
This
->
elem_vars
[
idx
]);
if
(
SUCCEEDED
(
hres
))
{
*
pid
=
idx
+
MSHTML_DISPID_CUSTOM_MIN
;
return
S_OK
;
}
if
(
hres
!=
DISP_E_UNKNOWNNAME
)
return
hres
;
idx
++
;
}
/* Populate possibly missing DISPIDs */
nsAString_InitDepend
(
&
nsstr
,
L"[name]"
);
nsres
=
nsIDOMHTMLDocument_QuerySelectorAll
(
This
->
nsdoc
,
&
nsstr
,
&
node_list
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
return
map_nsresult
(
nsres
);
for
(
i
=
0
,
hres
=
S_OK
;
SUCCEEDED
(
hres
);
i
++
)
{
nsres
=
nsIDOMNodeList_Item
(
node_list
,
i
,
&
nsnode
);
if
(
NS_FAILED
(
nsres
))
{
hres
=
map_nsresult
(
nsres
);
break
;
}
if
(
!
nsnode
)
break
;
nsres
=
nsIDOMNode_QueryInterface
(
nsnode
,
&
IID_nsIDOMElement
,
(
void
**
)
&
nselem
);
nsIDOMNode_Release
(
nsnode
);
if
(
nsres
!=
S_OK
)
continue
;
nsres
=
get_elem_attr_value
(
nselem
,
L"name"
,
&
nsstr
,
&
name
);
nsIDOMElement_Release
(
nselem
);
if
(
NS_FAILED
(
nsres
))
hres
=
map_nsresult
(
nsres
);
else
{
hres
=
dispid_from_elem_name
(
This
,
name
,
&
id
);
nsAString_Finish
(
&
nsstr
);
}
}
nsIDOMNodeList_Release
(
node_list
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
idx
>=
This
->
elem_vars_cnt
)
return
S_FALSE
;
*
pid
=
idx
+
MSHTML_DISPID_CUSTOM_MIN
;
return
S_OK
;
}
static
compat_mode_t
HTMLDocumentNode_get_compat_mode
(
DispatchEx
*
dispex
)
static
compat_mode_t
HTMLDocumentNode_get_compat_mode
(
DispatchEx
*
dispex
)
{
{
HTMLDocumentNode
*
This
=
impl_from_DispatchEx
(
dispex
);
HTMLDocumentNode
*
This
=
impl_from_DispatchEx
(
dispex
);
...
@@ -5948,7 +6016,7 @@ static const event_target_vtbl_t HTMLDocumentNode_event_target_vtbl = {
...
@@ -5948,7 +6016,7 @@ static const event_target_vtbl_t HTMLDocumentNode_event_target_vtbl = {
HTMLDocumentNode_get_name
,
HTMLDocumentNode_get_name
,
HTMLDocumentNode_invoke
,
HTMLDocumentNode_invoke
,
NULL
,
NULL
,
NULL
,
HTMLDocumentNode_next_dispid
,
HTMLDocumentNode_get_compat_mode
,
HTMLDocumentNode_get_compat_mode
,
NULL
NULL
},
},
...
...
dlls/mshtml/tests/documentmode.js
View file @
16c6c249
...
@@ -703,7 +703,6 @@ sync_test("elem_by_id", function() {
...
@@ -703,7 +703,6 @@ sync_test("elem_by_id", function() {
if
(
id_elem
===
"testname"
)
if
(
id_elem
===
"testname"
)
found
=
true
;
found
=
true
;
}
}
todo_wine
.
ok
(
found
,
"testname was not enumerated in document"
);
ok
(
found
,
"testname was not enumerated in document"
);
});
});
...
...
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