Hyper-linked MathML formulas should have default text-decoration property set to none

RESOLVED FIXED in mozilla7

Status

()

Core
MathML
RESOLVED FIXED
8 years ago
6 years ago

People

(Reporter: Joe Java, Assigned: fredw)

Tracking

unspecified
mozilla7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [inbound], URL)

Attachments

(4 attachments, 5 obsolete attachments)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5

Hyper-linked MathML equations should not have their appearance altered (other than color changes) when linked.
     (i.e the CSS code text-decoration: none should be the default for hyper-linked MathML formulas).
    I have include and image and webpage that shows that MathML formulas
that are hyper-linked are incorrectly displayed, unless CSS "text-decoration" is set to "none"

Reproducible: Always

Steps to Reproduce:
1. go to https://eyeasme.com/Joe/MathML/MathML_text_decoration_bug
2. see the bug
3.
Actual Results:  
When a MathML formula when hyperlinked should not change its appearance
(other than color)

Expected Results:  
When a Hyper-linked MathML formula has CSS property "text-decoration" property
set to "none" it displays correctly, otherwise it does not.

 This appears to be a simple bug to fix.  Just set the default CSS for hyper-linked MathML equations to "text-decoration: none"
(Reporter)

Comment 1

8 years ago
Created attachment 388709 [details]
here is an image of the problem

Attached is an image that clearly shows the problem.  MathML formulas should not change their (non-color) appearance when hyper-linked.
Status: UNCONFIRMED → NEW
Component: General → MathML
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → mathml
(Assignee)

Comment 2

8 years ago
Created attachment 407731 [details]
Testcase
(Assignee)

Comment 3

8 years ago
Created attachment 407732 [details]
Screenshot of the testcase (Firefox)
(Assignee)

Comment 4

8 years ago
Created attachment 407733 [details]
Screenshot of the testcase (Amaya)
(Assignee)

Comment 5

8 years ago
Just setting text-decoration: none on the <math/> element does not seem to work. 

Note the behavior of Amaya: "text-decoration: underline" is also inherited, but the workaround "text-decoration: none" works. Also, note that using xlink avoids this problem since no CSS is added (but XLink is currently broken, see bug 427990).
OS: Mac OS X → All
Hardware: PowerPC → All
(Reporter)

Comment 6

8 years ago
In regards to Comments 2 - 5.

I have modified your example to more clearly show how the CSS property 
'text-decoration' changes the appearence of hyperlinked equations.
 
https://eyeasme.com/Joe/MathML/test_for_bug504324.html

I have attached an image of the page.
(Reporter)

Comment 7

8 years ago
Created attachment 407766 [details]
image of webpage https://eyeasme.com/Joe/MathML/test_for_bug504324.html

image of page
https://eyeasme.com/Joe/MathML/test_for_bug504324.html

using firefox 3.5.3 on OS X 10.5.8
(Assignee)

Comment 8

8 years ago
Created attachment 407786 [details]
<a/> with text + MathML inside

I don't think setting text-decoration to false at the <a/> level is an appropriate fix because <math/> may have siblings that should be underlined. Setting text-decoration to false at the <math/> level would be OK (even if I think it's better to underline the whole formula) but it just seems not to work.
(Reporter)

Comment 9

8 years ago
MathML equations that are hyperlinked should not have their "size" changed or be underlined (since an equation might use underlining as a symbolic representation of a mathematical concept).  Color changes to represent hyperlinking would be OK, since CSS allows for the control of hyperlinking colors.
(Assignee)

Comment 10

