| 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, 2010 Apple Inc. All rights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2010 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(HTMLTableSectionElement) | 47 DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(HTMLTableSectionElement) |
| 48 | 48 |
| 49 const StylePropertySet* HTMLTableSectionElement::additionalPresentationAttribute
Style() | 49 const StylePropertySet* HTMLTableSectionElement::additionalPresentationAttribute
Style() |
| 50 { | 50 { |
| 51 if (HTMLTableElement* table = findParentTable()) | 51 if (HTMLTableElement* table = findParentTable()) |
| 52 return table->additionalGroupStyle(true); | 52 return table->additionalGroupStyle(true); |
| 53 return 0; | 53 return 0; |
| 54 } | 54 } |
| 55 | 55 |
| 56 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableSectionElement::insertRow(Exception
State& exceptionState) | |
| 57 { | |
| 58 // The default 'index' argument value is -1. | |
| 59 return insertRow(-1, exceptionState); | |
| 60 } | |
| 61 | |
| 62 // these functions are rather slow, since we need to get the row at | 56 // these functions are rather slow, since we need to get the row at |
| 63 // the index... but they aren't used during usual HTML parsing anyway | 57 // the index... but they aren't used during usual HTML parsing anyway |
| 64 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index
, ExceptionState& exceptionState) | 58 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index
, ExceptionState& exceptionState) |
| 65 { | 59 { |
| 66 RefPtrWillBeRawPtr<HTMLCollection> children = rows(); | 60 RefPtrWillBeRawPtr<HTMLCollection> children = rows(); |
| 67 int numRows = children ? static_cast<int>(children->length()) : 0; | 61 int numRows = children ? static_cast<int>(children->length()) : 0; |
| 68 if (index < -1 || index > numRows) { | 62 if (index < -1 || index > numRows) { |
| 69 exceptionState.throwDOMException(IndexSizeError, "The provided index ("
+ String::number(index) + " is outside the range [-1, " + String::number(numRows
) + "]."); | 63 exceptionState.throwDOMException(IndexSizeError, "The provided index ("
+ String::number(index) + " is outside the range [-1, " + String::number(numRows
) + "]."); |
| 70 return nullptr; | 64 return nullptr; |
| 71 } | 65 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 99 ++rowCount; | 93 ++rowCount; |
| 100 return rowCount; | 94 return rowCount; |
| 101 } | 95 } |
| 102 | 96 |
| 103 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLTableSectionElement::rows() | 97 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLTableSectionElement::rows() |
| 104 { | 98 { |
| 105 return ensureCachedCollection<HTMLCollection>(TSectionRows); | 99 return ensureCachedCollection<HTMLCollection>(TSectionRows); |
| 106 } | 100 } |
| 107 | 101 |
| 108 } | 102 } |
| OLD | NEW |