| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) |
| 3 * (C) 1997 Torben Weis (weis@kde.org) | 3 * (C) 1997 Torben Weis (weis@kde.org) |
| 4 * (C) 1998 Waldo Bastian (bastian@kde.org) | 4 * (C) 1998 Waldo Bastian (bastian@kde.org) |
| 5 * (C) 1999 Lars Knoll (knoll@kde.org) | 5 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserv
ed. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserv
ed. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "core/dom/ExceptionCode.h" | 30 #include "core/dom/ExceptionCode.h" |
| 31 #include "core/html/HTMLCollection.h" | 31 #include "core/html/HTMLCollection.h" |
| 32 #include "core/html/HTMLTableCellElement.h" | 32 #include "core/html/HTMLTableCellElement.h" |
| 33 #include "core/html/HTMLTableElement.h" | 33 #include "core/html/HTMLTableElement.h" |
| 34 #include "core/html/HTMLTableSectionElement.h" | 34 #include "core/html/HTMLTableSectionElement.h" |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace WebCore { |
| 37 | 37 |
| 38 using namespace HTMLNames; | 38 using namespace HTMLNames; |
| 39 | 39 |
| 40 HTMLTableRowElement::HTMLTableRowElement(const QualifiedName& tagName, Document*
document) | 40 HTMLTableRowElement::HTMLTableRowElement(const QualifiedName& tagName, Document&
document) |
| 41 : HTMLTablePartElement(tagName, document) | 41 : HTMLTablePartElement(tagName, document) |
| 42 { | 42 { |
| 43 ASSERT(hasTagName(trTag)); | 43 ASSERT(hasTagName(trTag)); |
| 44 ScriptWrappable::init(this); | 44 ScriptWrappable::init(this); |
| 45 } | 45 } |
| 46 | 46 |
| 47 PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(Document* document) | 47 PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(Document& document) |
| 48 { | 48 { |
| 49 return adoptRef(new HTMLTableRowElement(trTag, document)); | 49 return adoptRef(new HTMLTableRowElement(trTag, document)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(const QualifiedName&
tagName, Document* document) | 52 PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(const QualifiedName&
tagName, Document& document) |
| 53 { | 53 { |
| 54 return adoptRef(new HTMLTableRowElement(tagName, document)); | 54 return adoptRef(new HTMLTableRowElement(tagName, document)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 int HTMLTableRowElement::rowIndex() const | 57 int HTMLTableRowElement::rowIndex() const |
| 58 { | 58 { |
| 59 ContainerNode* table = parentNode(); | 59 ContainerNode* table = parentNode(); |
| 60 if (!table) | 60 if (!table) |
| 61 return -1; | 61 return -1; |
| 62 table = table->parentNode(); | 62 table = table->parentNode(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 PassRefPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, ExceptionStat
e& es) | 121 PassRefPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, ExceptionStat
e& es) |
| 122 { | 122 { |
| 123 RefPtr<HTMLCollection> children = cells(); | 123 RefPtr<HTMLCollection> children = cells(); |
| 124 int numCells = children ? children->length() : 0; | 124 int numCells = children ? children->length() : 0; |
| 125 if (index < -1 || index > numCells) { | 125 if (index < -1 || index > numCells) { |
| 126 es.throwDOMException(IndexSizeError); | 126 es.throwDOMException(IndexSizeError); |
| 127 return 0; | 127 return 0; |
| 128 } | 128 } |
| 129 | 129 |
| 130 RefPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create(tdTag, &doc
ument()); | 130 RefPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create(tdTag, docu
ment()); |
| 131 if (index < 0 || index >= numCells) | 131 if (index < 0 || index >= numCells) |
| 132 appendChild(cell, es); | 132 appendChild(cell, es); |
| 133 else { | 133 else { |
| 134 Node* n; | 134 Node* n; |
| 135 if (index < 1) | 135 if (index < 1) |
| 136 n = firstChild(); | 136 n = firstChild(); |
| 137 else | 137 else |
| 138 n = children->item(index); | 138 n = children->item(index); |
| 139 insertBefore(cell, n, es); | 139 insertBefore(cell, n, es); |
| 140 } | 140 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 159 { | 159 { |
| 160 return ensureCachedHTMLCollection(TRCells); | 160 return ensureCachedHTMLCollection(TRCells); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void HTMLTableRowElement::setCells(HTMLCollection*, ExceptionState& es) | 163 void HTMLTableRowElement::setCells(HTMLCollection*, ExceptionState& es) |
| 164 { | 164 { |
| 165 es.throwDOMException(NoModificationAllowedError); | 165 es.throwDOMException(NoModificationAllowedError); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } | 168 } |
| OLD | NEW |