@@ -132,18 +132,20 @@ void litehtml::style::add_property( const tchar_t* name, const tchar_t* val, con
132
132
add_property (_t (" border-bottom-style" ), tok->c_str (), baseurl, important);
133
133
} else
134
134
{
135
- if (web_color::is_color (tok->c_str ()))
136
- {
137
- add_property (_t (" border-left-color" ), tok->c_str (), baseurl, important);
138
- add_property (_t (" border-right-color" ), tok->c_str (), baseurl, important);
139
- add_property (_t (" border-top-color" ), tok->c_str (), baseurl, important);
140
- add_property (_t (" border-bottom-color" ), tok->c_str (), baseurl, important);
141
- } else
135
+ if (t_isdigit ((*tok)[0 ]) || (*tok)[0 ] == _t (' .' ) ||
136
+ value_in_list ((*tok), _t (" thin;medium;thick" )))
142
137
{
143
138
add_property (_t (" border-left-width" ), tok->c_str (), baseurl, important);
144
139
add_property (_t (" border-right-width" ), tok->c_str (), baseurl, important);
145
140
add_property (_t (" border-top-width" ), tok->c_str (), baseurl, important);
146
141
add_property (_t (" border-bottom-width" ), tok->c_str (), baseurl, important);
142
+ }
143
+ else
144
+ {
145
+ add_property (_t (" border-left-color" ), tok->c_str (), baseurl, important);
146
+ add_property (_t (" border-right-color" ), tok->c_str (), baseurl, important);
147
+ add_property (_t (" border-top-color" ), tok->c_str (), baseurl, important);
148
+ add_property (_t (" border-bottom-color" ), tok->c_str (), baseurl, important);
147
149
}
148
150
}
149
151
}
@@ -498,10 +500,7 @@ void litehtml::style::parse_short_background( const tstring& val, const tchar_t*
498
500
bool origin_found = false ;
499
501
for (string_vector::iterator tok = tokens.begin (); tok != tokens.end (); tok++)
500
502
{
501
- if (web_color::is_color (tok->c_str ()))
502
- {
503
- add_parsed_property (_t (" background-color" ), *tok, important);
504
- } else if (tok->substr (0 , 3 ) == _t (" url" ))
503
+ if (tok->substr (0 , 3 ) == _t (" url" ))
505
504
{
506
505
add_parsed_property (_t (" background-image" ), *tok, important);
507
506
if (baseurl)
@@ -538,6 +537,9 @@ void litehtml::style::parse_short_background( const tstring& val, const tchar_t*
538
537
{
539
538
add_parsed_property (_t (" background-position" ), *tok, important);
540
539
}
540
+ } else if (web_color::is_color (tok->c_str ()))
541
+ {
542
+ add_parsed_property (_t (" background-color" ), *tok, important);
541
543
}
542
544
}
543
545
}
0 commit comments