Closed Bug 1398720 Opened 9 years ago Closed 9 years ago

display:flex ignores bottom padding in children

Categories

(Core :: Layout, defect)

57 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 748518

People

(Reporter: sergey, Unassigned)

Details

Attachments

(1 file)

Attached file index.html —
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0 Build ID: 20170903140023 Steps to reproduce: Open attached index.html and scroll all the way to the end. Actual results: There is no padding at the bottom. Expected results: There is equal padding at all sides.
Component: Untriaged → Layout
Product: Firefox → Core
Thanks for filing. This isn't actually flexbox-specific -- you'll see the same issue if you remove display:flex from your testcase and just set a fixed height on the scrollable element (the <pre>), e.g. if you add pre { height: 50px }. (Flexbox layout has the effect of setting a fixed height, by virtue of trying to fit the flex items into the container more aggressively than block layout.) This was filed previously as bug 748518 -- marking as a dupe of that bug. This behavior is indeed a bit complicated/counterintuitive, but we're matching the w3c specs, as discussed there.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
BTW -- I assume your expectations come from Safari or Chrome (both of which are using WebKit-flavored rendering engines, since Blink is a WebKit fork). Their behavior on this seems to be a special WebKit quirk -- no other rendering engine has the same behavior. I tested Microsoft Edge 15 and Opera's old "Presto" rendering engine (12.15), and they match Firefox's behavior on your attached testcase. I'm just mentioning that to lend credibility to the fact that this isn't a quirky "Firefox-ism" -- instead, the Safari/Chrome behavior is a quirky "WebKit-ism". So: if you reliably want that padding to appear inside of your scrollable area, your best bet is probably to add a wrapper div inside of the <pre>, and put the padding on *that* element. That way the behavior will be well-defined and should work interoperably.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: