Closed Bug 1907425 Opened 8 months ago Closed 8 months ago

MathML attributes cannot be added in the DevTools DOM tree

Categories

(DevTools :: Inspector, defect)

Firefox 130
defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: vmakeev, Unassigned)

References

Details

Attachments

(1 file)

Attached file math.html

What were you doing?

  1. Open any HTML document containing MathML (see math.html attached)
  2. Open DevTools, find the <math> element
  3. Add display="block" attribute

What happened?

Attribute could not be added.

What should have happened?

Attribute should be added.

Anything else we should know?

  • Running document.querySelector('math').setAttribute('display', 'block') in the console adds the attribute.
  • Adding foo="bar" attribute to the <body> has the same effect: it could not be added.
  • The same applies to the <annotation> element: you can’t add the encoding attribute.
  • If an attribute is present, you can remove it but can’t add it back.
  • You can add attributes in Chrome DevTools, but cannot in Safari DevTools.

Vadim, how are you adding the attribute?
If I use the context menu Attributes > Add attribute, and enter display=block, everything works fine.
Could it be that you double-clicked on math ? Because this is handled as "tagname change", and so we end up with a math display=block tagname, which is invalid, and we revert back to math. This would explain the issue you are seeing on the body element as well.
Now, I agree this is not intuitive and we should try to parse the attributes added that way, which we already have a bug for (Bug 1173057)

Component: DOM → Inspector
Flags: needinfo?(vmakeev)

Oh, I see. You’re right. It’s not MathML-specific in Firefox’s case. It seems like it’s the same behavior in Safari’s case.

The quickest way to add/remove an attribute is to double-click the tag name. I have never used the context menu method. It’s too far away. :) I learned this behavior from Chrome DevTools and expect it everywhere. And it kind of makes sense.

The UI doesn’t differentiate between two cases: when you double-click the attribute to modify/remove it and when you double-click the tag name. Since there’s a clear space between the tag name and whatever I’m typing, I expect it to be parsed as an attribute.

Flags: needinfo?(vmakeev)
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → INVALID
See Also: → 1173057
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: