Bug 88242 - innerHTML for <TD> includes tags
Summary: innerHTML for <TD> includes tags
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-27 17:35 UTC by Ralf Wiebicke
Modified: 2004-09-07 12:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Testcase (758 bytes, text/html)
2004-08-27 17:39 UTC, Ralf Wiebicke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Wiebicke 2004-08-27 17:35:22 UTC
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.
Comment 1 Ralf Wiebicke 2004-08-27 17:39:28 UTC
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.
Comment 2 Christian Welzel 2004-09-01 11:56:39 UTC
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.
Comment 3 Leo Savernik 2004-09-03 00:40:49 UTC
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;
 }
 


Comment 4 Leo Savernik 2004-09-07 12:27:24 UTC
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;
 }