Skip to content

Commit

Permalink
Give attribute-change callbacks a realm so they can to_jsval
Browse files Browse the repository at this point in the history
  • Loading branch information
pshaughn committed Feb 12, 2020
1 parent 4199544 commit ea4c709
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions components/script/dom/customelementregistry.rs
Expand Up @@ -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());
Expand Down
@@ -1,2 +1,4 @@
[parser-sets-attributes-and-children.html]
expected: CRASH
[HTML parser should call connectedCallback before appending child nodes.]
expected: FAIL

0 comments on commit ea4c709

Please sign in to comment.