Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c8b3a164
Commit
c8b3a164
authored
Oct 06, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLStyle2::[get|put]_position.
parent
7a8043d3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
8 deletions
+49
-8
htmlstyle.c
dlls/mshtml/htmlstyle.c
+10
-4
htmlstyle.h
dlls/mshtml/htmlstyle.h
+2
-0
htmlstyle2.c
dlls/mshtml/htmlstyle2.c
+8
-4
dom.c
dlls/mshtml/tests/dom.c
+29
-0
No files found.
dlls/mshtml/htmlstyle.c
View file @
c8b3a164
...
...
@@ -69,6 +69,8 @@ static const WCHAR attrMarginRight[] =
{
'm'
,
'a'
,
'r'
,
'g'
,
'i'
,
'n'
,
'-'
,
'r'
,
'i'
,
'g'
,
'h'
,
't'
,
0
};
static
const
WCHAR
attrPaddingLeft
[]
=
{
'p'
,
'a'
,
'd'
,
'd'
,
'i'
,
'n'
,
'g'
,
'-'
,
'l'
,
'e'
,
'f'
,
't'
,
0
};
static
const
WCHAR
attrPosition
[]
=
{
'p'
,
'o'
,
's'
,
'i'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
attrTextDecoration
[]
=
{
't'
,
'e'
,
'x'
,
't'
,
'-'
,
'd'
,
'e'
,
'c'
,
'o'
,
'r'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
attrTop
[]
=
...
...
@@ -99,6 +101,7 @@ static const LPCWSTR style_strings[] = {
attrMarginLeft
,
attrMarginRight
,
attrPaddingLeft
,
attrPosition
,
attrTextDecoration
,
attrTop
,
attrVerticalAlign
,
...
...
@@ -172,7 +175,7 @@ static LPWSTR fix_url_value(LPCWSTR val)
#define ATTR_FIX_PX 1
#define ATTR_FIX_URL 2
static
HRESULT
set_style_attr
(
HTMLStyle
*
This
,
styleid_t
sid
,
LPCWSTR
value
,
DWORD
flags
)
HRESULT
set_nsstyle_attr
(
nsIDOMCSSStyleDeclaration
*
nsstyle
,
styleid_t
sid
,
LPCWSTR
value
,
DWORD
flags
)
{
nsAString
str_name
,
str_value
,
str_empty
;
LPWSTR
val
=
NULL
;
...
...
@@ -180,8 +183,6 @@ static HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWO
static
const
PRUnichar
wszEmpty
[]
=
{
0
};
TRACE
(
"(%p)->(%s %s)
\n
"
,
This
,
debugstr_w
(
style_strings
[
sid
]),
debugstr_w
(
value
));
if
(
flags
&
ATTR_FIX_PX
)
val
=
fix_px_value
(
value
);
if
(
flags
&
ATTR_FIX_URL
)
...
...
@@ -192,7 +193,7 @@ static HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWO
nsAString_Init
(
&
str_empty
,
wszEmpty
);
heap_free
(
val
);
nsres
=
nsIDOMCSSStyleDeclaration_SetProperty
(
This
->
nsstyle
,
&
str_name
,
&
str_value
,
&
str_empty
);
nsres
=
nsIDOMCSSStyleDeclaration_SetProperty
(
nsstyle
,
&
str_name
,
&
str_value
,
&
str_empty
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"SetProperty failed: %08x
\n
"
,
nsres
);
...
...
@@ -203,6 +204,11 @@ static HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWO
return
S_OK
;
}
static
inline
HRESULT
set_style_attr
(
HTMLStyle
*
This
,
styleid_t
sid
,
LPCWSTR
value
,
DWORD
flags
)
{
return
set_nsstyle_attr
(
This
->
nsstyle
,
sid
,
value
,
flags
);
}
static
HRESULT
get_nsstyle_attr_nsval
(
nsIDOMCSSStyleDeclaration
*
nsstyle
,
styleid_t
sid
,
nsAString
*
value
)
{
nsAString
str_name
;
...
...
dlls/mshtml/htmlstyle.h
View file @
c8b3a164
...
...
@@ -49,6 +49,7 @@ typedef enum {
STYLEID_MARGIN_LEFT
,
STYLEID_MARGIN_RIGHT
,
STYLEID_PADDING_LEFT
,
STYLEID_POSITION
,
STYLEID_TEXT_DECORATION
,
STYLEID_TOP
,
STYLEID_VERTICAL_ALIGN
,
...
...
@@ -59,3 +60,4 @@ typedef enum {
void
HTMLStyle2_Init
(
HTMLStyle
*
);
HRESULT
get_nsstyle_attr
(
nsIDOMCSSStyleDeclaration
*
,
styleid_t
,
BSTR
*
);
HRESULT
set_nsstyle_attr
(
nsIDOMCSSStyleDeclaration
*
,
styleid_t
,
LPCWSTR
,
DWORD
);
dlls/mshtml/htmlstyle2.c
View file @
c8b3a164
...
...
@@ -166,15 +166,19 @@ static HRESULT WINAPI HTMLStyle2_removeExpression(IHTMLStyle2 *iface, BSTR propn
static
HRESULT
WINAPI
HTMLStyle2_put_position
(
IHTMLStyle2
*
iface
,
BSTR
v
)
{
HTMLStyle
*
This
=
HTMLSTYLE2_THIS
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
return
set_nsstyle_attr
(
This
->
nsstyle
,
STYLEID_POSITION
,
v
,
0
);
}
static
HRESULT
WINAPI
HTMLStyle2_get_position
(
IHTMLStyle2
*
iface
,
BSTR
*
p
)
{
HTMLStyle
*
This
=
HTMLSTYLE2_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
get_nsstyle_attr
(
This
->
nsstyle
,
STYLEID_POSITION
,
p
);
}
static
HRESULT
WINAPI
HTMLStyle2_put_unicodeBidi
(
IHTMLStyle2
*
iface
,
BSTR
v
)
...
...
dlls/mshtml/tests/dom.c
View file @
c8b3a164
...
...
@@ -1998,8 +1998,31 @@ static void test_current_style(IHTMLCurrentStyle *current_style)
SysFreeString
(
str
);
}
static
void
test_style2
(
IHTMLStyle2
*
style2
)
{
BSTR
str
;
HRESULT
hres
;
str
=
(
void
*
)
0xdeadbeef
;
hres
=
IHTMLStyle2_get_position
(
style2
,
&
str
);
ok
(
hres
==
S_OK
,
"get_position failed: %08x
\n
"
,
hres
);
ok
(
!
str
,
"str != NULL
\n
"
);
str
=
a2bstr
(
"absolute"
);
hres
=
IHTMLStyle2_put_position
(
style2
,
str
);
ok
(
hres
==
S_OK
,
"get_position failed: %08x
\n
"
,
hres
);
SysFreeString
(
str
);
str
=
NULL
;
hres
=
IHTMLStyle2_get_position
(
style2
,
&
str
);
ok
(
hres
==
S_OK
,
"get_position failed: %08x
\n
"
,
hres
);
ok
(
!
strcmp_wa
(
str
,
"absolute"
),
"get_position returned %s
\n
"
,
dbgstr_w
(
str
));
SysFreeString
(
str
);
}
static
void
test_default_style
(
IHTMLStyle
*
style
)
{
IHTMLStyle2
*
style2
;
VARIANT_BOOL
b
;
VARIANT
v
;
BSTR
str
;
...
...
@@ -2195,6 +2218,12 @@ static void test_default_style(IHTMLStyle *style)
ok
(
!
strcmp_wa
(
V_BSTR
(
&
v
),
"middle"
),
"V_BSTR(v) = %s
\n
"
,
dbgstr_w
(
V_BSTR
(
&
v
)));
VariantClear
(
&
v
);
hres
=
IHTMLStyle_QueryInterface
(
style
,
&
IID_IHTMLStyle2
,
(
void
**
)
&
style2
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLStyle2 iface: %08x
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
{
test_style2
(
style2
);
IHTMLStyle2_Release
(
style2
);
}
}
static
void
test_default_selection
(
IHTMLDocument2
*
doc
)
...
...
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