MathML attributes cannot be added in the DevTools DOM tree
Categories
(DevTools :: Inspector, defect)
Tracking
(Not tracked)
People
(Reporter: vmakeev, Unassigned)
References
Details
Attachments
(1 file)
405 bytes,
text/html
|
Details |
What were you doing?
- Open any HTML document containing MathML (see math.html attached)
- Open DevTools, find the
<math>
element - 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 theencoding
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.
Comment 1•8 months ago
|
||
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)
Reporter | ||
Comment 2•8 months ago
|
||
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.
Reporter | ||
Updated•8 months ago
|
Description
•