This is follow-up to #2982:
...I saw $content_attributes being printed right after the classes, and I wondered if that variable could also contain additional classes. In that case, shouldn't we be merging those classes, or is it done automagically?
I have tried figuring out what $content_attributes may contain and where it comes from, but it is not documented (hence my search and the d.org issues I came across).
Respective issues for this in d.org https://www.drupal.org/project/drupal/issues/2332087 / https://www.drupal.org/node/569362
PR by @klonos (rip-off of @drupol's D7 backport patch 😄): ...