/* This Source Code Form is subject to the terms of the Mozilla Public * 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::bindings::codegen::HTMLFieldSetElementBinding; use dom::bindings::utils::ErrorResult; use dom::document::AbstractDocument; use dom::element::HTMLFieldSetElementTypeId; use dom::htmlcollection::HTMLCollection; use dom::htmlelement::HTMLElement; use dom::node::{AbstractNode, Node}; use dom::validitystate::ValidityState; use servo_util::str::DOMString; pub struct HTMLFieldSetElement { htmlelement: HTMLElement } impl HTMLFieldSetElement { pub fn new_inherited(localName: DOMString, document: AbstractDocument) -> HTMLFieldSetElement { HTMLFieldSetElement { htmlelement: HTMLElement::new_inherited(HTMLFieldSetElementTypeId, localName, document) } } pub fn new(localName: DOMString, document: AbstractDocument) -> AbstractNode { let element = HTMLFieldSetElement::new_inherited(localName, document); Node::reflect_node(@mut element, document, HTMLFieldSetElementBinding::Wrap) } } impl HTMLFieldSetElement { pub fn Disabled(&self) -> bool { false } pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult { Ok(()) } pub fn GetForm(&self) -> Option { None } pub fn Name(&self) -> DOMString { ~"" } pub fn SetName(&mut self, _name: DOMString) -> ErrorResult { Ok(()) } pub fn Type(&self) -> DOMString { ~"" } pub fn Elements(&self) -> @mut HTMLCollection { let window = self.htmlelement.element.node.owner_doc().document().window; HTMLCollection::new(window, ~[]) } pub fn WillValidate(&self) -> bool { false } pub fn Validity(&self) -> @mut ValidityState { let global = self.htmlelement.element.node.owner_doc().document().window; ValidityState::new(global) } pub fn ValidationMessage(&self) -> DOMString { ~"" } pub fn CheckValidity(&self) -> bool { false } pub fn SetCustomValidity(&mut self, _error: DOMString) { } }