version 1.287, 2004/11/15 09:12:02
|
version 1.288, 2004/11/25 17:06:55
|
Line 206 static void CSSParseError (char *msg, ch
|
Line 206 static void CSSParseError (char *msg, ch
|
*endvalue = c; |
*endvalue = c; |
} |
} |
|
|
|
/*---------------------------------------------------------------------- |
|
CSSCheckEndValue |
|
print an error message if another character is found |
|
----------------------------------------------------------------------*/ |
|
static char *CSSCheckEndValue (char *cssRule, char *endvalue, char *msg) |
|
{ |
|
char c = EOS; |
|
if (*endvalue != EOS && *endvalue != SPACE && *endvalue != '/' && |
|
*endvalue != ';' && *endvalue != EOL && *endvalue != TAB && |
|
*endvalue != __CR__) |
|
{ |
|
while (*endvalue != EOS && *endvalue != SPACE && *endvalue != '/' && |
|
*endvalue != ';' && *endvalue != EOL && *endvalue != TAB && |
|
*endvalue != __CR__) |
|
endvalue++; |
|
/* close the string here */ |
|
c = *endvalue; |
|
*endvalue = EOS; |
|
CSSPrintError (msg, cssRule); |
|
*endvalue = c; |
|
} |
|
return endvalue; |
|
} |
|
|
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
SkipProperty skips a property and display and error message |
SkipProperty skips a property and display and error message |
Line 228 static char *SkipProperty (char *ptr, Th
|
Line 252 static char *SkipProperty (char *ptr, Th
|
} |
} |
ptr++; |
ptr++; |
} |
} |
|
#ifdef IV |
/* print the skipped property */ |
/* print the skipped property */ |
c = *ptr; |
c = *ptr; |
*ptr = EOS; |
*ptr = EOS; |
Line 260 static char *SkipProperty (char *ptr, Th
|
Line 285 static char *SkipProperty (char *ptr, Th
|
strncasecmp (deb, "widows", 6)) |
strncasecmp (deb, "widows", 6)) |
CSSPrintError ("CSS property ignored:", deb); |
CSSPrintError ("CSS property ignored:", deb); |
*ptr = c; |
*ptr = c; |
|
#endif /* IV */ |
return (ptr); |
return (ptr); |
} |
} |
|
|
Line 462 char *ParseClampedUnit (char *cssRule, P
|
Line 488 char *ParseClampedUnit (char *cssRule, P
|
|
|
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
ParseBorderValue |
ParseABorderValue |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
static char *ParseBorderValue (char *cssRule, PresentationValue *border) |
static char *ParseABorderValue (char *cssRule, PresentationValue *border) |
{ |
{ |
char *ptr; |
char *ptr = cssRule; |
|
|
/* first parse the attribute string */ |
/* first parse the attribute string */ |
border->typed_data.value = 0; |
border->typed_data.value = 0; |
Line 476 static char *ParseBorderValue (char *css
|
Line 502 static char *ParseBorderValue (char *css
|
{ |
{ |
border->typed_data.unit = UNIT_PX; |
border->typed_data.unit = UNIT_PX; |
border->typed_data.value = 1; |
border->typed_data.value = 1; |
cssRule = SkipWord (cssRule); |
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 = SkipWord (cssRule); |
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 = SkipWord (cssRule); |
cssRule += 5; |
} |
} |
else if (isdigit (*cssRule) || *cssRule == '.') |
else if (isdigit (*cssRule) || *cssRule == '.') |
{ |
{ |
ptr = cssRule; |
|
cssRule = ParseCSSUnit (cssRule, border); |
cssRule = ParseCSSUnit (cssRule, border); |
if (border->typed_data.value == 0) |
if (border->typed_data.value == 0) |
border->typed_data.unit = UNIT_PX; |
border->typed_data.unit = UNIT_PX; |
Line 509 static char *ParseBorderValue (char *css
|
Line 534 static char *ParseBorderValue (char *css
|
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
|
ParseBorderValue |
|
----------------------------------------------------------------------*/ |
|
static char *ParseBorderValue (char *cssRule, PresentationValue *border) |
|
{ |
|
char *ptr = cssRule; |
|
|
|
cssRule = ParseABorderValue (cssRule, border); |
|
/* the value is parsed now */ |
|
if (ptr != cssRule) |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid border value"); |
|
return (cssRule); |
|
} |
|
|
|
/*---------------------------------------------------------------------- |
ParseBorderStyle |
ParseBorderStyle |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
static char *ParseBorderStyle (char *cssRule, PresentationValue *border) |
static char *ParseBorderStyle (char *cssRule, PresentationValue *border) |
{ |
{ |
|
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_PX; |
border->typed_data.unit = UNIT_PX; |
border->typed_data.real = FALSE; |
border->typed_data.real = FALSE; |
if (!strncasecmp (cssRule, "none", 4)) |
if (!strncasecmp (cssRule, "none", 4)) |
|
{ |
border->typed_data.value = BorderStyleNone; |
border->typed_data.value = BorderStyleNone; |
|
cssRule += 4; |
|
} |
else if (!strncasecmp (cssRule, "hidden", 6)) |
else if (!strncasecmp (cssRule, "hidden", 6)) |
|
{ |
border->typed_data.value = BorderStyleHidden; |
border->typed_data.value = BorderStyleHidden; |
|
cssRule += 6; |
|
} |
else if (!strncasecmp (cssRule, "dotted", 6)) |
else if (!strncasecmp (cssRule, "dotted", 6)) |
|
{ |
|
cssRule += 6; |
border->typed_data.value = BorderStyleDotted; |
border->typed_data.value = BorderStyleDotted; |
|
} |
else if (!strncasecmp (cssRule, "dashed", 6)) |
else if (!strncasecmp (cssRule, "dashed", 6)) |
|
{ |
border->typed_data.value = BorderStyleDashed; |
border->typed_data.value = BorderStyleDashed; |
|
cssRule += 6; |
|
} |
else if (!strncasecmp (cssRule, "solid", 5)) |
else if (!strncasecmp (cssRule, "solid", 5)) |
|
{ |
border->typed_data.value = BorderStyleSolid; |
border->typed_data.value = BorderStyleSolid; |
|
cssRule += 5; |
|
} |
else if (!strncasecmp (cssRule, "double", 6)) |
else if (!strncasecmp (cssRule, "double", 6)) |
|
{ |
border->typed_data.value = BorderStyleDouble; |
border->typed_data.value = BorderStyleDouble; |
|
cssRule += 6; |
|
} |
else if (!strncasecmp (cssRule, "groove", 6)) |
else if (!strncasecmp (cssRule, "groove", 6)) |
|
{ |
border->typed_data.value = BorderStyleGroove; |
border->typed_data.value = BorderStyleGroove; |
|
cssRule += 6; |
|
} |
else if (!strncasecmp (cssRule, "ridge", 5)) |
else if (!strncasecmp (cssRule, "ridge", 5)) |
|
{ |
border->typed_data.value = BorderStyleRidge; |
border->typed_data.value = BorderStyleRidge; |
|
cssRule += 5; |
|
} |
else if (!strncasecmp (cssRule, "inset", 5)) |
else if (!strncasecmp (cssRule, "inset", 5)) |
|
{ |
border->typed_data.value = BorderStyleInset; |
border->typed_data.value = BorderStyleInset; |
|
cssRule += 5; |
|
} |
else if (!strncasecmp (cssRule, "outset", 6)) |
else if (!strncasecmp (cssRule, "outset", 6)) |
|
{ |
border->typed_data.value = BorderStyleOutset; |
border->typed_data.value = BorderStyleOutset; |
|
cssRule += 6; |
|
} |
else |
else |
{ |
{ |
/* invalid style */ |
/* invalid style */ |
Line 544 static char *ParseBorderStyle (char *css
|
Line 615 static char *ParseBorderStyle (char *css
|
return (cssRule); |
return (cssRule); |
} |
} |
/* the value is parsed now */ |
/* the value is parsed now */ |
cssRule = SkipWord (cssRule); |
/*cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid border-style value");*/ |
return (cssRule); |
return (cssRule); |
} |
} |
|
|
Line 570 static char *ParseCSSColor (char *cssRul
|
Line 641 static char *ParseCSSColor (char *cssRul
|
ptr = TtaGiveRGB (cssRule, &redval, &greenval, &blueval); |
ptr = TtaGiveRGB (cssRule, &redval, &greenval, &blueval); |
if (!strncasecmp (cssRule, "inherit", 7)) |
if (!strncasecmp (cssRule, "inherit", 7)) |
{ |
{ |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
return (cssRule); |
return (cssRule); |
} |
} |
if (ptr == cssRule) |
if (ptr == cssRule) |
Line 636 static char *ParseCSSBorderTopWidth (Ele
|
Line 707 static char *ParseCSSBorderTopWidth (Ele
|
PresentationValue border; |
PresentationValue border; |
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = ParseBorderValue (cssRule, &border); |
cssRule = ParseABorderValue (cssRule, &border); |
if (border.typed_data.unit != UNIT_INVALID && DoApply) |
if (border.typed_data.unit != UNIT_INVALID && DoApply) |
{ |
{ |
/* check if it's an important rule */ |
/* check if it's an important rule */ |
Line 661 static char *ParseCSSBorderBottomWidth (
|
Line 732 static char *ParseCSSBorderBottomWidth (
|
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
/* first parse the attribute string */ |
/* first parse the attribute string */ |
cssRule = ParseBorderValue (cssRule, &border); |
cssRule = ParseABorderValue (cssRule, &border); |
if (border.typed_data.unit != UNIT_INVALID && DoApply) |
if (border.typed_data.unit != UNIT_INVALID && DoApply) |
{ |
{ |
/* check if it's an important rule */ |
/* check if it's an important rule */ |
Line 686 static char *ParseCSSBorderLeftWidth (El
|
Line 757 static char *ParseCSSBorderLeftWidth (El
|
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
/* first parse the attribute string */ |
/* first parse the attribute string */ |
cssRule = ParseBorderValue (cssRule, &border); |
cssRule = ParseABorderValue (cssRule, &border); |
if (border.typed_data.unit != UNIT_INVALID && DoApply) |
if (border.typed_data.unit != UNIT_INVALID && DoApply) |
{ |
{ |
/* check if it's an important rule */ |
/* check if it's an important rule */ |
Line 711 static char *ParseCSSBorderRightWidth (E
|
Line 782 static char *ParseCSSBorderRightWidth (E
|
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
/* first parse the attribute string */ |
/* first parse the attribute string */ |
cssRule = ParseBorderValue (cssRule, &border); |
cssRule = ParseABorderValue (cssRule, &border); |
if (border.typed_data.unit != UNIT_INVALID && DoApply) |
if (border.typed_data.unit != UNIT_INVALID && DoApply) |
{ |
{ |
/* check if it's an important rule */ |
/* check if it's an important rule */ |
Line 1262 static char *ParseCSSFloat (Element elem
|
Line 1333 static char *ParseCSSFloat (Element elem
|
{ |
{ |
DisplayMode dispMode; |
DisplayMode dispMode; |
PresentationValue pval; |
PresentationValue pval; |
|
char *ptr = cssRule; |
|
|
pval.typed_data.value = 0; |
pval.typed_data.value = 0; |
pval.typed_data.unit = UNIT_BOX; |
pval.typed_data.unit = UNIT_BOX; |
pval.typed_data.real = FALSE; |
pval.typed_data.real = FALSE; |
if (!strncasecmp (cssRule, "inherit", 7)) |
if (!strncasecmp (cssRule, "inherit", 7)) |
{ |
{ |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid float value"); |
return (cssRule); |
return (cssRule); |
} |
} |
if (!strncasecmp (cssRule, "none", 4)) |
if (!strncasecmp (cssRule, "none", 4)) |
pval.typed_data.value = FloatNone; |
{ |
|
pval.typed_data.value = FloatNone; |
|
cssRule += 4; |
|
} |
else if (!strncasecmp (cssRule, "left", 4)) |
else if (!strncasecmp (cssRule, "left", 4)) |
pval.typed_data.value = FloatLeft; |
{ |
|
pval.typed_data.value = FloatLeft; |
|
cssRule += 4; |
|
} |
else if (!strncasecmp (cssRule, "right", 5)) |
else if (!strncasecmp (cssRule, "right", 5)) |
pval.typed_data.value = FloatRight; |
{ |
|
pval.typed_data.value = FloatRight; |
|
cssRule += 5; |
|
} |
|
|
if (pval.typed_data.value == 0) |
if (pval.typed_data.value == 0) |
cssRule = SkipValue ("Invalid float value", cssRule); |
cssRule = SkipValue ("Invalid float value", cssRule); |
Line 1296 static char *ParseCSSFloat (Element elem
|
Line 1378 static char *ParseCSSFloat (Element elem
|
cssRule = CheckImportantRule (cssRule, context); |
cssRule = CheckImportantRule (cssRule, context); |
TtaSetStylePresentation (PRFloat, element, tsch, context, pval); |
TtaSetStylePresentation (PRFloat, element, tsch, context, pval); |
} |
} |
cssRule = SkipValue (NULL, cssRule); |
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid float value"); |
} |
} |
return (cssRule); |
return (cssRule); |
} |
} |
Line 1349 static char *ParseCSSDisplay (Element el
|
Line 1431 static char *ParseCSSDisplay (Element el
|
CSSInfoPtr css, ThotBool isHTML) |
CSSInfoPtr css, ThotBool isHTML) |
{ |
{ |
PresentationValue pval; |
PresentationValue pval; |
|
char *ptr = cssRule; |
|
|
pval.typed_data.unit = UNIT_REL; |
pval.typed_data.unit = UNIT_REL; |
pval.typed_data.real = FALSE; |
pval.typed_data.real = FALSE; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!strncasecmp (cssRule, "none", 4)) |
if (!strncasecmp (cssRule, "none", 4)) |
pval.typed_data.value = DisplayNone; |
{ |
|
cssRule += 4; |
|
pval.typed_data.value = DisplayNone; |
|
} |
else if (!strncasecmp (cssRule, "block", 5)) |
else if (!strncasecmp (cssRule, "block", 5)) |
pval.typed_data.value = Block; |
{ |
|
cssRule += 5; |
|
pval.typed_data.value = Block; |
|
} |
else if (!strncasecmp (cssRule, "inline", 6)) |
else if (!strncasecmp (cssRule, "inline", 6)) |
pval.typed_data.value = Inline; |
{ |
|
cssRule += 6; |
|
pval.typed_data.value = Inline; |
|
} |
else if (!strncasecmp (cssRule, "list-item", 9)) |
else if (!strncasecmp (cssRule, "list-item", 9)) |
pval.typed_data.value = ListItem; |
{ |
|
cssRule += 9; |
|
pval.typed_data.value = ListItem; |
|
} |
else if (!strncasecmp (cssRule, "run-in", 6)) |
else if (!strncasecmp (cssRule, "run-in", 6)) |
pval.typed_data.value = RunIn; |
{ |
|
cssRule += 6; |
|
pval.typed_data.value = RunIn; |
|
} |
else if (!strncasecmp (cssRule, "inline-block", 12)) |
else if (!strncasecmp (cssRule, "inline-block", 12)) |
pval.typed_data.value = InlineBlock; |
{ |
|
cssRule += 12; |
|
pval.typed_data.value = InlineBlock; |
|
} |
else |
else |
{ |
{ |
if (strncasecmp (cssRule, "table-row-group", 15) && |
if (strncasecmp (cssRule, "table-row-group", 15) && |
Line 1388 static char *ParseCSSDisplay (Element el
|
Line 1489 static char *ParseCSSDisplay (Element el
|
cssRule = CheckImportantRule (cssRule, context); |
cssRule = CheckImportantRule (cssRule, context); |
TtaSetStylePresentation (PRDisplay, element, tsch, context, pval); |
TtaSetStylePresentation (PRDisplay, element, tsch, context, pval); |
} |
} |
cssRule = SkipWord (cssRule); |
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid display value"); |
return (cssRule); |
return (cssRule); |
} |
} |
|
|
Line 1413 static char *ParseCSSListStyleType (Elem
|
Line 1514 static char *ParseCSSListStyleType (Elem
|
CSSInfoPtr css, ThotBool isHTML) |
CSSInfoPtr css, ThotBool isHTML) |
{ |
{ |
PresentationValue pval; |
PresentationValue pval; |
|
char *ptr = cssRule; |
|
|
pval.typed_data.unit = UNIT_REL; |
pval.typed_data.unit = UNIT_REL; |
pval.typed_data.real = FALSE; |
pval.typed_data.real = FALSE; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!strncasecmp (cssRule, "disc", 4)) |
if (!strncasecmp (cssRule, "disc", 4)) |
pval.typed_data.value = Disc; |
{ |
|
cssRule += 4; |
|
pval.typed_data.value = Disc; |
|
} |
else if (!strncasecmp (cssRule, "circle", 6)) |
else if (!strncasecmp (cssRule, "circle", 6)) |
pval.typed_data.value = Circle; |
{ |
|
cssRule += 6; |
|
pval.typed_data.value = Circle; |
|
} |
else if (!strncasecmp (cssRule, "square", 6)) |
else if (!strncasecmp (cssRule, "square", 6)) |
|
{ |
|
cssRule += 6; |
pval.typed_data.value = Square; |
pval.typed_data.value = Square; |
|
} |
else if (!strncasecmp (cssRule, "decimal-leading-zero", 20)) |
else if (!strncasecmp (cssRule, "decimal-leading-zero", 20)) |
|
{ |
|
cssRule += 20; |
pval.typed_data.value = DecimalLeadingZero; |
pval.typed_data.value = DecimalLeadingZero; |
|
} |
else if (!strncasecmp (cssRule, "decimal", 7)) |
else if (!strncasecmp (cssRule, "decimal", 7)) |
|
{ |
|
cssRule += 7; |
pval.typed_data.value = Decimal; |
pval.typed_data.value = Decimal; |
|
} |
else if (!strncasecmp (cssRule, "lower-roman", 11)) |
else if (!strncasecmp (cssRule, "lower-roman", 11)) |
|
{ |
|
cssRule += 11; |
pval.typed_data.value = LowerRoman; |
pval.typed_data.value = LowerRoman; |
|
} |
else if (!strncasecmp (cssRule, "upper-roman", 11)) |
else if (!strncasecmp (cssRule, "upper-roman", 11)) |
|
{ |
|
cssRule += 11; |
pval.typed_data.value = UpperRoman; |
pval.typed_data.value = UpperRoman; |
|
} |
else if (!strncasecmp (cssRule, "lower-greek", 11)) |
else if (!strncasecmp (cssRule, "lower-greek", 11)) |
|
{ |
|
cssRule += 11; |
pval.typed_data.value = LowerGreek; |
pval.typed_data.value = LowerGreek; |
|
} |
else if (!strncasecmp (cssRule, "lower-latin", 11)) |
else if (!strncasecmp (cssRule, "lower-latin", 11)) |
|
{ |
|
cssRule += 11; |
pval.typed_data.value = LowerLatin; |
pval.typed_data.value = LowerLatin; |
|
} |
else if (!strncasecmp (cssRule, "lower-alpha", 11)) |
else if (!strncasecmp (cssRule, "lower-alpha", 11)) |
|
{ |
|
cssRule += 11; |
pval.typed_data.value = LowerLatin; |
pval.typed_data.value = LowerLatin; |
|
} |
else if (!strncasecmp (cssRule, "upper-latin", 11)) |
else if (!strncasecmp (cssRule, "upper-latin", 11)) |
|
{ |
|
cssRule += 11; |
pval.typed_data.value = UpperLatin; |
pval.typed_data.value = UpperLatin; |
|
} |
else if (!strncasecmp (cssRule, "upper-alpha", 11)) |
else if (!strncasecmp (cssRule, "upper-alpha", 11)) |
|
{ |
|
cssRule += 11; |
pval.typed_data.value = UpperLatin; |
pval.typed_data.value = UpperLatin; |
|
} |
else if (!strncasecmp (cssRule, "armenian", 8)) |
else if (!strncasecmp (cssRule, "armenian", 8)) |
|
{ |
|
cssRule += 8; |
pval.typed_data.value = Decimal; |
pval.typed_data.value = Decimal; |
|
} |
else if (!strncasecmp (cssRule, "georgian", 8)) |
else if (!strncasecmp (cssRule, "georgian", 8)) |
|
{ |
|
cssRule += 8; |
pval.typed_data.value = Decimal; |
pval.typed_data.value = Decimal; |
|
} |
else if (!strncasecmp (cssRule, "none", 4)) |
else if (!strncasecmp (cssRule, "none", 4)) |
|
{ |
|
cssRule += 4; |
pval.typed_data.value = ListStyleTypeNone; |
pval.typed_data.value = ListStyleTypeNone; |
|
} |
else if (!strncasecmp (cssRule, "inherit", 7)) |
else if (!strncasecmp (cssRule, "inherit", 7)) |
/* not supported */ |
/* not supported */ |
{ |
{ |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid list-style-type value"); |
return (cssRule); |
return (cssRule); |
} |
} |
else |
else |
Line 1464 static char *ParseCSSListStyleType (Elem
|
Line 1612 static char *ParseCSSListStyleType (Elem
|
cssRule = CheckImportantRule (cssRule, context); |
cssRule = CheckImportantRule (cssRule, context); |
TtaSetStylePresentation (PRListStyleType, element, tsch, context, pval); |
TtaSetStylePresentation (PRListStyleType, element, tsch, context, pval); |
} |
} |
cssRule = SkipWord (cssRule); |
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid list-style-type value"); |
return (cssRule); |
return (cssRule); |
} |
} |
|
|
Line 1542 static char *ParseCSSListStyleImage (Ele
|
Line 1690 static char *ParseCSSListStyleImage (Ele
|
char *cssRule, CSSInfoPtr css, |
char *cssRule, CSSInfoPtr css, |
ThotBool isHTML) |
ThotBool isHTML) |
{ |
{ |
char *url; |
char *url; |
|
char *ptr = cssRule; |
|
|
url = NULL; |
url = NULL; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
Line 1559 static char *ParseCSSListStyleImage (Ele
|
Line 1708 static char *ParseCSSListStyleImage (Ele
|
/* @@@@@@@@@@@@@ */ |
/* @@@@@@@@@@@@@ */ |
} |
} |
else if (!strncasecmp (cssRule, "inherit", 7)) |
else if (!strncasecmp (cssRule, "inherit", 7)) |
|
{ |
/* not implemented */ |
/* not implemented */ |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid list-style-image value"); |
|
} |
else |
else |
cssRule = SkipValue ("Invalid list-style-image value", cssRule); |
cssRule = SkipValue ("Invalid list-style-image value", cssRule); |
|
|
Line 1577 static char *ParseCSSListStylePosition (
|
Line 1729 static char *ParseCSSListStylePosition (
|
ThotBool isHTML) |
ThotBool isHTML) |
{ |
{ |
PresentationValue pval; |
PresentationValue pval; |
|
char *ptr = cssRule; |
|
|
pval.typed_data.unit = UNIT_REL; |
pval.typed_data.unit = UNIT_REL; |
pval.typed_data.real = FALSE; |
pval.typed_data.real = FALSE; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!strncasecmp (cssRule, "inside", 6)) |
if (!strncasecmp (cssRule, "inside", 6)) |
pval.typed_data.value = Inside; |
{ |
|
pval.typed_data.value = Inside; |
|
cssRule += 6; |
|
} |
else if (!strncasecmp (cssRule, "outside", 7)) |
else if (!strncasecmp (cssRule, "outside", 7)) |
pval.typed_data.value = Outside; |
{ |
|
pval.typed_data.value = Outside; |
|
cssRule += 7; |
|
} |
else |
else |
{ |
{ |
if (!strncasecmp (cssRule, "inherit", 7)) |
if (!strncasecmp (cssRule, "inherit", 7)) |
|
{ |
/* not implemented */ |
/* not implemented */ |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid list-style-position value"); |
|
} |
else |
else |
cssRule = SkipValue ("Invalid list-style-position value", cssRule); |
cssRule = SkipValue ("Invalid list-style-position value", cssRule); |
return (cssRule); |
return (cssRule); |
Line 1601 static char *ParseCSSListStylePosition (
|
Line 1763 static char *ParseCSSListStylePosition (
|
pval); |
pval); |
} |
} |
|
|
cssRule = SkipWord (cssRule); |
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid list-style-position value"); |
return (cssRule); |
return (cssRule); |
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
Line 1665 static char *ParseCSSTextAlign (Element
|
Line 1827 static char *ParseCSSTextAlign (Element
|
PresentationContext context, char *cssRule, |
PresentationContext context, char *cssRule, |
CSSInfoPtr css, ThotBool isHTML) |
CSSInfoPtr css, ThotBool isHTML) |
{ |
{ |
|
char *ptr = cssRule; |
PresentationValue align; |
PresentationValue align; |
|
|
align.typed_data.value = 0; |
align.typed_data.value = 0; |
Line 1675 static char *ParseCSSTextAlign (Element
|
Line 1838 static char *ParseCSSTextAlign (Element
|
if (!strncasecmp (cssRule, "left", 4)) |
if (!strncasecmp (cssRule, "left", 4)) |
{ |
{ |
align.typed_data.value = AdjustLeft; |
align.typed_data.value = AdjustLeft; |
cssRule = SkipWord (cssRule); |
cssRule += 4; |
} |
} |
else if (!strncasecmp (cssRule, "right", 5)) |
else if (!strncasecmp (cssRule, "right", 5)) |
{ |
{ |
align.typed_data.value = AdjustRight; |
align.typed_data.value = AdjustRight; |
cssRule = SkipWord (cssRule); |
cssRule += 5; |
} |
} |
else if (!strncasecmp (cssRule, "center", 6)) |
else if (!strncasecmp (cssRule, "center", 6)) |
{ |
{ |
align.typed_data.value = Centered; |
align.typed_data.value = Centered; |
cssRule = SkipWord (cssRule); |
cssRule += 6; |
} |
} |
else if (!strncasecmp (cssRule, "justify", 7)) |
else if (!strncasecmp (cssRule, "justify", 7)) |
{ |
{ |
align.typed_data.value = Justify; |
align.typed_data.value = Justify; |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
} |
} |
else |
else |
{ |
{ |
Line 1706 static char *ParseCSSTextAlign (Element
|
Line 1869 static char *ParseCSSTextAlign (Element
|
cssRule = CheckImportantRule (cssRule, context); |
cssRule = CheckImportantRule (cssRule, context); |
TtaSetStylePresentation (PRAdjust, element, tsch, context, align); |
TtaSetStylePresentation (PRAdjust, element, tsch, context, align); |
} |
} |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid text-align value"); |
return (cssRule); |
return (cssRule); |
} |
} |
|
|
Line 1719 static char *ParseCSSTextAnchor (Element
|
Line 1883 static char *ParseCSSTextAnchor (Element
|
CSSInfoPtr css, ThotBool isHTML) |
CSSInfoPtr css, ThotBool isHTML) |
{ |
{ |
PresentationValue align; |
PresentationValue align; |
|
char *ptr = cssRule; |
|
|
align.typed_data.value = 0; |
align.typed_data.value = 0; |
align.typed_data.unit = UNIT_REL; |
align.typed_data.unit = UNIT_REL; |
Line 1728 static char *ParseCSSTextAnchor (Element
|
Line 1893 static char *ParseCSSTextAnchor (Element
|
if (!strncasecmp (cssRule, "start", 5)) |
if (!strncasecmp (cssRule, "start", 5)) |
{ |
{ |
align.typed_data.value = AdjustLeft; |
align.typed_data.value = AdjustLeft; |
cssRule = SkipWord (cssRule); |
cssRule += 5; |
} |
} |
else if (!strncasecmp (cssRule, "middle", 6)) |
else if (!strncasecmp (cssRule, "middle", 6)) |
{ |
{ |
align.typed_data.value = Centered; |
align.typed_data.value = Centered; |
cssRule = SkipWord (cssRule); |
cssRule += 6; |
} |
} |
else if (!strncasecmp (cssRule, "end", 3)) |
else if (!strncasecmp (cssRule, "end", 3)) |
{ |
{ |
align.typed_data.value = AdjustRight; |
align.typed_data.value = AdjustRight; |
cssRule = SkipWord (cssRule); |
cssRule += 3; |
} |
} |
else if (!strncasecmp (cssRule, "inherit", 7)) |
else if (!strncasecmp (cssRule, "inherit", 7)) |
{ |
{ |
/* not implemented */ |
/* not implemented */ |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid text-anchor value"); |
return (cssRule); |
return (cssRule); |
} |
} |
else |
else |
Line 1760 static char *ParseCSSTextAnchor (Element
|
Line 1926 static char *ParseCSSTextAnchor (Element
|
cssRule = CheckImportantRule (cssRule, context); |
cssRule = CheckImportantRule (cssRule, context); |
TtaSetStylePresentation (PRAdjust, element, tsch, context, align); |
TtaSetStylePresentation (PRAdjust, element, tsch, context, align); |
} |
} |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid text-anchor value"); |
return (cssRule); |
return (cssRule); |
} |
} |
|
|
Line 1771 static char *ParseCSSDirection (Element
|
Line 1938 static char *ParseCSSDirection (Element
|
CSSInfoPtr css, ThotBool isHTML) |
CSSInfoPtr css, ThotBool isHTML) |
{ |
{ |
PresentationValue direction; |
PresentationValue direction; |
|
char *ptr = cssRule; |
|
|
direction.typed_data.value = 0; |
direction.typed_data.value = 0; |
direction.typed_data.unit = UNIT_REL; |
direction.typed_data.unit = UNIT_REL; |
Line 1780 static char *ParseCSSDirection (Element
|
Line 1948 static char *ParseCSSDirection (Element
|
if (!strncasecmp (cssRule, "ltr", 3)) |
if (!strncasecmp (cssRule, "ltr", 3)) |
{ |
{ |
direction.typed_data.value = LeftToRight; |
direction.typed_data.value = LeftToRight; |
cssRule = SkipWord (cssRule); |
cssRule += 3; |
} |
} |
else if (!strncasecmp (cssRule, "rtl", 3)) |
else if (!strncasecmp (cssRule, "rtl", 3)) |
{ |
{ |
direction.typed_data.value = RightToLeft; |
direction.typed_data.value = RightToLeft; |
cssRule = SkipWord (cssRule); |
cssRule += 3; |
} |
} |
else if (!strncasecmp (cssRule, "inherit", 7)) |
else if (!strncasecmp (cssRule, "inherit", 7)) |
{ |
{ |
/* not implemented */ |
/* not implemented */ |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
return (cssRule); |
return (cssRule); |
} |
} |
else |
else |
Line 1807 static char *ParseCSSDirection (Element
|
Line 1975 static char *ParseCSSDirection (Element
|
cssRule = CheckImportantRule (cssRule, context); |
cssRule = CheckImportantRule (cssRule, context); |
TtaSetStylePresentation (PRDirection, element, tsch, context, direction); |
TtaSetStylePresentation (PRDirection, element, tsch, context, direction); |
} |
} |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid direction value"); |
return (cssRule); |
return (cssRule); |
} |
} |
|
|
Line 1818 static char *ParseCSSUnicodeBidi (Elemen
|
Line 1987 static char *ParseCSSUnicodeBidi (Elemen
|
CSSInfoPtr css, ThotBool isHTML) |
CSSInfoPtr css, ThotBool isHTML) |
{ |
{ |
PresentationValue bidi; |
PresentationValue bidi; |
|
char *ptr = cssRule; |
|
|
bidi.typed_data.value = 0; |
bidi.typed_data.value = 0; |
bidi.typed_data.unit = UNIT_REL; |
bidi.typed_data.unit = UNIT_REL; |
Line 1827 static char *ParseCSSUnicodeBidi (Elemen
|
Line 1997 static char *ParseCSSUnicodeBidi (Elemen
|
if (!strncasecmp (cssRule, "normal", 6)) |
if (!strncasecmp (cssRule, "normal", 6)) |
{ |
{ |
bidi.typed_data.value = Normal; |
bidi.typed_data.value = Normal; |
cssRule = SkipWord (cssRule); |
cssRule += 6; |
} |
} |
else if (!strncasecmp (cssRule, "embed", 5)) |
else if (!strncasecmp (cssRule, "embed", 5)) |
{ |
{ |
bidi.typed_data.value = Embed; |
bidi.typed_data.value = Embed; |
cssRule = SkipWord (cssRule); |
cssRule += 5; |
} |
} |
else if (!strncasecmp (cssRule, "bidi-override", 13)) |
else if (!strncasecmp (cssRule, "bidi-override", 13)) |
{ |
{ |
bidi.typed_data.value = Override; |
bidi.typed_data.value = Override; |
cssRule = SkipWord (cssRule); |
cssRule += 13; |
} |
} |
else if (!strncasecmp (cssRule, "inherit", 7)) |
else if (!strncasecmp (cssRule, "inherit", 7)) |
{ |
{ |
/* not implemented */ |
/* not implemented */ |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
return (cssRule); |
return (cssRule); |
} |
} |
else |
else |
Line 1859 static char *ParseCSSUnicodeBidi (Elemen
|
Line 2029 static char *ParseCSSUnicodeBidi (Elemen
|
cssRule = CheckImportantRule (cssRule, context); |
cssRule = CheckImportantRule (cssRule, context); |
TtaSetStylePresentation (PRUnicodeBidi, element, tsch, context, bidi); |
TtaSetStylePresentation (PRUnicodeBidi, element, tsch, context, bidi); |
} |
} |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid unicode-bidi value"); |
return (cssRule); |
return (cssRule); |
} |
} |
|
|
Line 1919 static char *ParseCSSVerticalAlign (Elem
|
Line 2090 static char *ParseCSSVerticalAlign (Elem
|
pval.typed_data.unit = UNIT_REL; |
pval.typed_data.unit = UNIT_REL; |
pval.typed_data.real = FALSE; |
pval.typed_data.real = FALSE; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
|
ptr = cssRule; |
if (!strncasecmp (cssRule, "baseline", 8)) |
if (!strncasecmp (cssRule, "baseline", 8)) |
{ |
{ |
pval.typed_data.value = 0; |
pval.typed_data.value = 0; |
cssRule = SkipWord (cssRule); |
cssRule += 8; |
} |
} |
else if (!strncasecmp (cssRule, "sub", 3)) |
else if (!strncasecmp (cssRule, "sub", 3)) |
{ |
{ |
pval.typed_data.value = -3; |
pval.typed_data.value = -3; |
cssRule = SkipWord (cssRule); |
cssRule += 3; |
} |
} |
else if (!strncasecmp (cssRule, "super", 5)) |
else if (!strncasecmp (cssRule, "super", 5)) |
{ |
{ |
pval.typed_data.value = 4; |
pval.typed_data.value = 4; |
cssRule = SkipWord (cssRule); |
cssRule += 5; |
} |
} |
else if (!strncasecmp (cssRule, "top", 3)) |
else if (!strncasecmp (cssRule, "top", 3)) |
{ |
{ |
pval.typed_data.unit = UNIT_INVALID; /* Not supported yet */ |
pval.typed_data.unit = UNIT_INVALID; /* Not supported yet */ |
pval.typed_data.value = 0; |
pval.typed_data.value = 0; |
cssRule = SkipWord (cssRule); |
cssRule += 3; |
} |
} |
else if (!strncasecmp (cssRule, "text-top", 8)) |
else if (!strncasecmp (cssRule, "text-top", 8)) |
{ |
{ |
pval.typed_data.unit = UNIT_INVALID; /* Not supported yet */ |
pval.typed_data.unit = UNIT_INVALID; /* Not supported yet */ |
pval.typed_data.value = 0; |
pval.typed_data.value = 0; |
cssRule = SkipWord (cssRule); |
cssRule += 8; |
} |
} |
else if (!strncasecmp (cssRule, "middle", 6)) |
else if (!strncasecmp (cssRule, "middle", 6)) |
{ |
{ |
pval.typed_data.unit = UNIT_INVALID; /* Not supported yet */ |
pval.typed_data.unit = UNIT_INVALID; /* Not supported yet */ |
pval.typed_data.value = 0; |
pval.typed_data.value = 0; |
cssRule = SkipWord (cssRule); |
cssRule += 6; |
} |
} |
else if (!strncasecmp (cssRule, "bottom", 6)) |
else if (!strncasecmp (cssRule, "bottom", 6)) |
{ |
{ |
pval.typed_data.unit = UNIT_INVALID; /* Not supported yet */ |
pval.typed_data.unit = UNIT_INVALID; /* Not supported yet */ |
pval.typed_data.value = 0; |
pval.typed_data.value = 0; |
cssRule = SkipWord (cssRule); |
cssRule += 6; |
} |
} |
else if (!strncasecmp (cssRule, "text-bottom", 11)) |
else if (!strncasecmp (cssRule, "text-bottom", 11)) |
{ |
{ |
pval.typed_data.unit = UNIT_INVALID; /* Not supported yet */ |
pval.typed_data.unit = UNIT_INVALID; /* Not supported yet */ |
pval.typed_data.value = 0; |
pval.typed_data.value = 0; |
cssRule = SkipWord (cssRule); |
cssRule += 11; |
} |
} |
else if (!strncasecmp (cssRule, "inherit", 7)) |
else if (!strncasecmp (cssRule, "inherit", 7)) |
{ |
{ |
pval.typed_data.unit = UNIT_INVALID; /* Not supported yet */ |
pval.typed_data.unit = UNIT_INVALID; /* Not supported yet */ |
pval.typed_data.value = 0; |
pval.typed_data.value = 0; |
cssRule = SkipWord (cssRule); |
cssRule +=7; |
} |
} |
else |
else |
{ |
{ |
/* parse <percentage> or <length> */ |
/* parse <percentage> or <length> */ |
ptr = cssRule; |
|
cssRule = ParseCSSUnit (cssRule, &pval); |
cssRule = ParseCSSUnit (cssRule, &pval); |
if (pval.typed_data.unit == UNIT_INVALID) |
if (pval.typed_data.unit == UNIT_INVALID) |
{ |
{ |
pval.typed_data.value = 0; |
pval.typed_data.value = 0; |
CSSParseError ("Invalid vertical-align value", ptr, cssRule); |
CSSParseError ("Invalid vertical-align value", ptr, cssRule); |
|
return (cssRule); |
} |
} |
else if (pval.typed_data.value == 0) |
else if (pval.typed_data.value == 0) |
{ |
|
pval.typed_data.unit = UNIT_PX; |
pval.typed_data.unit = UNIT_PX; |
} |
|
else if (pval.typed_data.unit == UNIT_BOX) |
else if (pval.typed_data.unit == UNIT_BOX) |
{ |
|
pval.typed_data.unit = UNIT_EM; |
pval.typed_data.unit = UNIT_EM; |
} |
|
else if (pval.typed_data.unit == UNIT_PERCENT) |
else if (pval.typed_data.unit == UNIT_PERCENT) |
/* it's a percentage */ |
/* it's a percentage */ |
{ |
{ |
Line 1998 static char *ParseCSSVerticalAlign (Elem
|
Line 2166 static char *ParseCSSVerticalAlign (Elem
|
} |
} |
if (pval.typed_data.unit != UNIT_INVALID && DoApply) |
if (pval.typed_data.unit != UNIT_INVALID && DoApply) |
TtaSetStylePresentation (PRHorizRef, element, tsch, context, pval); |
TtaSetStylePresentation (PRHorizRef, element, tsch, context, pval); |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid vertical-align value"); |
return (cssRule); |
return (cssRule); |
} |
} |
|
|
Line 2009 static char *ParseCSSWhiteSpace (Element
|
Line 2178 static char *ParseCSSWhiteSpace (Element
|
PresentationContext context, char *cssRule, |
PresentationContext context, char *cssRule, |
CSSInfoPtr css, ThotBool isHTML) |
CSSInfoPtr css, ThotBool isHTML) |
{ |
{ |
|
char *ptr = cssRule; |
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!strncasecmp (cssRule, "normal", 6)) |
if (!strncasecmp (cssRule, "normal", 6)) |
cssRule = SkipWord (cssRule); |
cssRule += 6; |
else if (!strncasecmp (cssRule, "pre", 3)) |
else if (!strncasecmp (cssRule, "pre", 3)) |
cssRule = SkipWord (cssRule); |
cssRule += 3; |
else if (!strncasecmp (cssRule, "nowrap", 6)) |
else if (!strncasecmp (cssRule, "nowrap", 6)) |
cssRule = SkipWord (cssRule); |
cssRule += 6; |
else if (!strncasecmp (cssRule, "pre-wrap", 8)) |
else if (!strncasecmp (cssRule, "pre-wrap", 8)) |
cssRule = SkipWord (cssRule); |
cssRule += 8; |
else if (!strncasecmp (cssRule, "pre-line", 8)) |
else if (!strncasecmp (cssRule, "pre-line", 8)) |
cssRule = SkipWord (cssRule); |
cssRule += 8; |
else if (!strncasecmp (cssRule, "inherit", 7)) |
else if (!strncasecmp (cssRule, "inherit", 7)) |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
else |
else |
cssRule = SkipValue ("Invalid white-space value", cssRule); |
{ |
|
cssRule = SkipValue ("Invalid white-space value", cssRule); |
|
return (cssRule); |
|
} |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid white-space value"); |
return (cssRule); |
return (cssRule); |
} |
} |
|
|
Line 2047 static char *ParseCSSLineHeight (Element
|
Line 2222 static char *ParseCSSLineHeight (Element
|
CSSInfoPtr css, ThotBool isHTML) |
CSSInfoPtr css, ThotBool isHTML) |
{ |
{ |
PresentationValue pval; |
PresentationValue pval; |
char *ptr; |
char *ptr; |
|
|
ptr = cssRule; |
ptr = cssRule; |
if (!strncasecmp (cssRule, "normal", 6)) |
if (!strncasecmp (cssRule, "normal", 6)) |
Line 2055 static char *ParseCSSLineHeight (Element
|
Line 2230 static char *ParseCSSLineHeight (Element
|
pval.typed_data.unit = UNIT_REL; |
pval.typed_data.unit = UNIT_REL; |
pval.typed_data.real = TRUE; |
pval.typed_data.real = TRUE; |
pval.typed_data.value = 1100; |
pval.typed_data.value = 1100; |
cssRule = SkipWord (cssRule); |
cssRule += 6; |
} |
} |
else if (!strncasecmp (cssRule, "inherit", 7)) |
else if (!strncasecmp (cssRule, "inherit", 7)) |
{ |
{ |
cssRule = SkipWord (cssRule); |
cssRule += 6; |
return (cssRule); |
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid line-height value"); |
|
return (cssRule); |
} |
} |
else |
else |
cssRule = ParseCSSUnit (cssRule, &pval); |
cssRule = ParseCSSUnit (cssRule, &pval); |
Line 2106 static char *ParseACSSFontSize (Element
|
Line 2282 static char *ParseACSSFontSize (Element
|
ElementType elType; |
ElementType elType; |
PresentationValue pval; |
PresentationValue pval; |
char *ptr = NULL, *ptr1 = NULL; |
char *ptr = NULL, *ptr1 = NULL; |
ThotBool real; |
ThotBool real, linespace = FALSE; |
|
|
pval.typed_data.real = FALSE; |
pval.typed_data.real = FALSE; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
|
/* look for a '/' within the current cssRule */ |
|
ptr1 = strchr (cssRule, ';'); |
|
ptr = strchr (cssRule, '/'); |
|
if (ptr && (ptr1 == NULL || ptr < ptr1)) |
|
{ |
|
/* keep the line spacing rule */ |
|
linespace = TRUE; |
|
ptr[0] = EOS; |
|
} |
|
else |
|
ptr = NULL; |
|
ptr1 = cssRule; |
/* absolute size */ |
/* absolute size */ |
if (!strncasecmp (cssRule, "xx-small", 8)) |
if (!strncasecmp (cssRule, "xx-small", 8)) |
{ |
{ |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.value = 8; |
pval.typed_data.value = 8; |
cssRule = SkipWord (cssRule); |
cssRule += 8; |
} |
} |
else if (!strncasecmp (cssRule, "x-small", 7)) |
else if (!strncasecmp (cssRule, "x-small", 7)) |
{ |
{ |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.value = 10; |
pval.typed_data.value = 10; |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
} |
} |
else if (!strncasecmp (cssRule, "small", 5)) |
else if (!strncasecmp (cssRule, "small", 5)) |
{ |
{ |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.value = 11; |
pval.typed_data.value = 11; |
cssRule = SkipWord (cssRule); |
cssRule += 5; |
} |
} |
else if (!strncasecmp (cssRule, "medium", 6)) |
else if (!strncasecmp (cssRule, "medium", 6)) |
{ |
{ |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.value = 12; |
pval.typed_data.value = 12; |
cssRule = SkipWord (cssRule); |
cssRule += 6; |
} |
} |
else if (!strncasecmp (cssRule, "large", 5)) |
else if (!strncasecmp (cssRule, "large", 5)) |
{ |
{ |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.value = 13; |
pval.typed_data.value = 13; |
cssRule = SkipWord (cssRule); |
cssRule += 5; |
} |
} |
else if (!strncasecmp (cssRule, "x-large", 7)) |
else if (!strncasecmp (cssRule, "x-large", 7)) |
{ |
{ |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.value = 14; |
pval.typed_data.value = 14; |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
} |
} |
else if (!strncasecmp (cssRule, "xx-large", 8)) |
else if (!strncasecmp (cssRule, "xx-large", 8)) |
{ |
{ |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.unit = UNIT_PT; |
pval.typed_data.value = 16; |
pval.typed_data.value = 16; |
cssRule = SkipWord (cssRule); |
cssRule += 8; |
} |
} |
/* relative size */ |
/* relative size */ |
else if (!strncasecmp (cssRule, "larger", 6)) |
else if (!strncasecmp (cssRule, "larger", 6)) |
{ |
{ |
pval.typed_data.unit = UNIT_PERCENT; |
pval.typed_data.unit = UNIT_PERCENT; |
pval.typed_data.value = 130; |
pval.typed_data.value = 130; |
cssRule = SkipWord (cssRule); |
cssRule += 6; |
} |
} |
else if (!strncasecmp (cssRule, "smaller", 7)) |
else if (!strncasecmp (cssRule, "smaller", 7)) |
{ |
{ |
pval.typed_data.unit = UNIT_PERCENT; |
pval.typed_data.unit = UNIT_PERCENT; |
pval.typed_data.value = 80; |
pval.typed_data.value = 80; |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
} |
} |
/* inherit */ |
/* inherit */ |
else if (!strncasecmp (cssRule, "inherit", 7)) |
else if (!strncasecmp (cssRule, "inherit", 7)) |
{ |
{ |
/* not implemented */ |
/* not implemented */ |
cssRule = SkipWord (cssRule); |
ptr = cssRule; |
|
cssRule += 7; |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid value"); |
return (cssRule); |
return (cssRule); |
} |
} |
/* length or percentage */ |
/* length or percentage */ |
Line 2181 static char *ParseACSSFontSize (Element
|
Line 2371 static char *ParseACSSFontSize (Element
|
return (cssRule); |
return (cssRule); |
} |
} |
else |
else |
{ |
{ |
/* look for a '/' within the current cssRule */ |
|
ptr1 = strchr (cssRule, ';'); |
|
ptr = strchr (cssRule, '/'); |
|
if (ptr && (ptr1 == NULL || ptr < ptr1)) |
|
{ |
|
/* keep the line spacing rule */ |
|
ptr[0] = EOS; |
|
ptr = &ptr[1]; |
|
} |
|
else |
|
ptr = NULL; |
|
|
|
cssRule = ParseCSSUnit (cssRule, &pval); |
cssRule = ParseCSSUnit (cssRule, &pval); |
if (pval.typed_data.unit == UNIT_BOX) |
if (pval.typed_data.unit == UNIT_BOX) |
/* no unit specified */ |
/* no unit specified */ |
Line 2250 static char *ParseACSSFontSize (Element
|
Line 2428 static char *ParseACSSFontSize (Element
|
/* install the presentation style */ |
/* install the presentation style */ |
if (!check && DoApply) |
if (!check && DoApply) |
{ |
{ |
|
cssRule = CSSCheckEndValue (ptr1, cssRule, "Invalid font-size value"); |
cssRule = CheckImportantRule (cssRule, context); |
cssRule = CheckImportantRule (cssRule, context); |
TtaSetStylePresentation (PRSize, element, tsch, context, pval); |
TtaSetStylePresentation (PRSize, element, tsch, context, pval); |
} |
} |
if (!check && ptr) |
if (!check && ptr) |
cssRule = ParseCSSLineHeight (element, tsch, context, ptr, css, isHTML); |
cssRule = ParseCSSLineHeight (element, tsch, context, &ptr[1], css, isHTML); |
|
if (linespace) |
|
*ptr = '/'; |
|
|
return (cssRule); |
return (cssRule); |
} |
} |
|
|
Line 2776 static char *ParseCSSTextDecoration (Ele
|
Line 2958 static char *ParseCSSTextDecoration (Ele
|
CSSInfoPtr css, ThotBool isHTML) |
CSSInfoPtr css, ThotBool isHTML) |
{ |
{ |
PresentationValue decor; |
PresentationValue decor; |
|
char *ptr = cssRule; |
|
|
decor.typed_data.value = 0; |
decor.typed_data.value = 0; |
decor.typed_data.unit = UNIT_REL; |
decor.typed_data.unit = UNIT_REL; |
Line 2784 static char *ParseCSSTextDecoration (Ele
|
Line 2967 static char *ParseCSSTextDecoration (Ele
|
if (!strncasecmp (cssRule, "none", 4)) |
if (!strncasecmp (cssRule, "none", 4)) |
{ |
{ |
decor.typed_data.value = NoUnderline; |
decor.typed_data.value = NoUnderline; |
cssRule = SkipWord (cssRule); |
cssRule += 4; |
} |
} |
else if (!strncasecmp (cssRule, "underline", 9)) |
else if (!strncasecmp (cssRule, "underline", 9)) |
{ |
{ |
decor.typed_data.value = Underline; |
decor.typed_data.value = Underline; |
cssRule = SkipWord (cssRule); |
cssRule += 9; |
} |
} |
else if (!strncasecmp (cssRule, "overline", 8)) |
else if (!strncasecmp (cssRule, "overline", 8)) |
{ |
{ |
decor.typed_data.value = Overline; |
decor.typed_data.value = Overline; |
cssRule = SkipWord (cssRule); |
cssRule += 8; |
} |
} |
else if (!strncasecmp (cssRule, "line-through", 12)) |
else if (!strncasecmp (cssRule, "line-through", 12)) |
{ |
{ |
decor.typed_data.value = CrossOut; |
decor.typed_data.value = CrossOut; |
cssRule = SkipWord (cssRule); |
cssRule += 12; |
} |
} |
else if (!strncasecmp (cssRule, "blink", 5)) |
else if (!strncasecmp (cssRule, "blink", 5)) |
{ |
{ |
/* the blink text-decoration attribute is not supported */ |
/* the blink text-decoration attribute is not supported */ |
cssRule = SkipWord (cssRule); |
cssRule += 5; |
} |
} |
else if (!strncasecmp (cssRule, "inherit", 7)) |
else if (!strncasecmp (cssRule, "inherit", 7)) |
{ |
{ |
cssRule = SkipWord (cssRule); |
cssRule += 7; |
return (cssRule); |
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid text-decoration value"); |
|
return (cssRule); |
} |
} |
else |
else |
{ |
{ |
Line 2825 static char *ParseCSSTextDecoration (Ele
|
Line 3009 static char *ParseCSSTextDecoration (Ele
|
cssRule = CheckImportantRule (cssRule, context); |
cssRule = CheckImportantRule (cssRule, context); |
TtaSetStylePresentation (PRUnderline, element, tsch, context, decor); |
TtaSetStylePresentation (PRUnderline, element, tsch, context, decor); |
} |
} |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid text-decoration value"); |
return (cssRule); |
return (cssRule); |
} |
} |
|
|
Line 2846 static char *ParseCSSHeight (Element ele
|
Line 3031 static char *ParseCSSHeight (Element ele
|
val.typed_data.unit = VALUE_AUTO; |
val.typed_data.unit = VALUE_AUTO; |
val.typed_data.value = 0; |
val.typed_data.value = 0; |
val.typed_data.real = FALSE; |
val.typed_data.real = FALSE; |
cssRule = SkipWord (cssRule); |
cssRule += 4; |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid height value"); |
} |
} |
else |
else |
cssRule = ParseCSSUnit (cssRule, &val); |
cssRule = ParseCSSUnit (cssRule, &val); |
Line 2885 static char *ParseCSSWidth (Element elem
|
Line 3071 static char *ParseCSSWidth (Element elem
|
val.typed_data.unit = VALUE_AUTO; |
val.typed_data.unit = VALUE_AUTO; |
val.typed_data.value = 0; |
val.typed_data.value = 0; |
val.typed_data.real = FALSE; |
val.typed_data.real = FALSE; |
cssRule = SkipWord (cssRule); |
cssRule += 4; |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid width value"); |
} |
} |
else |
else |
cssRule = ParseCSSUnit (cssRule, &val); |
cssRule = ParseCSSUnit (cssRule, &val); |
Line 2924 static char *ParseCSSMarginTop (Element
|
Line 3111 static char *ParseCSSMarginTop (Element
|
margin.typed_data.unit = VALUE_AUTO; |
margin.typed_data.unit = VALUE_AUTO; |
margin.typed_data.value = 0; |
margin.typed_data.value = 0; |
margin.typed_data.real = FALSE; |
margin.typed_data.real = FALSE; |
cssRule = SkipWord (cssRule); |
cssRule += 4; |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid margin-top value"); |
} |
} |
else |
else |
cssRule = ParseCSSUnit (cssRule, &margin); |
cssRule = ParseCSSUnit (cssRule, &margin); |
Line 2959 static char *ParseCSSMarginBottom (Eleme
|
Line 3147 static char *ParseCSSMarginBottom (Eleme
|
margin.typed_data.unit = VALUE_AUTO; |
margin.typed_data.unit = VALUE_AUTO; |
margin.typed_data.value = 0; |
margin.typed_data.value = 0; |
margin.typed_data.real = FALSE; |
margin.typed_data.real = FALSE; |
cssRule = SkipWord (cssRule); |
cssRule += 4; |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid margin-bottom value"); |
} |
} |
else |
else |
cssRule = ParseCSSUnit (cssRule, &margin); |
cssRule = ParseCSSUnit (cssRule, &margin); |
Line 2994 static char *ParseCSSMarginLeft (Element
|
Line 3183 static char *ParseCSSMarginLeft (Element
|
margin.typed_data.unit = VALUE_AUTO; |
margin.typed_data.unit = VALUE_AUTO; |
margin.typed_data.value = 0; |
margin.typed_data.value = 0; |
margin.typed_data.real = FALSE; |
margin.typed_data.real = FALSE; |
cssRule = SkipWord (cssRule); |
cssRule += 4; |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid margin-left value"); |
} |
} |
else |
else |
cssRule = ParseCSSUnit (cssRule, &margin); |
cssRule = ParseCSSUnit (cssRule, &margin); |
Line 3030 static char *ParseCSSMarginRight (Elemen
|
Line 3220 static char *ParseCSSMarginRight (Elemen
|
margin.typed_data.unit = VALUE_AUTO; |
margin.typed_data.unit = VALUE_AUTO; |
margin.typed_data.value = 0; |
margin.typed_data.value = 0; |
margin.typed_data.real = FALSE; |
margin.typed_data.real = FALSE; |
cssRule = SkipWord (cssRule); |
cssRule += 4; |
|
cssRule = CSSCheckEndValue (ptr, cssRule, "Invalid margin-right value"); |
} |
} |
else |
else |
cssRule = ParseCSSUnit (cssRule, &margin); |
cssRule = ParseCSSUnit (cssRule, &margin); |