author | Andriy Zui <PraZuBeR@gmail.com> |
Wed, 28 Mar 2012 21:00:14 -0400 | |
changeset 90581 | 095fd525afa782e7f4c23a7056b1810f512284ee |
parent 90580 | dcf8929a8115a4a90e673f9dbf5c857857307445 |
child 90582 | 9949bb0923030bdaccc2300b71641368e232633c |
push id | 22366 |
push user | mak77@bonardo.net |
push date | Thu, 29 Mar 2012 15:38:30 +0000 |
treeherder | mozilla-central@ff3521bc6559 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | karlt |
bugs | 729924 |
milestone | 14.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/layout/mathml/nsMathMLmactionFrame.cpp +++ b/layout/mathml/nsMathMLmactionFrame.cpp @@ -117,21 +117,19 @@ nsMathMLmactionFrame::Init(nsIContent* if (NS_MATHML_ACTION_TYPE_NONE == mActionType) { // expected tooltip prefix (8ch)... if (8 < value.Length() && 0 == value.Find("tooltip#")) mActionType = NS_MATHML_ACTION_TYPE_TOOLTIP; } 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 return nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow); } NS_IMETHODIMP nsMathMLmactionFrame::TransmitAutomaticData() { @@ -363,22 +361,38 @@ nsMathMLmactionFrame::MouseListener::Han return NS_OK; } void 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); } } } void nsMathMLmactionFrame::MouseOut() { // see if we should remove the status message