Version: (using KDE KDE 3.3.0) Installed from: SuSE RPMs OS: Linux Until KDE 3.3.0, the innerHTML of table cells returned the inner HTML. Since 3.3.0 it return, what I think is the outer HTML, which is the inner html enclose by <TD> and </TD>. I'll attach a test case. It pops up four alert windows with the innerHTML of a 2x2 table.
Created attachment 7321 [details] Testcase Press the button "GO". It should pop up four alert boxes with the text "CELL A1" etc. but the alert box shows "<TD>CELL A1 </TD>" etc.
Same problem here but with <span> Testcase on http://ets.camlann.de. Click on one of the "Übernehmen"-Buttons and see the input-fields above. This code works with all other browsers and also with konqueror from kde 3.2.
CVS commit by savernik: Fixed innerHTML getter to not behave like outerHTML. CCMAIL: 88242-done@bugs.kde.org M +4 -1 html_elementimpl.cpp 1.180 --- kdelibs/khtml/html/html_elementimpl.cpp #1.179:1.180 @@ -436,5 +436,8 @@ void HTMLElementImpl::removeCSSProperty( DOMString HTMLElementImpl::innerHTML() const { - return toString(); + DOMString result; + for (NodeImpl *child = firstChild(); child != NULL; child = child->nextSibling()) + result += child->toString(); + return result; }
CVS commit by savernik: Backport: Fixed innerHTML getter to not behave like outerHTML. CCMAIL: 88242@bugs.kde.org M +4 -1 html_elementimpl.cpp 1.179.2.1 --- kdelibs/khtml/html/html_elementimpl.cpp #1.179:1.179.2.1 @@ -436,5 +436,8 @@ void HTMLElementImpl::removeCSSProperty( DOMString HTMLElementImpl::innerHTML() const { - return toString(); + DOMString result; + for (NodeImpl *child = firstChild(); child != NULL; child = child->nextSibling()) + result += child->toString(); + return result; }