You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 19, 2021. It is now read-only.
[LayoutNG] First part of ShrinkToFit for flex items
Two places in the spec call for treating an item's inline size as
'fit-content' under certain conditions. This patch implements that
logic.
4 tests now pass and 2 "regress": FlexNG previously rendered the
scrollbars tests and their references so incorrectly that the first
800x600 pixels matched but most of rest of the output actually did not
match. Both the tests and their references are rendered better now, but
the differences now show up in the first 800x600 pixels.
Bug: 845235
Change-Id: I60de7ba4a26e54f6f171ba8a5e05299c3e953452
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1737742
Reviewed-by: Christian Biesinger <[email protected]>
Commit-Queue: David Grogan <[email protected]>
Cr-Commit-Position: refs/heads/master@{#684952}
<metaname="assert" content="A column flex container shrink wraps items both when determining their flex base sizes and when laying them out after their flexed size has been determined." />
8
+
9
+
<style>
10
+
11
+
x-flexbox {
12
+
display: flex;
13
+
flex-direction: column;
14
+
}
15
+
16
+
x-item {
17
+
display: block;
18
+
background: red;
19
+
/* Override default alignment of "stretch" because items don't shrink to fit
20
+
when they are stretched. */
21
+
align-self: start;
22
+
}
23
+
24
+
#mainSizeDependsOnCrossSize {
25
+
padding-bottom:50%;
26
+
background: green;
27
+
}
28
+
29
+
#widthSetter {
30
+
width:100px;
31
+
height:50px;
32
+
background: green;
33
+
}
34
+
35
+
</style>
36
+
37
+
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
38
+
39
+
<x-flexbox>
40
+
<x-item><!-- If fit-content is skipped when determining flex base size, this item gets a main size of 50px + 100vw / 2. -->
0 commit comments