The inner rim on the cockpit also has to be of specific dimensions, must be removable in 1 piece and can't contain any structural parts. 14.6.1 also mentions:
14.6.1 wrote:are covered, in all areas where the driver’s head is likely to make contact, with two plies of Aramid fibre/epoxy resin composite pre-preg material in plain weave 60gsm fabric with a cured resin content of 50% (+/-5%) by weight ;
which is probably what makes it look the way it looks now.
14.6.5 uses the word "foam", and there is a list of allowed materials:
14.6.5 wrote:All of the padding described above must be so installed that if movement of the driver's head, in any expected trajectory during an accident, were to compress the foam fully at any point,
14.6.1 wrote:are made from a material which is suitable for the relevant ambient air temperature, details of approved materials and the temperature bands in which they should be used may be found in the Appendix to these regulations ;
Unfortunately, the pdf on the FIA page doesn't contain the appendices that specify the types of material that can be used, so I can't say whether the loophole you're looking for is there.