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
dd8f202e
Commit
dd8f202e
authored
Aug 28, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use generic value checks for IHTMLStyle::put_fontWeight implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ab2bd77c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
21 deletions
+32
-21
htmlstyle.c
dlls/mshtml/htmlstyle.c
+32
-21
No files found.
dlls/mshtml/htmlstyle.c
View file @
dd8f202e
...
...
@@ -207,11 +207,24 @@ static const WCHAR word_wrapW[] =
static
const
WCHAR
z_indexW
[]
=
{
'z'
,
'-'
,
'i'
,
'n'
,
'd'
,
'e'
,
'x'
,
0
};
static
const
WCHAR
boldW
[]
=
{
'b'
,
'o'
,
'l'
,
'd'
,
0
};
static
const
WCHAR
bolderW
[]
=
{
'b'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
capsW
[]
=
{
's'
,
'm'
,
'a'
,
'l'
,
'l'
,
'-'
,
'c'
,
'a'
,
'p'
,
's'
,
0
};
static
const
WCHAR
italicW
[]
=
{
'i'
,
't'
,
'a'
,
'l'
,
'i'
,
'c'
,
0
};
static
const
WCHAR
lighterW
[]
=
{
'l'
,
'i'
,
'g'
,
'h'
,
't'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
normalW
[]
=
{
'n'
,
'o'
,
'r'
,
'm'
,
'a'
,
'l'
,
0
};
static
const
WCHAR
obliqueW
[]
=
{
'o'
,
'b'
,
'l'
,
'i'
,
'q'
,
'u'
,
'e'
,
0
};
static
const
WCHAR
style100W
[]
=
{
'1'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style200W
[]
=
{
'2'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style300W
[]
=
{
'3'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style400W
[]
=
{
'4'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style500W
[]
=
{
'5'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style600W
[]
=
{
'6'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style700W
[]
=
{
'7'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style800W
[]
=
{
'8'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style900W
[]
=
{
'9'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
*
font_style_values
[]
=
{
italicW
,
normalW
,
...
...
@@ -225,6 +238,23 @@ static const WCHAR *font_variant_values[] = {
NULL
};
static
const
WCHAR
*
font_weight_values
[]
=
{
style100W
,
style200W
,
style300W
,
style400W
,
style500W
,
style600W
,
style700W
,
style800W
,
style900W
,
boldW
,
bolderW
,
lighterW
,
normalW
,
NULL
};
#define ATTR_FIX_PX 0x0001
#define ATTR_FIX_URL 0x0002
#define ATTR_STR_TO_INT 0x0004
...
...
@@ -284,7 +314,7 @@ static const style_tbl_entry_t style_tbl[] = {
{
font_sizeW
,
DISPID_IHTMLSTYLE_FONTSIZE
,
ATTR_FIX_PX
},
{
font_styleW
,
DISPID_IHTMLSTYLE_FONTSTYLE
,
0
,
font_style_values
},
{
font_variantW
,
DISPID_IHTMLSTYLE_FONTVARIANT
,
0
,
font_variant_values
},
{
font_weightW
,
DISPID_IHTMLSTYLE_FONTWEIGHT
,
ATTR_STR_TO_INT
},
{
font_weightW
,
DISPID_IHTMLSTYLE_FONTWEIGHT
,
ATTR_STR_TO_INT
,
font_weight_values
},
{
heightW
,
DISPID_IHTMLSTYLE_HEIGHT
,
ATTR_FIX_PX
},
{
leftW
,
DISPID_IHTMLSTYLE_LEFT
},
{
letter_spacingW
,
DISPID_IHTMLSTYLE_LETTERSPACING
},
...
...
@@ -432,7 +462,7 @@ static HRESULT set_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_
nsresult
nsres
;
HRESULT
hres
=
S_OK
;
if
(
value
)
{
if
(
value
&&
*
value
)
{
unsigned
flags
=
style_tbl
[
sid
].
flags
;
if
(
flags
&
ATTR_FIX_PX
)
val
=
fix_px_value
(
value
);
...
...
@@ -952,28 +982,9 @@ static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
static
HRESULT
WINAPI
HTMLStyle_put_fontWeight
(
IHTMLStyle
*
iface
,
BSTR
v
)
{
HTMLStyle
*
This
=
impl_from_IHTMLStyle
(
iface
);
static
const
WCHAR
styleBold
[]
=
{
'b'
,
'o'
,
'l'
,
'd'
,
0
};
static
const
WCHAR
styleBolder
[]
=
{
'b'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
styleLighter
[]
=
{
'l'
,
'i'
,
'g'
,
'h'
,
't'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
style100
[]
=
{
'1'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style200
[]
=
{
'2'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style300
[]
=
{
'3'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style400
[]
=
{
'4'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style500
[]
=
{
'5'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style600
[]
=
{
'6'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style700
[]
=
{
'7'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style800
[]
=
{
'8'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
style900
[]
=
{
'9'
,
'0'
,
'0'
,
0
};
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
/* fontWeight can only be one of the following */
if
(
v
&&
*
v
&&
strcmpiW
(
normalW
,
v
)
&&
strcmpiW
(
styleBold
,
v
)
&&
strcmpiW
(
styleBolder
,
v
)
&&
strcmpiW
(
styleLighter
,
v
)
&&
strcmpiW
(
style100
,
v
)
&&
strcmpiW
(
style200
,
v
)
&&
strcmpiW
(
style300
,
v
)
&&
strcmpiW
(
style400
,
v
)
&&
strcmpiW
(
style500
,
v
)
&&
strcmpiW
(
style600
,
v
)
&&
strcmpiW
(
style700
,
v
)
&&
strcmpiW
(
style800
,
v
)
&&
strcmpiW
(
style900
,
v
))
return
E_INVALIDARG
;
return
set_style_property
(
This
,
STYLEID_FONT_WEIGHT
,
v
);
}
...
...
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