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
7858cc01
Commit
7858cc01
authored
Mar 28, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Add IHTMLDocument7::createElementNS implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3dc6d9d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
2 deletions
+53
-2
htmldoc.c
dlls/mshtml/htmldoc.c
+33
-2
elements.js
dlls/mshtml/tests/elements.js
+20
-0
No files found.
dlls/mshtml/htmldoc.c
View file @
7858cc01
...
...
@@ -3288,8 +3288,39 @@ static HRESULT WINAPI HTMLDocument7_getElementsByTagNameNS(IHTMLDocument7 *iface
static
HRESULT
WINAPI
HTMLDocument7_createElementNS
(
IHTMLDocument7
*
iface
,
VARIANT
*
pvarNS
,
BSTR
bstrTag
,
IHTMLElement
**
newElem
)
{
HTMLDocument
*
This
=
impl_from_IHTMLDocument7
(
iface
);
FIXME
(
"(%p)->(%s %s %p)
\n
"
,
This
,
debugstr_variant
(
pvarNS
),
debugstr_w
(
bstrTag
),
newElem
);
return
E_NOTIMPL
;
nsIDOMElement
*
dom_element
;
HTMLElement
*
element
;
nsAString
ns
,
tag
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%s %s %p)
\n
"
,
This
,
debugstr_variant
(
pvarNS
),
debugstr_w
(
bstrTag
),
newElem
);
if
(
!
This
->
doc_node
->
nsdoc
)
{
FIXME
(
"NULL nsdoc
\n
"
);
return
E_FAIL
;
}
if
(
pvarNS
&&
V_VT
(
pvarNS
)
!=
VT_NULL
&&
V_VT
(
pvarNS
)
!=
VT_BSTR
)
FIXME
(
"Unsupported namespace %s
\n
"
,
debugstr_variant
(
pvarNS
));
nsAString_InitDepend
(
&
ns
,
pvarNS
&&
V_VT
(
pvarNS
)
==
VT_BSTR
?
V_BSTR
(
pvarNS
)
:
NULL
);
nsAString_InitDepend
(
&
tag
,
bstrTag
);
nsres
=
nsIDOMHTMLDocument_CreateElementNS
(
This
->
doc_node
->
nsdoc
,
&
ns
,
&
tag
,
&
dom_element
);
nsAString_Finish
(
&
ns
);
nsAString_Finish
(
&
tag
);
if
(
NS_FAILED
(
nsres
))
{
WARN
(
"CreateElementNS failed: %08x
\n
"
,
nsres
);
return
map_nsresult
(
nsres
);
}
hres
=
HTMLElement_Create
(
This
->
doc_node
,
(
nsIDOMNode
*
)
dom_element
,
FALSE
,
&
element
);
nsIDOMElement_Release
(
dom_element
);
if
(
FAILED
(
hres
))
return
hres
;
*
newElem
=
&
element
->
IHTMLElement_iface
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLDocument7_createAttributeNS
(
IHTMLDocument7
*
iface
,
VARIANT
*
pvarNS
,
...
...
dlls/mshtml/tests/elements.js
View file @
7858cc01
...
...
@@ -168,6 +168,25 @@ function test_getElementsByClassName() {
next_test
();
}
function
test_createElementNS
()
{
var
svg_ns
=
"http://www.w3.org/2000/svg"
;
var
elem
;
elem
=
document
.
createElementNS
(
null
,
"test"
);
ok
(
elem
.
tagName
===
"test"
,
"elem.tagName = "
+
elem
.
tagName
);
elem
=
document
.
createElementNS
(
svg_ns
,
"test"
);
ok
(
elem
.
tagName
===
"test"
,
"elem.tagName = "
+
elem
.
tagName
);
elem
=
document
.
createElementNS
(
svg_ns
,
"svg"
);
ok
(
elem
.
tagName
===
"svg"
,
"elem.tagName = "
+
elem
.
tagName
);
elem
=
document
.
createElementNS
(
"test"
,
"svg"
);
ok
(
elem
.
tagName
===
"svg"
,
"elem.tagName = "
+
elem
.
tagName
);
next_test
();
}
function
test_query_selector
()
{
document
.
body
.
innerHTML
=
'<div class="class1">'
+
'<div class="class1"></div>'
...
...
@@ -351,6 +370,7 @@ var tests = [
test_textContent
,
test_ElementTraversal
,
test_getElementsByClassName
,
test_createElementNS
,
test_head
,
test_iframe
,
test_anchor
,
...
...
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