Ensure id attributes on elements only affect elements present in a document.
auto merge of #1710 : jdm/servo/idmap-in-doc, r=Ms2ger

...ent.