VERIFIED FIXED 3295
cellIndex is always zero
https://bugs.webkit.org/show_bug.cgi?id=3295
Summary cellIndex is always zero
Jonathan Hurshman
Reported 2005-06-07 05:54:57 PDT
The cellIndex property of TD nodes is always 0, regardless of the actual position of the cell in the row.
Attachments
A testcase for this bug (675 bytes, text/html)
2005-06-07 05:57 PDT, Jonathan Hurshman
no flags
Proposed patch (2.52 KB, patch)
2005-06-17 13:42 PDT, Justin Garcia
hyatt: review+
Proposed patch with better coding style :-) (2.52 KB, patch)
2005-06-17 14:30 PDT, Justin Garcia
hyatt: review+
Remove outdated commnet (522 bytes, patch)
2005-06-18 03:02 PDT, Harri Porten
no flags
Remove outdated comment (522 bytes, patch)
2005-06-18 03:02 PDT, Harri Porten
darin: review+
Jonathan Hurshman
Comment 1 2005-06-07 05:57:27 PDT
Created attachment 2128 [details] A testcase for this bug
Jonathan Hurshman
Comment 2 2005-06-07 06:14:28 PDT
(This bug was copied from Apple's Bug Reporter #3756860)
Allan Sandfeld Jensen
Comment 3 2005-06-13 03:47:53 PDT
Fixed in Konqueror
Justin Garcia
Comment 5 2005-06-17 13:42:32 PDT
Created attachment 2448 [details] Proposed patch
Dave Hyatt
Comment 6 2005-06-17 14:09:36 PDT
+ const NodeImpl * node = this; + int index = 0; + do { + node = node->previousSibling(); + if(node && (node->id() == ID_TD || node->id() == ID_TH)) + index++; + } while(node); for (const NodeImpl* node = node->previousSibling(); node; node = node->previousSibling()) if (node->id() == ID_TH || node->id() == ID_TH) index++; ... reads better to me then a do construct that still ends up null-checking.
Dave Hyatt
Comment 7 2005-06-17 14:10:09 PDT
+ const NodeImpl * node = this; + int index = 0; + do { + node = node->previousSibling(); + if(node && (node->id() == ID_TD || node->id() == ID_TH)) + index++; + } while(node); for (const NodeImpl* node = node->previousSibling(); node; node = node->previousSibling()) { if (node->id() == ID_TD || node->id() == ID_TH) index++; } ... reads better to me then a do construct that still ends up null-checking.
Dave Hyatt
Comment 8 2005-06-17 14:10:59 PDT
node = previousSibling(). Yes, I can write code. Really. ;)
Dave Hyatt
Comment 9 2005-06-17 14:14:40 PDT
Comment on attachment 2448 [details] Proposed patch r=me, would prefer for loop, but don't really feel strongly. :)
Justin Garcia
Comment 10 2005-06-17 14:30:42 PDT
Created attachment 2449 [details] Proposed patch with better coding style :-)
Dave Hyatt
Comment 11 2005-06-17 14:34:53 PDT
Comment on attachment 2449 [details] Proposed patch with better coding style :-) r=me, fix the 8-space indentation to be 4-space though.
Harri Porten
Comment 12 2005-06-18 03:02:43 PDT
Created attachment 2456 [details] Remove outdated commnet I don't think the comment is valid anymore.
Harri Porten
Comment 13 2005-06-18 03:02:47 PDT
Created attachment 2457 [details] Remove outdated comment I don't think the comment is valid anymore.
Darin Adler
Comment 14 2005-06-18 21:02:17 PDT
Patch looks good, and since Justin has commit privileges I'm not going to land it for him. Justin, you should commit this!
Darin Adler
Comment 15 2005-06-19 11:57:24 PDT
The for loop idiom is pretty nice, nicer than the original do/while. There's also a good while idiom for this sort of thing that you can see in functions like HTMLOptionElementImpl::text.
Anders Carlsson
Comment 16 2005-06-24 08:16:13 PDT
*** Bug 3623 has been marked as a duplicate of this bug. ***
Joost de Valk (AlthA)
Comment 17 2005-07-13 23:05:31 PDT
Fixed in 10.4.2
Note You need to log in before you can comment on or make changes to this bug.