Always assert that it's safe to modify the DOM before doing so. Fixes #1224.
auto merge of #1252 : jdm/servo/layoutassert, r=kmcallister

...224.