mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Auto merge of #11832 - GuillaumeGomez:insert-adjacent, r=nox
Fix insert-adjacent error r? @nox <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11832) <!-- Reviewable:end -->
This commit is contained in:
commit
32f2ab7088
5 changed files with 3 additions and 73 deletions
|
@ -2069,14 +2069,14 @@ impl ElementMethods for Element {
|
|||
let context = match context.downcast::<Element>() {
|
||||
Some(elem) if elem.local_name() != &atom!("html") ||
|
||||
!elem.html_element_in_html_document() => Root::from_ref(elem),
|
||||
_ => Root::upcast(HTMLBodyElement::new(atom!("body"), None, &*context.owner_doc()))
|
||||
_ => Root::upcast(HTMLBodyElement::new(atom!("body"), None, &*context.owner_doc())),
|
||||
};
|
||||
|
||||
// Step 3.
|
||||
let fragment = try!(context.upcast::<Node>().parse_fragment(text));
|
||||
|
||||
// Step 4.
|
||||
context.insert_adjacent(position, fragment.upcast()).map(|_| ())
|
||||
self.insert_adjacent(position, fragment.upcast()).map(|_| ())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue