Safari internal error with Facelets

We had an experience with Safari and Facelets that I thought is nice to share. Using facelet templates, we usually use two tags to define and design the layout: ui:insert and ui:include. The point is that the first one includes the “rendered” output of the inserted template while the second one includes it before rendering. It is typical that a doctype declaration is present at the first line of each XHTML template in facelet. But, in the case ui:include there must no such doctype declaration since it is already defined in the parent template. Firefox does not complain about this but Safari does leading to an internal error message.