Mobs which hitboxes overlap glass blocks will not take damage.
Repro:
1. Encapsulate a 2x2x1 empty space with glass.
2. Spawn a horse in the empty space.
3. Notice that the horse will not take any damage.
Related issues
Attachments
Comments

[media]

WAI as of MC-46765 MC-139394 MC-146432
Players use it to make hostile mobs displays.
Proposed fix (MC suggestion): Make hollowed glass - waterloggable, can hold mobs like composter or fixed-grid 4 glass panes.
Leaves should not suffocate. There was a test to make leaves suffocating, but riding through forest was too painful then, so it was reverted.