Last Comment Bug 625703 - A flexbox (display:box) element’s margins aren’t collapsed with surrounding elements
: A flexbox (display:box) element’s margins aren’t collapsed with surrounding e...
Status: NEW
:
Product: Core
Classification: Components
Component: General (show other bugs)
: Trunk
: x86 All
: -- normal with 3 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
http://oli.jp/bugs/mozilla/flexbox-ma...
Depends on: 87277
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-14 02:52 PST by Oli Studholme
Modified: 2016-07-12 08:55 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
three box siblings (464 bytes, text/html)
2011-07-16 05:28 PDT, Daniel.S
no flags Details

Description Oli Studholme 2011-01-14 02:52:06 PST
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
Comment 1 Boris Zbarsky [:bz] (still a bit busy) 2011-01-14 06:27:57 PST
Yeah, the margin-collapsing code all lives in nsBlockFrame.  This is basically the same as bug 87277.
Comment 2 Anthony Hughes (:ashughes) [GFX][QA][Mentor] 2011-03-11 11:06:01 PST
Based on comment 1, should this be duped?
Comment 3 Daniel.S 2011-07-16 05:28:25 PDT
Created attachment 546312 [details]
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.
Comment 4 Jose Fandos 2012-04-28 11:47:47 PDT
Confirming
Comment 5 Oli Studholme 2012-11-08 19:15:25 PST
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
Comment 6 Daniel.S 2013-08-24 06:43:09 PDT
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?
Comment 7 Boris Zbarsky [:bz] (still a bit busy) 2013-08-26 20:23:55 PDT
> Is -moz-box going to go away anytime soon

In general no, but for websites, hopefully yes...
Comment 8 chrisharvey2pi 2016-07-12 08:55:18 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.