Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contextmenu / draggable #133

Open
fred-wang opened this issue Feb 22, 2019 · 9 comments
Open

contextmenu / draggable #133

fred-wang opened this issue Feb 22, 2019 · 9 comments

Comments

@fred-wang
Copy link
Contributor

Originally reported at https://gitlab.com/mathml/MathMLinHTML5/issues/7

Created by: Yaffle
Any chance to have support for these attributes for MathML elements on web page?

Created by: fred-wang
Note that http://www.mathml-association.org/MathMLinHTML5/ is an implementation note for a core subset of MathML in HTML5, not a standard specification. If these attributes are allowed by the HTML5 & MathML W3C specifications and if there is a strong use case for them, then they could be added. But probably that would be in later versions since we want to implement the core subset in web engines first.

Created by: Yaffle
tabIndex, focus and blur were added to SVG elements, not good that this addition occurred not on the Element interface.
A hack can be used to make an element focusable+draggable in Firefox - <mrow href="#">, but this is still a hack and no way to call element.focus().
@fred-wang
Copy link
Contributor Author

See also #129 for the general issue.

@fred-wang fred-wang changed the title contextmenu / draggable / tabindex contextmenu / draggable Sep 15, 2019
@fred-wang
Copy link
Contributor Author

tabindex is now supported, so changing title

@Yaffle
Copy link

Yaffle commented Oct 13, 2019

In Chrome it is possible to make a MathML element draggable using:

[draggable="true"] {
  -webkit-user-drag: element;
  user-select: none;
}

Of course, it should not be used, as -webkit-user-drag is a non-standard property.

@NSoiffer
Copy link
Contributor

Unless I'm missing something, it doesn't make sense for a MathML element to be dragable in general because some elements need to live in certain contexts (e.g, a table row needs to live in a table and all elements need to live inside of a math element. Other cases can be problems too. E.g, dragging a numerator elsewhere leaves a fraction element with too few children, and the repair mechanism would cause the denominator to become the numerator, which is probably not intended.

It would be possible to describe situations where drag and drop is legal/sensible, but I don't think the effort is worth the benefit. Editing a MathML expression is best left to MathML editors IMHO.

@Yaffle
Copy link

Yaffle commented Oct 13, 2019

@NSoiffer , the draggable attribute does not do the removal of the element by itself, the JavaScript should handle dragstart event.

@fred-wang
Copy link
Contributor Author

@fred-wang
Copy link
Contributor Author

cc @bkardell

@Yaffle
Copy link

Yaffle commented Nov 27, 2019

Both of them,
An example can be found at https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contextmenu .

Well, right not, it is only supported in Firefox and not sure if it is useful (may be, I could collect info how many users use it). So, the support is not so much important right now. And it was deprecated in HTML spec, where it was defined on all elements....
Firefox supports "contextmenu" attribute on MathML elements, but does not fire "oncontextmenu" event (which is useful when you need to adjust or "setup" the menu for the specific element if you are sharing the same <menu> element..., but the event is easy to polyfill (just listen on the document))

@davidcarlisle davidcarlisle transferred this issue from w3c/mathml Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants