Bug 49655: Fix selective serialization when reusing cached HTML

This fixes round-trip issues on [[en:Bleak House]] and others.

Change-Id: I6c047ac01bb99c8cd793fbd01db5777f560f492b
Merge "Bug 49655: Fix selective serialization when reusing cached HTML"