diff --git a/layout/mathml/nsMathMLmencloseFrame.cpp b/layout/mathml/nsMathMLmencloseFrame.cpp index 4b8d4e9ebf0..f5890722bee 100644 --- a/layout/mathml/nsMathMLmencloseFrame.cpp +++ b/layout/mathml/nsMathMLmencloseFrame.cpp @@ -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(); } diff --git a/layout/mathml/nsMathMLmencloseFrame.h b/layout/mathml/nsMathMLmencloseFrame.h index 5040b480f63..b36c125d56f 100644 --- a/layout/mathml/nsMathMLmencloseFrame.h +++ b/layout/mathml/nsMathMLmencloseFrame.h @@ -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); diff --git a/layout/mathml/nsMathMLmsqrtFrame.cpp b/layout/mathml/nsMathMLmsqrtFrame.cpp index 9eb11c52b68..f2e3a9f32b6 100644 --- a/layout/mathml/nsMathMLmsqrtFrame.cpp +++ b/layout/mathml/nsMathMLmsqrtFrame.cpp @@ -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, diff --git a/layout/mathml/nsMathMLmsqrtFrame.h b/layout/mathml/nsMathMLmsqrtFrame.h index 939888249ba..94404bd8ea6 100644 --- a/layout/mathml/nsMathMLmsqrtFrame.h +++ b/layout/mathml/nsMathMLmsqrtFrame.h @@ -79,6 +79,9 @@ public: nsIFrame* aParent, nsIFrame* aPrevInFlow); + NS_IMETHOD + InheritAutomaticData(nsIFrame* aParent); + NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID, nsIAtom* aAttribute,