Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11132 closed bug (cantfix)

.width() on hidden cell messes up table layout in Google Chrome

Reported by: romario333 Owned by:
Priority: low Milestone: None
Component: dimensions Version: 1.7.1
Keywords: Cc: timmywil
Blocked by: Blocking:

Description

When you call .width() on a hidden cell and than make it visible, the cell is shifted to the right from its original position.

This happens only in Google Chrome (16.0.912.63), in Firefox and IE the table renders correctly.

Here is a simple test case: http://jsfiddle.net/tuR2S/

Change History (8)

comment:1 Changed 10 years ago by timmywil

Component: unfileddimensions
Priority: undecidedlow
Resolution: invalid
Status: newclosed

There is a temporary swap occurring, but given that all of the settable properties are reset properly, the original fiddle can only be a webkit issue.

Nevertheless, if one uses jQuery to show it, the issue does not occur.

http://jsfiddle.net/timmywil/tuR2S/2/

comment:2 Changed 10 years ago by romario333

Last edited 10 years ago by romario333 (previous) (diff)

comment:3 in reply to:  1 Changed 10 years ago by romario333

Replying to timmywil:

There is a temporary swap occurring, but given that all of the settable properties are reset properly, the original fiddle can only be a webkit issue.

Nevertheless, if one uses jQuery to show it, the issue does not occur.

http://jsfiddle.net/timmywil/tuR2S/2/

Not true, when you call show and width on a single cell, issue still occurs:

http://jsfiddle.net/romario333/9bqhA/

comment:4 Changed 10 years ago by romario333

I've reported this issue to WebKit project:

https://bugs.webkit.org/show_bug.cgi?id=75798

I believe jQuery should have workaround for this bug though as I don't know how long it will take guys at WebKit to fix it.

comment:5 Changed 10 years ago by addyosmani

#11156 is a duplicate of this ticket.

comment:6 Changed 10 years ago by addyosmani

Cc: timmywil added
Keywords: needsreview added
Resolution: invalid
Status: closedreopened

Re-opening as this was brought up again in http://bugs.jquery.com/ticket/11156. Given that the submitter believes this is a WebKit issue, do we feel it's widely enough experienced to even consider a workaround?

comment:7 Changed 10 years ago by timmywil

Keywords: needsreview removed
Resolution: cantfix
Status: reopenedclosed

It seems the duplicate was created by the op of this ticket. @romario333: Let's keep the discussion of this issue in this ticket.

As I said before, I don't think there's anything we can do since the css is being reset to their original display values correctly, but webkit is not rendering as it should. A workaround is to show the cell in webkit with .css('display', 'block'), but this would not be viable for core.

http://jsfiddle.net/timmywil/9bqhA/1/

comment:8 Changed 10 years ago by romario333

Ok, I understand that this cannot be easily solved in core.

Your workaround works only in simple scenarios. Problem is that table cell's display should be "table-cell" rather than "block". When it's set to "block", it can lead to other formatting issues. But when you set it to "table-cell", workaround no longer works :(

Note: See TracTickets for help on using tickets.