Give attribute-change callbacks a realm so they can to_jsval

This commit is contained in:
Patrick Shaughnessy 2020-02-12 10:54:33 -05:00
parent 419954474b
commit ea4c709e96
2 changed files with 7 additions and 1 deletions

View file

@ -897,6 +897,10 @@ impl CustomElementReactionStack {
}
let cx = element.global().get_cx();
// We might be here during HTML parsing, rather than
// during Javscript execution, and so we typically aren't
// already in a realm here.
let _ac = JSAutoRealm::new(*cx, element.global().reflector().get_jsobject().get());
let local_name = DOMString::from(&*local_name);
rooted!(in(*cx) let mut name_value = UndefinedValue());