diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/html/HTMLTableSectionElement.cpp | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/html/HTMLTableSectionElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLTableSectionElement.cpp | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/Source/WebCore/html/HTMLTableSectionElement.cpp b/Source/WebCore/html/HTMLTableSectionElement.cpp index be84245c2..32b8396f4 100644 --- a/Source/WebCore/html/HTMLTableSectionElement.cpp +++ b/Source/WebCore/html/HTMLTableSectionElement.cpp @@ -26,13 +26,11 @@ #include "HTMLTableSectionElement.h" #include "ExceptionCode.h" -#include "GenericCachedHTMLCollection.h" #include "HTMLCollection.h" #include "HTMLNames.h" #include "HTMLTableRowElement.h" #include "HTMLTableElement.h" #include "NodeList.h" -#include "NodeRareData.h" #include "Text.h" namespace WebCore { @@ -44,9 +42,9 @@ inline HTMLTableSectionElement::HTMLTableSectionElement(const QualifiedName& tag { } -Ref<HTMLTableSectionElement> HTMLTableSectionElement::create(const QualifiedName& tagName, Document& document) +PassRefPtr<HTMLTableSectionElement> HTMLTableSectionElement::create(const QualifiedName& tagName, Document& document) { - return adoptRef(*new HTMLTableSectionElement(tagName, document)); + return adoptRef(new HTMLTableSectionElement(tagName, document)); } const StyleProperties* HTMLTableSectionElement::additionalPresentationAttributeStyle() @@ -58,38 +56,39 @@ const StyleProperties* HTMLTableSectionElement::additionalPresentationAttributeS // these functions are rather slow, since we need to get the row at // the index... but they aren't used during usual HTML parsing anyway -RefPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index, ExceptionCode& ec) +PassRefPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index, ExceptionCode& ec) { RefPtr<HTMLTableRowElement> row; - Ref<HTMLCollection> children = rows(); - int numRows = children->length(); + RefPtr<HTMLCollection> children = rows(); + int numRows = children ? (int)children->length() : 0; if (index < -1 || index > numRows) ec = INDEX_SIZE_ERR; // per the DOM else { row = HTMLTableRowElement::create(trTag, document()); if (numRows == index || index == -1) - appendChild(*row, ec); + appendChild(row, ec); else { Node* n; if (index < 1) n = firstChild(); else n = children->item(index); - insertBefore(*row, n, ec); + insertBefore(row, n, ec); } } - return row; + return row.release(); } void HTMLTableSectionElement::deleteRow(int index, ExceptionCode& ec) { - Ref<HTMLCollection> children = rows(); - int numRows = children->length(); + RefPtr<HTMLCollection> children = rows(); + int numRows = children ? (int)children->length() : 0; if (index == -1) index = numRows - 1; - if (index >= 0 && index < numRows) - HTMLElement::removeChild(*children->item(index), ec); - else + if (index >= 0 && index < numRows) { + RefPtr<Node> row = children->item(index); + HTMLElement::removeChild(row.get(), ec); + } else ec = INDEX_SIZE_ERR; } @@ -106,49 +105,49 @@ int HTMLTableSectionElement::numRows() const return rows; } -const AtomicString& HTMLTableSectionElement::align() const +String HTMLTableSectionElement::align() const { - return fastGetAttribute(alignAttr); + return getAttribute(alignAttr); } -void HTMLTableSectionElement::setAlign(const AtomicString& value) +void HTMLTableSectionElement::setAlign(const String &value) { setAttribute(alignAttr, value); } -const AtomicString& HTMLTableSectionElement::ch() const +String HTMLTableSectionElement::ch() const { - return fastGetAttribute(charAttr); + return getAttribute(charAttr); } -void HTMLTableSectionElement::setCh(const AtomicString& value) +void HTMLTableSectionElement::setCh(const String &value) { setAttribute(charAttr, value); } -const AtomicString& HTMLTableSectionElement::chOff() const +String HTMLTableSectionElement::chOff() const { return getAttribute(charoffAttr); } -void HTMLTableSectionElement::setChOff(const AtomicString& value) +void HTMLTableSectionElement::setChOff(const String &value) { setAttribute(charoffAttr, value); } -const AtomicString& HTMLTableSectionElement::vAlign() const +String HTMLTableSectionElement::vAlign() const { - return fastGetAttribute(valignAttr); + return getAttribute(valignAttr); } -void HTMLTableSectionElement::setVAlign(const AtomicString& value) +void HTMLTableSectionElement::setVAlign(const String &value) { setAttribute(valignAttr, value); } -Ref<HTMLCollection> HTMLTableSectionElement::rows() +PassRefPtr<HTMLCollection> HTMLTableSectionElement::rows() { - return ensureRareData().ensureNodeLists().addCachedCollection<GenericCachedHTMLCollection<CollectionTypeTraits<TSectionRows>::traversalType>>(*this, TSectionRows); + return ensureCachedHTMLCollection(TSectionRows); } } |