fix logic
[personal-kdelibs.git] / khtml / dom / html_table.cpp
blobd77d3f00460b1e95f8e09404d2a6746d47d41e9c
1 /**
2 * This file is part of the DOM implementation for KDE.
4 * Copyright 1999 Lars Knoll (knoll@kde.org)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 // --------------------------------------------------------------------------
24 #include "html_table.h"
25 #include "html_misc.h"
26 #include "dom_exception.h"
28 #include <html/html_miscimpl.h>
29 #include <html/html_tableimpl.h>
30 #include <misc/htmlhashes.h>
32 using namespace DOM;
34 HTMLTableCaptionElement::HTMLTableCaptionElement() : HTMLElement()
38 HTMLTableCaptionElement::HTMLTableCaptionElement(const HTMLTableCaptionElement &other) : HTMLElement(other)
42 HTMLTableCaptionElement::HTMLTableCaptionElement(HTMLTableCaptionElementImpl *impl) : HTMLElement(impl)
46 HTMLTableCaptionElement &HTMLTableCaptionElement::operator = (const Node &other)
48 assignOther( other, ID_CAPTION );
49 return *this;
52 HTMLTableCaptionElement &HTMLTableCaptionElement::operator = (const HTMLTableCaptionElement &other)
54 HTMLElement::operator = (other);
55 return *this;
58 HTMLTableCaptionElement::~HTMLTableCaptionElement()
62 DOMString HTMLTableCaptionElement::align() const
64 if(!impl) return DOMString();
65 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
68 void HTMLTableCaptionElement::setAlign( const DOMString &value )
70 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
73 // --------------------------------------------------------------------------
75 HTMLTableCellElement::HTMLTableCellElement() : HTMLElement()
79 HTMLTableCellElement::HTMLTableCellElement(const HTMLTableCellElement &other) : HTMLElement(other)
83 HTMLTableCellElement::HTMLTableCellElement(HTMLTableCellElementImpl *impl) : HTMLElement(impl)
87 HTMLTableCellElement &HTMLTableCellElement::operator = (const Node &other)
89 if( other.elementId() != ID_TD &&
90 other.elementId() != ID_TH )
92 if ( impl ) impl->deref();
93 impl = 0;
94 } else {
95 Node::operator = (other);
97 return *this;
100 HTMLTableCellElement &HTMLTableCellElement::operator = (const HTMLTableCellElement &other)
102 HTMLElement::operator = (other);
103 return *this;
106 HTMLTableCellElement::~HTMLTableCellElement()
110 long HTMLTableCellElement::cellIndex() const
112 if(!impl) return 0;
113 return ((HTMLTableCellElementImpl *)impl)->cellIndex();
116 void HTMLTableCellElement::setCellIndex( long /*_cellIndex*/ )
118 throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
121 DOMString HTMLTableCellElement::abbr() const
123 if(!impl) return DOMString();
124 return ((ElementImpl *)impl)->getAttribute(ATTR_ABBR);
127 void HTMLTableCellElement::setAbbr( const DOMString &value )
129 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ABBR, value);
132 DOMString HTMLTableCellElement::align() const
134 if(!impl) return DOMString();
135 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
138 void HTMLTableCellElement::setAlign( const DOMString &value )
140 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
143 DOMString HTMLTableCellElement::axis() const
145 if(!impl) return DOMString();
146 return ((ElementImpl *)impl)->getAttribute(ATTR_AXIS);
149 void HTMLTableCellElement::setAxis( const DOMString &value )
151 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_AXIS, value);
154 DOMString HTMLTableCellElement::bgColor() const
156 if(!impl) return DOMString();
157 return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
160 void HTMLTableCellElement::setBgColor( const DOMString &value )
162 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
165 DOMString HTMLTableCellElement::ch() const
167 if(!impl) return DOMString();
168 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
171 void HTMLTableCellElement::setCh( const DOMString &value )
173 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
176 DOMString HTMLTableCellElement::chOff() const
178 if(!impl) return DOMString();
179 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
182 void HTMLTableCellElement::setChOff( const DOMString &value )
184 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
187 long HTMLTableCellElement::colSpan() const
189 if(!impl) return 0;
190 return ((ElementImpl *)impl)->getAttribute(ATTR_COLSPAN).toInt();
193 void HTMLTableCellElement::setColSpan( long _colSpan )
195 if(impl) {
196 DOMString value(QString::number(_colSpan));
197 ((ElementImpl *)impl)->setAttribute(ATTR_COLSPAN,value);
201 DOMString HTMLTableCellElement::headers() const
203 if(!impl) return DOMString();
204 return ((ElementImpl *)impl)->getAttribute(ATTR_HEADERS);
207 void HTMLTableCellElement::setHeaders( const DOMString &value )
209 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HEADERS, value);
212 DOMString HTMLTableCellElement::height() const
214 if(!impl) return DOMString();
215 return ((ElementImpl *)impl)->getAttribute(ATTR_HEIGHT);
218 void HTMLTableCellElement::setHeight( const DOMString &value )
220 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, value);
223 bool HTMLTableCellElement::noWrap() const
225 if(!impl) return false;
226 return !((ElementImpl *)impl)->getAttribute(ATTR_NOWRAP).isNull();
229 void HTMLTableCellElement::setNoWrap( bool _noWrap )
231 if(impl)
232 ((ElementImpl *)impl)->setAttribute(ATTR_NOWRAP, _noWrap ? "" : 0);
235 long HTMLTableCellElement::rowSpan() const
237 if(!impl) return 0;
238 return ((ElementImpl *)impl)->getAttribute(ATTR_ROWSPAN).toInt();
241 void HTMLTableCellElement::setRowSpan( long _rowSpan )
243 if(impl) {
244 DOMString value(QString::number(_rowSpan));
245 ((ElementImpl *)impl)->setAttribute(ATTR_ROWSPAN,value);
249 DOMString HTMLTableCellElement::scope() const
251 if(!impl) return DOMString();
252 return ((ElementImpl *)impl)->getAttribute(ATTR_SCOPE);
255 void HTMLTableCellElement::setScope( const DOMString &value )
257 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SCOPE, value);
260 DOMString HTMLTableCellElement::vAlign() const
262 if(!impl) return DOMString();
263 return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
266 void HTMLTableCellElement::setVAlign( const DOMString &value )
268 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
271 DOMString HTMLTableCellElement::width() const
273 if(!impl) return DOMString();
274 return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
277 void HTMLTableCellElement::setWidth( const DOMString &value )
279 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
282 // --------------------------------------------------------------------------
284 HTMLTableColElement::HTMLTableColElement() : HTMLElement()
288 HTMLTableColElement::HTMLTableColElement(const HTMLTableColElement &other) : HTMLElement(other)
292 HTMLTableColElement::HTMLTableColElement(HTMLTableColElementImpl *impl) : HTMLElement(impl)
296 HTMLTableColElement &HTMLTableColElement::operator = (const Node &other)
298 if( other.elementId() != ID_COL &&
299 other.elementId() != ID_COLGROUP )
301 if ( impl ) impl->deref();
302 impl = 0;
303 } else {
304 Node::operator = (other);
306 return *this;
309 HTMLTableColElement &HTMLTableColElement::operator = (const HTMLTableColElement &other)
311 HTMLElement::operator = (other);
312 return *this;
315 HTMLTableColElement::~HTMLTableColElement()
319 DOMString HTMLTableColElement::align() const
321 if(!impl) return DOMString();
322 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
325 void HTMLTableColElement::setAlign( const DOMString &value )
327 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
330 DOMString HTMLTableColElement::ch() const
332 if(!impl) return DOMString();
333 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
336 void HTMLTableColElement::setCh( const DOMString &value )
338 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
341 DOMString HTMLTableColElement::chOff() const
343 if(!impl) return DOMString();
344 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
347 void HTMLTableColElement::setChOff( const DOMString &value )
349 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
352 long HTMLTableColElement::span() const
354 if(!impl) return 0;
355 return ((ElementImpl *)impl)->getAttribute(ATTR_SPAN).toInt();
358 void HTMLTableColElement::setSpan( long _span )
360 if(impl) {
361 DOMString value(QString::number(_span));
362 ((ElementImpl *)impl)->setAttribute(ATTR_SPAN,value);
366 DOMString HTMLTableColElement::vAlign() const
368 if(!impl) return DOMString();
369 return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
372 void HTMLTableColElement::setVAlign( const DOMString &value )
374 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
377 DOMString HTMLTableColElement::width() const
379 if(!impl) return DOMString();
380 return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
383 void HTMLTableColElement::setWidth( const DOMString &value )
385 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
388 // --------------------------------------------------------------------------
390 HTMLTableElement::HTMLTableElement() : HTMLElement()
394 HTMLTableElement::HTMLTableElement(const HTMLTableElement &other) : HTMLElement(other)
398 HTMLTableElement::HTMLTableElement(HTMLTableElementImpl *impl) : HTMLElement(impl)
402 HTMLTableElement &HTMLTableElement::operator = (const Node &other)
404 assignOther( other, ID_TABLE );
405 return *this;
408 HTMLTableElement &HTMLTableElement::operator = (const HTMLTableElement &other)
410 HTMLElement::operator = (other);
411 return *this;
414 HTMLTableElement::~HTMLTableElement()
418 HTMLTableCaptionElement HTMLTableElement::caption() const
420 if(!impl) return 0;
421 return ((HTMLTableElementImpl *)impl)->caption();
424 void HTMLTableElement::setCaption( const HTMLTableCaptionElement &_caption )
426 if(impl)
427 ((HTMLTableElementImpl *)impl)
428 ->setCaption( ((HTMLTableCaptionElementImpl *)_caption.impl) );
431 HTMLTableSectionElement HTMLTableElement::tHead() const
433 if(!impl) return 0;
434 return ((HTMLTableElementImpl *)impl)->tHead();
437 void HTMLTableElement::setTHead( const HTMLTableSectionElement &_tHead )
440 if(impl)
441 ((HTMLTableElementImpl *)impl)
442 ->setTHead( ((HTMLTableSectionElementImpl *)_tHead.impl) );
445 HTMLTableSectionElement HTMLTableElement::tFoot() const
447 if(!impl) return 0;
448 return ((HTMLTableElementImpl *)impl)->tFoot();
451 void HTMLTableElement::setTFoot( const HTMLTableSectionElement &_tFoot )
454 if(impl)
455 ((HTMLTableElementImpl *)impl)
456 ->setTFoot( ((HTMLTableSectionElementImpl *)_tFoot.impl) );
459 HTMLCollection HTMLTableElement::rows() const
461 if(!impl) return HTMLCollection();
462 return HTMLCollection(impl, HTMLCollectionImpl::TABLE_ROWS);
465 HTMLCollection HTMLTableElement::tBodies() const
467 if(!impl) return HTMLCollection();
468 return HTMLCollection(impl, HTMLCollectionImpl::TABLE_TBODIES);
471 DOMString HTMLTableElement::align() const
473 if(!impl) return DOMString();
474 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
477 void HTMLTableElement::setAlign( const DOMString &value )
479 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
482 DOMString HTMLTableElement::bgColor() const
484 if(!impl) return DOMString();
485 return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
488 void HTMLTableElement::setBgColor( const DOMString &value )
490 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
493 DOMString HTMLTableElement::border() const
495 if(!impl) return DOMString();
496 return ((ElementImpl *)impl)->getAttribute(ATTR_BORDER);
499 void HTMLTableElement::setBorder( const DOMString &value )
501 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_BORDER, value);
504 DOMString HTMLTableElement::cellPadding() const
506 if(!impl) return DOMString();
507 return ((ElementImpl *)impl)->getAttribute(ATTR_CELLPADDING);
510 void HTMLTableElement::setCellPadding( const DOMString &value )
512 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CELLPADDING, value);
515 DOMString HTMLTableElement::cellSpacing() const
517 if(!impl) return DOMString();
518 return ((ElementImpl *)impl)->getAttribute(ATTR_CELLSPACING);
521 void HTMLTableElement::setCellSpacing( const DOMString &value )
523 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CELLSPACING, value);
526 DOMString HTMLTableElement::frame() const
528 if(!impl) return DOMString();
529 return ((ElementImpl *)impl)->getAttribute(ATTR_FRAME);
532 void HTMLTableElement::setFrame( const DOMString &value )
534 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_FRAME, value);
537 DOMString HTMLTableElement::rules() const
539 if(!impl) return DOMString();
540 return ((ElementImpl *)impl)->getAttribute(ATTR_RULES);
543 void HTMLTableElement::setRules( const DOMString &value )
545 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_RULES, value);
548 DOMString HTMLTableElement::summary() const
550 if(!impl) return DOMString();
551 return ((ElementImpl *)impl)->getAttribute(ATTR_SUMMARY);
554 void HTMLTableElement::setSummary( const DOMString &value )
556 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SUMMARY, value);
559 DOMString HTMLTableElement::width() const
561 if(!impl) return DOMString();
562 return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
565 void HTMLTableElement::setWidth( const DOMString &value )
567 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
570 HTMLElement HTMLTableElement::createTHead( )
572 if(!impl) return 0;
573 return ((HTMLTableElementImpl *)impl)->createTHead( );
576 void HTMLTableElement::deleteTHead( )
578 if(impl)
579 ((HTMLTableElementImpl *)impl)->deleteTHead( );
582 HTMLElement HTMLTableElement::createTFoot( )
584 if(!impl) return 0;
585 return ((HTMLTableElementImpl *)impl)->createTFoot( );
588 void HTMLTableElement::deleteTFoot( )
590 if(impl)
591 ((HTMLTableElementImpl *)impl)->deleteTFoot( );
594 HTMLElement HTMLTableElement::createCaption( )
596 if(!impl) return 0;
597 return ((HTMLTableElementImpl *)impl)->createCaption( );
600 void HTMLTableElement::deleteCaption( )
602 if(impl)
603 ((HTMLTableElementImpl *)impl)->deleteCaption( );
606 HTMLElement HTMLTableElement::insertRow( long index )
608 if(!impl) return 0;
609 int exceptioncode = 0;
610 HTMLElementImpl* ret = ((HTMLTableElementImpl *)impl)->insertRow( index, exceptioncode );
611 if (exceptioncode)
612 throw DOMException(exceptioncode);
613 return ret;
616 void HTMLTableElement::deleteRow( long index )
618 int exceptioncode = 0;
619 if(impl)
620 ((HTMLTableElementImpl *)impl)->deleteRow( index, exceptioncode );
621 if (exceptioncode)
622 throw DOMException(exceptioncode);
625 // --------------------------------------------------------------------------
627 HTMLTableRowElement::HTMLTableRowElement() : HTMLElement()
631 HTMLTableRowElement::HTMLTableRowElement(const HTMLTableRowElement &other) : HTMLElement(other)
635 HTMLTableRowElement::HTMLTableRowElement(HTMLTableRowElementImpl *impl) : HTMLElement(impl)
639 HTMLTableRowElement &HTMLTableRowElement::operator = (const Node &other)
641 assignOther( other, ID_TR );
642 return *this;
645 HTMLTableRowElement &HTMLTableRowElement::operator = (const HTMLTableRowElement &other)
647 HTMLElement::operator = (other);
648 return *this;
651 HTMLTableRowElement::~HTMLTableRowElement()
655 long HTMLTableRowElement::rowIndex() const
657 if(!impl) return 0;
658 return ((HTMLTableRowElementImpl *)impl)->rowIndex();
661 void HTMLTableRowElement::setRowIndex( long /*_rowIndex*/ )
663 throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
666 long HTMLTableRowElement::sectionRowIndex() const
668 if(!impl) return 0;
669 return ((HTMLTableRowElementImpl *)impl)->sectionRowIndex();
672 void HTMLTableRowElement::setSectionRowIndex( long /*_sectionRowIndex*/ )
674 throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
677 HTMLCollection HTMLTableRowElement::cells() const
679 if(!impl) return HTMLCollection();
680 return HTMLCollection(impl, HTMLCollectionImpl::TR_CELLS);
683 void HTMLTableRowElement::setCells( const HTMLCollection & /*_cells*/ )
685 throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
688 DOMString HTMLTableRowElement::align() const
690 if(!impl) return DOMString();
691 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
694 void HTMLTableRowElement::setAlign( const DOMString &value )
696 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
699 DOMString HTMLTableRowElement::bgColor() const
701 if(!impl) return DOMString();
702 return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
705 void HTMLTableRowElement::setBgColor( const DOMString &value )
707 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
710 DOMString HTMLTableRowElement::ch() const
712 if(!impl) return DOMString();
713 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
716 void HTMLTableRowElement::setCh( const DOMString &value )
718 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
721 DOMString HTMLTableRowElement::chOff() const
723 if(!impl) return DOMString();
724 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
727 void HTMLTableRowElement::setChOff( const DOMString &value )
729 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
732 DOMString HTMLTableRowElement::vAlign() const
734 if(!impl) return DOMString();
735 return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
738 void HTMLTableRowElement::setVAlign( const DOMString &value )
740 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
743 HTMLElement HTMLTableRowElement::insertCell( long index )
745 if(!impl) return 0;
746 int exceptioncode = 0;
747 HTMLElementImpl* ret = ((HTMLTableRowElementImpl *)impl)->insertCell( index, exceptioncode );
748 if (exceptioncode)
749 throw DOMException(exceptioncode);
750 return ret;
753 void HTMLTableRowElement::deleteCell( long index )
755 int exceptioncode = 0;
756 if(impl)
757 ((HTMLTableRowElementImpl *)impl)->deleteCell( index, exceptioncode );
758 if (exceptioncode)
759 throw DOMException(exceptioncode);
762 // --------------------------------------------------------------------------
764 HTMLTableSectionElement::HTMLTableSectionElement() : HTMLElement()
768 HTMLTableSectionElement::HTMLTableSectionElement(const HTMLTableSectionElement &other) : HTMLElement(other)
772 HTMLTableSectionElement::HTMLTableSectionElement(HTMLTableSectionElementImpl *impl) : HTMLElement(impl)
776 HTMLTableSectionElement &HTMLTableSectionElement::operator = (const Node &other)
778 if(other.elementId() != ID_TBODY &&
779 other.elementId() != ID_THEAD &&
780 other.elementId() != ID_TFOOT )
782 if ( impl ) impl->deref();
783 impl = 0;
784 } else {
785 Node::operator = (other);
787 return *this;
790 HTMLTableSectionElement &HTMLTableSectionElement::operator = (const HTMLTableSectionElement &other)
792 HTMLElement::operator = (other);
793 return *this;
796 HTMLTableSectionElement::~HTMLTableSectionElement()
800 DOMString HTMLTableSectionElement::align() const
802 if(!impl) return DOMString();
803 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
806 void HTMLTableSectionElement::setAlign( const DOMString &value )
808 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
811 DOMString HTMLTableSectionElement::ch() const
813 if(!impl) return DOMString();
814 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
817 void HTMLTableSectionElement::setCh( const DOMString &value )
819 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
822 DOMString HTMLTableSectionElement::chOff() const
824 if(!impl) return DOMString();
825 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
828 void HTMLTableSectionElement::setChOff( const DOMString &value )
830 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
833 DOMString HTMLTableSectionElement::vAlign() const
835 if(!impl) return DOMString();
836 return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
839 void HTMLTableSectionElement::setVAlign( const DOMString &value )
841 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
844 HTMLCollection HTMLTableSectionElement::rows() const
846 if(!impl) return HTMLCollection();
847 return HTMLCollection(impl, HTMLCollectionImpl::TSECTION_ROWS);
850 HTMLElement HTMLTableSectionElement::insertRow( long index )
852 if(!impl) return 0;
853 int exceptioncode = 0;
854 HTMLElementImpl* ret = ((HTMLTableSectionElementImpl *)impl)->insertRow( index, exceptioncode );
855 if (exceptioncode)
856 throw DOMException(exceptioncode);
857 return ret;
860 void HTMLTableSectionElement::deleteRow( long index )
862 int exceptioncode = 0;
863 if(impl)
864 ((HTMLTableSectionElementImpl *)impl)->deleteRow( index, exceptioncode );
865 if (exceptioncode)
866 throw DOMException(exceptioncode);