Resolves: rhbz#1096747 crash/hang on format-page on html document

Change-Id: I9a989620375eb210e553b84b7a642a0360c8f03f