mathvariant on mstyle not applied to mi (bug 569125). r=karlt

--HG--
extra : rebase_source : bdce878ef359b11ada93c4e378855f8bde445243
This commit is contained in:
Frédéric Wang 2011-05-13 09:37:03 +12:00
Родитель 8b4f6eb2f4
Коммит 9ce65b6bd0
2 изменённых файлов: 23 добавлений и 6 удалений

Просмотреть файл

@ -58,6 +58,17 @@ nsMathMLTokenFrame::~nsMathMLTokenFrame()
{
}
NS_IMETHODIMP
nsMathMLTokenFrame::InheritAutomaticData(nsIFrame* aParent)
{
// let the base class get the default from our parent
nsMathMLContainerFrame::InheritAutomaticData(aParent);
ProcessTextData();
return NS_OK;
}
eMathMLFrameType
nsMathMLTokenFrame::GetMathMLFrameType()
{
@ -67,15 +78,15 @@ nsMathMLTokenFrame::GetMathMLFrameType()
}
// for <mi>, distinguish between italic and upright...
// Don't use nsMathMLFrame::GetAttribute for mathvariant or fontstyle as
// default values are not inherited.
nsAutoString style;
// mathvariant overrides fontstyle
// http://www.w3.org/TR/2003/REC-MathML2-20031021/chapter3.html#presm.deprecatt
mContent->GetAttr(kNameSpaceID_None,
nsGkAtoms::_moz_math_fontstyle_, style) ||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::mathvariant_, style) ||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::fontstyle_, style);
GetAttribute(mContent, mPresentationData.mstyle, nsGkAtoms::mathvariant_,
style) ||
GetAttribute(mContent, mPresentationData.mstyle, nsGkAtoms::fontstyle_,
style);
if (style.EqualsLiteral("italic") || style.EqualsLiteral("bold-italic") ||
style.EqualsLiteral("script") || style.EqualsLiteral("bold-script") ||
@ -330,8 +341,11 @@ nsMathMLTokenFrame::SetTextStyle()
}
else {
// Attributes override the default behavior.
if (!(mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::mathvariant_) ||
mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::fontstyle_))) {
nsAutoString value;
if (!(GetAttribute(mContent, mPresentationData.mstyle,
nsGkAtoms::mathvariant_, value) ||
GetAttribute(mContent, mPresentationData.mstyle,
nsGkAtoms::fontstyle_, value))) {
if (!isSingleCharacter) {
fontstyle.AssignLiteral("normal");
}

Просмотреть файл

@ -62,6 +62,9 @@ public:
return NS_OK;
}
NS_IMETHOD
InheritAutomaticData(nsIFrame* aParent);
virtual eMathMLFrameType GetMathMLFrameType();
NS_IMETHOD