Diff for /Amaya/amaya/styleparser.c between versions 1.146 and 1.147

version 1.146, 2002/08/26 15:40:56 version 1.147, 2002/09/04 13:05:29
Line 2509  static char *ParseCSSBackgroundColor (El Line 2509  static char *ParseCSSBackgroundColor (El
                                         CSSInfoPtr css, ThotBool isHTML)                                          CSSInfoPtr css, ThotBool isHTML)
 {  {
   PresentationValue     best;    PresentationValue     best;
   unsigned int          savedtype = 0;  
   ThotBool              moved;  
   
   /* move the HTML rule to the root element */  
   moved = ((context->type == HTML_EL_HTML || context->type == HTML_EL_BODY) && isHTML);  
   if (moved)  
     {  
       if (element)  
         element = TtaGetMainRoot (context->doc);  
       else  
         {  
           savedtype = context->type;  
           context->type = HTML_EL_Document;  
         }  
     }  
   
   best.typed_data.unit = STYLE_UNIT_INVALID;    best.typed_data.unit = STYLE_UNIT_INVALID;
   best.typed_data.real = FALSE;    best.typed_data.real = FALSE;
Line 2559  static char *ParseCSSBackgroundColor (El Line 2544  static char *ParseCSSBackgroundColor (El
     }      }
   
   /* restore the refered element */    /* restore the refered element */
   if (moved && !element)  
     context->type = savedtype;  
   return (cssRule);    return (cssRule);
 }  }
   
Line 2758  static char *ParseCSSBackgroundImage (El Line 2741  static char *ParseCSSBackgroundImage (El
   char                      *base;    char                      *base;
   char                       tempname[MAX_LENGTH];    char                       tempname[MAX_LENGTH];
   char                       imgname[MAX_LENGTH];    char                       imgname[MAX_LENGTH];
   unsigned int               savedtype = 0;  
   ThotBool                   moved;  
   
   /* default element for FetchImage */  
   el = TtaGetMainRoot (context->doc);  
   /* move the HTML rule to the root element */  
   moved = ((context->type == HTML_EL_HTML || context->type == HTML_EL_BODY) && isHTML);  
   if (moved)  
     {  
       if (element)  
         element = el;  
       else  
         {  
           savedtype = context->type;  
           context->type = HTML_EL_Document;  
         }  
     }  
   else if (element)  
     el = element;  
   
     el = element;
   url = NULL;    url = NULL;
   cssRule = SkipBlanksAndComments (cssRule);    cssRule = SkipBlanksAndComments (cssRule);
   if (!strncasecmp (cssRule, "url", 3))    if (!strncasecmp (cssRule, "url", 3))
Line 2867  static char *ParseCSSBackgroundImage (El Line 2832  static char *ParseCSSBackgroundImage (El
             TtaFreeMemory (url);              TtaFreeMemory (url);
         }          }
     }      }
   
   /* restore the refered element */  
   if (moved && !element)  
     context->type = savedtype;  
   return (cssRule);    return (cssRule);
 }  }
   
