diff options
Diffstat (limited to 'src/components/script/dom/virtualmethods.rs')
-rw-r--r-- | src/components/script/dom/virtualmethods.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/components/script/dom/virtualmethods.rs b/src/components/script/dom/virtualmethods.rs index aafe3efe4f4..b32af5139da 100644 --- a/src/components/script/dom/virtualmethods.rs +++ b/src/components/script/dom/virtualmethods.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use dom::attr::{AttrValue, StringAttrValue}; use dom::bindings::codegen::InheritTypes::ElementCast; use dom::bindings::codegen::InheritTypes::HTMLAnchorElementCast; use dom::bindings::codegen::InheritTypes::HTMLBodyElementCast; @@ -50,6 +51,15 @@ pub trait VirtualMethods { } } + /// Returns the right AttrValue variant for the attribute with name `name` + /// on this element. + fn parse_plain_attribute(&self, name: &str, value: DOMString) -> AttrValue { + match self.super_type() { + Some(ref s) => s.parse_plain_attribute(name, value), + _ => StringAttrValue(value), + } + } + /// Called when a Node is appended to a tree that is part of a Document. fn bind_to_tree(&self) { match self.super_type() { |