Open Bug 625703 Opened 14 years ago Updated 2 years ago

A flexbox (display:box) element’s margins aren’t collapsed with surrounding elements

Categories

(Core :: General, defect)

x86
All
defect

Tracking

()

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b8) Gecko/20100101 Firefox/4.0b8
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b8) Gecko/20100101 Firefox/4.0b8

Refer to an example at http://oli.jp/bugs/mozilla/flexbox-margin-collapsing.html

Reproducible: Always

Actual Results:  
the margins of an element using display: box to trigger flexible box layout don’t collapse with the margins of surrounding elements

Expected Results:  
margins should collapse as usual
Yeah, the margin-collapsing code all lives in nsBlockFrame.  This is basically the same as bug 87277.
Depends on: 87277
OS: Mac OS X → All
Version: unspecified → Trunk
Based on comment 1, should this be duped?
Whiteboard: DUPEME? [fx4-unco-bugday]
Attached file three box siblings
(In reply to comment #1)
> Yeah, the margin-collapsing code all lives in nsBlockFrame.  This is
> basically the same as bug 87277.

I don't think it is the same issue.

If you look at my testcase, you can see that we treat -moz-box like an inline-block, while WebKit and IE treat it like a block box.

Also, unlike bug 87277 this issue won't be fixed by bug 659828.

I can't tell who's right.
Confirming
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: DUPEME? [fx4-unco-bugday]
Summary: A flexbox element’s margins aren’t collapsed with surrounding elements → A flexbox (display:box) element’s margins aren’t collapsed with surrounding elements
Just FYI this is regarding OLD Flexbox (display: box;), not NEW Flexbox (display: flex;), and the chances of it being fixed are probably not great. For more background:
https://bugzilla.mozilla.org/show_bug.cgi?id=625694
If I read bug 625694 correctly, this bug is either Invalid (since whatever -moz-box does is intended) or Won'tFix (since whatever -moz-box does is being relied on), is it not?

I'd like to add some margin-collapsing tests for -moz-box (in bug 477462), and if there is no bug, I won't mark those test failing.

Is -moz-box going to go away anytime soon, as hinted in bug 625694?
Flags: needinfo?(bzbarsky)
> Is -moz-box going to go away anytime soon

In general no, but for websites, hopefully yes...
Flags: needinfo?(bzbarsky)
Also please remember to update the “[Mastering margin collapsing](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing)” article.

In this article, there is no mention of whether the vertical margins of an element with `display: flex;` should/should not collapse with the vertical margins of its first and last child (as of 2016-07-12 they still do not collapse). This information should be explicitly added to the article to reduce confusion.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: