margin-top on table-caption with caption-side: left or right is not rendered

NEW
Unassigned

Status

()

7 years ago
7 years ago

People

(Reporter: crazy-daniel, Unassigned)

Tracking

(Depends on: 1 bug, {testcase})

Trunk
testcase
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

545 bytes, text/html
Details
(Reporter)

Description

7 years ago
Created attachment 554719 [details]
testcase

I know, this is table related, not specified in a spec and may actually never get specified at all. I'd just like to have a record or reference.

A caption that is positioned to the left or to the right of a table can't have a margin-top (i.e. margin-top is not rendered on such elements).
margin-bottom works.

According to the description of side caption, margin-top was intended to be rendered, see http://fantasai.inkedblade.net/style/discuss/captions/

Bug 659828 will remove the margin-collapsing of such a margin-top because the table/caption model will be updated to CSS 2.1. That should make it easier to fix this issue.

Comment 1

7 years ago
This might be fixed by including the caption top and bottom margin in nsTableOuterFrame

761   case NS_STYLE_CAPTION_SIDE_RIGHT:
762     case NS_STYLE_CAPTION_SIDE_LEFT:
763       aOrigin.y = aInnerMargin.top;
764       switch (GetCaptionVerticalAlign()) {
765         case NS_STYLE_VERTICAL_ALIGN_MIDDLE:
766           aOrigin.y = NS_MAX(0, aInnerMargin.top + ((aInnerSize.height - aCaptionSize.height) / 2));
767           break;
768         case NS_STYLE_VERTICAL_ALIGN_BOTTOM:
769           aOrigin.y = NS_MAX(0, aInnerMargin.top + aInnerSize.height - aCaptionSize.height);
770           break;
771         default:
772           break;
773       }
You need to log in before you can comment on or make changes to this bug.