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
22c2d81a
Commit
22c2d81a
authored
Apr 06, 2014
by
Zhenbo Li
Committed by
Alexandre Julliard
Apr 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLTable::bgColor property implementation.
parent
c4a51b0b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
4 deletions
+72
-4
htmltable.c
dlls/mshtml/htmltable.c
+37
-4
dom.c
dlls/mshtml/tests/dom.c
+35
-0
No files found.
dlls/mshtml/htmltable.c
View file @
22c2d81a
...
@@ -246,15 +246,48 @@ static HRESULT WINAPI HTMLTable_get_background(IHTMLTable *iface, BSTR *p)
...
@@ -246,15 +246,48 @@ static HRESULT WINAPI HTMLTable_get_background(IHTMLTable *iface, BSTR *p)
static
HRESULT
WINAPI
HTMLTable_put_bgColor
(
IHTMLTable
*
iface
,
VARIANT
v
)
static
HRESULT
WINAPI
HTMLTable_put_bgColor
(
IHTMLTable
*
iface
,
VARIANT
v
)
{
{
HTMLTable
*
This
=
impl_from_IHTMLTable
(
iface
);
HTMLTable
*
This
=
impl_from_IHTMLTable
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_variant
(
&
v
));
nsAString
val
;
return
E_NOTIMPL
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_variant
(
&
v
));
nsAString_InitDepend
(
&
val
,
V_BSTR
(
&
v
));
variant_to_nscolor
(
&
v
,
&
val
);
nsres
=
nsIDOMHTMLTableElement_SetBgColor
(
This
->
nstable
,
&
val
);
nsAString_Finish
(
&
val
);
if
(
NS_FAILED
(
nsres
)){
ERR
(
"Set BgColor(%s) failed!
\n
"
,
debugstr_variant
(
&
v
));
return
E_FAIL
;
}
return
S_OK
;
}
}
static
HRESULT
WINAPI
HTMLTable_get_bgColor
(
IHTMLTable
*
iface
,
VARIANT
*
p
)
static
HRESULT
WINAPI
HTMLTable_get_bgColor
(
IHTMLTable
*
iface
,
VARIANT
*
p
)
{
{
HTMLTable
*
This
=
impl_from_IHTMLTable
(
iface
);
HTMLTable
*
This
=
impl_from_IHTMLTable
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString
strColor
;
return
E_NOTIMPL
;
nsresult
nsres
;
HRESULT
hres
;
const
PRUnichar
*
color
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
strColor
,
NULL
);
nsres
=
nsIDOMHTMLTableElement_GetBgColor
(
This
->
nstable
,
&
strColor
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString_GetData
(
&
strColor
,
&
color
);
V_VT
(
p
)
=
VT_BSTR
;
hres
=
nscolor_to_str
(
color
,
&
V_BSTR
(
p
));
}
else
{
ERR
(
"SetBgColor failed: %08x
\n
"
,
nsres
);
hres
=
E_FAIL
;
}
nsAString_Finish
(
&
strColor
);
return
hres
;
}
}
static
HRESULT
WINAPI
HTMLTable_put_borderColor
(
IHTMLTable
*
iface
,
VARIANT
v
)
static
HRESULT
WINAPI
HTMLTable_put_borderColor
(
IHTMLTable
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/tests/dom.c
View file @
22c2d81a
...
@@ -5729,6 +5729,7 @@ static void test_table_elem(IHTMLElement *elem)
...
@@ -5729,6 +5729,7 @@ static void test_table_elem(IHTMLElement *elem)
VARIANT
v
;
VARIANT
v
;
HRESULT
hres
;
HRESULT
hres
;
BSTR
bstr
;
BSTR
bstr
;
VARIANT
vbg
,
vDefaultbg
;
static
const
elem_type_t
row_types
[]
=
{
ET_TR
,
ET_TR
};
static
const
elem_type_t
row_types
[]
=
{
ET_TR
,
ET_TR
};
static
const
elem_type_t
all_types
[]
=
{
ET_TBODY
,
ET_TR
,
ET_TR
,
ET_TD
,
ET_TD
};
static
const
elem_type_t
all_types
[]
=
{
ET_TBODY
,
ET_TR
,
ET_TR
,
ET_TD
,
ET_TD
};
...
@@ -5794,6 +5795,40 @@ static void test_table_elem(IHTMLElement *elem)
...
@@ -5794,6 +5795,40 @@ static void test_table_elem(IHTMLElement *elem)
ok
(
!
strcmp_wa
(
bstr
,
"left"
),
"get_align returned %s
\n
"
,
wine_dbgstr_w
(
bstr
));
ok
(
!
strcmp_wa
(
bstr
,
"left"
),
"get_align returned %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
SysFreeString
(
bstr
);
hres
=
IHTMLTable_get_bgColor
(
table
,
&
vDefaultbg
);
ok
(
hres
==
S_OK
,
"get_bgColor failed: %08x
\n
"
,
hres
);
ok
(
V_VT
(
&
vDefaultbg
)
==
VT_BSTR
,
"bstr != NULL
\n
"
);
ok
(
!
V_BSTR
(
&
vDefaultbg
),
"V_BSTR(bgColor) = %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
vDefaultbg
)));
V_VT
(
&
vbg
)
=
VT_BSTR
;
V_BSTR
(
&
vbg
)
=
a2bstr
(
"red"
);
hres
=
IHTMLTable_put_bgColor
(
table
,
vbg
);
ok
(
hres
==
S_OK
,
"put_bgColor failed: %08x
\n
"
,
hres
);
VariantClear
(
&
vbg
);
hres
=
IHTMLTable_get_bgColor
(
table
,
&
vbg
);
ok
(
hres
==
S_OK
,
"get_bgColor failed: %08x
\n
"
,
hres
);
ok
(
V_VT
(
&
vDefaultbg
)
==
VT_BSTR
,
"V_VT(&vDefaultbg) != VT_BSTR
\n
"
);
ok
(
!
strcmp_wa
(
V_BSTR
(
&
vbg
),
"#ff0000"
),
"Unexpected bgcolor %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
vbg
)));
VariantClear
(
&
vbg
);
V_VT
(
&
vbg
)
=
VT_I4
;
V_I4
(
&
vbg
)
=
0xff0000
;
hres
=
IHTMLTable_put_bgColor
(
table
,
vbg
);
ok
(
hres
==
S_OK
,
"put_bgColor failed: %08x
\n
"
,
hres
);
VariantClear
(
&
vbg
);
hres
=
IHTMLTable_get_bgColor
(
table
,
&
vbg
);
ok
(
hres
==
S_OK
,
"get_bgColor failed: %08x
\n
"
,
hres
);
ok
(
V_VT
(
&
vDefaultbg
)
==
VT_BSTR
,
"V_VT(&vDefaultbg) != VT_BSTR
\n
"
);
ok
(
!
strcmp_wa
(
V_BSTR
(
&
vbg
),
"#ff0000"
),
"Unexpected bgcolor %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
vbg
)));
VariantClear
(
&
vbg
);
/* Restore Originial */
hres
=
IHTMLTable_put_bgColor
(
table
,
vDefaultbg
);
ok
(
hres
==
S_OK
,
"put_bgColor failed: %08x
\n
"
,
hres
);
VariantClear
(
&
vDefaultbg
);
IHTMLTable_Release
(
table
);
IHTMLTable_Release
(
table
);
}
}
...
...
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