Last Comment Bug 356870 - (mlabeledtr) mlabeledtr disallowed
(mlabeledtr)
: mlabeledtr disallowed
Status: RESOLVED FIXED
: dev-doc-complete
Product: Core
Classification: Components
Component: MathML (show other bugs)
: Trunk
: All All
: -- normal with 1 vote (vote)
: mozilla9
Assigned To: Frédéric Wang (:fredw)
:
Mentors:
Depends on:
Blocks: mathml-2 mathml-in-mathjax
  Show dependency treegraph
 
Reported: 2006-10-16 13:06 PDT by rbs
Modified: 2011-11-15 12:24 PST (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
allow mlabeledtr to be used in mtable (989 bytes, patch)
2011-09-21 15:07 PDT, Frédéric Wang (:fredw)
karlt: review+
Details | Diff | Splinter Review
testcase (3.97 KB, text/html)
2011-09-22 00:36 PDT, Frédéric Wang (:fredw)
no flags Details
allow mlabeledtr to be used in mtable - V2 (1.23 KB, patch)
2011-09-23 14:28 PDT, Frédéric Wang (:fredw)
karlt: review+
Details | Diff | Splinter Review

Description rbs 2006-10-16 13:06:39 PDT
In the course of fixing bug 347355, I added this snippet in mathml.css

+/* Don't support mtr without mtable, nor mtd without mtr */
+:not(mtable) > mtr,
+:not(mtr) > mtd {
+  display: none !important;
+}

This was also shown to be of effect in bug 348492.

I have now got a feedback that the CSS may be too harsh, and that it should perhaps be relaxed so that <mlabeledtr> (which we don't support) is possible for content-providers who want to refer to it. The suggestion is to split the rules, and only put important on one rule, i.e.:

>   /* Enforce no support for mtr unless in mtable */
>   :not(mtable) > mtr {
>     display: none !important;
>   }
> 
>   /* Don't support mtd unless in mtr */
>   :not(mtr) > mtd {
>     display: none;
>   }

Note: as a UA, there isn't much point having the second rule without !important. So if we are to take this, we might either just take the first rule, or change the second to include mlabeledtr with important, but I don't want to reference mlabeledtr since we don't have a supporting code for it, and users who look at mathml.css and see a selector with mlabeledtr may be misled into thinking that it is supported.
Comment 1 William F. Hammond 2006-10-16 14:51:10 PDT
The "!important" on "not(mtr) > mtd" in "mathml.css" has a significant adverse effect (whole formulas drop out of sight) on legacy XHTML+MathML documents
generated by GELLMU since September 2004, and, moreover, it excludes all use of "mlabeledtr", which _can_ be given usable Mozilla rendering with easy CSS help and _is_ supported by other user agents.  Thanks.


Comment 2 Frédéric Wang (:fredw) 2011-08-09 07:27:12 PDT
MathJax is going to add support for equation labeling and referencing, which is likely to be an important new feature:

https://github.com/mathjax/MathJax/issues/71

The labeling relies on mlabeledtr, so it would be good to fix this bug.

(In reply to William F. Hammond from comment #1)

> moreover, it excludes all use
> of "mlabeledtr", which _can_ be given usable Mozilla rendering with easy CSS
> help and _is_ supported by other user agents.  Thanks.

Do you have a proposal for something that could be added in our CSS stylesheet?
http://mxr.mozilla.org/mozilla-central/source/layout/mathml/mathml.css
Comment 3 William F. Hammond 2011-08-15 10:28:17 PDT
Without the blocking of mlabeledtr by lines 257-260, a content provider can 
use CSS color to distinguish the (first) label cell from a normal cell with
something like:
mlabeledtr {
  display: table-row;
}
mlabeledtr > mtd:first-child {
  color: #004400;
  background-color: #fafffa;
}
But the mathml spec describes positioning for the rendered label that this will
not address, and the colors here need to provide sufficient contrast with other
colors.

This same color effect can also be done with "mtr[class='labeled']" instead of
"mlabeledtr".

Without
Comment 4 Frédéric Wang (:fredw) 2011-09-21 15:05:07 PDT
The lack of support for mlabeledtr is likely to make MathJax v2.0 use the HTML-CSS by default instead of our native rendering:

https://github.com/mathjax/MathJax/issues/71

I'm going to attach a workaround to relax the condition and allow to use mlabeledtr in mtable.
Comment 5 Frédéric Wang (:fredw) 2011-09-21 15:07:17 PDT
Created attachment 561588 [details] [diff] [review]
allow mlabeledtr to be used in mtable
Comment 6 Frédéric Wang (:fredw) 2011-09-21 15:15:57 PDT
(In reply to Frédéric Wang (:fred) from comment #5)
> Created attachment 561588 [details] [diff] [review]
> allow mlabeledtr to be used in mtable

Probably we don't want mlabeledtr without mtable too...
Comment 7 Karl Tomlinson (:karlt) 2011-09-21 20:58:21 PDT
Comment on attachment 561588 [details] [diff] [review]
allow mlabeledtr to be used in mtable

(In reply to Frédéric Wang (:fred) from comment #6)
> Probably we don't want mlabeledtr without mtable too...

I don't know all the details behind bug 347355, but comments suggest that the display:none rules are no longer necessary for safety, in which case I don't see them as important.

Perhaps it would be worth adding another crashtest like that for bug 347355 but with mlabeledtr instead of mtr, to confirm?
Comment 8 Karl Tomlinson (:karlt) 2011-09-21 21:06:36 PDT
CCing Jesse to check his tests know about mlabeledtr.
Comment 9 Jesse Ruderman 2011-09-21 21:12:05 PDT
Added mlabeledtr to the DOM fuzzer.
Comment 10 Frédéric Wang (:fredw) 2011-09-22 00:36:16 PDT
The alignment will be incorrect for an mtable that uses both mlabeledtr and mtr rows. This can probably be fixed by adding cell frames in nsMathMLmtableFrame.cpp (I don't know exactly how and where)

Otherwise, we can do

mlabeledtr > mtd:first-child {
    display: none;
}

to hide the label (without !important, so that users will be able to override this setting).
Comment 11 Frédéric Wang (:fredw) 2011-09-22 00:36:44 PDT
Created attachment 561676 [details]
testcase
Comment 12 Frédéric Wang (:fredw) 2011-09-22 06:11:08 PDT
Or maybe a cleaner way would be to do 

mlabeledtr {
  display: -moz-labeled-table-row;
}

and implement such a private CSS property on the layout side, but I even less idea which part of the code should be modified.
Comment 13 Frédéric Wang (:fredw) 2011-09-22 09:24:25 PDT
https://tbpl.mozilla.org/?tree=Try&usebuildbot=1&rev=355250067020
Comment 14 Frédéric Wang (:fredw) 2011-09-23 14:28:21 PDT
Created attachment 562167 [details] [diff] [review]
allow mlabeledtr to be used in mtable - V2

The former patch used invalid CSS... I've fixed this and add an overridable rule to hide the label for now. Thus the rendering will be the same as the workaround made by MathJax for Firefox+nativeMML.
Comment 15 Karl Tomlinson (:karlt) 2011-09-25 15:50:35 PDT
Comment on attachment 562167 [details] [diff] [review]
allow mlabeledtr to be used in mtable - V2

(In reply to Frédéric Wang (:fred) from comment #14)
> add an overridable
> rule to hide the label for now.

Sounds a good compromise.
Comment 16 Frédéric Wang (:fredw) 2011-09-26 09:21:20 PDT
https://tbpl.mozilla.org/?tree=Try&usebuildbot=1&rev=74d9def9c9de
Comment 18 Ed Morley [:emorley] 2011-09-27 03:29:36 PDT
https://hg.mozilla.org/mozilla-central/rev/36d40fbb0106
Comment 19 Eric Shepherd [:sheppy] 2011-11-15 11:48:01 PST
Does this make mlabeledtr work, or just make it not fail spectacularly?
Comment 20 Frédéric Wang (:fredw) 2011-11-15 12:10:48 PST
(In reply to Eric Shepherd [:sheppy] from comment #19)
> Does this make mlabeledtr work, or just make it not fail spectacularly?

The latter. See bug 689641
Comment 21 Eric Shepherd [:sheppy] 2011-11-15 12:24:40 PST
Added a note to Firefox 9 for developers.

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