| 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 18 matching lines...) Expand all Loading... |
| 29 #include "bindings/v8/ExceptionState.h" | 29 #include "bindings/v8/ExceptionState.h" |
| 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/HTMLTableElement.h" | 32 #include "core/html/HTMLTableElement.h" |
| 33 #include "core/html/HTMLTableRowElement.h" | 33 #include "core/html/HTMLTableRowElement.h" |
| 34 | 34 |
| 35 namespace WebCore { | 35 namespace WebCore { |
| 36 | 36 |
| 37 using namespace HTMLNames; | 37 using namespace HTMLNames; |
| 38 | 38 |
| 39 inline HTMLTableSectionElement::HTMLTableSectionElement(const QualifiedName& tag
Name, Document* document) | 39 inline HTMLTableSectionElement::HTMLTableSectionElement(const QualifiedName& tag
Name, Document& document) |
| 40 : HTMLTablePartElement(tagName, document) | 40 : HTMLTablePartElement(tagName, document) |
| 41 { | 41 { |
| 42 ScriptWrappable::init(this); | 42 ScriptWrappable::init(this); |
| 43 } | 43 } |
| 44 | 44 |
| 45 PassRefPtr<HTMLTableSectionElement> HTMLTableSectionElement::create(const Qualif
iedName& tagName, Document* document) | 45 PassRefPtr<HTMLTableSectionElement> HTMLTableSectionElement::create(const Qualif
iedName& tagName, Document& document) |
| 46 { | 46 { |
| 47 return adoptRef(new HTMLTableSectionElement(tagName, document)); | 47 return adoptRef(new HTMLTableSectionElement(tagName, document)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 const StylePropertySet* HTMLTableSectionElement::additionalPresentationAttribute
Style() | 50 const StylePropertySet* HTMLTableSectionElement::additionalPresentationAttribute
Style() |
| 51 { | 51 { |
| 52 if (HTMLTableElement* table = findParentTable()) | 52 if (HTMLTableElement* table = findParentTable()) |
| 53 return table->additionalGroupStyle(true); | 53 return table->additionalGroupStyle(true); |
| 54 return 0; | 54 return 0; |
| 55 } | 55 } |
| 56 | 56 |
| 57 // these functions are rather slow, since we need to get the row at | 57 // these functions are rather slow, since we need to get the row at |
| 58 // the index... but they aren't used during usual HTML parsing anyway | 58 // the index... but they aren't used during usual HTML parsing anyway |
| 59 PassRefPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index, ExceptionS
tate& es) | 59 PassRefPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index, ExceptionS
tate& es) |
| 60 { | 60 { |
| 61 RefPtr<HTMLTableRowElement> row; | 61 RefPtr<HTMLTableRowElement> row; |
| 62 RefPtr<HTMLCollection> children = rows(); | 62 RefPtr<HTMLCollection> children = rows(); |
| 63 int numRows = children ? (int)children->length() : 0; | 63 int numRows = children ? (int)children->length() : 0; |
| 64 if (index < -1 || index > numRows) | 64 if (index < -1 || index > numRows) |
| 65 es.throwDOMException(IndexSizeError); // per the DOM | 65 es.throwDOMException(IndexSizeError); // per the DOM |
| 66 else { | 66 else { |
| 67 row = HTMLTableRowElement::create(trTag, &document()); | 67 row = HTMLTableRowElement::create(trTag, document()); |
| 68 if (numRows == index || index == -1) | 68 if (numRows == index || index == -1) |
| 69 appendChild(row, es); | 69 appendChild(row, es); |
| 70 else { | 70 else { |
| 71 Node* n; | 71 Node* n; |
| 72 if (index < 1) | 72 if (index < 1) |
| 73 n = firstChild(); | 73 n = firstChild(); |
| 74 else | 74 else |
| 75 n = children->item(index); | 75 n = children->item(index); |
| 76 insertBefore(row, n, es); | 76 insertBefore(row, n, es); |
| 77 } | 77 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 { | 145 { |
| 146 setAttribute(valignAttr, value); | 146 setAttribute(valignAttr, value); |
| 147 } | 147 } |
| 148 | 148 |
| 149 PassRefPtr<HTMLCollection> HTMLTableSectionElement::rows() | 149 PassRefPtr<HTMLCollection> HTMLTableSectionElement::rows() |
| 150 { | 150 { |
| 151 return ensureCachedHTMLCollection(TSectionRows); | 151 return ensureCachedHTMLCollection(TSectionRows); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } | 154 } |
| OLD | NEW |