Bug 14309 - Table captions have incorrect width when the table has vertical borders
Summary: Table captions have incorrect width when the table has vertical borders
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tables (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 3243
  Show dependency treegraph
 
Reported: 2007-06-22 05:08 PDT by mitz
Modified: 2022-06-21 14:52 PDT (History)
9 users (show)

See Also:


Attachments
Test case (760 bytes, text/html)
2007-06-22 05:08 PDT, mitz
no flags Details
Caption width off by several pixesl when table has padding. (537 bytes, text/html)
2008-05-14 01:01 PDT, Keith Winkler
no flags Details
Percentage width Caption bug. (806 bytes, text/html)
2008-05-20 11:22 PDT, Jesse
no flags Details
Caption not displaying at 100% of table (3.34 KB, application/xhtml+xml)
2011-03-21 15:16 PDT, Murray Nuttall
no flags Details
Safari 15.5 matches with Chrome but differs from Firefox (728.51 KB, image/png)
2022-06-21 14:44 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2007-06-22 05:08:22 PDT
The attached test case shows that the width of the caption is wrong when it computes to 'auto' or '100%' and the table has vertical borders.
Comment 1 mitz 2007-06-22 05:08:58 PDT
Created attachment 15179 [details]
Test case
Comment 2 mitz 2007-06-24 13:05:25 PDT
In the "100%" cases, Firefox might be trying to follow this sentence from CSS2.1 17.4: "Percentages on 'width' on the table are relative to the anonymous box's containing block, not the anonymous box itself", as it makes the caption as wide as the body.
Comment 3 Keith Winkler 2008-05-14 00:57:41 PDT
The caption width is also wrong (by 5px or so) when the table has any horizontal padding at all--even if the caption is given the same padding.
Comment 4 Keith Winkler 2008-05-14 01:01:07 PDT
Created attachment 21122 [details]
Caption width off by several pixesl when table has padding.

Created attachment showing caption width off by several pixel.
Comment 5 Jesse 2008-05-20 11:22:25 PDT
Created attachment 21258 [details]
Percentage width Caption bug. 

percentage based width of the caption is using the table as the container not the element containing the table. In this example I have set the table width to 50% and the caption width to 50%. This is showing the caption at 50% of the table width (25% of the page width). Where in all other browsers it is showing the caption and the table at 50% of the page. Indicating that the caption should be contained by the page not the table. Can anyone confirm the W3 recommendation on this?
Comment 6 Murray Nuttall 2011-03-21 15:16:35 PDT
Created attachment 86373 [details]
Caption not displaying at 100% of table

I am having this issue with Windows 7 64-bit using either Chrome or Safari.
Comment 7 Matteo Settenvini 2011-10-31 05:24:42 PDT
Is bug #38358 a dupe of this?
Bug present also on GNU/Linux with latest Epiphany and Google Chrome.
Comment 8 Ahmad Saleem 2022-06-21 14:44:12 PDT
Created attachment 460384 [details]
Safari 15.5 matches with Chrome but differs from Firefox

Based on attached test case in Comment 01, Safari 15.5 matches with Chrome Canary 105 but differs from Firefox Nightly 103 as shown in the attached screenshot.

NOTE - Firefox Screenshot is cut half but the "red" box extend beyond visual viewport.

I am not clear on expected behavior and which browser is behaving right but appreciate if someone can have a look and update in quick summary on what is expected behavior inline with web-spec. Thanks!