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
84f1b60e
Commit
84f1b60e
authored
Dec 19, 2022
by
Santino Mazza
Committed by
Alexandre Julliard
Jan 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement HTMLDocument_get_body for document fragments.
parent
071f38b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
htmldoc.c
dlls/mshtml/htmldoc.c
+16
-6
dom.c
dlls/mshtml/tests/dom.c
+2
-2
No files found.
dlls/mshtml/htmldoc.c
View file @
84f1b60e
...
...
@@ -497,20 +497,30 @@ static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCo
static
HRESULT
WINAPI
HTMLDocument_get_body
(
IHTMLDocument2
*
iface
,
IHTMLElement
**
p
)
{
HTMLDocumentNode
*
This
=
impl_from_IHTMLDocument2
(
iface
);
nsIDOM
HTML
Element
*
nsbody
=
NULL
;
nsIDOMElement
*
nsbody
=
NULL
;
HTMLElement
*
element
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
This
->
html_document
)
{
nsresult
nsres
;
nsres
=
nsIDOMHTMLDocument_GetBody
(
This
->
html_document
,
&
nsbody
);
nsres
=
nsIDOMHTMLDocument_GetBody
(
This
->
html_document
,
(
nsIDOMHTMLElement
**
)
&
nsbody
);
if
(
NS_FAILED
(
nsres
))
{
TRACE
(
"Could not get body: %08lx
\n
"
,
nsres
);
return
E_UNEXPECTED
;
}
}
else
{
nsAString
nsnode_name
;
nsIDOMDocumentFragment
*
frag
;
nsres
=
nsIDOMNode_QueryInterface
(
This
->
node
.
nsnode
,
&
IID_nsIDOMDocumentFragment
,
(
void
**
)
&
frag
);
if
(
!
NS_FAILED
(
nsres
))
{
nsAString_InitDepend
(
&
nsnode_name
,
L"BODY"
);
nsIDOMDocumentFragment_QuerySelector
(
frag
,
&
nsnode_name
,
&
nsbody
);
nsAString_Finish
(
&
nsnode_name
);
nsIDOMDocumentFragment_Release
(
frag
);
}
}
if
(
!
nsbody
)
{
...
...
@@ -518,8 +528,8 @@ static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement
return
S_OK
;
}
hres
=
get_element
(
(
nsIDOMElement
*
)
nsbody
,
&
element
);
nsIDOM
HTML
Element_Release
(
nsbody
);
hres
=
get_element
(
nsbody
,
&
element
);
nsIDOMElement_Release
(
nsbody
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/mshtml/tests/dom.c
View file @
84f1b60e
...
...
@@ -11081,9 +11081,9 @@ static void test_docfrag(IHTMLDocument2 *doc)
hres
=
IHTMLDocument2_get_body
(
frag
,
&
frag_body
);
ok
(
hres
==
S_OK
,
"get_body failed: %08lx
\n
"
,
hres
);
todo_wine
ok
(
frag_body
!=
NULL
,
"body == NULL
\n
"
);
ok
(
frag_body
!=
NULL
,
"body == NULL
\n
"
);
if
(
frag_body
)
{
todo_wine
ok
(
!
iface_cmp
((
IUnknown
*
)
frag_body
,
(
IUnknown
*
)
main_body
),
"frag_body == main_body
\n
"
);
ok
(
!
iface_cmp
((
IUnknown
*
)
frag_body
,
(
IUnknown
*
)
main_body
),
"frag_body == main_body
\n
"
);
IHTMLElement_Release
(
frag_body
);
}
IHTMLElement_Release
(
main_body
);
...
...
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