Duplicate IDs: can they be helped? #11529
Labels
idle
involves: Content
Requires the attention of the Content team.
macros
tracking issues related to kumascript macros
needs discussion
p3
We don't have visibility when this will be addressed.
Summary
Sometimes, content generated by macros can have IDs that duplicate with what's already on the page. This makes the HTML invalid. I'm not sure if it can be helped, but just want to discuss because they are discovered by my checker.
URL
I have discovered 15 cases of duplicate IDs:
Reproduction steps
Go to one of the pages above, such as https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Page_structures/Live_samples, and in the console type
document.querySelectorAll("#frame_iframe_size")
. See that the list contains more than one item.Expected behavior
IDs are globally unique
Actual behavior
IDs are not globally unique.
The reports can be divided into several cases:
EmbedLiveSample
s that use the same ID. I'm not sure why the iframe needs an ID at all; maybe we can just remove it. Otherwise we should have a parameter that sets the ID for the iframe.offset-path
is both adl
item and a formal syntax symbol.<calc-sum>
appears twice in the syntax. On https://developer.mozilla.org/en-US/docs/Web/CSS/offset,<offset-path>
appears twice, and with different expansions. Maybe it's pulling from multiple specs.I think, in general, we may be able to fix this by post-processing the HTML file and adding suffixes if IDs collide, but just want to bring it to your attention for discussion.
Device
Desktop
Browser
Chrome
Browser version
Stable
Operating system
Mac OS
Screenshot
No response
Anything else?
#5913 is a similar issue but not duplicate. I don't actually care about the final rendered MDN page; I only care about the content HTML, so if there are duplicate IDs in the site layout I won't report them.
Validations
The text was updated successfully, but these errors were encountered: