Diff for /Amaya/amaya/styleparser.c between versions 1.262 and 1.263

version 1.262, 2004/04/06 14:15:17 version 1.263, 2004/04/07 10:22:18
Line 2117  static char *ParseCSSFontFamily (Element Line 2117  static char *ParseCSSFontFamily (Element
    we expect the input string describing the attribute to be          we expect the input string describing the attribute to be     
    normal, bold, bolder, lighter, 100, 200, 300, ... 900, inherit.     normal, bold, bolder, lighter, 100, 200, 300, ... 900, inherit.
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 static char *ParseCSSFontWeight (Element element, PSchema tsch,  static char *ParseACSSFontWeight (Element element, PSchema tsch,
                                  PresentationContext context, char *cssRule,                                   PresentationContext context, char *cssRule,
                                  CSSInfoPtr css, ThotBool isHTML)                                   CSSInfoPtr css, ThotBool isHTML)
 {  {
Line 2201  static char *ParseCSSFontWeight (Element Line 2201  static char *ParseCSSFontWeight (Element
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
      ParseCSSFontWeight: parse a CSS font weight string   
      we expect the input string describing the attribute to be     
      normal, bold, bolder, lighter, 100, 200, 300, ... 900, inherit.
     ----------------------------------------------------------------------*/
   static char *ParseCSSFontWeight (Element element, PSchema tsch,
                                    PresentationContext context, char *cssRule,
                                    CSSInfoPtr css, ThotBool isHTML)
   {
     char           *ptr;
     
     ptr = cssRule;
     cssRule = ParseACSSFontWeight (element, tsch, context, cssRule, css, isHTML);
     if (ptr == cssRule)
       cssRule = SkipValue ("Invalid font-weight value", cssRule);
     return (cssRule);
   }
   
   /*----------------------------------------------------------------------
    ParseCSSFontVariant: parse a CSS font variant string          ParseCSSFontVariant: parse a CSS font variant string     
    we expect the input string describing the attribute to be          we expect the input string describing the attribute to be     
    normal or small-caps     normal or small-caps
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 static char *ParseCSSFontVariant (Element element, PSchema tsch,  static char *ParseACSSFontVariant (Element element, PSchema tsch,
                                   PresentationContext context, char *cssRule,                                    PresentationContext context, char *cssRule,
                                   CSSInfoPtr css, ThotBool isHTML)                                    CSSInfoPtr css, ThotBool isHTML)
 {  {
Line 2230  static char *ParseCSSFontVariant (Elemen Line 2248  static char *ParseCSSFontVariant (Elemen
        /* Not supported yet */         /* Not supported yet */
        cssRule = SkipWord (cssRule);         cssRule = SkipWord (cssRule);
      }       }
    else  
        return (cssRule);  
   
    return (cssRule);     return (cssRule);
 }  }
   
   /*----------------------------------------------------------------------
      ParseCSSFontVariant: parse a CSS font variant string     
      we expect the input string describing the attribute to be     
      normal or small-caps
     ----------------------------------------------------------------------*/
   static char *ParseCSSFontVariant (Element element, PSchema tsch,
                                     PresentationContext context, char *cssRule,
                                     CSSInfoPtr css, ThotBool isHTML)
   {
     char           *ptr;
     
     ptr = cssRule;
     cssRule = ParseACSSFontVariant (element, tsch, context, cssRule, css, isHTML);
     if (ptr == cssRule)
       cssRule = SkipValue ("Invalid font-variant value", cssRule);
     return (cssRule);
   }
   
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
    ParseCSSFontStyle: parse a CSS font style string          ParseCSSFontStyle: parse a CSS font style string     
    we expect the input string describing the attribute to be          we expect the input string describing the attribute to be     
    italic, oblique or normal                              italic, oblique or normal                         
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 static char *ParseCSSFontStyle (Element element, PSchema tsch,  static char *ParseACSSFontStyle (Element element, PSchema tsch,
                                 PresentationContext context, char *cssRule,                                  PresentationContext context, char *cssRule,
                                 CSSInfoPtr css, ThotBool isHTML)                                  CSSInfoPtr css, ThotBool isHTML)
 {  {
Line 2278  static char *ParseCSSFontStyle (Element Line 2311  static char *ParseCSSFontStyle (Element
        return (cssRule);         return (cssRule);
      }       }
    else     else
      {       /* invalid font style */
        /* invalid font style */       return (cssRule);
        return (cssRule);  
      }  
   
    /*     /*
     * install the new presentation.      * install the new presentation.
Line 2312  static char *ParseCSSFontStyle (Element Line 2343  static char *ParseCSSFontStyle (Element
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
      ParseCSSFontStyle: parse a CSS font style string     
      we expect the input string describing the attribute to be     
      italic, oblique or normal                         
     ----------------------------------------------------------------------*/
   static char *ParseCSSFontStyle (Element element, PSchema tsch,
                                   PresentationContext context, char *cssRule,
                                   CSSInfoPtr css, ThotBool isHTML)
   {
     char           *ptr;
     
     ptr = cssRule;
     cssRule = ParseACSSFontStyle (element, tsch, context, cssRule, css, isHTML);
     if (ptr == cssRule)
       cssRule = SkipValue ("Invalid font-style value", cssRule);
     return (cssRule);
   }
   
   /*----------------------------------------------------------------------
   ParseCSSFont: parse a CSS font attribute string    ParseCSSFont: parse a CSS font attribute string
   we expect the input string describing the attribute to be    we expect the input string describing the attribute to be
   !!!!!!                                      !!!!!!                                  
Line 2325  static char *ParseCSSFont (Element eleme Line 2374  static char *ParseCSSFont (Element eleme
   
   cssRule = SkipBlanksAndComments (cssRule);    cssRule = SkipBlanksAndComments (cssRule);
   if (!strncasecmp (cssRule, "caption", 7))    if (!strncasecmp (cssRule, "caption", 7))
     ;      cssRule += 7;
   else if (!strncasecmp (cssRule, "icon", 4))    else if (!strncasecmp (cssRule, "icon", 4))
     ;      cssRule += 4;
   else if (!strncasecmp (cssRule, "menu", 4))    else if (!strncasecmp (cssRule, "menu", 4))
     ;      cssRule += 4;
   else if (!strncasecmp (cssRule, "message-box", 11))    else if (!strncasecmp (cssRule, "message-box", 11))
     ;      cssRule += 11;
   else if (!strncasecmp (cssRule, "small-caption", 13))    else if (!strncasecmp (cssRule, "small-caption", 13))
     ;      cssRule += 13;
   else if (!strncasecmp (cssRule, "status-bar", 10))    else if (!strncasecmp (cssRule, "status-bar", 10))
     ;      cssRule += 10;
     else if (!strncasecmp (cssRule, "inherit", 7))
       cssRule += 7;
   else    else
     {      {
       while (*cssRule != ';' && *cssRule != EOS)        skippedNL = NewLineSkipped;
         {        cssRule = ParseACSSFontStyle (element, tsch, context, cssRule, css, isHTML);
           ptr = cssRule;        NewLineSkipped = skippedNL;
           skippedNL = NewLineSkipped;        cssRule = ParseACSSFontVariant (element, tsch, context, cssRule, css, isHTML);
           cssRule = ParseCSSFontStyle (element, tsch, context, cssRule, css, isHTML);        NewLineSkipped = skippedNL;
           if (ptr == cssRule)        cssRule = ParseACSSFontWeight (element, tsch, context, cssRule, css, isHTML);
             {        NewLineSkipped = skippedNL;
               NewLineSkipped = skippedNL;        ptr = cssRule;
               cssRule = ParseCSSFontVariant (element, tsch, context, cssRule, css, isHTML);        if (*cssRule != ';' && *cssRule != EOS)
             }          cssRule = ParseCSSFontSize (element, tsch, context, cssRule, css, isHTML);
           if (ptr == cssRule)        NewLineSkipped = skippedNL;
             {        if (*cssRule != ';' && *cssRule != EOS)
               NewLineSkipped = skippedNL;        cssRule = ParseCSSFontFamily (element, tsch, context, cssRule, css, isHTML);
               cssRule = ParseCSSFontWeight (element, tsch, context, cssRule, css, isHTML);        if (ptr == cssRule)
             }          cssRule = SkipValue ("Invalid font value", cssRule);
           if (ptr == cssRule)  
             {  
               NewLineSkipped = skippedNL;  
               cssRule = ParseCSSFontSize (element, tsch, context, cssRule, css, isHTML);  
             }  
           if (ptr == cssRule)  
             {  
               NewLineSkipped = skippedNL;  
               cssRule = ParseCSSFontFamily (element, tsch, context, cssRule, css, isHTML);  
             }  
           if (ptr == cssRule)  
             cssRule = SkipValue ("Invalid font value", cssRule);  
           cssRule = SkipBlanksAndComments (cssRule);  
         }  
     }      }
     cssRule = SkipBlanksAndComments (cssRule);
     if (*cssRule != ';' && *cssRule != EOS)
       cssRule = SkipValue ("Invalid font value", cssRule);
   return (cssRule);    return (cssRule);
 }  }
   
Line 4543  static char *ParseGenericSelector (char Line 4583  static char *ParseGenericSelector (char
                         }                          }
                   }                    }
                 else                  else
                   pseudoclasses[0] = deb;                    {
                       pseudoclasses[0] = deb;
                       /* a "pseudo-class" attribute must match */
                       attrmatch[0] = Txtmatch;
                     }
                 if (names[0] && !strcmp (names[0], "*"))                  if (names[0] && !strcmp (names[0], "*"))
                   names[0] = NULL;                    names[0] = NULL;
               }                }

Removed from v.1.262  
changed lines
  Added in v.1.263


Webmaster