auto merge of #2087 : Ms2ger/servo/vtable2, r=jdm

Fixes #1527. Does *not* include the code for #1528.

(Originally by @jdm in #1688 and #1866.)
This commit is contained in:
bors-servo 2014-04-11 16:31:14 -04:00
commit 9d2a6b7824
9 changed files with 274 additions and 148 deletions

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLElementBinding;
use dom::bindings::codegen::InheritTypes::ElementCast;
use dom::bindings::codegen::InheritTypes::HTMLElementDerived;
use dom::bindings::js::JS;
use dom::bindings::error::{ErrorResult, Fallible};
@ -10,6 +11,7 @@ use dom::document::Document;
use dom::element::{Element, ElementTypeId, HTMLElementTypeId};
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
use dom::node::{Node, ElementNodeTypeId};
use dom::virtualmethods::VirtualMethods;
use js::jsapi::JSContext;
use js::jsval::{JSVal, NullValue};
use servo_util::namespace;
@ -161,3 +163,10 @@ impl HTMLElement {
0
}
}
impl VirtualMethods for JS<HTMLElement> {
fn super_type(&self) -> Option<~VirtualMethods:> {
let element: JS<Element> = ElementCast::from(self);
Some(~element as ~VirtualMethods:)
}
}