Line 2882  static char *ParseCSSBackgroundRepeat (E Line 2843  static char *ParseCSSBackgroundRepeat (E
                                        char *cssRule, CSSInfoPtr css, ThotBool isHTML)                                         char *cssRule, CSSInfoPtr css, ThotBool isHTML)
 {  {
   PresentationValue   repeat;    PresentationValue   repeat;
   unsigned int        savedtype = 0;  
   ThotBool            moved;  
   
   /* move the HTML rule to the root element */  
   moved = ((context->type == HTML_EL_HTML || context->type == HTML_EL_BODY) && isHTML);  
   if (moved)  
     {  
       if (element)  
         element = TtaGetMainRoot (context->doc);  
       else  
         {  
           savedtype = context->type;  
           context->type = HTML_EL_Document;  
         }  
     }  
   
   repeat.typed_data.value = STYLE_REALSIZE;    repeat.typed_data.value = STYLE_REALSIZE;
   repeat.typed_data.unit = STYLE_UNIT_REL;    repeat.typed_data.unit = STYLE_UNIT_REL;
Line 2922  static char *ParseCSSBackgroundRepeat (E Line 2868  static char *ParseCSSBackgroundRepeat (E
       TtaSetStylePresentation (PRPictureMode, element, tsch, context, repeat);        TtaSetStylePresentation (PRPictureMode, element, tsch, context, repeat);
     }      }
   cssRule = SkipWord (cssRule);    cssRule = SkipWord (cssRule);
     return (cssRule);
   /* restore the refered element */  
   if (moved && !element)  
     context->type = savedtype;  
    return (cssRule);  
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
Line 2938  static char *ParseCSSBackgroundAttachmen Line 2880  static char *ParseCSSBackgroundAttachmen
                                            char *cssRule, CSSInfoPtr css,                                             char *cssRule, CSSInfoPtr css,
                                            ThotBool isHTML)                                             ThotBool isHTML)
 {  {
   unsigned int          savedtype = 0;  
   ThotBool              moved;  
   
   /* move the HTML rule to the root element */  
   moved = ((context->type == HTML_EL_HTML || context->type == HTML_EL_BODY) && isHTML);  
   if (moved)  
     {  
       if (element)  
         element = TtaGetMainRoot (context->doc);  
       else  
         {  
           savedtype = context->type;  
           context->type = HTML_EL_Document;  
         }  
     }  
   
    cssRule = SkipBlanksAndComments (cssRule);     cssRule = SkipBlanksAndComments (cssRule);
    if (!strncasecmp (cssRule, "scroll", 6))     if (!strncasecmp (cssRule, "scroll", 6))
      cssRule = SkipWord (cssRule);       cssRule = SkipWord (cssRule);
    else if (!strncasecmp (cssRule, "fixed", 5))     else if (!strncasecmp (cssRule, "fixed", 5))
      cssRule = SkipWord (cssRule);       cssRule = SkipWord (cssRule);
   
   /* restore the refered element */  
   if (moved && !element)  
     context->type = savedtype;  
    return (cssRule);     return (cssRule);
 }  }
   
Line 2976  static char *ParseCSSBackgroundPosition Line 2898  static char *ParseCSSBackgroundPosition
                                          ThotBool isHTML)                                           ThotBool isHTML)
 {  {
   PresentationValue     repeat;    PresentationValue     repeat;
   unsigned int          savedtype = 0;  
   ThotBool              moved;  
   ThotBool              ok;    ThotBool              ok;
   
   /* move the HTML rule to the root element */  
   moved = ((context->type == HTML_EL_HTML || context->type == HTML_EL_BODY) && isHTML);  
   if (moved)  
     {  
       if (element)  
         element = TtaGetMainRoot (context->doc);  
       else  
         {  
           savedtype = context->type;  
           context->type = HTML_EL_Document;  
         }  
     }  
   
    cssRule = SkipBlanksAndComments (cssRule);     cssRule = SkipBlanksAndComments (cssRule);
    ok = TRUE;     ok = TRUE;
    if (!strncasecmp (cssRule, "left", 4))     if (!strncasecmp (cssRule, "left", 4))
Line 3021  static char *ParseCSSBackgroundPosition Line 2928  static char *ParseCSSBackgroundPosition
          cssRule = CheckImportantRule (cssRule, context);           cssRule = CheckImportantRule (cssRule, context);
        TtaSetStylePresentation (PRPictureMode, element, tsch, context, repeat);         TtaSetStylePresentation (PRPictureMode, element, tsch, context, repeat);
      }       }
   
   /* restore the refered element */  
   if (moved && !element)  
     context->type = savedtype;  
    return (cssRule);     return (cssRule);
 }  }
   

Removed from v.1.146  
changed lines
  Added in v.1.147


Webmaster