Fix MathML bug 114909 - dynamically changing the displaystyle attribute in <mstyle> tag doesn't change display

git-svn-id: svn://10.0.0.236/trunk@111791 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rbs%maths.uq.edu.au
2002-01-10 04:42:55 +00:00
parent 0938408b74
commit 8dbb385e2b
15 changed files with 400 additions and 52 deletions

View File

@@ -105,6 +105,47 @@ nsMathMLmunderFrame::UpdatePresentationData(nsIPresContext* aPresContext,
return NS_OK;
}
NS_IMETHODIMP
nsMathMLmunderFrame::UpdatePresentationDataFromChildAt(nsIPresContext* aPresContext,
PRInt32 aFirstIndex,
PRInt32 aLastIndex,
PRInt32 aScriptLevelIncrement,
PRUint32 aFlagsValues,
PRUint32 aFlagsToUpdate)
{
// munder is special... The REC says:
// Within underscript, <munder> always sets displaystyle to "false",
// but increments scriptlevel by 1 only when accentunder is "false".
// This means that
// 1. don't allow displaystyle to change in the underscript
// 2. if the value of the accent is changed, we need to recompute the
// scriptlevel of the underscript. The problem is that the accent
// can change in the <mo> deep down the embellished hierarchy
// Do #1 here, never allow displaystyle to be changed in the underscript
PRInt32 index = 0;
nsIFrame* childFrame = mFrames.FirstChild();
while (childFrame) {
if ((index >= aFirstIndex) &&
((aLastIndex <= 0) || ((aLastIndex > 0) && (index <= aLastIndex)))) {
if (index > 0) {
// disable the flag
aFlagsToUpdate &= ~NS_MATHML_DISPLAYSTYLE;
aFlagsValues &= ~NS_MATHML_DISPLAYSTYLE;
}
PropagatePresentationDataFor(aPresContext, childFrame,
aScriptLevelIncrement, aFlagsValues, aFlagsToUpdate);
}
index++;
childFrame->GetNextSibling(&childFrame);
}
return NS_OK;
// XXX For #2, if the inner <mo> changes, is has to trigger
// XXX a re-computation of all flags that depend on its state
// XXX in the entire embellished hierarchy
}
NS_IMETHODIMP
nsMathMLmunderFrame::SetInitialChildList(nsIPresContext* aPresContext,
nsIAtom* aListName,