Diff for /Amaya/amaya/styleparser.c between versions 1.322 and 1.323

version 1.322, 2005/06/22 16:23:40 version 1.323, 2005/07/06 10:39:51
Line 4540  static char *ParseCSSBackground (Element Line 4540  static char *ParseCSSBackground (Element
                                  PresentationContext ctxt, char *cssRule,                                   PresentationContext ctxt, char *cssRule,
                                  CSSInfoPtr css, ThotBool isHTML)                                   CSSInfoPtr css, ThotBool isHTML)
 {  {
   char     *ptr;    char           *ptr;
   int   skippedNL;    int             skippedNL;
     ThotBool        img, repeat, position, attach, color;
   
   cssRule = SkipBlanksAndComments (cssRule);    cssRule = SkipBlanksAndComments (cssRule);
     img = repeat = position = attach = color = FALSE;
   while (*cssRule != ';' && *cssRule != '}' && *cssRule != EOS && *cssRule != ',')    while (*cssRule != ';' && *cssRule != '}' && *cssRule != EOS && *cssRule != ',')
     {      {
       /* perhaps a Background Image */        /* perhaps a Background Image */
       if (!strncasecmp (cssRule, "url", 3) || !strncasecmp (cssRule, "none", 4))        if (!strncasecmp (cssRule, "url", 3) || !strncasecmp (cssRule, "none", 4))
          cssRule = ParseCSSBackgroundImage (element, tsch, ctxt, cssRule,          {
                                             css, isHTML);            cssRule = ParseCSSBackgroundImage (element, tsch, ctxt, cssRule,
                                                css, isHTML);
             img = TRUE;
           }
       /* perhaps a Background Attachment */        /* perhaps a Background Attachment */
       else if (!strncasecmp (cssRule, "scroll", 6) ||        else if (!strncasecmp (cssRule, "scroll", 6) ||
                !strncasecmp (cssRule, "fixed", 5))                 !strncasecmp (cssRule, "fixed", 5))
         cssRule = ParseACSSBackgroundAttachment (element, tsch, ctxt,          {
                                                 cssRule, css, isHTML);            cssRule = ParseACSSBackgroundAttachment (element, tsch, ctxt,
                                                      cssRule, css, isHTML);
             attach = TRUE;
           }
       /* perhaps a Background Repeat */        /* perhaps a Background Repeat */
       else if (!strncasecmp (cssRule, "no-repeat", 9) ||        else if (!strncasecmp (cssRule, "no-repeat", 9) ||
                !strncasecmp (cssRule, "repeat-y", 8)  ||                 !strncasecmp (cssRule, "repeat-y", 8)  ||
                !strncasecmp (cssRule, "repeat-x", 8)  ||                 !strncasecmp (cssRule, "repeat-x", 8)  ||
                !strncasecmp (cssRule, "repeat", 6))                 !strncasecmp (cssRule, "repeat", 6))
         cssRule = ParseACSSBackgroundRepeat (element, tsch, ctxt,          {
                                              cssRule, css, isHTML);            cssRule = ParseACSSBackgroundRepeat (element, tsch, ctxt,
                                                  cssRule, css, isHTML);
             repeat = TRUE;
           }
       /* perhaps a Background Position */        /* perhaps a Background Position */
       else if (!strncasecmp (cssRule, "left", 4)   ||        else if (!strncasecmp (cssRule, "left", 4)   ||
                !strncasecmp (cssRule, "right", 5)  ||                 !strncasecmp (cssRule, "right", 5)  ||
Line 4569  static char *ParseCSSBackground (Element Line 4580  static char *ParseCSSBackground (Element
                !strncasecmp (cssRule, "top", 3)    ||                 !strncasecmp (cssRule, "top", 3)    ||
                !strncasecmp (cssRule, "bottom", 6) ||                 !strncasecmp (cssRule, "bottom", 6) ||
                isdigit (*cssRule) || *cssRule == '.' || *cssRule == '-')                 isdigit (*cssRule) || *cssRule == '.' || *cssRule == '-')
           {
            cssRule = ParseACSSBackgroundPosition (element, tsch, ctxt,             cssRule = ParseACSSBackgroundPosition (element, tsch, ctxt,
                                                  cssRule, css, isHTML);                                                   cssRule, css, isHTML);
              position = TRUE;
           }
       /* perhaps a Background Color */        /* perhaps a Background Color */
       else        else if (!color)
         {          {
             if (!img)
               {
                 img = TRUE;
                 ParseCSSBackgroundImage (element, tsch, ctxt, "none",
                                          css, isHTML);
                 if (!repeat)
                   ParseACSSBackgroundRepeat (element, tsch, ctxt,
                                              "repeat", css, isHTML);
                 if (!position)
                   ParseACSSBackgroundPosition (element, tsch, ctxt,
                                                "0% 0%", css, isHTML);
                 if (!attach)
                   ParseACSSBackgroundAttachment (element, tsch, ctxt,
                                                  "scroll", css, isHTML);
               }
           skippedNL = NewLineSkipped;            skippedNL = NewLineSkipped;
           /* check if the rule has been found */            /* check if the rule has been found */
           ptr = cssRule;            ptr = cssRule;
Line 4585  static char *ParseCSSBackground (Element Line 4614  static char *ParseCSSBackground (Element
               /* rule not found */                /* rule not found */
               cssRule = SkipProperty (cssRule, FALSE);                cssRule = SkipProperty (cssRule, FALSE);
             }              }
             else
               color = TRUE;
         }          }
       cssRule = SkipBlanksAndComments (cssRule);        cssRule = SkipBlanksAndComments (cssRule);
     }      }
Line 6513  char ReadCSSRules (Document docRef, CSSI Line 6544  char ReadCSSRules (Document docRef, CSSI
               if (!quoted && CSSindex > 1 && CSScomment != MAX_CSS_LENGTH &&                if (!quoted && CSSindex > 1 && CSScomment != MAX_CSS_LENGTH &&
                   CSSbuffer[CSSindex - 1] == '*')                    CSSbuffer[CSSindex - 1] == '*')
                 {                  {
                   /* close a comment and ignore its contents */                    /* clean up the buffer */
                     if (newlines && CSSindex > 0)
                       while (CSSindex > 0 &&
                              (CSSbuffer[CSSindex] == SPACE ||
                               CSSbuffer[CSSindex] == BSPACE ||
                               CSSbuffer[CSSindex] == EOL ||
                               CSSbuffer[CSSindex] == TAB ||
                               CSSbuffer[CSSindex] == __CR__))
                         {
                           if ( CSSbuffer[CSSindex] == EOL)
                             {
                               LineNumber ++;
                                 newlines --;
                             }
                         CSSindex--;
                         }
                   CSSindex = CSScomment - 1; /* will be incremented later */                    CSSindex = CSScomment - 1; /* will be incremented later */
                   CSScomment = MAX_CSS_LENGTH;                    CSScomment = MAX_CSS_LENGTH;
                   /* clean up the buffer */                    /* clean up the buffer */

Removed from v.1.322  
changed lines
  Added in v.1.323


Webmaster