Fix panic when called on root node, and update test expectations.

The three tests that are marked as failures are because they use offsetWidth as a dummy to force a layout flush. Now that these exist, they expose an unrelated bug with reflow.
This commit is contained in:
Glenn Watson 2015-08-03 11:29:48 +10:00
parent 9e5687e3e7
commit 39972a174e
5 changed files with 11 additions and 7 deletions

View file

@ -839,8 +839,8 @@ impl<'a> WindowHelpers for &'a Window {
Some(parent_node_address) => {
let node = from_untrusted_node_address(js_runtime.rt(),
parent_node_address);
let element = ElementCast::to_ref(node.r()).unwrap();
Some(Root::from_ref(element))
let element = ElementCast::to_ref(node.r());
element.map(Root::from_ref)
}
None => {
None

View file

@ -0,0 +1,3 @@
[first-letter-dynamic-003a.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[first-letter-dynamic-003b.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[run-in-basic-017.htm]
type: reftest
expected: FAIL

View file

@ -1,5 +0,0 @@
[input-type-button.html]
type: testharness
[label value]
expected: FAIL