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
9ce3e6b7
Commit
9ce3e6b7
authored
Oct 19, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Moved creating new element to separated function.
parent
dd0a7078
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
16 deletions
+37
-16
htmldoc.c
dlls/mshtml/htmldoc.c
+6
-16
htmlelem.c
dlls/mshtml/htmlelem.c
+29
-0
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-0
No files found.
dlls/mshtml/htmldoc.c
View file @
9ce3e6b7
...
...
@@ -911,28 +911,18 @@ static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTa
IHTMLElement
**
newElem
)
{
HTMLDocument
*
This
=
HTMLDOC_THIS
(
iface
);
nsIDOMElement
*
nselem
;
nsIDOM
HTML
Element
*
nselem
;
HTMLElement
*
elem
;
nsAString
tag_str
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
eTag
),
newElem
);
if
(
!
This
->
nsdoc
)
{
WARN
(
"NULL nsdoc
\n
"
);
return
E_UNEXPECTED
;
}
nsAString_Init
(
&
tag_str
,
eTag
);
nsres
=
nsIDOMDocument_CreateElement
(
This
->
nsdoc
,
&
tag_str
,
&
nselem
);
nsAString_Finish
(
&
tag_str
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CreateElement failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
hres
=
create_nselem
(
This
->
doc_node
,
eTag
,
&
nselem
);
if
(
FAILED
(
hres
))
return
hres
;
elem
=
HTMLElement_Create
(
This
->
doc_node
,
(
nsIDOMNode
*
)
nselem
,
TRUE
);
nsIDOMElement_Release
(
nselem
);
nsIDOM
HTML
Element_Release
(
nselem
);
*
newElem
=
HTMLELEM
(
elem
);
IHTMLElement_AddRef
(
HTMLELEM
(
elem
));
...
...
dlls/mshtml/htmlelem.c
View file @
9ce3e6b7
...
...
@@ -38,6 +38,35 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define HTMLELEM_THIS(iface) DEFINE_THIS(HTMLElement, HTMLElement, iface)
HRESULT
create_nselem
(
HTMLDocumentNode
*
doc
,
const
WCHAR
*
tag
,
nsIDOMHTMLElement
**
ret
)
{
nsIDOMElement
*
nselem
;
nsAString
tag_str
;
nsresult
nsres
;
if
(
!
doc
->
basedoc
.
nsdoc
)
{
WARN
(
"NULL nsdoc
\n
"
);
return
E_UNEXPECTED
;
}
nsAString_Init
(
&
tag_str
,
tag
);
nsres
=
nsIDOMDocument_CreateElement
(
doc
->
basedoc
.
nsdoc
,
&
tag_str
,
&
nselem
);
nsAString_Finish
(
&
tag_str
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CreateElement failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMElement_QueryInterface
(
nselem
,
&
IID_nsIDOMHTMLElement
,
(
void
**
)
ret
);
nsIDOMElement_Release
(
nselem
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMHTMLElement iface: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
return
S_OK
;
}
#define HTMLELEM_NODE_THIS(iface) DEFINE_THIS2(HTMLElement, node, iface)
static
HRESULT
WINAPI
HTMLElement_QueryInterface
(
IHTMLElement
*
iface
,
...
...
dlls/mshtml/mshtml_private.h
View file @
9ce3e6b7
...
...
@@ -659,6 +659,8 @@ void detach_selection(HTMLDocumentNode*);
void
detach_ranges
(
HTMLDocumentNode
*
);
HRESULT
get_node_text
(
HTMLDOMNode
*
,
BSTR
*
);
HRESULT
create_nselem
(
HTMLDocumentNode
*
,
const
WCHAR
*
,
nsIDOMHTMLElement
**
);
HTMLDOMNode
*
HTMLDOMTextNode_Create
(
HTMLDocumentNode
*
,
nsIDOMNode
*
);
HTMLElement
*
HTMLElement_Create
(
HTMLDocumentNode
*
,
nsIDOMNode
*
,
BOOL
);
...
...
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