To make snaks of any kind identifiable in the DOM, we should add their IDs / hashes to the HTML, as classes (not as element id: one snak can appear several times in the same entity). This is required for T168532: Check constraints on qualifiers and references.
This slightly increases the page size, but not excessively: even for large entities, the increase is only slightly above 5%, and typical entities seem to grow by 1-3% (see gist).