min-width/height should default to auto for flexbox items
[WebKit-https.git] / LayoutTests / fast / css / auto-min-size.html
1 <!DOCTYPE html>
2 <script src='../../resources/js-test-pre.js'></script>
3 <div id=foo></div>
4 <div id="flexbox" style="display: flex;"><div id="flexitem"></div></div>
5 <script>
6 div = document.getElementById('foo');
7 shouldBe('div.style.minWidth', '""');
8 shouldBe('getComputedStyle(div)["min-width"]', '"0px"');
9
10 div.style.minWidth = 'auto';
11 div.style.maxWidth = 'auto';
12 shouldBe('div.style.minWidth', '"auto"');
13 shouldBe('div.style.maxWidth', '""');
14 shouldBe('getComputedStyle(div).minWidth', '"0px"');
15
16 div.style.minWidth = 0;
17 shouldBe('div.style.minWidth', '"0px"');
18 shouldBe('getComputedStyle(div)["min-width"]', '"0px"');
19
20 shouldBe('div.style.minHeight', '""');
21 shouldBe('getComputedStyle(div)["min-height"]', '"0px"');
22
23 div.style.minHeight = 'auto';
24 div.style.maxHeight = 'auto';
25 shouldBe('div.style.minHeight', '"auto"');
26 shouldBe('div.style.maxHeight', '""');
27 shouldBe('getComputedStyle(div).minHeight', '"0px"');
28
29 div.style.minHeight = 0;
30 shouldBe('div.style.minHeight', '"0px"');
31 shouldBe('getComputedStyle(div)["min-height"]', '"0px"');
32
33 var flexitem = document.getElementById("flexitem");
34 shouldBe('flexitem.style.minWidth', '""');
35 shouldBe('getComputedStyle(flexitem)["min-width"]', '"auto"');
36
37 flexitem.style.minWidth = 'auto';
38 flexitem.style.maxWidth = 'auto';
39 shouldBe('flexitem.style.minWidth', '"auto"');
40 shouldBe('flexitem.style.maxWidth', '""');
41 shouldBe('getComputedStyle(flexitem).minWidth', '"auto"');
42
43 flexitem.style.minWidth = 0;
44 shouldBe('flexitem.style.minWidth', '"0px"');
45 shouldBe('getComputedStyle(flexitem)["min-width"]', '"0px"');
46
47 shouldBe('flexitem.style.minHeight', '""');
48 shouldBe('getComputedStyle(flexitem)["min-height"]', '"auto"');
49
50 flexitem.style.minHeight = 'auto';
51 flexitem.style.maxHeight = 'auto';
52 shouldBe('flexitem.style.minHeight', '"auto"');
53 shouldBe('flexitem.style.maxHeight', '""');
54 shouldBe('getComputedStyle(flexitem).minHeight', '"auto"');
55
56 flexitem.style.minHeight = 0;
57 shouldBe('flexitem.style.minHeight', '"0px"');
58 shouldBe('getComputedStyle(flexitem)["min-height"]', '"0px"');
59 </script>
60 <script src='../../resources/js-test-post.js'></script>