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
af0aa283
Commit
af0aa283
authored
Nov 05, 2008
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Nov 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement IHTMLStyle get/put posLeft.
parent
2e25b859
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
4 deletions
+93
-4
htmlstyle.c
dlls/mshtml/htmlstyle.c
+63
-4
dom.c
dlls/mshtml/tests/dom.c
+30
-0
No files found.
dlls/mshtml/htmlstyle.c
View file @
af0aa283
...
...
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
#include <math.h>
#define COBJMACROS
...
...
@@ -353,6 +354,57 @@ static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR ex
return
S_OK
;
}
static
inline
HRESULT
set_style_pos
(
HTMLStyle
*
This
,
styleid_t
sid
,
float
value
)
{
WCHAR
szValue
[
25
];
WCHAR
szFormat
[]
=
{
'%'
,
'.'
,
'0'
,
'f'
,
'p'
,
'x'
,
0
};
value
=
floor
(
value
);
sprintfW
(
szValue
,
szFormat
,
value
);
return
set_style_attr
(
This
,
sid
,
szValue
,
0
);
}
HRESULT
get_nsstyle_pos
(
HTMLStyle
*
This
,
styleid_t
sid
,
float
*
p
)
{
nsAString
str_value
;
HRESULT
hres
;
WCHAR
pxW
[]
=
{
'p'
,
'x'
,
0
};
TRACE
(
"%p %d %p
\n
"
,
This
,
sid
,
p
);
*
p
=
0
.
0
f
;
nsAString_Init
(
&
str_value
,
NULL
);
hres
=
get_nsstyle_attr_nsval
(
This
->
nsstyle
,
sid
,
&
str_value
);
if
(
hres
==
S_OK
)
{
WCHAR
*
ptr
;
const
PRUnichar
*
value
;
nsAString_GetData
(
&
str_value
,
&
value
);
if
(
value
)
{
*
p
=
strtolW
(
value
,
&
ptr
,
10
);
if
(
*
ptr
&&
strcmpW
(
ptr
,
pxW
))
{
nsAString_Finish
(
&
str_value
);
FIXME
(
"only px values are currently supported
\n
"
);
return
E_FAIL
;
}
}
}
TRACE
(
"ret %f
\n
"
,
*
p
);
nsAString_Finish
(
&
str_value
);
return
hres
;
}
#define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
static
HRESULT
WINAPI
HTMLStyle_QueryInterface
(
IHTMLStyle
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -1807,15 +1859,22 @@ static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
static
HRESULT
WINAPI
HTMLStyle_put_posLeft
(
IHTMLStyle
*
iface
,
float
v
)
{
HTMLStyle
*
This
=
HTMLSTYLE_THIS
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%f)
\n
"
,
This
,
v
);
return
set_style_pos
(
This
,
STYLEID_LEFT
,
v
);
}
static
HRESULT
WINAPI
HTMLStyle_get_posLeft
(
IHTMLStyle
*
iface
,
float
*
p
)
{
HTMLStyle
*
This
=
HTMLSTYLE_THIS
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
p
)
return
E_POINTER
;
return
get_nsstyle_pos
(
This
,
STYLEID_LEFT
,
p
);
}
static
HRESULT
WINAPI
HTMLStyle_put_posWidth
(
IHTMLStyle
*
iface
,
float
v
)
...
...
dlls/mshtml/tests/dom.c
View file @
af0aa283
...
...
@@ -2281,6 +2281,7 @@ static void test_default_style(IHTMLStyle *style)
VARIANT
v
;
BSTR
str
;
HRESULT
hres
;
float
f
;
test_disp
((
IUnknown
*
)
style
,
&
DIID_DispHTMLStyle
);
test_ifaces
((
IUnknown
*
)
style
,
style_iids
);
...
...
@@ -2382,12 +2383,41 @@ static void test_default_style(IHTMLStyle *style)
ok
(
!
V_BSTR
(
&
v
),
"V_BSTR(v) != NULL
\n
"
);
VariantClear
(
&
v
);
/* Test posLeft */
hres
=
IHTMLStyle_get_posLeft
(
style
,
NULL
);
ok
(
hres
==
E_POINTER
,
"get_left failed: %08x
\n
"
,
hres
);
f
=
1
.
0
f
;
hres
=
IHTMLStyle_get_posLeft
(
style
,
&
f
);
ok
(
hres
==
S_OK
,
"get_left failed: %08x
\n
"
,
hres
);
ok
(
f
==
0
.
0
,
"expected 0.0 got %f
\n
"
,
f
);
hres
=
IHTMLStyle_put_posLeft
(
style
,
4
.
9
f
);
ok
(
hres
==
S_OK
,
"get_left failed: %08x
\n
"
,
hres
);
hres
=
IHTMLStyle_get_posLeft
(
style
,
&
f
);
ok
(
hres
==
S_OK
,
"get_left failed: %08x
\n
"
,
hres
);
ok
(
f
==
4
.
0
,
"expected 4.0 got %f
\n
"
,
f
);
/* Ensure left is updated correctly. */
V_VT
(
&
v
)
=
VT_EMPTY
;
hres
=
IHTMLStyle_get_left
(
style
,
&
v
);
ok
(
hres
==
S_OK
,
"get_left failed: %08x
\n
"
,
hres
);
ok
(
V_VT
(
&
v
)
==
VT_BSTR
,
"V_VT(v)=%d
\n
"
,
V_VT
(
&
v
));
ok
(
!
strcmp_wa
(
V_BSTR
(
&
v
),
"4px"
),
"V_BSTR(v) = %s
\n
"
,
dbgstr_w
(
V_BSTR
(
&
v
)));
VariantClear
(
&
v
);
/* Test left */
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
a2bstr
(
"3px"
);
hres
=
IHTMLStyle_put_left
(
style
,
v
);
ok
(
hres
==
S_OK
,
"put_left failed: %08x
\n
"
,
hres
);
VariantClear
(
&
v
);
hres
=
IHTMLStyle_get_posLeft
(
style
,
&
f
);
ok
(
hres
==
S_OK
,
"get_left failed: %08x
\n
"
,
hres
);
ok
(
f
==
3
.
0
,
"expected 3.0 got %f
\n
"
,
f
);
V_VT
(
&
v
)
=
VT_EMPTY
;
hres
=
IHTMLStyle_get_left
(
style
,
&
v
);
ok
(
hres
==
S_OK
,
"get_left failed: %08x
\n
"
,
hres
);
...
...
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