8 years ago
(In reply to comment #9)
> MathML equations that are hyperlinked should not have their "size" changed or
> be underlined (since an equation might use underlining as a symbolic
> representation of a mathematical concept).  Color changes to represent
> hyperlinking would be OK, since CSS allows for the control of hyperlinking
> colors.

I don't think underlining a formula is really problematic and actually I find it more consistent with the surrounding HTML. In attachment 407786 [details], I would find strange to have the beginning of the link "the formula" and the end "inside a <a/>" underlined but not the formula "sqrt(x^2 - 1)".

Anyway, my point was that the fix you suggest (setting text-decoration:false to the <a/>) is bad, because the <math/> element changes the style of its parent element. What could be OK is setting text-decoration:false to the <math/> element, but this does not work.

I think the right thing to do is to find why there are additional spaces when the formula is in a link. text-decoration on the parent <a/> probably change other rendering parameters and I would be interested to know what is exactly happening.
(Reporter)

Comment 11

8 years ago
(In reply to comment #10)
> (In reply to comment #9)
> > MathML equations that are hyperlinked should not have their "size" changed or
> > be underlined (since an equation might use underlining as a symbolic
> > representation of a mathematical concept).  Color changes to represent
> > hyperlinking would be OK, since CSS allows for the control of hyperlinking
> > colors.
> 
> I don't think underlining a formula is really problematic and actually I find
> it more consistent with the surrounding HTML. In attachment 407786 [details], I would
> find strange to have the beginning of the link "the formula" and the end
> "inside a <a/>" underlined but not the formula "sqrt(x^2 - 1)".
> 

sigh.... OK... Underlining is an acceptable mathematical symbol.
See 
https://eyeasme.com/Joe/MathML/MathML_browser_test
The "De Morgan's law" example.  There overlining represents complementation.  In the same way often underlining can be used to represent a attribute.

For example, what is the value of "sin(1.4)"  The answer depends on if the angle is in radians or degrees, sometimes to make life easier all degree angles are underlined.

In teaching linear algebra sometimes it helps the student to underline variables that are one dimensional, underline twice two dimensional variables and not underlining scalars.

If lecture notes are htmlized and variables are hyperlinked, then when a student prints out the htmlized lecture notes everything will be screwed up by the added underlining done by the browser.  

MathML equations/formulas should not be changed in shape or have additional markings made to them by being hyperlinked.  They should not be bolded, underlined, overlined, dashed, etc., when hyperlinked  They CAN have their color change and the cursor can change shape when over the equation.

I understand your desire be uniform with the surrounding HTML, but MathML is NOT HTML.  Mathematical equations are in a class all there own... like images, SVG, applets, etc.  


> Anyway, my point was that the fix you suggest (setting text-decoration:false to
> the <a/>) is bad, because the <math/> element changes the style of its parent
> element. What could be OK is setting text-decoration:false to the <math/>
> element, but this does not work.
> 
> I think the right thing to do is to find why there are additional spaces when
> the formula is in a link. text-decoration on the parent <a/> probably change
> other rendering parameters and I would be interested to know what is exactly
> happening.

I agree that my fix is not correct for all cases.  I would like the final solution to end up producing hyperlinked equations that look similar the third example in
https://eyeasme.com/Joe/MathML/test_for_bug504324.html
There the MathML equation is marked as hyperlinked by having ONLY its color changed (and the mouse changes shape over it to show a hyperlink).
(Assignee)

Comment 12

7 years ago
Created attachment 502338 [details]
testcase

updated testcase
Attachment #407731 - Attachment is obsolete: true
Attachment #407732 - Attachment is obsolete: true
Attachment #407733 - Attachment is obsolete: true
Attachment #407786 - Attachment is obsolete: true
(Assignee)

Comment 13

7 years ago
Created attachment 502339 [details] [diff] [review]
Patch for xlink and mathml 3 href

This patch fixes the cases 2 and 3 (xlink and MathML 3 href).
(Assignee)

Updated

7 years ago
Attachment #502339 - Flags: review?(roc)
Two things:
* wouldn't it be better to use :link instead of attribute selectors?
* why !important? shouldn't authors be able to override this?
So I think you just want

:-moz-any-link { text-decoration:none; }
If that works! I'm not sure how the precedence will work out between mathml.css and the rules inserted by PresShell::SetPrefLinkRules.
If that doesn't work you might need to insert a MathML rule into PresShell::SetPrefLinkRules (or just make the mathml.css rule !important).
(Assignee)

Comment 18

7 years ago
Thanks for the hints. Yes, the patch uses !important because it doesn't work otherwise. I can also use :-moz-any-link { text-decoration:none; !important; }, which gives the same result.

To extend slightly the issue of this bug, note that the rule "text-decoration: underline;" confuses the rendering of formulas (it adds unexpected spaces under each MathML frames). Moreover, I think the appropriate markup for underlying a MathML fragment is rather <menclose notation="bottom"> ... </menclose> instead of CSS text-decoration. Hence I guess we could actually set text-decoration=none for any MathML element?

However, putting "text-decoration: none !important;" in mathml.css does not work for the top-level <math/> element (see tests 1 and 2 of attachment 502338 [details]). Is there a simple way to make this work?
I don't know why that wouldn't work.
(Assignee)

Comment 20

7 years ago
Created attachment 505534 [details] [diff] [review]
Patch for xlink and mathml 3 href (V2)
Attachment #502339 - Attachment is obsolete: true
Attachment #502339 - Flags: review?(roc)
(Assignee)

Updated

6 years ago
Attachment #505534 - Flags: review?(roc)
Attachment #505534 - Flags: review?(roc) → review+
Blocks: 427990
(Reporter)

Comment 21

6 years ago
Concerning underlining hyper-linked MathML: see

http://lists.w3.org/Archives/Public/www-style/2010Aug/0334.html

specifically:

  | User agents must not render these text decorations on content that is
  | not text. For example, images and inline blocks must not be underlined.

if MathML is considered "not text" then it should not be underlined.
(In reply to comment #21)
> Concerning underlining hyper-linked MathML: see
> 
> http://lists.w3.org/Archives/Public/www-style/2010Aug/0334.html
> 
> specifically:
> 
>   | User agents must not render these text decorations on content that is
>   | not text. For example, images and inline blocks must not be underlined.
> 
> if MathML is considered "not text" then it should not be underlined.

MathML is actually a special case in that links can really never be underlined, as doing so alters the formulas by making it look like you are doing division where you are not.
Pushed to inbound along with bug 427990:
http://hg.mozilla.org/integration/mozilla-inbound/rev/6b26a5b08522
Whiteboard: [inbound]
Target Milestone: --- → mozilla7
http://hg.mozilla.org/mozilla-central/rev/6b26a5b08522
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Comment 25

6 years ago
The patch doesn't fix the bug when the link is done that way: <a href=""><math>...</math></a>. However, it does fix cases such as <math href="">...</math>, <math>...<mrow href="">...</mrow>  ...</math> (and similarly for xlink:href) which are the appropriate way to do links in MathML.
(Reporter)

Comment 26

6 years ago
I have updated the reference page to HTML5
https://eyeasme.com/Joe/MathML/MathML_text_decoration_bug

The problem is that I place the MathML code into my HTML5 
pages with PHP includes.  MathML is very verbose, it is easier
to work with several smaller files automatically included into
one large file, rather than one huge file.  It is easy to create
the MathML code and them just use the PHP include command to 
embed the code within any link tag 'a'.

As noted in Comment #25 and shown in the reference page this 
does not work.

Should a new bug be filed for the case of a math tag within
link tab or this bug re-opened?
(Reporter)

Comment 27

6 years ago
Also note that once a linked MathML formula has been visited 
the blue "never been visited" and purple "visited" link colors 
get screwed up and only part of the formula has the purple 
"been visited" color.  

Should this be a new bug or a continuation of this bug?
(Assignee)

Comment 28

6 years ago
> Should a new bug be filed for the case of a math tag within
> link tab or this bug re-opened?

Please open a separate bug for that. Also, note that it is not specific to links, for example it also happens with <u> (see attachment 502338 [details]).
(Assignee)

Comment 29

6 years ago
(In reply to comment #27)
> Also note that once a linked MathML formula has been visited 
> the blue "never been visited" and purple "visited" link colors 
> get screwed up and only part of the formula has the purple 
> "been visited" color.  
> 
> Should this be a new bug or a continuation of this bug?

A new bug, please. I think it only happens with <mo>'s, which are drawn differently because of there stretchiness property.
(Assignee)

Updated

6 years ago
Assignee: nobody → fred.wang
You need to log in before you can comment on or make changes to this bug.