Ticket #5759 (closed bug: wontfix)
Webkit table cell replaceWith() issue
| Reported by: | kuvik | Owned by: | |
|---|---|---|---|
| Priority: | critical | Milestone: | 1.4 |
| Component: | core | Version: | 1.4a2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Hi,
I found a bug in jQuery 1.4a2: When you use a replaceWith() method on a hidden table cell, it breaks the table in Webkit browsers (for example Chrome 3). In IE8, Firefox 3.5 and Opera 10 it works correctly.
I also tried jQuery 1.3.2 and it doesn't show the bug in any browser.
Testcase (1.3.2): http://gamca.informacie.sk/betatest/webkit_table2/index_1-3-2.html Testcase (1.4a2): http://gamca.informacie.sk/betatest/webkit_table2/index_1-4a2.html
Change History
comment:2 Changed 3 years ago by john
- Status changed from new to closed
- Resolution set to wontfix
I'm going to have to concur with Dave here - I think it's an issue with Webkit's CSS :first-child rendering, unfortunately. And doubly-unfortunately there's not a whole lot that we can do to fix it. My suggestion would be to add a class to the first child in the page and style it that way - it'd be much more likely to be consistent across all browsers, too.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Seems like it may be related to this fix?
http://github.com/jquery/jquery/commit/2a6de9ab66653e5e424d9cc79d195b555158d04f
The test page has this css rule:
table td:first-child { display: none; }With 1.4 it's removing the first td from the document before inserting the replacement, so maybe Safari is then hiding the second td based on the rule. You would think that reinserting the replacement td as the first child would make it show again, but that doesn't seem to be happening?