First: do not do this.
Browsers are very tolerant when it comes to parsing HTML, so firefox has a valid DOM in your case. Having multiple html, body, and head tags does not affect page parsing performance. But keep in mind that the browser will work in quirks mode and affect the rendering of any of your elements.
In any case, this is completely contrary to any standards, and you should avoid creating such pages. Some browsers may reject the display of any of your site. These may be some browsers that you did not even think about, a text browser or a lightweight browser on an older mobile phone, for example.
source share