I propose we cover these two cases with unit tests first (both in the case of media queries): That a new head element gets added if there is none, and that an existing head element is kept (e.g., the title element still is there).