Bug 669713 - Increment the scriptlevel of the over child in <munderover accent=true> when rendered as a supscript; r=karlt

This commit is contained in:
Jonathan Hage 2011-08-14 11:17:22 +02:00
Родитель 9f1e430f97
Коммит 0e07761f09
4 изменённых файлов: 63 добавлений и 4 удалений

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

@ -262,10 +262,14 @@ XXX The winner is the outermost setting in conflicting settings like these:
}
}
PRBool subsupDisplay =
NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishData.flags) &&
!NS_MATHML_IS_DISPLAYSTYLE(mPresentationData.flags);
// disable the stretch-all flag if we are going to act like a superscript
if ( NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishData.flags) &&
!NS_MATHML_IS_DISPLAYSTYLE(mPresentationData.flags))
if (subsupDisplay) {
mPresentationData.flags &= ~NS_MATHML_STRETCH_ALL_CHILDREN_HORIZONTALLY;
}
// Now transmit any change that we want to our children so that they
// can update their mPresentationData structs
@ -278,6 +282,10 @@ XXX The winner is the outermost setting in conflicting settings like these:
Within overscript, <munderover> always sets displaystyle to "false",
but increments scriptlevel by 1 only when accent is "false".
Within subscript and superscript it increments scriptlevel by 1, and
sets displaystyle to "false", but leaves both attributes unchanged within
base.
The TeXBook treats 'over' like a superscript, so p.141 or Rule 13a
say it shouldn't be compressed. However, The TeXBook says
that math accents and \overline change uncramped styles to their
@ -288,7 +296,7 @@ XXX The winner is the outermost setting in conflicting settings like these:
PRUint32 compress = NS_MATHML_EMBELLISH_IS_ACCENTOVER(mEmbellishData.flags)
? NS_MATHML_COMPRESSED : 0;
SetIncrementScriptLevel(tag == nsGkAtoms::mover_ ? 1 : 2,
!NS_MATHML_EMBELLISH_IS_ACCENTOVER(mEmbellishData.flags));
!NS_MATHML_EMBELLISH_IS_ACCENTOVER(mEmbellishData.flags) || subsupDisplay);
PropagatePresentationDataFor(overscriptFrame,
~NS_MATHML_DISPLAYSTYLE | compress,
NS_MATHML_DISPLAYSTYLE | compress);
@ -299,7 +307,7 @@ XXX The winner is the outermost setting in conflicting settings like these:
*/
if (tag == nsGkAtoms::munder_ ||
tag == nsGkAtoms::munderover_) {
SetIncrementScriptLevel(1, !NS_MATHML_EMBELLISH_IS_ACCENTUNDER(mEmbellishData.flags));
SetIncrementScriptLevel(1, !NS_MATHML_EMBELLISH_IS_ACCENTUNDER(mEmbellishData.flags) || subsupDisplay);
PropagatePresentationDataFor(underscriptFrame,
~NS_MATHML_DISPLAYSTYLE | NS_MATHML_COMPRESSED,
NS_MATHML_DISPLAYSTYLE | NS_MATHML_COMPRESSED);

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

@ -74,6 +74,7 @@ fails == mstyle-5.xhtml mstyle-5-ref.xhtml # See bug 569125#c29
== mpadded-1-2.html mpadded-1-2-ref.html
== mpadded-6.html mpadded-6-ref.html
== math-display.html math-display-ref.html
== scriptlevel-movablelimits-1.html scriptlevel-movablelimits-1-ref.html
== mfrac-linethickness-1.xhtml mfrac-linethickness-1-ref.xhtml
== mathml-negativespace.html mathml-negativespace-ref.html
!= link-1.xhtml link-ref.xhtml

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

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head><title>Test accent/accentunder</title></head>
<body>
<math displaystyle="false">
<munderover>
<mo>&#x2211;</mo>
<mi>a</mi>
<mi>b</mi>
</munderover>
</math>
<math displaystyle="false">
<munder>
<mo>&#x2211;</mo>
<mi>a</mi>
</munder>
</math>
<math displaystyle="false">
<mover>
<mo>&#x2211;</mo>
<mi>a</mi>
</mover>
</math>
</body>
</html>

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

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head><title>Test accent/accentunder</title></head>
<body>
<math displaystyle="false">
<munderover accentunder="true" accent="true">
<mo>&#x2211;</mo>
<mi>a</mi>
<mi>b</mi>
</munderover>
</math>
<math displaystyle="false">
<munder accentunder="true">
<mo>&#x2211;</mo>
<mi>a</mi>
</munder>
</math>
<math displaystyle="false">
<mover accent="true">
<mo>&#x2211;</mo>
<mi>a</mi>
</mover>
</math>
</body>
</html>