The default bug view has changed. See this FAQ.

In <munderover accent=true> the scriptlevel of the over child is not incremented, even when rendered as a supscript

RESOLVED FIXED in mozilla8

Status

()

Core
MathML
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: fredw, Assigned: Jonathan Hage)

Tracking

Trunk
mozilla8
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 7 obsolete attachments)

(Reporter)

Description

6 years ago
Created attachment 544304 [details]
testcase

The MathML3 spec says for munder (and similarly for mover, munderover):

"It always sets displaystyle to "false" within underscript and overscript, but increments scriptlevel by 1 only when accentunder or accent, respectively, are "false". Within base, it always leaves both attributes unchanged. (see Section 3.1.6 Displaystyle and Scriptlevel). "

"If base is an operator with movablelimits="true" (or an embellished operator whose mo element core has movablelimits="true"), and displaystyle="false", then underscript is drawn in a subscript position. In this case, the accentunder attribute is ignored. This is often used for limits on symbols such as &sum;. "

Currently, when we are in the case of an operator with movablelimits="true" and displaystyle="false", the effect of accentunder is taken into account, for example the scriptlevel is not incremented. See the testcase.

A possible fix would be to modify the calls to SetIncrementScriptLevel in TransmitAutomaticData, to force incrementing scriptlevel when movablelimits="true" and displaystyle="false".
(Reporter)

Updated

6 years ago
Whiteboard: [good second bug]
(Reporter)

Comment 1

6 years ago
The elements in the testcase should be rendered as their msup/msub/msubsup counterparts, so one can write a reftest for this bug.
Keywords: helpwanted
(Assignee)

Comment 2

6 years ago
Created attachment 545150 [details] [diff] [review]
Code
(Assignee)

Comment 3

6 years ago
Created attachment 545151 [details] [diff] [review]
Reftest
(Assignee)

Updated

6 years ago
Attachment #545150 - Flags: review?(karlt)
(Assignee)

Updated

6 years ago
Attachment #545151 - Flags: review?(karlt)
(Reporter)

Comment 4

6 years ago
> PRBool subsupDisplay =
>		NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishData.flags)
>		&& !NS_MATHML_IS_DISPLAYSTYLE(mPresentationData.flags);

The operator && should be placed at the end of a line, not the beginning.
subsupDisplay could be defined just before the if statement above and used in that statement.
(Reporter)

Comment 5

6 years ago
I guess this patch can not solve the problem for munder/mover without the fix for bug 668204.
Depends on: 668204
(Assignee)

Comment 6

6 years ago
Created attachment 546470 [details] [diff] [review]
Code V2
Attachment #545150 - Attachment is obsolete: true
Attachment #545150 - Flags: review?(karlt)
(Assignee)

Comment 7

6 years ago
Created attachment 546499 [details] [diff] [review]
Code V3
Attachment #546470 - Attachment is obsolete: true
(Assignee)

Comment 8

6 years ago
Created attachment 546509 [details] [diff] [review]
Code V4
Attachment #546499 - Attachment is obsolete: true
(Reporter)

Comment 9

6 years ago
(In reply to comment #8)
> Created attachment 546509 [details] [diff] [review] [review]
> Code V4

FYI, this patch misses a mercurial header with commit message.
Comment on attachment 545151 [details] [diff] [review]
Reftest

I wonder whether these <math> elements should have an explicit
displaystyle="false" attribute as the test depends on this and "When the
display attribute is missing, a rendering agent is free to initialize as
appropriate to the context."

Hopefully we'll add further scriplevel tests, so the test file name should
include a number.  It would also be helpful to indicate that this is a
moveablelimits test, so perhaps "scriptlevel-moveablelimits-1.html".
(Assignee)

Comment 11

6 years ago
Created attachment 550320 [details] [diff] [review]
Reftests v2
Attachment #545151 - Attachment is obsolete: true
Attachment #545151 - Flags: review?(karlt)
(Assignee)

Comment 12

6 years ago
Created attachment 550322 [details] [diff] [review]
Reftests v2
Attachment #550320 - Attachment is obsolete: true
(Assignee)

Comment 13

6 years ago
Created attachment 550324 [details] [diff] [review]
Code v4
Attachment #546509 - Attachment is obsolete: true
(Assignee)

Updated

6 years ago
Attachment #550322 - Flags: review?(karlt)
(Assignee)

Updated

6 years ago
Attachment #550324 - Flags: review?(karlt)
Attachment #550322 - Flags: review?(karlt) → review+
Comment on attachment 550324 [details] [diff] [review]
Code v4

>   /* The REC says:
>      Within underscript, <munderover> always sets displaystyle to "false",
>      but increments scriptlevel by 1 only when accentunder is "false". 
>@@ -283,28 +287,28 @@ XXX The winner is the outermost setting 
>      that math accents and \overline change uncramped styles to their
>      cramped counterparts.
>   */
>   if (tag == nsGkAtoms::mover_ ||
>       tag == nsGkAtoms::munderover_) {
>     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));

The logic here is not right.  subsupDisplay is boolean while flags is a bitmask.
It would probably be tidiest to add an "increment" boolean variable so the logic doesn't need to be duplicated.

Can you update the "REC says" comment to describe what the new logic supports, please?
Attachment #550324 - Flags: review?(karlt) → review-
(Assignee)

Comment 15

6 years ago
Created attachment 550979 [details] [diff] [review]
Code v5

The logic is not duplicated, we have one hand accentover and the other hand accentunder.    
I updated the "REC says" but I'm not sure if it's what you want.
Attachment #550324 - Attachment is obsolete: true
Attachment #550979 - Flags: review?(karlt)
(Reporter)

Updated

6 years ago
Assignee: nobody → hage.jonathan
Attachment #550979 - Flags: review?(karlt) → review+
Keywords: helpwanted
Whiteboard: [good second bug]
(Reporter)

Updated

6 years ago
Keywords: checkin-needed

Updated

6 years ago
Keywords: checkin-needed
http://hg.mozilla.org/integration/mozilla-inbound/rev/7e6ca29cfa7c

In the future, could you please provide a commit message that include bug number, description of what the patch does, and reviewer?
Flags: in-testsuite+
Target Milestone: --- → mozilla8
http://hg.mozilla.org/mozilla-central/rev/7e6ca29cfa7c
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.