version 1.240, 2010/02/16 13:47:46
|
version 1.241, 2010/07/19 12:07:07
|
Line 1
|
Line 1
|
/* |
/* |
* |
* |
* (c) COPYRIGHT INRIA and W3C, 1996-2009 |
* (c) COPYRIGHT INRIA and W3C, 1996-2010 |
* Please first read the full copyright statement in file COPYRIGHT. |
* Please first read the full copyright statement in file COPYRIGHT. |
* |
* |
*/ |
*/ |
Line 4344 void MathMLElementCreated (Element
|
Line 4344 void MathMLElementCreated (Element
|
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
EvaluateChildRendering tests what children should be displayed |
EvaluateChildRendering |
|
choose the child of element el (a <semantics> element) that should be |
|
displayed |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
void EvaluateChildRendering (Element el, Document doc) |
void EvaluateChildRendering (Element el, Document doc) |
{ |
{ |
Line 4360 void EvaluateChildRendering (Element el,
|
Line 4362 void EvaluateChildRendering (Element el,
|
|
|
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 */ |
|
/* prepare the value of the 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; |
MathMLSSchema = TtaGetElementType(el).ElSSchema; |
MathMLSSchema = TtaGetElementType(el).ElSSchema; |
/* process all children in order */ |
renderedChild = NULL; /* no child to render yet */ |
|
/* check all children of element el */ |
child = TtaGetFirstChild (el); |
child = TtaGetFirstChild (el); |
renderedChild = NULL; |
|
while (child) |
while (child) |
{ |
{ |
/* if this child is a comment or a processing instruction, skip it */ |
/* if this child is a comment, a processing instruction, or an annotation |
|
we skip it */ |
elType = TtaGetElementType (child); |
elType = TtaGetElementType (child); |
ctxt->destroy = FALSE; /* we will most probably create a PRule |
ctxt->destroy = FALSE; /* we will most probably create a PRule |
Visibility: 0; for this child */ |
Visibility: 0; for this child */ |
Line 4380 void EvaluateChildRendering (Element el,
|
Line 4384 void EvaluateChildRendering (Element el,
|
elType.ElTypeNum != MathML_EL_ANNOTATION) |
elType.ElTypeNum != MathML_EL_ANNOTATION) |
{ |
{ |
if (!renderedChild && elType.ElTypeNum == MathML_EL_ANNOTATION_XML) |
if (!renderedChild && elType.ElTypeNum == MathML_EL_ANNOTATION_XML) |
|
/* it's an <annotation-xml> element */ |
{ |
{ |
/* check if the mime type is known */ |
/* check its encoding */ |
attrType.AttrSSchema = MathMLSSchema; |
attrType.AttrSSchema = MathMLSSchema; |
attrType.AttrTypeNum = MathML_ATTR_encoding; |
attrType.AttrTypeNum = MathML_ATTR_encoding; |
attr = TtaGetAttribute (child, attrType); |
attr = TtaGetAttribute (child, attrType); |
|
/* there is an "encoding" attribute */ |
if (attr) |
if (attr) |
{ |
{ |
length = TtaGetTextAttributeLength (attr); |
length = TtaGetTextAttributeLength (attr); |
Line 4398 void EvaluateChildRendering (Element el,
|
Line 4404 void EvaluateChildRendering (Element el,
|
!strncmp (value, "text/htm", 8) || |
!strncmp (value, "text/htm", 8) || |
!strcmp (value, AM_XHTML_MIME_TYPE)) |
!strcmp (value, AM_XHTML_MIME_TYPE)) |
{ |
{ |
/* display that child */ |
/* we know this encoding. We will display that child*/ |
renderedChild = child; |
renderedChild = child; |
|
/* remove the Visibility rule if there is one */ |
ctxt->destroy = TRUE; |
ctxt->destroy = TRUE; |
} |
} |
} |
} |
Line 4648 void MathMLElementComplete (ParserD
|
Line 4655 void MathMLElementComplete (ParserD
|
CreatePlaceholders (TtaGetFirstChild (el), doc); |
CreatePlaceholders (TtaGetFirstChild (el), doc); |
break; |
break; |
case MathML_EL_SEMANTICS: |
case MathML_EL_SEMANTICS: |
/* it's a ANNOTATION_XML element */ |
/* it's a <semantics> element */ |
/* Evaluate what direct child element to be rendered */ |
/* Evaluate what child element to be rendered */ |
EvaluateChildRendering (el, doc); |
EvaluateChildRendering (el, doc); |
break; |
break; |
case MathML_EL_MGLYPH: |
case MathML_EL_MGLYPH: |