<commit_before>/* 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::BindingDeclarations::HTMLTableElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTableElementDerived;
use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult;
use dom::document::Document;
use dom::element::HTMLTableElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
use dom::htmlelement::HTMLElement;
use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;

#[deriving(Encodable)]
pub struct HTMLTableElement {
    pub htmlelement: HTMLElement,
}

impl HTMLTableElementDerived for EventTarget {
    fn is_htmltableelement(&self) -> bool {
        self.type_id == NodeTargetTypeId(ElementNodeTypeId(HTMLTableElementTypeId))
    }
}

impl HTMLTableElement {
    pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTableElement {
        HTMLTableElement {
            htmlelement: HTMLElement::new_inherited(HTMLTableElementTypeId, localName, document)
        }
    }

    pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableElement> {
        let element = HTMLTableElement::new_inherited(localName, document);
        Node::reflect_node(box element, document, HTMLTableElementBinding::Wrap)
    }
}

pub trait HTMLTableElementMethods {
    fn DeleteCaption(&self);
    fn DeleteTHead(&self);
    fn DeleteTFoot(&self);
    fn DeleteRow(&mut self, _index: i32) -> ErrorResult;
    fn Sortable(&self) -> bool;
    fn SetSortable(&self, _sortable: bool);
    fn StopSorting(&self);
    fn Align(&self) -> DOMString;
    fn SetAlign(&self, _align: DOMString) -> ErrorResult;
    fn Border(&self) -> DOMString;
    fn SetBorder(&self, _border: DOMString) -> ErrorResult;
    fn Frame(&self) -> DOMString;
    fn SetFrame(&self, _frame: DOMString) -> ErrorResult;
    fn Rules(&self) -> DOMString;
    fn SetRules(&self, _rules: DOMString) -> ErrorResult;
    fn Summary(&self) -> DOMString;
    fn SetSummary(&self, _summary: DOMString) -> ErrorResult;
    fn Width(&self) -> DOMString;
    fn SetWidth(&self, _width: DOMString) -> ErrorResult;
    fn BgColor(&self) -> DOMString;
    fn SetBgColor(&self, _bg_color: DOMString) -> ErrorResult;
    fn CellPadding(&self) -> DOMString;
    fn SetCellPadding(&self, _cell_padding: DOMString) -> ErrorResult;
    fn CellSpacing(&self) -> DOMString;
    fn SetCellSpacing(&self, _cell_spacing: DOMString) -> ErrorResult;
}

impl<'a> HTMLTableElementMethods for JSRef<'a, HTMLTableElement> {
    fn DeleteCaption(&self) {
    }

    fn DeleteTHead(&self) {
    }

    fn DeleteTFoot(&self) {
    }

    fn DeleteRow(&mut self, _index: i32) -> ErrorResult {<commit_msg>Remove needless '&mut self' from HTMLTableElementMethods.<commit_after>/* 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::BindingDeclarations::HTMLTableElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTableElementDerived;
use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult;
use dom::document::Document;
use dom::element::HTMLTableElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
use dom::htmlelement::HTMLElement;
use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;

#[deriving(Encodable)]
pub struct HTMLTableElement {
    pub htmlelement: HTMLElement,
}

impl HTMLTableElementDerived for EventTarget {
    fn is_htmltableelement(&self) -> bool {
        self.type_id == NodeTargetTypeId(ElementNodeTypeId(HTMLTableElementTypeId))
    }
}

impl HTMLTableElement {
    pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTableElement {
        HTMLTableElement {
            htmlelement: HTMLElement::new_inherited(HTMLTableElementTypeId, localName, document)
        }
    }

    pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableElement> {
        let element = HTMLTableElement::new_inherited(localName, document);
        Node::reflect_node(box element, document, HTMLTableElementBinding::Wrap)
    }
}

pub trait HTMLTableElementMethods {
    fn DeleteCaption(&self);
    fn DeleteTHead(&self);
    fn DeleteTFoot(&self);
    fn DeleteRow(&self, _index: i32) -> ErrorResult;
    fn Sortable(&self) -> bool;
    fn SetSortable(&self, _sortable: bool);
    fn StopSorting(&self);
    fn Align(&self) -> DOMString;
    fn SetAlign(&self, _align: DOMString) -> ErrorResult;
    fn Border(&self) -> DOMString;
    fn SetBorder(&self, _border: DOMString) -> ErrorResult;
    fn Frame(&self) -> DOMString;
    fn SetFrame(&self, _frame: DOMString) -> ErrorResult;
    fn Rules(&self) -> DOMString;
    fn SetRules(&self, _rules: DOMString) -> ErrorResult;
    fn Summary(&self) -> DOMString;
    fn SetSummary(&self, _summary: DOMString) -> ErrorResult;
    fn Width(&self) -> DOMString;
    fn SetWidth(&self, _width: DOMString) -> ErrorResult;
    fn BgColor(&self) -> DOMString;
    fn SetBgColor(&self, _bg_color: DOMString) -> ErrorResult;
    fn CellPadding(&self) -> DOMString;
    fn SetCellPadding(&self, _cell_padding: DOMString) -> ErrorResult;
    fn CellSpacing(&self) -> DOMString;
    fn SetCellSpacing(&self, _cell_spacing: DOMString) -> ErrorResult;
}

impl<'a> HTMLTableElementMethods for JSRef<'a, HTMLTableElement> {
    fn DeleteCaption(&self) {
    }

    fn DeleteTHead(&self) {
    }

    fn DeleteTFoot(&self) {
    }

    fn DeleteRow(&self, _index: i32) -> ErrorResult {
{'fraction_non_alphanumeric': 0.12667814113597245, 'fraction_numerical': 0.002753872633390706, 'mean_word_length': 4.49763481551561, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7311685', 'n_tokens_mistral': 1813, 'n_tokens_neox': 1804, 'n_words': 435}