| 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, 2008, 2010, 2011 Apple Inc. All rights
reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010, 2011 Apple Inc. All rights
reserved. |
| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 for (Node* child = lastChild(); child; child = child->previousSibling()) { | 181 for (Node* child = lastChild(); child; child = child->previousSibling()) { |
| 182 if (child->hasTagName(tbodyTag)) | 182 if (child->hasTagName(tbodyTag)) |
| 183 return toHTMLTableSectionElement(child); | 183 return toHTMLTableSectionElement(child); |
| 184 } | 184 } |
| 185 return 0; | 185 return 0; |
| 186 } | 186 } |
| 187 | 187 |
| 188 PassRefPtr<HTMLElement> HTMLTableElement::insertRow(int index, ExceptionState& e
s) | 188 PassRefPtr<HTMLElement> HTMLTableElement::insertRow(int index, ExceptionState& e
s) |
| 189 { | 189 { |
| 190 if (index < -1) { | 190 if (index < -1) { |
| 191 es.throwDOMException(IndexSizeError); | 191 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 192 return 0; | 192 return 0; |
| 193 } | 193 } |
| 194 | 194 |
| 195 RefPtr<Node> protectFromMutationEvents(this); | 195 RefPtr<Node> protectFromMutationEvents(this); |
| 196 | 196 |
| 197 RefPtr<HTMLTableRowElement> lastRow = 0; | 197 RefPtr<HTMLTableRowElement> lastRow = 0; |
| 198 RefPtr<HTMLTableRowElement> row = 0; | 198 RefPtr<HTMLTableRowElement> row = 0; |
| 199 if (index == -1) | 199 if (index == -1) |
| 200 lastRow = HTMLTableRowsCollection::lastRow(this); | 200 lastRow = HTMLTableRowsCollection::lastRow(this); |
| 201 else { | 201 else { |
| 202 for (int i = 0; i <= index; ++i) { | 202 for (int i = 0; i <= index; ++i) { |
| 203 row = HTMLTableRowsCollection::rowAfter(this, lastRow.get()); | 203 row = HTMLTableRowsCollection::rowAfter(this, lastRow.get()); |
| 204 if (!row) { | 204 if (!row) { |
| 205 if (i != index) { | 205 if (i != index) { |
| 206 es.throwDOMException(IndexSizeError); | 206 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 207 return 0; | 207 return 0; |
| 208 } | 208 } |
| 209 break; | 209 break; |
| 210 } | 210 } |
| 211 lastRow = row; | 211 lastRow = row; |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 | 214 |
| 215 RefPtr<ContainerNode> parent; | 215 RefPtr<ContainerNode> parent; |
| 216 if (lastRow) | 216 if (lastRow) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 237 if (index == -1) | 237 if (index == -1) |
| 238 row = HTMLTableRowsCollection::lastRow(this); | 238 row = HTMLTableRowsCollection::lastRow(this); |
| 239 else { | 239 else { |
| 240 for (int i = 0; i <= index; ++i) { | 240 for (int i = 0; i <= index; ++i) { |
| 241 row = HTMLTableRowsCollection::rowAfter(this, row); | 241 row = HTMLTableRowsCollection::rowAfter(this, row); |
| 242 if (!row) | 242 if (!row) |
| 243 break; | 243 break; |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 if (!row) { | 246 if (!row) { |
| 247 es.throwDOMException(IndexSizeError); | 247 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 248 return; | 248 return; |
| 249 } | 249 } |
| 250 row->remove(es); | 250 row->remove(es); |
| 251 } | 251 } |
| 252 | 252 |
| 253 static inline bool isTableCellAncestor(Node* n) | 253 static inline bool isTableCellAncestor(Node* n) |
| 254 { | 254 { |
| 255 return n->hasTagName(theadTag) || n->hasTagName(tbodyTag) || | 255 return n->hasTagName(theadTag) || n->hasTagName(tbodyTag) || |
| 256 n->hasTagName(tfootTag) || n->hasTagName(trTag) || | 256 n->hasTagName(tfootTag) || n->hasTagName(trTag) || |
| 257 n->hasTagName(thTag); | 257 n->hasTagName(thTag); |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 } | 573 } |
| 574 | 574 |
| 575 void HTMLTableElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons
t | 575 void HTMLTableElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons
t |
| 576 { | 576 { |
| 577 HTMLElement::addSubresourceAttributeURLs(urls); | 577 HTMLElement::addSubresourceAttributeURLs(urls); |
| 578 | 578 |
| 579 addSubresourceURL(urls, document().completeURL(getAttribute(backgroundAttr))
); | 579 addSubresourceURL(urls, document().completeURL(getAttribute(backgroundAttr))
); |
| 580 } | 580 } |
| 581 | 581 |
| 582 } | 582 } |
| OLD | NEW |