MathML: "stretchy" attribute not working for horizontal arrows in some simple situations

RESOLVED FIXED

Status

()

Core
MathML
RESOLVED FIXED
12 years ago
3 years ago

People

(Reporter: David Harvey, Assigned: rbs)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 1 obsolete attachment)

610 bytes, application/xhtml+xml
Details
616 bytes, application/xhtml+xml
Details
1.76 KB, patch
roc
: review+
Details | Diff | Splinter Review
(Reporter)

Description

12 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/416.12 (KHTML, like Gecko) Safari/416.13
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

When I try to explicitly horizontally stretch an arrow like this:

<mo stretchy="true" minsize="5em" maxsize="5em">&rarr;</mo>

the arrow doesn't stretch. However, if I make this <mo> element a sub-element of something like <mfrac> or <mover>, e.g.

<mover>
  <mi>x</mi>
  <mo stretchy="true" minsize="5em" maxsize="5em">&rarr;</mo>
</mover>

then the arrow stretches correctly. Similar behaviour for &DoubleRightArrow, etc.


Reproducible: Always

Steps to Reproduce:
1. View a MathML object containing only the operator <mo stretchy="true" minsize="5em" maxsize="5em">&rarr;</mo> as above.
2.
3.

Actual Results:  
The arrow doesn't stretch.

Expected Results:  
The arrow should stretch.

I wonder if this is related to bug 236963.
(Assignee)

Updated

12 years ago
Assignee: nobody → rbs
Status: UNCONFIRMED → NEW
Component: General → MathML
Ever confirmed: true
Product: Firefox → Core
Version: unspecified → Trunk
QA Contact: general → ian
(Assignee)

Comment 1

12 years ago
Created attachment 235679 [details]
testcase

WFM.
(Reporter)

Comment 2

12 years ago
Created attachment 235688 [details]
testcase showing problem

Testcase attached. It appears that displaystyle=false is necessary to trigger the bug. Apologies for not noting this before.
(Assignee)

Comment 3

11 years ago
Created attachment 236379 [details] [diff] [review]
patch

It is not really related to displaystyle. It has more to do with the directionality of the stretching. If you say

<mstyle>
  <mrow> <!-- something really big here --> </mrow>
  <mo>&RightArrow;</mo>
  <mo>&UpArrow;</mo>
</mstyle>

Even though both arrows are intrinsically stretchy, the surrounding <mstyle> will only make the &UpArrow; to stretch. There is not enough context to stretch the &RightArrow; unambiguously. Stretching it (by default) would be inappropriate/unexpected by users. And the situtation is reverse if you have <munderover> instead of <mstyle>. The &RightArrow; will stretch while the &UpArrow; will stay put...

However, this bug shows a case where the minsize attribute should override the directionality coming from the parent to allow any char to stretch in its natural direction to span the requested minsize. That's what the patch does.
Attachment #236379 - Flags: superreview?(roc)
Attachment #236379 - Flags: review?(roc)
(Assignee)

Comment 4

11 years ago
Comment on attachment 236379 [details] [diff] [review]
patch

I need to iterate a bit to be more careful with the stretched size.

When the direction is different from what was requested, we have to take:
max(min(CHARSIZE,maxsize),minsize)
instead of:
max(min(CONTAINERSIZE,maxsize),minsize)

(i.e., the container ceases to play a role since the direction that it asked isn't been honored.) I will get back to this later.
Attachment #236379 - Attachment is obsolete: true
Attachment #236379 - Flags: superreview?(roc)
Attachment #236379 - Flags: review?(roc)
(Assignee)

Comment 5

11 years ago
Created attachment 236627 [details] [diff] [review]
iteration per above comment
Attachment #236627 - Flags: superreview?(roc)
Attachment #236627 - Flags: review?(roc)
Attachment #236627 - Flags: superreview?(roc)
Attachment #236627 - Flags: superreview+
Attachment #236627 - Flags: review?(roc)
Attachment #236627 - Flags: review+
(Assignee)

Comment 6

11 years ago
Checked in.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.