Diff for /Amaya/amaya/MathMLbuilder.c between versions 1.186 and 1.187

version 1.186, 2003/03/17 09:23:29 version 1.187, 2003/03/17 15:09:50
Line 4004  void EvaluateChildRendering (Element el, Line 4004  void EvaluateChildRendering (Element el,
 {  {
   ElementType          elType;    ElementType          elType;
   Element              child, renderedChild;    Element              child, renderedChild;
   SSchema              MathSSchema;    SSchema              MathMLSSchema;
     AttributeType        attrType;
     Attribute            attr;
   PresentationValue    pval;    PresentationValue    pval;
   PresentationContext  ctxt;    PresentationContext  ctxt;
   char                *name;    char                *value;
     int                  length;
   
   ctxt = TtaGetSpecificStyleContext (doc);    ctxt = TtaGetSpecificStyleContext (doc);
   ctxt->cssSpecificity = 0;   /* the presentation rule to be set is not a CSS rule */    ctxt->cssSpecificity = 0;   /* the presentation rule to be set is not a CSS rule */
   pval.typed_data.unit = UNIT_PX;    pval.typed_data.unit = UNIT_PX;
   pval.typed_data.value = 0;    pval.typed_data.value = 0;
   pval.typed_data.real = FALSE;    pval.typed_data.real = FALSE;
   MathSSchema = TtaGetElementType(el).ElSSchema;    MathMLSSchema = TtaGetElementType(el).ElSSchema;
   /* process all children in order */    /* process all children in order */
   child = TtaGetFirstChild (el);    child = TtaGetFirstChild (el);
   renderedChild = NULL;    renderedChild = NULL;
Line 4022  void EvaluateChildRendering (Element el, Line 4025  void EvaluateChildRendering (Element el,
     {      {
       /* if this child is a comment or a processing instruction, skip it */        /* if this child is a comment or a processing instruction, skip it */
       elType = TtaGetElementType (child);        elType = TtaGetElementType (child);
       if (elType.ElSSchema != MathSSchema ||        ctxt->destroy = FALSE; /* we will most probably create a PRule
           (elType.ElTypeNum != MathML_EL_XMLcomment &&                                  Visibility: 0; for this child */
            elType.ElTypeNum != MathML_EL_XMLPI &&        if (elType.ElSSchema == MathMLSSchema &&
            elType.ElTypeNum != MathML_EL_Unknown_namespace))            elType.ElTypeNum != MathML_EL_XMLcomment &&
             elType.ElTypeNum != MathML_EL_XMLPI &&
             elType.ElTypeNum != MathML_EL_Unknown_namespace &&
             elType.ElTypeNum != MathML_EL_ANNOTATION)
         {          {
           name = TtaGetSSchemaName (elType.ElSSchema);            if (!renderedChild && elType.ElTypeNum == MathML_EL_ANNOTATION_XML)
           if (!renderedChild &&  
               (!strcmp (name, "SVG") || !strcmp (name, "MathML")))  
             {              {
               renderedChild = child;                /* check if the mime type is known */
               ctxt->destroy = TRUE;                attrType.AttrSSchema = MathMLSSchema;
                 attrType.AttrTypeNum = MathML_ATTR_encoding;
                 attr = TtaGetAttribute (child, attrType);
                 if (attr)
                   {
                     length = TtaGetTextAttributeLength (attr);
                     if (length > 0)
                       {
                         value = TtaGetMemory (length+1);
                         value[0] = EOS;
                         TtaGiveTextAttributeValue (attr, value, &length);
                         if (!strncmp (value, "image/svg", 9) ||
                             !strcmp (value, AM_SVG_MIME_TYPE) ||
                             !strncmp (value, "text/htm", 8) ||
                             !strcmp (value, AM_XHTML_MIME_TYPE))
                           {
                             /* display that child */
                             renderedChild = child;
                             ctxt->destroy = TRUE;
                           }  
                       }
                   }
             }              }
           else  
             ctxt->destroy = FALSE; /* we will most probably create a PRule  
                                     Visibility: 0; for this child */  
           /* set or remove a visibility PRule for this child */            /* set or remove a visibility PRule for this child */
           TtaSetStylePresentation (PRVisibility, child, NULL, ctxt, pval);            TtaSetStylePresentation (PRVisibility, child, NULL, ctxt, pval);
         }          }
Line 4242  void      MathMLElementComplete (ParserD Line 4264  void      MathMLElementComplete (ParserD
           /* Create placeholders within the MACTION element */            /* Create placeholders within the MACTION element */
           CreatePlaceholders (TtaGetFirstChild (el), doc);            CreatePlaceholders (TtaGetFirstChild (el), doc);
           break;            break;
        case MathML_EL_ANNOTATION_XML:         case MathML_EL_SEMANTICS:
          /* it's a ANNOTATION_XML element */           /* it's a ANNOTATION_XML element */
          /* Evaluate what direct child element to be rendered */           /* Evaluate what direct child element to be rendered */
          EvaluateChildRendering (el, doc);           EvaluateChildRendering (el, doc);

Removed from v.1.186  
changed lines
  Added in v.1.187


Webmaster