File indexing completed on 2024-04-28 15:23:03

0001 /**
0002  * This file is part of the DOM implementation for KDE.
0003  *
0004  * Copyright 1999 Lars Knoll (knoll@kde.org)
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public License
0017  * along with this library; see the file COPYING.LIB.  If not, write to
0018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0019  * Boston, MA 02110-1301, USA.
0020  *
0021  */
0022 // --------------------------------------------------------------------------
0023 
0024 #include "html_table.h"
0025 #include "html_misc.h"
0026 #include "dom_exception.h"
0027 
0028 #include <html/html_miscimpl.h>
0029 #include <html/html_tableimpl.h>
0030 
0031 using namespace DOM;
0032 
0033 HTMLTableCaptionElement::HTMLTableCaptionElement() : HTMLElement()
0034 {
0035 }
0036 
0037 HTMLTableCaptionElement::HTMLTableCaptionElement(const HTMLTableCaptionElement &other) : HTMLElement(other)
0038 {
0039 }
0040 
0041 HTMLTableCaptionElement::HTMLTableCaptionElement(HTMLTableCaptionElementImpl *impl) : HTMLElement(impl)
0042 {
0043 }
0044 
0045 HTMLTableCaptionElement &HTMLTableCaptionElement::operator = (const Node &other)
0046 {
0047     assignOther(other, ID_CAPTION);
0048     return *this;
0049 }
0050 
0051 HTMLTableCaptionElement &HTMLTableCaptionElement::operator = (const HTMLTableCaptionElement &other)
0052 {
0053     HTMLElement::operator = (other);
0054     return *this;
0055 }
0056 
0057 HTMLTableCaptionElement::~HTMLTableCaptionElement()
0058 {
0059 }
0060 
0061 DOMString HTMLTableCaptionElement::align() const
0062 {
0063     if (!impl) {
0064         return DOMString();
0065     }
0066     return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
0067 }
0068 
0069 void HTMLTableCaptionElement::setAlign(const DOMString &value)
0070 {
0071     if (impl) {
0072         ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
0073     }
0074 }
0075 
0076 // --------------------------------------------------------------------------
0077 
0078 HTMLTableCellElement::HTMLTableCellElement() : HTMLElement()
0079 {
0080 }
0081 
0082 HTMLTableCellElement::HTMLTableCellElement(const HTMLTableCellElement &other) : HTMLElement(other)
0083 {
0084 }
0085 
0086 HTMLTableCellElement::HTMLTableCellElement(HTMLTableCellElementImpl *impl) : HTMLElement(impl)
0087 {
0088 }
0089 
0090 HTMLTableCellElement &HTMLTableCellElement::operator = (const Node &other)
0091 {
0092     if (other.elementId() != ID_TD &&
0093             other.elementId() != ID_TH) {
0094         if (impl) {
0095             impl->deref();
0096         }
0097         impl = nullptr;
0098     } else {
0099         Node::operator = (other);
0100     }
0101     return *this;
0102 }
0103 
0104 HTMLTableCellElement &HTMLTableCellElement::operator = (const HTMLTableCellElement &other)
0105 {
0106     HTMLElement::operator = (other);
0107     return *this;
0108 }
0109 
0110 HTMLTableCellElement::~HTMLTableCellElement()
0111 {
0112 }
0113 
0114 long HTMLTableCellElement::cellIndex() const
0115 {
0116     if (!impl) {
0117         return 0;
0118     }
0119     return ((HTMLTableCellElementImpl *)impl)->cellIndex();
0120 }
0121 
0122 void HTMLTableCellElement::setCellIndex(long /*_cellIndex*/)
0123 {
0124     throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
0125 }
0126 
0127 DOMString HTMLTableCellElement::abbr() const
0128 {
0129     if (!impl) {
0130         return DOMString();
0131     }
0132     return ((ElementImpl *)impl)->getAttribute(ATTR_ABBR);
0133 }
0134 
0135 void HTMLTableCellElement::setAbbr(const DOMString &value)
0136 {
0137     if (impl) {
0138         ((ElementImpl *)impl)->setAttribute(ATTR_ABBR, value);
0139     }
0140 }
0141 
0142 DOMString HTMLTableCellElement::align() const
0143 {
0144     if (!impl) {
0145         return DOMString();
0146     }
0147     return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
0148 }
0149 
0150 void HTMLTableCellElement::setAlign(const DOMString &value)
0151 {
0152     if (impl) {
0153         ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
0154     }
0155 }
0156 
0157 DOMString HTMLTableCellElement::axis() const
0158 {
0159     if (!impl) {
0160         return DOMString();
0161     }
0162     return ((ElementImpl *)impl)->getAttribute(ATTR_AXIS);
0163 }
0164 
0165 void HTMLTableCellElement::setAxis(const DOMString &value)
0166 {
0167     if (impl) {
0168         ((ElementImpl *)impl)->setAttribute(ATTR_AXIS, value);
0169     }
0170 }
0171 
0172 DOMString HTMLTableCellElement::bgColor() const
0173 {
0174     if (!impl) {
0175         return DOMString();
0176     }
0177     return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
0178 }
0179 
0180 void HTMLTableCellElement::setBgColor(const DOMString &value)
0181 {
0182     if (impl) {
0183         ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
0184     }
0185 }
0186 
0187 DOMString HTMLTableCellElement::ch() const
0188 {
0189     if (!impl) {
0190         return DOMString();
0191     }
0192     return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
0193 }
0194 
0195 void HTMLTableCellElement::setCh(const DOMString &value)
0196 {
0197     if (impl) {
0198         ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
0199     }
0200 }
0201 
0202 DOMString HTMLTableCellElement::chOff() const
0203 {
0204     if (!impl) {
0205         return DOMString();
0206     }
0207     return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
0208 }
0209 
0210 void HTMLTableCellElement::setChOff(const DOMString &value)
0211 {
0212     if (impl) {
0213         ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
0214     }
0215 }
0216 
0217 long HTMLTableCellElement::colSpan() const
0218 {
0219     if (!impl) {
0220         return 0;
0221     }
0222     return ((ElementImpl *)impl)->getAttribute(ATTR_COLSPAN).toInt();
0223 }
0224 
0225 void HTMLTableCellElement::setColSpan(long _colSpan)
0226 {
0227     if (impl) {
0228         DOMString value(QString::number(_colSpan));
0229         ((ElementImpl *)impl)->setAttribute(ATTR_COLSPAN, value);
0230     }
0231 }
0232 
0233 DOMString HTMLTableCellElement::headers() const
0234 {
0235     if (!impl) {
0236         return DOMString();
0237     }
0238     return ((ElementImpl *)impl)->getAttribute(ATTR_HEADERS);
0239 }
0240 
0241 void HTMLTableCellElement::setHeaders(const DOMString &value)
0242 {
0243     if (impl) {
0244         ((ElementImpl *)impl)->setAttribute(ATTR_HEADERS, value);
0245     }
0246 }
0247 
0248 DOMString HTMLTableCellElement::height() const
0249 {
0250     if (!impl) {
0251         return DOMString();
0252     }
0253     return ((ElementImpl *)impl)->getAttribute(ATTR_HEIGHT);
0254 }
0255 
0256 void HTMLTableCellElement::setHeight(const DOMString &value)
0257 {
0258     if (impl) {
0259         ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, value);
0260     }
0261 }
0262 
0263 bool HTMLTableCellElement::noWrap() const
0264 {
0265     if (!impl) {
0266         return false;
0267     }
0268     return !((ElementImpl *)impl)->getAttribute(ATTR_NOWRAP).isNull();
0269 }
0270 
0271 void HTMLTableCellElement::setNoWrap(bool _noWrap)
0272 {
0273     if (impl) {
0274         ((ElementImpl *)impl)->setAttribute(ATTR_NOWRAP, _noWrap ? "" : nullptr);
0275     }
0276 }
0277 
0278 long HTMLTableCellElement::rowSpan() const
0279 {
0280     if (!impl) {
0281         return 0;
0282     }
0283     return ((ElementImpl *)impl)->getAttribute(ATTR_ROWSPAN).toInt();
0284 }
0285 
0286 void HTMLTableCellElement::setRowSpan(long _rowSpan)
0287 {
0288     if (impl) {
0289         DOMString value(QString::number(_rowSpan));
0290         ((ElementImpl *)impl)->setAttribute(ATTR_ROWSPAN, value);
0291     }
0292 }
0293 
0294 DOMString HTMLTableCellElement::scope() const
0295 {
0296     if (!impl) {
0297         return DOMString();
0298     }
0299     return ((ElementImpl *)impl)->getAttribute(ATTR_SCOPE);
0300 }
0301 
0302 void HTMLTableCellElement::setScope(const DOMString &value)
0303 {
0304     if (impl) {
0305         ((ElementImpl *)impl)->setAttribute(ATTR_SCOPE, value);
0306     }
0307 }
0308 
0309 DOMString HTMLTableCellElement::vAlign() const
0310 {
0311     if (!impl) {
0312         return DOMString();
0313     }
0314     return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
0315 }
0316 
0317 void HTMLTableCellElement::setVAlign(const DOMString &value)
0318 {
0319     if (impl) {
0320         ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
0321     }
0322 }
0323 
0324 DOMString HTMLTableCellElement::width() const
0325 {
0326     if (!impl) {
0327         return DOMString();
0328     }
0329     return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
0330 }
0331 
0332 void HTMLTableCellElement::setWidth(const DOMString &value)
0333 {
0334     if (impl) {
0335         ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
0336     }
0337 }
0338 
0339 // --------------------------------------------------------------------------
0340 
0341 HTMLTableColElement::HTMLTableColElement() : HTMLElement()
0342 {
0343 }
0344 
0345 HTMLTableColElement::HTMLTableColElement(const HTMLTableColElement &other) : HTMLElement(other)
0346 {
0347 }
0348 
0349 HTMLTableColElement::HTMLTableColElement(HTMLTableColElementImpl *impl) : HTMLElement(impl)
0350 {
0351 }
0352 
0353 HTMLTableColElement &HTMLTableColElement::operator = (const Node &other)
0354 {
0355     if (other.elementId() != ID_COL &&
0356             other.elementId() != ID_COLGROUP) {
0357         if (impl) {
0358             impl->deref();
0359         }
0360         impl = nullptr;
0361     } else {
0362         Node::operator = (other);
0363     }
0364     return *this;
0365 }
0366 
0367 HTMLTableColElement &HTMLTableColElement::operator = (const HTMLTableColElement &other)
0368 {
0369     HTMLElement::operator = (other);
0370     return *this;
0371 }
0372 
0373 HTMLTableColElement::~HTMLTableColElement()
0374 {
0375 }
0376 
0377 DOMString HTMLTableColElement::align() const
0378 {
0379     if (!impl) {
0380         return DOMString();
0381     }
0382     return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
0383 }
0384 
0385 void HTMLTableColElement::setAlign(const DOMString &value)
0386 {
0387     if (impl) {
0388         ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
0389     }
0390 }
0391 
0392 DOMString HTMLTableColElement::ch() const
0393 {
0394     if (!impl) {
0395         return DOMString();
0396     }
0397     return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
0398 }
0399 
0400 void HTMLTableColElement::setCh(const DOMString &value)
0401 {
0402     if (impl) {
0403         ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
0404     }
0405 }
0406 
0407 DOMString HTMLTableColElement::chOff() const
0408 {
0409     if (!impl) {
0410         return DOMString();
0411     }
0412     return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
0413 }
0414 
0415 void HTMLTableColElement::setChOff(const DOMString &value)
0416 {
0417     if (impl) {
0418         ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
0419     }
0420 }
0421 
0422 long HTMLTableColElement::span() const
0423 {
0424     if (!impl) {
0425         return 0;
0426     }
0427     return ((ElementImpl *)impl)->getAttribute(ATTR_SPAN).toInt();
0428 }
0429 
0430 void HTMLTableColElement::setSpan(long _span)
0431 {
0432     if (impl) {
0433         DOMString value(QString::number(_span));
0434         ((ElementImpl *)impl)->setAttribute(ATTR_SPAN, value);
0435     }
0436 }
0437 
0438 DOMString HTMLTableColElement::vAlign() const
0439 {
0440     if (!impl) {
0441         return DOMString();
0442     }
0443     return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
0444 }
0445 
0446 void HTMLTableColElement::setVAlign(const DOMString &value)
0447 {
0448     if (impl) {
0449         ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
0450     }
0451 }
0452 
0453 DOMString HTMLTableColElement::width() const
0454 {
0455     if (!impl) {
0456         return DOMString();
0457     }
0458     return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
0459 }
0460 
0461 void HTMLTableColElement::setWidth(const DOMString &value)
0462 {
0463     if (impl) {
0464         ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
0465     }
0466 }
0467 
0468 // --------------------------------------------------------------------------
0469 
0470 HTMLTableElement::HTMLTableElement() : HTMLElement()
0471 {
0472 }
0473 
0474 HTMLTableElement::HTMLTableElement(const HTMLTableElement &other) : HTMLElement(other)
0475 {
0476 }
0477 
0478 HTMLTableElement::HTMLTableElement(HTMLTableElementImpl *impl) : HTMLElement(impl)
0479 {
0480 }
0481 
0482 HTMLTableElement &HTMLTableElement::operator = (const Node &other)
0483 {
0484     assignOther(other, ID_TABLE);
0485     return *this;
0486 }
0487 
0488 HTMLTableElement &HTMLTableElement::operator = (const HTMLTableElement &other)
0489 {
0490     HTMLElement::operator = (other);
0491     return *this;
0492 }
0493 
0494 HTMLTableElement::~HTMLTableElement()
0495 {
0496 }
0497 
0498 HTMLTableCaptionElement HTMLTableElement::caption() const
0499 {
0500     if (!impl) {
0501         return nullptr;
0502     }
0503     return ((HTMLTableElementImpl *)impl)->caption();
0504 }
0505 
0506 void HTMLTableElement::setCaption(const HTMLTableCaptionElement &_caption)
0507 {
0508     if (impl)
0509         ((HTMLTableElementImpl *)impl)
0510         ->setCaption(((HTMLTableCaptionElementImpl *)_caption.impl));
0511 }
0512 
0513 HTMLTableSectionElement HTMLTableElement::tHead() const
0514 {
0515     if (!impl) {
0516         return nullptr;
0517     }
0518     return ((HTMLTableElementImpl *)impl)->tHead();
0519 }
0520 
0521 void HTMLTableElement::setTHead(const HTMLTableSectionElement &_tHead)
0522 {
0523 
0524     if (impl)
0525         ((HTMLTableElementImpl *)impl)
0526         ->setTHead(((HTMLTableSectionElementImpl *)_tHead.impl));
0527 }
0528 
0529 HTMLTableSectionElement HTMLTableElement::tFoot() const
0530 {
0531     if (!impl) {
0532         return nullptr;
0533     }
0534     return ((HTMLTableElementImpl *)impl)->tFoot();
0535 }
0536 
0537 void HTMLTableElement::setTFoot(const HTMLTableSectionElement &_tFoot)
0538 {
0539 
0540     if (impl)
0541         ((HTMLTableElementImpl *)impl)
0542         ->setTFoot(((HTMLTableSectionElementImpl *)_tFoot.impl));
0543 }
0544 
0545 HTMLCollection HTMLTableElement::rows() const
0546 {
0547     if (!impl) {
0548         return HTMLCollection();
0549     }
0550     return HTMLCollection(impl, HTMLCollectionImpl::TABLE_ROWS);
0551 }
0552 
0553 HTMLCollection HTMLTableElement::tBodies() const
0554 {
0555     if (!impl) {
0556         return HTMLCollection();
0557     }
0558     return HTMLCollection(impl, HTMLCollectionImpl::TABLE_TBODIES);
0559 }
0560 
0561 DOMString HTMLTableElement::align() const
0562 {
0563     if (!impl) {
0564         return DOMString();
0565     }
0566     return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
0567 }
0568 
0569 void HTMLTableElement::setAlign(const DOMString &value)
0570 {
0571     if (impl) {
0572         ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
0573     }
0574 }
0575 
0576 DOMString HTMLTableElement::bgColor() const
0577 {
0578     if (!impl) {
0579         return DOMString();
0580     }
0581     return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
0582 }
0583 
0584 void HTMLTableElement::setBgColor(const DOMString &value)
0585 {
0586     if (impl) {
0587         ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
0588     }
0589 }
0590 
0591 DOMString HTMLTableElement::border() const
0592 {
0593     if (!impl) {
0594         return DOMString();
0595     }
0596     return ((ElementImpl *)impl)->getAttribute(ATTR_BORDER);
0597 }
0598 
0599 void HTMLTableElement::setBorder(const DOMString &value)
0600 {
0601     if (impl) {
0602         ((ElementImpl *)impl)->setAttribute(ATTR_BORDER, value);
0603     }
0604 }
0605 
0606 DOMString HTMLTableElement::cellPadding() const
0607 {
0608     if (!impl) {
0609         return DOMString();
0610     }
0611     return ((ElementImpl *)impl)->getAttribute(ATTR_CELLPADDING);
0612 }
0613 
0614 void HTMLTableElement::setCellPadding(const DOMString &value)
0615 {
0616     if (impl) {
0617         ((ElementImpl *)impl)->setAttribute(ATTR_CELLPADDING, value);
0618     }
0619 }
0620 
0621 DOMString HTMLTableElement::cellSpacing() const
0622 {
0623     if (!impl) {
0624         return DOMString();
0625     }
0626     return ((ElementImpl *)impl)->getAttribute(ATTR_CELLSPACING);
0627 }
0628 
0629 void HTMLTableElement::setCellSpacing(const DOMString &value)
0630 {
0631     if (impl) {
0632         ((ElementImpl *)impl)->setAttribute(ATTR_CELLSPACING, value);
0633     }
0634 }
0635 
0636 DOMString HTMLTableElement::frame() const
0637 {
0638     if (!impl) {
0639         return DOMString();
0640     }
0641     return ((ElementImpl *)impl)->getAttribute(ATTR_FRAME);
0642 }
0643 
0644 void HTMLTableElement::setFrame(const DOMString &value)
0645 {
0646     if (impl) {
0647         ((ElementImpl *)impl)->setAttribute(ATTR_FRAME, value);
0648     }
0649 }
0650 
0651 DOMString HTMLTableElement::rules() const
0652 {
0653     if (!impl) {
0654         return DOMString();
0655     }
0656     return ((ElementImpl *)impl)->getAttribute(ATTR_RULES);
0657 }
0658 
0659 void HTMLTableElement::setRules(const DOMString &value)
0660 {
0661     if (impl) {
0662         ((ElementImpl *)impl)->setAttribute(ATTR_RULES, value);
0663     }
0664 }
0665 
0666 DOMString HTMLTableElement::summary() const
0667 {
0668     if (!impl) {
0669         return DOMString();
0670     }
0671     return ((ElementImpl *)impl)->getAttribute(ATTR_SUMMARY);
0672 }
0673 
0674 void HTMLTableElement::setSummary(const DOMString &value)
0675 {
0676     if (impl) {
0677         ((ElementImpl *)impl)->setAttribute(ATTR_SUMMARY, value);
0678     }
0679 }
0680 
0681 DOMString HTMLTableElement::width() const
0682 {
0683     if (!impl) {
0684         return DOMString();
0685     }
0686     return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
0687 }
0688 
0689 void HTMLTableElement::setWidth(const DOMString &value)
0690 {
0691     if (impl) {
0692         ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
0693     }
0694 }
0695 
0696 HTMLElement HTMLTableElement::createTHead()
0697 {
0698     if (!impl) {
0699         return nullptr;
0700     }
0701     return ((HTMLTableElementImpl *)impl)->createTHead();
0702 }
0703 
0704 void HTMLTableElement::deleteTHead()
0705 {
0706     if (impl) {
0707         ((HTMLTableElementImpl *)impl)->deleteTHead();
0708     }
0709 }
0710 
0711 HTMLElement HTMLTableElement::createTFoot()
0712 {
0713     if (!impl) {
0714         return nullptr;
0715     }
0716     return ((HTMLTableElementImpl *)impl)->createTFoot();
0717 }
0718 
0719 void HTMLTableElement::deleteTFoot()
0720 {
0721     if (impl) {
0722         ((HTMLTableElementImpl *)impl)->deleteTFoot();
0723     }
0724 }
0725 
0726 HTMLElement HTMLTableElement::createCaption()
0727 {
0728     if (!impl) {
0729         return nullptr;
0730     }
0731     return ((HTMLTableElementImpl *)impl)->createCaption();
0732 }
0733 
0734 void HTMLTableElement::deleteCaption()
0735 {
0736     if (impl) {
0737         ((HTMLTableElementImpl *)impl)->deleteCaption();
0738     }
0739 }
0740 
0741 HTMLElement HTMLTableElement::insertRow(long index)
0742 {
0743     if (!impl) {
0744         return nullptr;
0745     }
0746     int exceptioncode = 0;
0747     HTMLElementImpl *ret = ((HTMLTableElementImpl *)impl)->insertRow(index, exceptioncode);
0748     if (exceptioncode) {
0749         throw DOMException(exceptioncode);
0750     }
0751     return ret;
0752 }
0753 
0754 void HTMLTableElement::deleteRow(long index)
0755 {
0756     int exceptioncode = 0;
0757     if (impl) {
0758         ((HTMLTableElementImpl *)impl)->deleteRow(index, exceptioncode);
0759     }
0760     if (exceptioncode) {
0761         throw DOMException(exceptioncode);
0762     }
0763 }
0764 
0765 // --------------------------------------------------------------------------
0766 
0767 HTMLTableRowElement::HTMLTableRowElement() : HTMLElement()
0768 {
0769 }
0770 
0771 HTMLTableRowElement::HTMLTableRowElement(const HTMLTableRowElement &other) : HTMLElement(other)
0772 {
0773 }
0774 
0775 HTMLTableRowElement::HTMLTableRowElement(HTMLTableRowElementImpl *impl) : HTMLElement(impl)
0776 {
0777 }
0778 
0779 HTMLTableRowElement &HTMLTableRowElement::operator = (const Node &other)
0780 {
0781     assignOther(other, ID_TR);
0782     return *this;
0783 }
0784 
0785 HTMLTableRowElement &HTMLTableRowElement::operator = (const HTMLTableRowElement &other)
0786 {
0787     HTMLElement::operator = (other);
0788     return *this;
0789 }
0790 
0791 HTMLTableRowElement::~HTMLTableRowElement()
0792 {
0793 }
0794 
0795 long HTMLTableRowElement::rowIndex() const
0796 {
0797     if (!impl) {
0798         return 0;
0799     }
0800     return ((HTMLTableRowElementImpl *)impl)->rowIndex();
0801 }
0802 
0803 void HTMLTableRowElement::setRowIndex(long /*_rowIndex*/)
0804 {
0805     throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
0806 }
0807 
0808 long HTMLTableRowElement::sectionRowIndex() const
0809 {
0810     if (!impl) {
0811         return 0;
0812     }
0813     return ((HTMLTableRowElementImpl *)impl)->sectionRowIndex();
0814 }
0815 
0816 void HTMLTableRowElement::setSectionRowIndex(long /*_sectionRowIndex*/)
0817 {
0818     throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
0819 }
0820 
0821 HTMLCollection HTMLTableRowElement::cells() const
0822 {
0823     if (!impl) {
0824         return HTMLCollection();
0825     }
0826     return HTMLCollection(impl, HTMLCollectionImpl::TR_CELLS);
0827 }
0828 
0829 void HTMLTableRowElement::setCells(const HTMLCollection & /*_cells*/)
0830 {
0831     throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
0832 }
0833 
0834 DOMString HTMLTableRowElement::align() const
0835 {
0836     if (!impl) {
0837         return DOMString();
0838     }
0839     return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
0840 }
0841 
0842 void HTMLTableRowElement::setAlign(const DOMString &value)
0843 {
0844     if (impl) {
0845         ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
0846     }
0847 }
0848 
0849 DOMString HTMLTableRowElement::bgColor() const
0850 {
0851     if (!impl) {
0852         return DOMString();
0853     }
0854     return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
0855 }
0856 
0857 void HTMLTableRowElement::setBgColor(const DOMString &value)
0858 {
0859     if (impl) {
0860         ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
0861     }
0862 }
0863 
0864 DOMString HTMLTableRowElement::ch() const
0865 {
0866     if (!impl) {
0867         return DOMString();
0868     }
0869     return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
0870 }
0871 
0872 void HTMLTableRowElement::setCh(const DOMString &value)
0873 {
0874     if (impl) {
0875         ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
0876     }
0877 }
0878 
0879 DOMString HTMLTableRowElement::chOff() const
0880 {
0881     if (!impl) {
0882         return DOMString();
0883     }
0884     return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
0885 }
0886 
0887 void HTMLTableRowElement::setChOff(const DOMString &value)
0888 {
0889     if (impl) {
0890         ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
0891     }
0892 }
0893 
0894 DOMString HTMLTableRowElement::vAlign() const
0895 {
0896     if (!impl) {
0897         return DOMString();
0898     }
0899     return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
0900 }
0901 
0902 void HTMLTableRowElement::setVAlign(const DOMString &value)
0903 {
0904     if (impl) {
0905         ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
0906     }
0907 }
0908 
0909 HTMLElement HTMLTableRowElement::insertCell(long index)
0910 {
0911     if (!impl) {
0912         return nullptr;
0913     }
0914     int exceptioncode = 0;
0915     HTMLElementImpl *ret = ((HTMLTableRowElementImpl *)impl)->insertCell(index, exceptioncode);
0916     if (exceptioncode) {
0917         throw DOMException(exceptioncode);
0918     }
0919     return ret;
0920 }
0921 
0922 void HTMLTableRowElement::deleteCell(long index)
0923 {
0924     int exceptioncode = 0;
0925     if (impl) {
0926         ((HTMLTableRowElementImpl *)impl)->deleteCell(index, exceptioncode);
0927     }
0928     if (exceptioncode) {
0929         throw DOMException(exceptioncode);
0930     }
0931 }
0932 
0933 // --------------------------------------------------------------------------
0934 
0935 HTMLTableSectionElement::HTMLTableSectionElement() : HTMLElement()
0936 {
0937 }
0938 
0939 HTMLTableSectionElement::HTMLTableSectionElement(const HTMLTableSectionElement &other) : HTMLElement(other)
0940 {
0941 }
0942 
0943 HTMLTableSectionElement::HTMLTableSectionElement(HTMLTableSectionElementImpl *impl) : HTMLElement(impl)
0944 {
0945 }
0946 
0947 HTMLTableSectionElement &HTMLTableSectionElement::operator = (const Node &other)
0948 {
0949     if (other.elementId() != ID_TBODY &&
0950             other.elementId() != ID_THEAD &&
0951             other.elementId() != ID_TFOOT) {
0952         if (impl) {
0953             impl->deref();
0954         }
0955         impl = nullptr;
0956     } else {
0957         Node::operator = (other);
0958     }
0959     return *this;
0960 }
0961 
0962 HTMLTableSectionElement &HTMLTableSectionElement::operator = (const HTMLTableSectionElement &other)
0963 {
0964     HTMLElement::operator = (other);
0965     return *this;
0966 }
0967 
0968 HTMLTableSectionElement::~HTMLTableSectionElement()
0969 {
0970 }
0971 
0972 DOMString HTMLTableSectionElement::align() const
0973 {
0974     if (!impl) {
0975         return DOMString();
0976     }
0977     return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
0978 }
0979 
0980 void HTMLTableSectionElement::setAlign(const DOMString &value)
0981 {
0982     if (impl) {
0983         ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
0984     }
0985 }
0986 
0987 DOMString HTMLTableSectionElement::ch() const
0988 {
0989     if (!impl) {
0990         return DOMString();
0991     }
0992     return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
0993 }
0994 
0995 void HTMLTableSectionElement::setCh(const DOMString &value)
0996 {
0997     if (impl) {
0998         ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
0999     }
1000 }
1001 
1002 DOMString HTMLTableSectionElement::chOff() const
1003 {
1004     if (!impl) {
1005         return DOMString();
1006     }
1007     return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
1008 }
1009 
1010 void HTMLTableSectionElement::setChOff(const DOMString &value)
1011 {
1012     if (impl) {
1013         ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
1014     }
1015 }
1016 
1017 DOMString HTMLTableSectionElement::vAlign() const
1018 {
1019     if (!impl) {
1020         return DOMString();
1021     }
1022     return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
1023 }
1024 
1025 void HTMLTableSectionElement::setVAlign(const DOMString &value)
1026 {
1027     if (impl) {
1028         ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
1029     }
1030 }
1031 
1032 HTMLCollection HTMLTableSectionElement::rows() const
1033 {
1034     if (!impl) {
1035         return HTMLCollection();
1036     }
1037     return HTMLCollection(impl, HTMLCollectionImpl::TSECTION_ROWS);
1038 }
1039 
1040 HTMLElement HTMLTableSectionElement::insertRow(long index)
1041 {
1042     if (!impl) {
1043         return nullptr;
1044     }
1045     int exceptioncode = 0;
1046     HTMLElementImpl *ret = ((HTMLTableSectionElementImpl *)impl)->insertRow(index, exceptioncode);
1047     if (exceptioncode) {
1048         throw DOMException(exceptioncode);
1049     }
1050     return ret;
1051 }
1052 
1053 void HTMLTableSectionElement::deleteRow(long index)
1054 {
1055     int exceptioncode = 0;
1056     if (impl) {
1057         ((HTMLTableSectionElementImpl *)impl)->deleteRow(index, exceptioncode);
1058     }
1059     if (exceptioncode) {
1060         throw DOMException(exceptioncode);
1061     }
1062 }
1063