diff --git a/layout/mathml/nsMathMLmactionFrame.cpp b/layout/mathml/nsMathMLmactionFrame.cpp index 94e3de745063..0b895387869a 100644 --- a/layout/mathml/nsMathMLmactionFrame.cpp +++ b/layout/mathml/nsMathMLmactionFrame.cpp @@ -122,11 +122,9 @@ nsMathMLmactionFrame::Init(nsIContent* aContent, } if (NS_MATHML_ACTION_TYPE_NONE == mActionType) { - // expected statusline prefix (11ch)... - if (11 < value.Length() && 0 == value.Find("statusline#")) + if (value.EqualsLiteral("statusline")) mActionType = NS_MATHML_ACTION_TYPE_STATUSLINE; } - } // Let the base class do the rest @@ -368,12 +366,28 @@ nsMathMLmactionFrame::MouseOver() { // see if we should display a status message if (NS_MATHML_ACTION_TYPE_STATUSLINE == mActionType) { - nsAutoString value; - mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::actiontype_, value); - // expected statusline prefix (11ch)... - if (11 < value.Length() && 0 == value.Find("statusline#")) { - value.Cut(0, 11); - ShowStatus(PresContext(), value); + // retrieve content from a second child if it exists + nsIFrame* childFrame = mFrames.FrameAt(1); + if (!childFrame) return; + + nsIContent* content = childFrame->GetContent(); + if (!content) return; + + // check whether the content is mtext or not + if (content->GetNameSpaceID() == kNameSpaceID_MathML && + content->Tag() == nsGkAtoms::mtext_) { + // get the text to be displayed + content = content->GetFirstChild(); + if (!content) return; + + const nsTextFragment* textFrg = content->GetText(); + if (!textFrg) return; + + nsAutoString text; + textFrg->AppendTo(text); + // collapse whitespaces as listed in REC, section 3.2.6.1 + text.CompressWhitespace(); + ShowStatus(PresContext(), text); } } }