Skip to content

Commit

Permalink
Fix insert-adjacent error
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 23, 2016
1 parent 0fb5d63 commit fc88f81
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 73 deletions.
4 changes: 2 additions & 2 deletions components/script/dom/element.rs
Expand Up @@ -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(|_| ())
}
}

Expand Down
8 changes: 0 additions & 8 deletions tests/wpt/metadata/domparsing/insert-adjacent.html.ini

This file was deleted.

32 changes: 0 additions & 32 deletions tests/wpt/metadata/domparsing/insert_adjacent_html.html.ini

This file was deleted.

30 changes: 0 additions & 30 deletions tests/wpt/metadata/domparsing/insert_adjacent_html.xhtml.ini
@@ -1,35 +1,5 @@
[insert_adjacent_html.xhtml]
type: testharness
[beforeBegin content without next sibling]
expected: FAIL

[afterend content without next sibling]
expected: FAIL

[beforeBegin content again, with next sibling]
expected: FAIL

[afterend content again, with next sibling]
expected: FAIL

[beforeBegin child node not in tree but has parent]
expected: FAIL

[afterend child node not in tree but has parent]
expected: FAIL

[beforeBegin content2 without next sibling]
expected: FAIL

[afterend content2 without next sibling]
expected: FAIL

[beforeBegin content2 test again, now that there's a next sibling]
expected: FAIL
[afterend content2 test again, now that there's a next sibling]
expected: FAIL

[insertAdjacentHTML in HTML]
expected: FAIL

2 changes: 1 addition & 1 deletion tests/wpt/mozilla/meta/mozilla/sigsegv.html.ini
@@ -1,4 +1,4 @@
[sigsegv.html]
type: testharness
prefs: [dom.testbinding.enabled:true,dom.testable_crash.enabled:true]
prefs: [dom.testbinding.enabled:true, dom.testable_crash.enabled:true]
expected: CRASH

0 comments on commit fc88f81

Please sign in to comment.