version 1.318, 2005/06/15 15:39:01
|
version 1.319, 2005/06/20 13:38:56
|
Line 511 static char *ParseABorderValue (char *cs
|
Line 511 static char *ParseABorderValue (char *cs
|
char *ptr = cssRule; |
char *ptr = cssRule; |
|
|
/* first parse the attribute string */ |
/* first parse the attribute string */ |
border->typed_data.value = 0; |
border->typed_data.value = 0; |
border->typed_data.unit = UNIT_INVALID; |
border->typed_data.unit = UNIT_INVALID; |
border->typed_data.real = FALSE; |
border->typed_data.real = FALSE; |
if (!strncasecmp (cssRule, "thin", 4)) |
if (!strncasecmp (cssRule, "thin", 4)) |
{ |
{ |
border->typed_data.unit = UNIT_PX; |
border->typed_data.unit = UNIT_PX; |
border->typed_data.value = 1; |
border->typed_data.value = 1; |
cssRule += 4; |
cssRule += 4; |
} |
} |
else if (!strncasecmp (cssRule, "medium", 6)) |
else if (!strncasecmp (cssRule, "medium", 6)) |
{ |
{ |
border->typed_data.unit = UNIT_PX; |
border->typed_data.unit = UNIT_PX; |
border->typed_data.value = 3; |
border->typed_data.value = 3; |
cssRule += 6; |
cssRule += 6; |
} |
} |
else if (!strncasecmp (cssRule, "thick", 5)) |
else if (!strncasecmp (cssRule, "thick", 5)) |
{ |
{ |
border->typed_data.unit = UNIT_PX; |
border->typed_data.unit = UNIT_PX; |
border->typed_data.value = 5; |
border->typed_data.value = 5; |
cssRule += 5; |
cssRule += 5; |
} |
} |
else if (isdigit (*cssRule) || *cssRule == '.') |
else if (!strncasecmp (cssRule, "inherit", 7)) |
{ |
{ |
cssRule = ParseCSSUnit (cssRule, border); |
border->typed_data.unit = VALUE_INHERIT; |
if (border->typed_data.value == 0) |
cssRule += 7; |
border->typed_data.unit = UNIT_PX; |
} |
else if (border->typed_data.unit == UNIT_INVALID || |
else if (isdigit (*cssRule) || *cssRule == '.') |
border->typed_data.unit == UNIT_BOX || |
{ |
border->typed_data.unit == UNIT_PERCENT) |
cssRule = ParseCSSUnit (cssRule, border); |
{ |
if (border->typed_data.value == 0) |
border->typed_data.unit = UNIT_INVALID; |
border->typed_data.unit = UNIT_PX; |
border->typed_data.value = 0; |
else if (border->typed_data.unit == UNIT_INVALID || |
CSSParseError ("Invalid border-width value", ptr, cssRule); |
border->typed_data.unit == UNIT_BOX || |
} |
border->typed_data.unit == UNIT_PERCENT) |
} |
{ |
return (cssRule); |
border->typed_data.unit = UNIT_INVALID; |
|
border->typed_data.value = 0; |
|
CSSParseError ("Invalid border-width value", ptr, cssRule); |
|
} |
|
} |
|
return (cssRule); |
} |
} |
|
|
|
|