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
44de20a0
Commit
44de20a0
authored
Jan 13, 2009
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Jan 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement IHTMLStyle get/put borderLeftStyle.
parent
0ffd26ab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
144 additions
and
4 deletions
+144
-4
htmlstyle.c
dlls/mshtml/htmlstyle.c
+37
-4
htmlstyle.h
dlls/mshtml/htmlstyle.h
+1
-0
dom.c
dlls/mshtml/tests/dom.c
+106
-0
No files found.
dlls/mshtml/htmlstyle.c
View file @
44de20a0
...
...
@@ -45,6 +45,8 @@ static const WCHAR attrBorder[] =
{
'b'
,
'o'
,
'r'
,
'd'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
attrBorderLeft
[]
=
{
'b'
,
'o'
,
'r'
,
'd'
,
'e'
,
'r'
,
'-'
,
'l'
,
'e'
,
'f'
,
't'
,
0
};
static
const
WCHAR
attrBorderLeftStyle
[]
=
{
'b'
,
'o'
,
'r'
,
'd'
,
'e'
,
'r'
,
'-'
,
'l'
,
'e'
,
'f'
,
't'
,
'-'
,
's'
,
't'
,
'y'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
attrBorderWidth
[]
=
{
'b'
,
'o'
,
'r'
,
'd'
,
'e'
,
'r'
,
'-'
,
'w'
,
'i'
,
'd'
,
't'
,
'h'
,
0
};
static
const
WCHAR
attrColor
[]
=
...
...
@@ -105,6 +107,7 @@ static const struct{
{
attrBackgroundImage
,
DISPID_IHTMLSTYLE_BACKGROUNDIMAGE
},
{
attrBorder
,
DISPID_IHTMLSTYLE_BORDER
},
{
attrBorderLeft
,
DISPID_IHTMLSTYLE_BORDERLEFT
},
{
attrBorderLeftStyle
,
DISPID_IHTMLSTYLE_BORDERLEFTSTYLE
},
{
attrBorderWidth
,
DISPID_IHTMLSTYLE_BORDERWIDTH
},
{
attrColor
,
DISPID_IHTMLSTYLE_COLOR
},
{
attrCursor
,
DISPID_IHTMLSTYLE_CURSOR
},
...
...
@@ -413,6 +416,32 @@ static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
return
hres
;
}
static
BOOL
is_valid_border_style
(
BSTR
v
)
{
static
const
WCHAR
styleNone
[]
=
{
'n'
,
'o'
,
'n'
,
'e'
,
0
};
static
const
WCHAR
styleDotted
[]
=
{
'd'
,
'o'
,
't'
,
't'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
styleDashed
[]
=
{
'd'
,
'a'
,
's'
,
'h'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
styleSolid
[]
=
{
's'
,
'o'
,
'l'
,
'i'
,
'd'
,
0
};
static
const
WCHAR
styleDouble
[]
=
{
'd'
,
'o'
,
'u'
,
'b'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
styleGroove
[]
=
{
'g'
,
'r'
,
'o'
,
'o'
,
'v'
,
'e'
,
0
};
static
const
WCHAR
styleRidge
[]
=
{
'r'
,
'i'
,
'd'
,
'g'
,
'e'
,
0
};
static
const
WCHAR
styleInset
[]
=
{
'i'
,
'n'
,
's'
,
'e'
,
't'
,
0
};
static
const
WCHAR
styleOutset
[]
=
{
'o'
,
'u'
,
't'
,
's'
,
'e'
,
't'
,
0
};
TRACE
(
"%s
\n
"
,
debugstr_w
(
v
));
if
(
!
v
||
strcmpiW
(
v
,
styleNone
)
==
0
||
strcmpiW
(
v
,
styleDotted
)
==
0
||
strcmpiW
(
v
,
styleDashed
)
==
0
||
strcmpiW
(
v
,
styleSolid
)
==
0
||
strcmpiW
(
v
,
styleDouble
)
==
0
||
strcmpiW
(
v
,
styleGroove
)
==
0
||
strcmpiW
(
v
,
styleRidge
)
==
0
||
strcmpiW
(
v
,
styleInset
)
==
0
||
strcmpiW
(
v
,
styleOutset
)
==
0
)
{
return
TRUE
;
}
return
FALSE
;
}
#define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
static
HRESULT
WINAPI
HTMLStyle_QueryInterface
(
IHTMLStyle
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -1473,15 +1502,19 @@ static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p
static
HRESULT
WINAPI
HTMLStyle_put_borderLeftStyle
(
IHTMLStyle
*
iface
,
BSTR
v
)
{
HTMLStyle
*
This
=
HTMLSTYLE_THIS
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
if
(
!
is_valid_border_style
(
v
))
return
E_INVALIDARG
;
return
set_style_attr
(
This
,
STYLEID_BORDER_LEFT_STYLE
,
v
,
0
);
}
static
HRESULT
WINAPI
HTMLStyle_get_borderLeftStyle
(
IHTMLStyle
*
iface
,
BSTR
*
p
)
{
HTMLStyle
*
This
=
HTMLSTYLE_THIS
(
iface
);
FIXM
E
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
TRAC
E
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
get_style_attr
(
This
,
STYLEID_BORDER_LEFT_STYLE
,
p
)
;
}
static
HRESULT
WINAPI
HTMLStyle_put_width
(
IHTMLStyle
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/htmlstyle.h
View file @
44de20a0
...
...
@@ -36,6 +36,7 @@ typedef enum {
STYLEID_BACKGROUND_IMAGE
,
STYLEID_BORDER
,
STYLEID_BORDER_LEFT
,
STYLEID_BORDER_LEFT_STYLE
,
STYLEID_BORDER_WIDTH
,
STYLEID_COLOR
,
STYLEID_CURSOR
,
...
...
dlls/mshtml/tests/dom.c
View file @
44de20a0
...
...
@@ -1790,6 +1790,108 @@ static void _test_doc_set_title(unsigned line, IHTMLDocument2 *doc, const char *
SysFreeString
(
tmp
);
}
#define test_border_styles(p, n) _test_border_styles(__LINE__, p, n)
static
void
_test_border_styles
(
unsigned
line
,
IHTMLStyle
*
pStyle
,
BSTR
Name
)
{
HRESULT
hres
;
DISPID
dispid
;
hres
=
IHTMLStyle_GetIDsOfNames
(
pStyle
,
&
IID_NULL
,
(
LPOLESTR
*
)
&
Name
,
1
,
LOCALE_USER_DEFAULT
,
&
dispid
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"GetIDsOfNames: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
DISPPARAMS
params
=
{
NULL
,
NULL
,
0
,
0
};
DISPID
dispidNamed
=
DISPID_PROPERTYPUT
;
VARIANT
ret
;
VARIANT
vDefault
;
VARIANTARG
arg
;
hres
=
IHTMLStyle_Invoke
(
pStyle
,
dispid
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYGET
,
&
params
,
&
vDefault
,
NULL
,
NULL
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"get_default. ret: %08x
\n
"
,
hres
);
params
.
cArgs
=
1
;
params
.
cNamedArgs
=
1
;
params
.
rgdispidNamedArgs
=
&
dispidNamed
;
V_VT
(
&
arg
)
=
VT_BSTR
;
V_BSTR
(
&
arg
)
=
a2bstr
(
"none"
);
params
.
rgvarg
=
&
arg
;
hres
=
IHTMLStyle_Invoke
(
pStyle
,
dispid
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYPUT
,
&
params
,
&
ret
,
NULL
,
NULL
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"none. ret: %08x
\n
"
,
hres
);
VariantClear
(
&
arg
);
V_VT
(
&
arg
)
=
VT_BSTR
;
V_BSTR
(
&
arg
)
=
a2bstr
(
"dotted"
);
hres
=
IHTMLStyle_Invoke
(
pStyle
,
dispid
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYPUT
,
&
params
,
&
ret
,
NULL
,
NULL
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"dotted. ret: %08x
\n
"
,
hres
);
VariantClear
(
&
arg
);
V_VT
(
&
arg
)
=
VT_BSTR
;
V_BSTR
(
&
arg
)
=
a2bstr
(
"dashed"
);
hres
=
IHTMLStyle_Invoke
(
pStyle
,
dispid
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYPUT
,
&
params
,
&
ret
,
NULL
,
NULL
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"dashed. ret: %08x
\n
"
,
hres
);
VariantClear
(
&
arg
);
V_VT
(
&
arg
)
=
VT_BSTR
;
V_BSTR
(
&
arg
)
=
a2bstr
(
"solid"
);
hres
=
IHTMLStyle_Invoke
(
pStyle
,
dispid
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYPUT
,
&
params
,
&
ret
,
NULL
,
NULL
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"solid. ret: %08x
\n
"
,
hres
);
VariantClear
(
&
arg
);
V_VT
(
&
arg
)
=
VT_BSTR
;
V_BSTR
(
&
arg
)
=
a2bstr
(
"double"
);
hres
=
IHTMLStyle_Invoke
(
pStyle
,
dispid
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYPUT
,
&
params
,
&
ret
,
NULL
,
NULL
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"double. ret: %08x
\n
"
,
hres
);
VariantClear
(
&
arg
);
V_VT
(
&
arg
)
=
VT_BSTR
;
V_BSTR
(
&
arg
)
=
a2bstr
(
"groove"
);
hres
=
IHTMLStyle_Invoke
(
pStyle
,
dispid
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYPUT
,
&
params
,
&
ret
,
NULL
,
NULL
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"groove. ret: %08x
\n
"
,
hres
);
VariantClear
(
&
arg
);
V_VT
(
&
arg
)
=
VT_BSTR
;
V_BSTR
(
&
arg
)
=
a2bstr
(
"ridge"
);
hres
=
IHTMLStyle_Invoke
(
pStyle
,
dispid
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYPUT
,
&
params
,
&
ret
,
NULL
,
NULL
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"ridge. ret: %08x
\n
"
,
hres
);
VariantClear
(
&
arg
);
V_VT
(
&
arg
)
=
VT_BSTR
;
V_BSTR
(
&
arg
)
=
a2bstr
(
"inset"
);
hres
=
IHTMLStyle_Invoke
(
pStyle
,
dispid
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYPUT
,
&
params
,
&
ret
,
NULL
,
NULL
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"inset. ret: %08x
\n
"
,
hres
);
VariantClear
(
&
arg
);
V_VT
(
&
arg
)
=
VT_BSTR
;
V_BSTR
(
&
arg
)
=
a2bstr
(
"outset"
);
hres
=
IHTMLStyle_Invoke
(
pStyle
,
dispid
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYPUT
,
&
params
,
&
ret
,
NULL
,
NULL
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"outset. ret: %08x
\n
"
,
hres
);
VariantClear
(
&
arg
);
V_VT
(
&
arg
)
=
VT_BSTR
;
V_BSTR
(
&
arg
)
=
a2bstr
(
"invalid"
);
hres
=
IHTMLStyle_Invoke
(
pStyle
,
dispid
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYPUT
,
&
params
,
&
ret
,
NULL
,
NULL
);
ok_
(
__FILE__
,
line
)
(
FAILED
(
hres
),
"invalid value passed.
\n
"
);
VariantClear
(
&
arg
);
params
.
rgvarg
=
&
vDefault
;
hres
=
IHTMLStyle_Invoke
(
pStyle
,
dispid
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYPUT
,
&
params
,
&
ret
,
NULL
,
NULL
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"default. ret: %08x
\n
"
,
hres
);
}
}
static
void
test_elem_col_item
(
IHTMLElementCollection
*
col
,
LPCWSTR
n
,
const
elem_type_t
*
elem_types
,
long
len
)
{
...
...
@@ -2786,6 +2888,10 @@ static void test_default_style(IHTMLStyle *style)
SysFreeString
(
str
);
str
=
a2bstr
(
"borderLeftStyle"
);
test_border_styles
(
style
,
str
);
SysFreeString
(
str
);
hres
=
IHTMLStyle_QueryInterface
(
style
,
&
IID_IHTMLStyle2
,
(
void
**
)
&
style2
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLStyle2 iface: %08x
\n
"
,
hres
);
if
(
SUCCEEDED
(
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