margin-bottom of <ul> with height less than min-height is ignored

RESOLVED DUPLICATE of bug 616339

Status

()

Core
Layout: Block and Inline
RESOLVED DUPLICATE of bug 616339
3 years ago
3 years ago

People

(Reporter: f.stojentin, Unassigned)

Tracking

38 Branch
x86_64
Windows 8.1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; ASJB; rv:11.0) like Gecko

Steps to reproduce:

I defined a list <ul> with a min-height Attribute and a bottom-margin.


Actual results:

When the actual height of the <ul> is less than the defined min-height, the margin-bottom is ignored.


Expected results:

The value for margin-bottom should be always used, not only when the actual height is greater than the min-height.
(Reporter)

Comment 1

3 years ago
Created attachment 8553610 [details]
Testcase

complete testcase
Component: Untriaged → Layout
Product: Firefox → Core
Version: Firefox 38 → 38 Branch
> I defined a list <ul> with a min-height Attribute and a bottom-margin.

No, your min-height is on the parent of the <ul>.

Presumably the question is what happens for margin-collapsing purposes with the bottom margin when min-height is set on the parent...  It seems to be collapsing kinda weirdly.
Status: UNCONFIRMED → NEW
Component: Layout → Layout: Block and Inline
Ever confirmed: true
Flags: needinfo?(dbaron)
I believe that http://dev.w3.org/csswg/css2/box.html#collapsing-margins says the margins (bottom margin of li, 0, bottom margin of ul, 40px, and bottom margin of div, 0) should collapse.  (Though I hate reading it; see https://lists.w3.org/Archives/Public/www-style/2010Jul/0507.html and https://lists.w3.org/Archives/Public/www-style/2012Mar/0057.html .)

The collapsed 40px margin should, in turn, be outside of the div, according to http://dev.w3.org/csswg/css2/visudet.html#normal-block .


It's possible that fixing this might be as simple as removing this code:
    if (autoBSize != contentBSize) {
      // Our min-height or max-height made our height change.  Don't carry out
      // our kids' block-end margins.
      aMetrics.mCarriedOutBEndMargin.Zero();
    }
in nsBlockFrame::ComputeFinalSize.
Flags: needinfo?(dbaron)
And probably duplicate of bug 616339.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 616339
You need to log in before you can comment on or make changes to this bug.