/*
 * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

module html {

    interface [
        GenerateNativeConverter
    ] HTMLTableSectionElement : HTMLElement {
        attribute [Reflect] DOMString align;
        attribute [Reflect=char] DOMString ch;
        attribute [Reflect=charoff] DOMString chOff;
        attribute [Reflect] DOMString vAlign;
        readonly attribute HTMLCollection rows;
        HTMLElement insertRow(in long index) raises(DOMException);
        void deleteRow(in long index) raises(DOMException);
    };

}
