Commit bad2b6fd authored by beidson's avatar beidson

Reviewed by Darin

        Append FTP row entries to the first TBODY instead of the TABLE element itself, 
        as many TABLE elements end up with an implicit TBODY and that's where most people would
        expect it to be added.

        * html/HTMLTableElement.h:
        (WebCore::HTMLTableElement::firstTBody): Added this accessor

        * loader/FTPDirectoryDocument.cpp:
        (WebCore::FTPDirectoryTokenizer::appendEntry): Add to the first tbody if it exists



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 29a46fe2
2007-07-16 Brady Eidson <beidson@apple.com>
Reviewed by Darin
Append FTP row entries to the first TBODY instead of the TABLE element itself,
as many TABLE elements end up with an implicit TBODY and that's where most people would
expect it to be added.
* html/HTMLTableElement.h:
(WebCore::HTMLTableElement::firstTBody): Added this accessor
* loader/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryTokenizer::appendEntry): Add to the first tbody if it exists
2007-07-16 Justin Garcia <justin.garcia@apple.com>
Reviewed by Adele.
......@@ -75,6 +75,7 @@ public:
HTMLTableSectionElement* tFoot() const { return m_foot; }
Node* setTFoot(HTMLTableSectionElement*);
HTMLTableSectionElement* firstTBody() const { return m_firstBody; }
Node* setTBody(HTMLTableSectionElement*);
HTMLElement* createTHead();
......
......@@ -120,7 +120,6 @@ void FTPDirectoryTokenizer::appendEntry(const String& filename, const String& si
RefPtr<Element> rowElement = m_doc->createElementNS(xhtmlNamespaceURI, "tr", ec);
rowElement->setAttribute("class", "ftpDirectoryEntryRow", ec);
m_tableElement->appendChild(rowElement, ec);
RefPtr<Element> element = m_doc->createElementNS(xhtmlNamespaceURI, "td", ec);
element->appendChild(new Text(m_doc, String(&noBreakSpace, 1)), ec);
......@@ -143,6 +142,15 @@ void FTPDirectoryTokenizer::appendEntry(const String& filename, const String& si
element->appendChild(new Text(m_doc, size), ec);
element->setAttribute("class", "ftpDirectoryFileSize", ec);
rowElement->appendChild(element, ec);
// Append the new row to the first tbody if it exists.
// Many <TABLE> elements end up having an implicit <TBODY> created for them and in those
// cases, it's more correct to append to the tbody instead of the table itself
HTMLTableSectionElement* body = m_tableElement->firstTBody();
if (body)
body->appendChild(rowElement, ec);
else
m_tableElement->appendChild(rowElement, ec);
}
PassRefPtr<Element> FTPDirectoryTokenizer::createTDForFilename(const String& filename)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment