add SVGElement, SVGGraphicsElement interfaces and SVGSVGElement element

This commit is contained in:
Alexandrov Sergey 2016-10-05 00:16:45 +03:00
parent 318b23ed00
commit 9876020c22
13 changed files with 355 additions and 13 deletions

View file

@ -7,6 +7,8 @@ use dom::bindings::inheritance::Castable;
use dom::bindings::inheritance::ElementTypeId;
use dom::bindings::inheritance::HTMLElementTypeId;
use dom::bindings::inheritance::NodeTypeId;
use dom::bindings::inheritance::SVGElementTypeId;
use dom::bindings::inheritance::SVGGraphicsElementTypeId;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{AttributeMutation, Element};
@ -47,6 +49,7 @@ use dom::htmltemplateelement::HTMLTemplateElement;
use dom::htmltextareaelement::HTMLTextAreaElement;
use dom::htmltitleelement::HTMLTitleElement;
use dom::node::{ChildrenMutation, CloneChildrenFlag, Node, UnbindContext};
use dom::svgsvgelement::SVGSVGElement;
use string_cache::Atom;
use style::attr::AttrValue;
@ -231,6 +234,11 @@ pub fn vtable_for(node: &Node) -> &VirtualMethods {
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTitleElement)) => {
node.downcast::<HTMLTitleElement>().unwrap() as &VirtualMethods
}
NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement(
SVGGraphicsElementTypeId::SVGSVGElement
))) => {
node.downcast::<SVGSVGElement>().unwrap() as &VirtualMethods
}
NodeTypeId::Element(ElementTypeId::Element) => {
node.downcast::<Element>().unwrap() as &VirtualMethods
}