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
696e8faa
Commit
696e8faa
authored
Apr 23, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Add IHTMLElement6::hasAttribute implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
83fc6f0e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
3 deletions
+42
-3
htmlelem.c
dlls/mshtml/htmlelem.c
+22
-3
dom.js
dlls/mshtml/tests/dom.js
+20
-0
No files found.
dlls/mshtml/htmlelem.c
View file @
696e8faa
...
...
@@ -202,6 +202,22 @@ HRESULT elem_string_attr_setter(HTMLElement *elem, const WCHAR *name, const WCHA
return
S_OK
;
}
static
VARIANT_BOOL
element_has_attribute
(
HTMLElement
*
element
,
const
WCHAR
*
name
)
{
nsAString
name_str
;
cpp_bool
r
;
nsresult
nsres
;
if
(
!
element
->
dom_element
)
{
WARN
(
"no DOM element
\n
"
);
return
VARIANT_FALSE
;
}
nsAString_InitDepend
(
&
name_str
,
name
);
nsres
=
nsIDOMElement_HasAttribute
(
element
->
dom_element
,
&
name_str
,
&
r
);
return
variant_bool
(
NS_SUCCEEDED
(
nsres
)
&&
r
);
}
HRESULT
get_readystate_string
(
READYSTATE
readystate
,
BSTR
*
p
)
{
static
const
LPCWSTR
readystate_strs
[]
=
{
...
...
@@ -4453,11 +4469,14 @@ static HRESULT WINAPI HTMLElement6_removeAttributeNode(IHTMLElement6 *iface, IHT
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLElement6_hasAttribute
(
IHTMLElement6
*
iface
,
BSTR
name
,
VARIANT_BOOL
*
p
fHasAttribute
)
static
HRESULT
WINAPI
HTMLElement6_hasAttribute
(
IHTMLElement6
*
iface
,
BSTR
name
,
VARIANT_BOOL
*
p
)
{
HTMLElement
*
This
=
impl_from_IHTMLElement6
(
iface
);
FIXME
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
name
),
pfHasAttribute
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
name
),
p
);
*
p
=
element_has_attribute
(
This
,
name
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLElement6_getElementsByTagNameNS
(
IHTMLElement6
*
iface
,
VARIANT
*
varNS
,
BSTR
bstrLocalName
,
IHTMLElementCollection
**
pelColl
)
...
...
dlls/mshtml/tests/dom.js
View file @
696e8faa
...
...
@@ -468,3 +468,23 @@ sync_test("title", function() {
ok
(
elem
.
title
===
"test"
,
"div.title = "
+
elem
.
title
);
ok
(
elem
.
getAttribute
(
"title"
)
===
"test"
,
"title attribute = "
+
elem
.
getAttribute
(
"title"
));
});
sync_test
(
"hasAttribute"
,
function
()
{
document
.
body
.
innerHTML
=
'<div attr="test"></div>'
;
var
elem
=
document
.
body
.
firstChild
,
r
;
r
=
elem
.
hasAttribute
(
"attr"
);
ok
(
r
===
true
,
"hasAttribute(attr) returned "
+
r
);
r
=
elem
.
hasAttribute
(
"attr2"
);
ok
(
r
===
false
,
"hasAttribute(attr2) returned "
+
r
);
elem
.
setAttribute
(
"attr2"
,
"abc"
);
r
=
elem
.
hasAttribute
(
"attr2"
);
todo_wine
.
ok
(
r
===
true
,
"hasAttribute(attr2) returned "
+
r
);
elem
.
removeAttribute
(
"attr"
);
r
=
elem
.
hasAttribute
(
"attr"
);
todo_wine
.
ok
(
r
===
false
,
"hasAttribute(attr) returned "
+
r
);
});
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