Bug 1037446 - [rule view] Adding new rules fails when document.head is undefined. r=harth