Bug 669719 - support the displaystyle attribute on the <math/> element. r=roc

This commit is contained in:
Jonathan Hage 2011-07-12 12:06:34 -04:00
parent 27d2020203
commit d14defe899
4 changed files with 30 additions and 3 deletions

View File

@ -62,14 +62,15 @@ nsMathMLFrame::GetMathMLFrameType()
return eMathMLFrameType_Ordinary;
}
// snippet of code used by <mstyle> and <mtable>, which are the only
// two tags where the displaystyle attribute is allowed by the spec.
// snippet of code used by <mstyle>, <mtable> and <math> which are the only
// three tags where the displaystyle attribute is allowed by the spec.
/* static */ void
nsMathMLFrame::FindAttrDisplaystyle(nsIContent* aContent,
nsPresentationData& aPresentationData)
{
NS_ASSERTION(aContent->Tag() == nsGkAtoms::mstyle_ ||
aContent->Tag() == nsGkAtoms::mtable_, "bad caller");
aContent->Tag() == nsGkAtoms::mtable_ ||
aContent->Tag() == nsGkAtoms::math, "bad caller");
static nsIContent::AttrValuesArray strings[] =
{&nsGkAtoms::_false, &nsGkAtoms::_true, nsnull};
// see if the explicit displaystyle attribute is there
@ -219,6 +220,7 @@ nsMathMLFrame::GetPresentationDataFrom(nsIFrame* aFrame,
if (display->mDisplay == NS_STYLE_DISPLAY_BLOCK) {
aPresentationData.flags |= NS_MATHML_DISPLAYSTYLE;
}
FindAttrDisplaystyle(content, aPresentationData);
aPresentationData.mstyle = frame->GetFirstContinuation();
break;
}

View File

@ -0,0 +1,13 @@
<html>
<body>
<math>
<mstyle displaystyle="true">
<munderover>
<mo>&sum;</mo>
<mi>b</mi>
<mi>c</mi>
</munderover>
</mstyle>
</math>
</body>
</html>

View File

@ -0,0 +1,11 @@
<html>
<body>
<math displaystyle="true">
<munderover>
<mo>&sum;</mo>
<mi>b</mi>
<mi>c</mi>
</munderover>
</math>
</body>
</html>

View File

@ -72,6 +72,7 @@ fails == mstyle-5.xhtml mstyle-5-ref.xhtml # See bug 569125#c29
== mpadded-5.html mpadded-5-ref.html
== mpadded-1-2.html mpadded-1-2-ref.html
== mpadded-6.html mpadded-6-ref.html
== math-display.html math-display-ref.html
== mfrac-linethickness-1.xhtml mfrac-linethickness-1-ref.xhtml
== mathml-negativespace.html mathml-negativespace-ref.html
!= link-1.xhtml link-ref.xhtml