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
872810e6
Commit
872810e6
authored
Apr 24, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Return VT_NULL instead of empty string in getAttribute.
parent
01f241c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
htmlelem.c
dlls/mshtml/htmlelem.c
+2
-2
dom.c
dlls/mshtml/tests/dom.c
+31
-2
No files found.
dlls/mshtml/htmlelem.c
View file @
872810e6
...
...
@@ -178,7 +178,7 @@ static HRESULT WINAPI HTMLElement_getAttribute(IHTMLElement *iface, BSTR strAttr
WARN
(
"(%p)->(%s %08x %p)
\n
"
,
This
,
debugstr_w
(
strAttributeName
),
lFlags
,
AttributeValue
);
V
ariantInit
(
AttributeValue
)
;
V
_VT
(
AttributeValue
)
=
VT_NULL
;
nsAString_Init
(
&
attr_str
,
strAttributeName
);
nsAString_Init
(
&
value_str
,
NULL
);
...
...
@@ -206,7 +206,7 @@ static HRESULT WINAPI HTMLElement_getAttribute(IHTMLElement *iface, BSTR strAttr
TRACE
(
"attr_value=%s
\n
"
,
debugstr_w
(
V_BSTR
(
AttributeValue
)));
}
}
}
else
{
}
else
if
(
*
value
)
{
V_VT
(
AttributeValue
)
=
VT_BSTR
;
V_BSTR
(
AttributeValue
)
=
SysAllocString
(
value
);
TRACE
(
"attr_value=%s
\n
"
,
debugstr_w
(
V_BSTR
(
AttributeValue
)));
...
...
dlls/mshtml/tests/dom.c
View file @
872810e6
...
...
@@ -58,6 +58,8 @@ static WCHAR wordW[] = {'w','o','r','d',0};
static
const
WCHAR
text_javascriptW
[]
=
{
't'
,
'e'
,
'x'
,
't'
,
'/'
,
'j'
,
'a'
,
'v'
,
'a'
,
's'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
0
};
static
const
WCHAR
idW
[]
=
{
'i'
,
'd'
,
0
};
typedef
enum
{
ET_NONE
,
ET_HTML
,
...
...
@@ -364,6 +366,30 @@ static void _test_elem_type(unsigned line, IUnknown *unk, elem_type_t type)
_test_disp
(
line
,
unk
,
elem_type_infos
[
type
].
dispiid
);
}
#define test_elem_attr(e,n,v) _test_elem_attr(__LINE__,e,n,v)
static
void
_test_elem_attr
(
unsigned
line
,
IHTMLElement
*
elem
,
LPCWSTR
name
,
LPCWSTR
exval
)
{
VARIANT
value
;
BSTR
tmp
;
HRESULT
hres
;
VariantInit
(
&
value
);
tmp
=
SysAllocString
(
name
);
hres
=
IHTMLElement_getAttribute
(
elem
,
tmp
,
0
,
&
value
);
SysFreeString
(
tmp
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"getAttribute failed: %08x
\n
"
,
hres
);
if
(
exval
)
{
ok_
(
__FILE__
,
line
)
(
V_VT
(
&
value
)
==
VT_BSTR
,
"vt=%d
\n
"
,
V_VT
(
&
value
));
ok_
(
__FILE__
,
line
)
(
!
lstrcmpW
(
exval
,
V_BSTR
(
&
value
)),
"unexpected value %s
\n
"
,
dbgstr_w
(
V_BSTR
(
&
value
)));
}
else
{
ok_
(
__FILE__
,
line
)
(
V_VT
(
&
value
)
==
VT_NULL
,
"vt=%d
\n
"
,
V_VT
(
&
value
));
}
VariantClear
(
&
value
);
}
static
void
test_doc_elem
(
IHTMLDocument2
*
doc
)
{
IHTMLElement
*
elem
;
...
...
@@ -1400,9 +1426,12 @@ static void test_elems(IHTMLDocument2 *doc)
elem
=
get_doc_elem_by_id
(
doc
,
sW
);
ok
(
elem
!=
NULL
,
"elem == NULL
\n
"
);
test_elem_type
((
IUnknown
*
)
elem
,
ET_SELECT
);
if
(
elem
)
if
(
elem
)
{
test_elem_type
((
IUnknown
*
)
elem
,
ET_SELECT
);
test_elem_attr
(
elem
,
xxxW
,
NULL
);
test_elem_attr
(
elem
,
idW
,
sW
);
IHTMLElement_Release
(
elem
);
}
elem
=
get_elem_by_id
(
doc
,
sW
,
TRUE
);
if
(
elem
)
{
...
...
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