Support for attribute "notation" on mstyle (bug 569125). r=karlt

--HG--
extra : rebase_source : 58564e2ab4a41244beb224f214ac0b963ef2c0d8
This commit is contained in:
Frédéric Wang 2011-05-13 09:31:34 +12:00
Родитель caf5f67ea8
Коммит c4f67e0e71
4 изменённых файлов: 21 добавлений и 23 удалений

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

@ -170,9 +170,14 @@ nsresult nsMathMLmencloseFrame::AddNotation(const nsAString& aNotation)
*/
void nsMathMLmencloseFrame::InitNotations()
{
mNotationsToDraw = 0;
mLongDivCharIndex = mRadicalCharIndex = -1;
mMathMLChar.Clear();
nsAutoString value;
if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::notation_, value)) {
if (GetAttribute(mContent, mPresentationData.mstyle, nsGkAtoms::notation_,
value)) {
// parse the notation attribute
nsWhitespaceTokenizer tokenizer(value);
@ -186,19 +191,6 @@ void nsMathMLmencloseFrame::InitNotations()
}
}
NS_IMETHODIMP
nsMathMLmencloseFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
NS_ENSURE_SUCCESS(rv, rv);
InitNotations();
return NS_OK;
}
NS_IMETHODIMP
nsMathMLmencloseFrame::InheritAutomaticData(nsIFrame* aParent)
{
@ -207,6 +199,8 @@ nsMathMLmencloseFrame::InheritAutomaticData(nsIFrame* aParent)
mPresentationData.flags |= NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY;
InitNotations();
return NS_OK;
}
@ -702,10 +696,6 @@ nsMathMLmencloseFrame::AttributeChanged(PRInt32 aNameSpaceID,
PRInt32 aModType)
{
if (aAttribute == nsGkAtoms::notation_) {
mNotationsToDraw = 0;
mLongDivCharIndex = mRadicalCharIndex = -1;
mMathMLChar.Clear();
InitNotations();
}

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

@ -104,11 +104,6 @@ public:
virtual nsStyleContext*
GetAdditionalStyleContext(PRInt32 aIndex) const;
NS_IMETHOD
Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists);

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

@ -84,6 +84,16 @@ nsMathMLmsqrtFrame::Init(nsIContent* aContent,
return rv;
}
NS_IMETHODIMP
nsMathMLmsqrtFrame::InheritAutomaticData(nsIFrame* aParent)
{
nsMathMLContainerFrame::InheritAutomaticData(aParent);
mPresentationData.flags |= NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY;
return NS_OK;
}
NS_IMETHODIMP
nsMathMLmsqrtFrame::AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,

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

@ -79,6 +79,9 @@ public:
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD
InheritAutomaticData(nsIFrame* aParent);
NS_IMETHOD
AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,