KDE Bug Tracking System
Home
Report New Wish or Bug
Query Existing Reports
First
Last
Prev
Next
No search results available
Search page
Bug
58799
:
<td> cellIndex using DOM has incorrect value
P
roduct
:
konqueror
Co
m
ponent
:
khtml ecma
Status
:
RESOLVED
Resolution
:
FIXED
Target
:
---
Version
:
unspecified
Pr
i
ority
:
NOR
Severity
:
normal
V
otes
:
0
Description
:
Opened:
2003-05-22 13:03
Last Changed:
2005-06-17 04:55:59
Version: (using KDE KDE 3.1.2) Installed from: Gentoo Packages Compiler: gcc 3.2.2 OS: Linux I'm using javascript as part of a webapp project, and as part of that project, I track which cell a user has click in an html <table>. Using DOM methods, I lookup the cellIndex of the html element they clicked on. Opera, IE6, Mozilla1.3, and Netscape7 all return the expected value. Konqueror does not. Example: <html> <head> <title>blah</title> </head> <body> <table border=1> <tr> <td onclick="alert(this.cellIndex)">Test1</td> <td onclick="alert(this.cellIndex)">Test2</td> </tr> </table> </body> </html> In all the above browsers mentioned (except Konq, of course) clicking on 'Test1' brings up an alert box displaying '0', and clicking Test2 brings up an alert box display '1'. Konqueror, on the other hand, displays '0' in both cases. I believe this to be a bug.
Comment
#1
George Staikos 2003-07-02 21:12:01
Yes, cellIndex() is not implemented.
Comment
#2
George Staikos 2003-09-29 09:53:37
Better return this to the pool. I don't have time to finish it right now.
Comment
#3
Stephan Kulow 2003-12-02 15:27:42
JFR:
http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-84150186
cellIndex of type long, readonly The index of this cell in the row, starting from 0. This index is in document tree order and not display order.
Comment
#4
Rob Buis 2004-09-26 21:50:31
Created an attachment (id=7690)
[details]
Poposed patch Hi, The attached patch works for this testcase, but maybe it needs more testing? Cheers, Rob.
Comment
#5
Harri Porten 2005-05-07 15:50:40
Applied the patch. Even if it weren't quite right it's better than nothing.
Comment
#6
Maksim Orlovich 2005-06-17 04:48:33
SVN commit 426346 by orlovich: justing in #khtml was looking at the cellIndex commit, and asked: could there be other tags then TD in a TR? The answer is yes, so using nodeIndex for cellIndex isn't quite right. This testcase shows the difference (and the baseline is right). Proper fix upcoming. CCBUG:58799 A baseline/unsorted/58799.html-dom AM baseline/unsorted/58799.html-dump.png A baseline/unsorted/58799.html-render A tests/unsorted/58799.html ** trunk/tests/khtmltests/regression/baseline/unsorted/58799.html-dump.png #property changes Name: svn:mime-type + application/octet-stream
Comment
#7
Maksim Orlovich 2005-06-17 04:55:58
SVN commit 426347 by orlovich: Make cellIndex not count tags != TD, TH when counting its index. Code essentially copies from the sectionRowIndex code from TRs. CCBUG:58799 M +11 -1 html_tableimpl.cpp --- trunk/KDE/kdelibs/khtml/html/html_tableimpl.cpp #426346:426347 @@ -791,7 +791,17 @@ long HTMLTableCellElementImpl::cellIndex() const { - return nodeIndex(); + int cIndex = 0; + const NodeImpl *n = this; + do { + n = n->previousSibling(); + if (n && (n->isElementNode() && n->id() == ID_TD || + n->isElementNode() && n->id() == ID_TH)) + cIndex++; + } + while (n); + + return cIndex; } void HTMLTableCellElementImpl::parseAttribute(AttributeImpl *attr)
P
latform
:
Gentoo Packages
O
S
:
Linux
K
eywords
:
People
Reporter
:
Andrew
Assigned To
:
Konqueror Developers
Related actions
View Bug Activity
Format For Printing
XML
Clone This Bug
Note
You need to
log in
before you can comment on or make changes to this bug.
Attachments
Poposed patch
(1.24 KB, patch)
2004-09-26 21:50
,
Rob Buis
Details
View All
Add an attachment
(proposed patch, testcase, etc.)
Depends on
:
B
locks
:
Show dependency tree
-
Show dependency graph
First
Last
Prev
Next
No search results available
Search page
Actions
Reports
Requests
Reports
Bugs reported today
Bugs reported in the last 3 days
Bug reports with patches
Weekly Bug statistics
The most hated bugs
The most severe bugs
The most frequently reported bugs
The most wanted features
Junior Jobs
Report ownership counts and charts
My Account
New Account
Log In