Bug 165048 - `whitespace: no-wrap` prevents flexbox wrap in Safari
Summary: `whitespace: no-wrap` prevents flexbox wrap in Safari
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 9
Hardware: Mac OS X 10.11
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-11-23 11:02 PST by aviewtoaphil
Modified: 2017-02-28 10:33 PST (History)
4 users (show)

See Also:


Attachments
Flex container not wrapping item to next line (9.90 KB, image/png)
2016-11-23 11:02 PST, aviewtoaphil
no flags Details
Flex container correctly wrapping item to next line (in Chrome, Firefox) (8.38 KB, image/png)
2016-11-23 11:03 PST, aviewtoaphil
no flags Details
Test reduction (360 bytes, text/html)
2016-11-29 08:06 PST, zalan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description aviewtoaphil 2016-11-23 11:02:40 PST
Created attachment 295372 [details]
Flex container not wrapping item to next line

Using the following code, one would expect that when the flex item becomes too narrow to contain its contents, it would wrap to the next flex line. However, in Safari the contents instead overflows the flex item.

Screenshots attached.

<div class="FlexContainer">
  <div class="FlexItem">Item 1</div>
  <div class="FlexItem">Item 2</div>
  <div class="FlexItem">Item 3</div>
</div>

<div class="FlexContainer">
  <div class="FlexItem">Item 1</div>
  <div class="FlexItem">Item 2</div>
  <div class="FlexItem">Item 3 Item 3 Item 3 Item 3 Item 3</div>
</div>

* {
    box-sizing: border-box;
}

.FlexContainer {
    display: flex;
    flex-wrap: wrap;
    margin: 10px;
    width: 50%;
}

.FlexItem {
    flex: 1 0 33%;
    padding: 5px;
    border: 1px solid black;
    white-space: nowrap;
    background: red;
}
Comment 1 aviewtoaphil 2016-11-23 11:03:11 PST
Created attachment 295373 [details]
Flex container correctly wrapping item to next line (in Chrome, Firefox)
Comment 2 zalan 2016-11-29 08:06:25 PST
Created attachment 295596 [details]
Test reduction
Comment 3 Radar WebKit Bug Importer 2016-12-01 12:35:47 PST
<rdar://problem/29464628>
Comment 4 Dave Hyatt 2017-02-28 10:33:50 PST
Fixed by recent changes to merge in with Blink code.