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
985d8afc
Commit
985d8afc
authored
May 04, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
May 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLDOMAttribute2::get_value implementation.
parent
8e0d6619
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
+42
-2
htmlattr.c
dlls/mshtml/htmlattr.c
+19
-2
dom.c
dlls/mshtml/tests/dom.c
+23
-0
No files found.
dlls/mshtml/htmlattr.c
View file @
985d8afc
...
@@ -303,8 +303,25 @@ static HRESULT WINAPI HTMLDOMAttribute2_put_value(IHTMLDOMAttribute2 *iface, BST
...
@@ -303,8 +303,25 @@ static HRESULT WINAPI HTMLDOMAttribute2_put_value(IHTMLDOMAttribute2 *iface, BST
static
HRESULT
WINAPI
HTMLDOMAttribute2_get_value
(
IHTMLDOMAttribute2
*
iface
,
BSTR
*
p
)
static
HRESULT
WINAPI
HTMLDOMAttribute2_get_value
(
IHTMLDOMAttribute2
*
iface
,
BSTR
*
p
)
{
{
HTMLDOMAttribute
*
This
=
impl_from_IHTMLDOMAttribute2
(
iface
);
HTMLDOMAttribute
*
This
=
impl_from_IHTMLDOMAttribute2
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
VARIANT
val
;
return
E_NOTIMPL
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
elem
)
{
FIXME
(
"NULL This->elem
\n
"
);
return
E_UNEXPECTED
;
}
hres
=
get_elem_attr_value_by_dispid
(
This
->
elem
,
This
->
dispid
,
ATTRFLAG_ASSTRING
,
&
val
);
if
(
FAILED
(
hres
))
return
hres
;
assert
(
V_VT
(
&
val
)
==
VT_BSTR
);
*
p
=
V_BSTR
(
&
val
);
if
(
!*
p
&&
!
(
*
p
=
SysAllocStringLen
(
NULL
,
0
)))
return
E_OUTOFMEMORY
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
HTMLDOMAttribute2_get_expando
(
IHTMLDOMAttribute2
*
iface
,
VARIANT_BOOL
*
p
)
static
HRESULT
WINAPI
HTMLDOMAttribute2_get_expando
(
IHTMLDOMAttribute2
*
iface
,
VARIANT_BOOL
*
p
)
...
...
dlls/mshtml/tests/dom.c
View file @
985d8afc
...
@@ -1806,6 +1806,24 @@ static void _test_attr_expando(unsigned line, IHTMLDOMAttribute *attr, VARIANT_B
...
@@ -1806,6 +1806,24 @@ static void _test_attr_expando(unsigned line, IHTMLDOMAttribute *attr, VARIANT_B
IHTMLDOMAttribute2_Release
(
attr2
);
IHTMLDOMAttribute2_Release
(
attr2
);
}
}
#define test_attr_value(a,b) _test_attr_value(__LINE__,a,b)
static
void
_test_attr_value
(
unsigned
line
,
IHTMLDOMAttribute
*
attr
,
const
char
*
exval
)
{
IHTMLDOMAttribute2
*
attr2
=
_get_attr2_iface
(
line
,
(
IUnknown
*
)
attr
);
BSTR
val
;
HRESULT
hres
;
hres
=
IHTMLDOMAttribute2_get_value
(
attr2
,
&
val
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_value failed: %08x
\n
"
,
hres
);
if
(
exval
)
ok_
(
__FILE__
,
line
)(
!
strcmp_wa
(
val
,
exval
),
"value = %s, expected %s
\n
"
,
wine_dbgstr_w
(
val
),
exval
);
else
ok_
(
__FILE__
,
line
)(
!
val
,
"value = %s, expected NULL
\n
"
,
wine_dbgstr_w
(
val
));
IHTMLDOMAttribute2_Release
(
attr2
);
SysFreeString
(
val
);
}
#define test_comment_attrs(c) _test_comment_attrs(__LINE__,c)
#define test_comment_attrs(c) _test_comment_attrs(__LINE__,c)
static
void
_test_comment_attrs
(
unsigned
line
,
IUnknown
*
unk
)
static
void
_test_comment_attrs
(
unsigned
line
,
IUnknown
*
unk
)
{
{
...
@@ -3251,6 +3269,7 @@ static void test_attr_collection(IHTMLElement *elem)
...
@@ -3251,6 +3269,7 @@ static void test_attr_collection(IHTMLElement *elem)
ok
(
V_VT
(
&
val
)
==
VT_BSTR
,
"id: V_VT(&val) = %d
\n
"
,
V_VT
(
&
val
));
ok
(
V_VT
(
&
val
)
==
VT_BSTR
,
"id: V_VT(&val) = %d
\n
"
,
V_VT
(
&
val
));
ok
(
!
strcmp_wa
(
V_BSTR
(
&
val
),
"attr"
),
"id: V_BSTR(&val) = %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
val
)));
ok
(
!
strcmp_wa
(
V_BSTR
(
&
val
),
"attr"
),
"id: V_BSTR(&val) = %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
val
)));
test_attr_expando
(
dom_attr
,
VARIANT_FALSE
);
test_attr_expando
(
dom_attr
,
VARIANT_FALSE
);
test_attr_value
(
dom_attr
,
"attr"
);
}
else
if
(
!
strcmp_wa
(
name
,
"attr1"
))
{
}
else
if
(
!
strcmp_wa
(
name
,
"attr1"
))
{
checked
++
;
checked
++
;
hres
=
IHTMLDOMAttribute_get_nodeValue
(
dom_attr
,
&
val
);
hres
=
IHTMLDOMAttribute_get_nodeValue
(
dom_attr
,
&
val
);
...
@@ -3258,24 +3277,28 @@ static void test_attr_collection(IHTMLElement *elem)
...
@@ -3258,24 +3277,28 @@ static void test_attr_collection(IHTMLElement *elem)
ok
(
V_VT
(
&
val
)
==
VT_BSTR
,
"attr1: V_VT(&val) = %d
\n
"
,
V_VT
(
&
val
));
ok
(
V_VT
(
&
val
)
==
VT_BSTR
,
"attr1: V_VT(&val) = %d
\n
"
,
V_VT
(
&
val
));
ok
(
!
strcmp_wa
(
V_BSTR
(
&
val
),
"attr1"
),
"attr1: V_BSTR(&val) = %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
val
)));
ok
(
!
strcmp_wa
(
V_BSTR
(
&
val
),
"attr1"
),
"attr1: V_BSTR(&val) = %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
val
)));
test_attr_expando
(
dom_attr
,
VARIANT_TRUE
);
test_attr_expando
(
dom_attr
,
VARIANT_TRUE
);
test_attr_value
(
dom_attr
,
"attr1"
);
}
else
if
(
!
strcmp_wa
(
name
,
"attr2"
))
{
}
else
if
(
!
strcmp_wa
(
name
,
"attr2"
))
{
checked
++
;
checked
++
;
hres
=
IHTMLDOMAttribute_get_nodeValue
(
dom_attr
,
&
val
);
hres
=
IHTMLDOMAttribute_get_nodeValue
(
dom_attr
,
&
val
);
ok
(
hres
==
S_OK
,
"%d) get_nodeValue failed: %08x
\n
"
,
i
,
hres
);
ok
(
hres
==
S_OK
,
"%d) get_nodeValue failed: %08x
\n
"
,
i
,
hres
);
ok
(
V_VT
(
&
val
)
==
VT_BSTR
,
"attr2: V_VT(&val) = %d
\n
"
,
V_VT
(
&
val
));
ok
(
V_VT
(
&
val
)
==
VT_BSTR
,
"attr2: V_VT(&val) = %d
\n
"
,
V_VT
(
&
val
));
ok
(
!
V_BSTR
(
&
val
),
"attr2: V_BSTR(&val) != NULL
\n
"
);
ok
(
!
V_BSTR
(
&
val
),
"attr2: V_BSTR(&val) != NULL
\n
"
);
test_attr_value
(
dom_attr
,
""
);
}
else
if
(
!
strcmp_wa
(
name
,
"attr3"
))
{
}
else
if
(
!
strcmp_wa
(
name
,
"attr3"
))
{
checked
++
;
checked
++
;
hres
=
IHTMLDOMAttribute_get_nodeValue
(
dom_attr
,
&
val
);
hres
=
IHTMLDOMAttribute_get_nodeValue
(
dom_attr
,
&
val
);
ok
(
hres
==
S_OK
,
"%d) get_nodeValue failed: %08x
\n
"
,
i
,
hres
);
ok
(
hres
==
S_OK
,
"%d) get_nodeValue failed: %08x
\n
"
,
i
,
hres
);
ok
(
V_VT
(
&
val
)
==
VT_BSTR
,
"attr3: V_VT(&val) = %d
\n
"
,
V_VT
(
&
val
));
ok
(
V_VT
(
&
val
)
==
VT_BSTR
,
"attr3: V_VT(&val) = %d
\n
"
,
V_VT
(
&
val
));
ok
(
!
strcmp_wa
(
V_BSTR
(
&
val
),
"attr3"
),
"attr3: V_BSTR(&val) = %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
val
)));
ok
(
!
strcmp_wa
(
V_BSTR
(
&
val
),
"attr3"
),
"attr3: V_BSTR(&val) = %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
val
)));
test_attr_value
(
dom_attr
,
"attr3"
);
}
else
if
(
!
strcmp_wa
(
name
,
"test"
))
{
}
else
if
(
!
strcmp_wa
(
name
,
"test"
))
{
checked
++
;
checked
++
;
hres
=
IHTMLDOMAttribute_get_nodeValue
(
dom_attr
,
&
val
);
hres
=
IHTMLDOMAttribute_get_nodeValue
(
dom_attr
,
&
val
);
ok
(
hres
==
S_OK
,
"%d) get_nodeValue failed: %08x
\n
"
,
i
,
hres
);
ok
(
hres
==
S_OK
,
"%d) get_nodeValue failed: %08x
\n
"
,
i
,
hres
);
ok
(
V_VT
(
&
val
)
==
VT_I4
,
"test: V_VT(&val) = %d
\n
"
,
V_VT
(
&
val
));
ok
(
V_VT
(
&
val
)
==
VT_I4
,
"test: V_VT(&val) = %d
\n
"
,
V_VT
(
&
val
));
ok
(
V_I4
(
&
val
)
==
1
,
"test: V_I4(&val) = %d
\n
"
,
V_I4
(
&
val
));
ok
(
V_I4
(
&
val
)
==
1
,
"test: V_I4(&val) = %d
\n
"
,
V_I4
(
&
val
));
test_attr_value
(
dom_attr
,
"1"
);
}
}
IHTMLDOMAttribute_Release
(
dom_attr
);
IHTMLDOMAttribute_Release
(
dom_attr
);
...
...
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