Closed Bug 1177986 Opened 9 years ago Closed 5 years ago

block with whites-space:nowrap ends up with its text sticking out when it follows a float in a shrink-wrap container

Categories

(Core :: Layout: Floats, defect)

defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: sander, Unassigned, NeedInfo)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36

Steps to reproduce:

The width of a flexbox item containing a floating element followed by an element with white-space: nowrap is not calculated correctly. It seems that the width of the floating element is not added to the total width needed by both elements.

A fiddle @ http://jsfiddle.net/ux94dc82/ to illustrates the problem.


Actual results:

Flexbox doesn't grow wide enough to accommodate both paragraphs.


Expected results:

It should be as wide as the first and second paragraph combined. It feels like the calculation is off because the second paragraph is stretched by the white-space: nowrap property, but that's just a hunch.
Component: Untriaged → Layout: Floats
Product: Firefox → Core
Version: 38 Branch → Trunk
So the issue is that we determine the width of the shrink-wrap thing as the max of the width of the unwrappable block and the float, but then don't clear the block past the float (because nothing really prevents the block from shrinking below its intrinsic width in this testcase, so that's exactly what it does).  A simpler testcase not involving flexbox at all:

  <style>
  div {
    border: 1px solid red;
    float: left;
  }
  p:first-child { float: left; }
  p { white-space: nowrap; border: 1px solid blue}
  </style>
  <div>
    <p>Some</p>
    <p>long text</p>
  </div>

David, do we have an existing bug on this that you know of?
Flags: needinfo?(dbaron)
Summary: Flexbox width is incorrect when containing floating elements → block with whites-space:nowrap ends up with its text sticking out when it follows a float in a shrink-wrap container
Attached file reduced testcase 1
(Here's a live version of bz's testcase, FWIW.)

2019-03-06

This bug is part of a group of bugs which have had an open needinfo for at least 12 weeks.

The request for information has not been answered, and we can't move forward on the bug so we are closing it.

If the defect is still present, please reopen this bug with an updated report.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: