Last Comment Bug 722880 - (mtable-width) Support for attribute "width" on mtable
(mtable-width)
: Support for attribute "width" on mtable
Status: RESOLVED FIXED
[good second bug]
: dev-doc-complete, helpwanted
Product: Core
Classification: Components
Component: MathML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla13
Assigned To: François Wang
:
: Anthony Jones (:kentuckyfriedtakahe, :k17e)
Mentors:
http://www.w3.org/TR/MathML3/chapter3...
Depends on:
Blocks: mathml-2 557086 mathml-in-mathjax
  Show dependency treegraph
 
Reported: 2012-01-31 14:39 PST by Frédéric Wang (:fredw)
Modified: 2012-03-08 14:38 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch V1 (3.90 KB, patch)
2012-02-22 09:54 PST, François Wang
karlt: review+
Details | Diff | Splinter Review
Patch reftests V1 (2.91 KB, patch)
2012-02-26 13:40 PST, François Wang
karlt: review+
Details | Diff | Splinter Review

Description Frédéric Wang (:fredw) 2012-01-31 14:39:28 PST
Here is a test case from the MathML testsuite:

http://www.w3.org/Math/testsuite/build/main/Presentation/TablesAndMatrices/mtable/mtableAwidth1-full.xhtml

Note that to workaround this bug, MathJax attaches the corresponding style="width: ..." on the mtable element. Hence an easy way to fix this bug would be to do this attribute mapping in src/content/mathml/content/src/nsMathMLElement.cpp. Note the special value "auto" and the case when length is unitless (it should be interpreted in the same way as a % per chapter 2).

Good new, we don't have to care about mstyle:
"MathML specifies that when the attributes height, depth or width are specified on an mstyle element, they apply only to mspace elements, and not to the corresponding attributes of mglyph, mpadded, or mtable."

Here is a reftest I wrote for the MathJax project:

http://devel.mathjax.org/testing/testsuite/MathMLToDisplay/Presentation/TablesAndMatrices/mtable/width-1.html?&outputJax=NativeMML

http://devel.mathjax.org/testing/testsuite/MathMLToDisplay/Presentation/TablesAndMatrices/mtable/width-1-ref.html?&outputJax=NativeMML

(one can also compare the effect of the attribute width with the one of the corresponding style="width: ..." rule)
Comment 1 François Wang 2012-02-22 09:54:09 PST
Created attachment 599666 [details] [diff] [review]
Patch V1
Comment 2 Frédéric Wang (:fredw) 2012-02-22 10:04:51 PST
> Here is a reftest I wrote for the MathJax project:
> 
> http://devel.mathjax.org/testing/testsuite/MathMLToDisplay/Presentation/
> TablesAndMatrices/mtable/width-1.html?&outputJax=NativeMML
> 
> http://devel.mathjax.org/testing/testsuite/MathMLToDisplay/Presentation/
> TablesAndMatrices/mtable/width-1-ref.html?&outputJax=NativeMML
> 
> (one can also compare the effect of the attribute width with the one of the
> corresponding style="width: ..." rule)

The reference in this reftest does not work very well for us, because of bug 459363. So maybe we should just compare

<mtable width="...">...

against

<mtable style="width: ...;">...

We can also verify that "auto" is the same as the default value:

<mtable width="auto">...

and

<mtable>...

(I think in attachment 599666 [details] [diff] [review], ParseNumericValue will just ignore "auto" and thus provide the expected behavior here).
Comment 3 Frédéric Wang (:fredw) 2012-02-26 09:54:22 PST
https://tbpl.mozilla.org/?tree=Try&rev=4d4d2e22ce1a
Comment 4 François Wang 2012-02-26 13:40:49 PST
Created attachment 600810 [details] [diff] [review]
Patch reftests V1

Note You need to log in before you can comment on or make changes to this bug.