Update rootParagraphElement patch to manipulate DOM directly