Bug 74125 - table.insertRow(table.rows.length) inserts at the beginning
Summary: table.insertRow(table.rows.length) inserts at the beginning
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml ecma (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-04 13:40 UTC by Ralf Wiebicke
Modified: 2004-02-04 21:06 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Testcase (1.30 KB, text/html)
2004-02-04 13:47 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-02-04 13:40:38 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    SuSE RPMs
OS:          Linux

I will attach a very short test case, which I think is self-explaining. This problem did not occur with KDE 3.1.5.
Comment 1 Ralf Wiebicke 2004-02-04 13:47:22 UTC
Created attachment 4509 [details]
Testcase

Please press the button. The rows to be appended are inserted at the beginning
instead. This problem did not occur in KDE 3.1.5
Comment 2 Ralf Wiebicke 2004-02-04 13:52:45 UTC
I did not find the screenshot tool in KDE 3.2, so I just describe, what I see: After pressing the button, the rows of the table have the following order:

2: inserted at rows.length
1: inserted at rows.length
initial row 1 
initial row 2 
3: inserted at rows.length-1
4: inserted at rows.length-1
initial row 3

Correct order would be (as in KDE 3.1.5):

initial row 1 
initial row 2 
initial row 3
1: inserted at rows.length
3: inserted at rows.length-1
4: inserted at rows.length-1
2: inserted at rows.length
Comment 3 Stephan Kulow 2004-02-04 14:15:31 UTC
Subject: Re:  table.insertRow(table.rows.length) inserts at the beginning

On Wednesday 04 February 2004 13:52, Ralf Wiebicke wrote:
> ------- Additional Comments From ralf@rw7.de  2004-02-04 13:52 -------
> I did not find the screenshot tool in KDE 3.2, so I just describe, what I see: After pressing the button, the rows of the table have the following order:
> 
> 2: inserted at rows.length
> 1: inserted at rows.length
> initial row 1 
> initial row 2 
> 3: inserted at rows.length-1
> 4: inserted at rows.length-1
> initial row 3
> 
When you add a <tfoot>, it works. Of course it should work without though :)

Greetings, Stephan

Comment 4 Ralf Wiebicke 2004-02-04 14:59:17 UTC
Thanks for the workaround. Now I can live with the bug much easier.

Oh, and by the way, thank you for that nice KDE 3.2, and that many nice versions before. I use it since KDE 1.0 beta3, and now one will have to pry it "from my cold dead hands." :-)

Best regards,
Ralf.
Comment 5 Stephan Kulow 2004-02-04 15:50:18 UTC
Subject: kdelibs/khtml

CVS commit by coolo: 

my next try on ECMA (please review and backport if correct, I add test cases)
CCMAIL: 74125@bugs.kde.org


  M +5 -0      ChangeLog   1.195
  M +1 -1      html/html_tableimpl.cpp   1.180


--- kdelibs/khtml/ChangeLog  #1.194:1.195
@@ -1,2 +1,7 @@
+2004-02-04  Stephan Kulow  <coolo@kde.org>
+
+        * html/html_tableimpl.cpp (insertRow): append to tbody if 
+        there is no tfood for insertRow(numRows) (#74125)
+
 2004-01-29  Germain Garand  <germain@ebooksfrance.org>
 

--- kdelibs/khtml/html/html_tableimpl.cpp  #1.179:1.180
@@ -251,5 +251,5 @@ HTMLElementImpl *HTMLTableElementImpl::i
     }
     // insertRow(numRows) appends to TFOOT. insertRow(-1) appends to TBODY, hence the !append.
-    if ( !found && foot && !append )
+    if ( !found && !append )
         section = static_cast<HTMLTableSectionElementImpl *>(foot);
 


Comment 6 Stephan Kulow 2004-02-04 21:06:08 UTC
backported now