Ensure that it's safe to modify the DOM node pointers before doing so. Fixes #1224.
Add forgotten test for Element.attributes.
auto merge of #1252 : jdm/servo/layoutassert, r=metajack

...224.