- Notifications
You must be signed in to change notification settings - Fork 3.3k
/
Copy pathbutton-min-width.html
47 lines (47 loc) · 1.4 KB
/
button-min-width.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html>
<metacharset="utf-8">
<title>min-width: Should apply to buttons</title>
<linkrel="author" href="mailto:masonf@chromium.org">
<linkrel="help" href="https://www.w3.org/TR/CSS2/visudet.html#min-max-widths">
<scriptsrc="/resources/testharness.js"></script>
<scriptsrc="/resources/testharnessreport.js"></script>
<style>
.button-row {
background-color:#BBB;
display: flex;
flex-direction: row;
width:400px;
margin-top:8px;
}
button {
flex:00 auto;
margin:0px;
}
</style>
<div>
<p>Expected: All buttons should be 200px wide</p>
</div>
<divclass="button-row">
<buttonstyle="min-width: 200px">Foo</button>
<buttonstyle="min-width: 200px">Bar</button>
</div>
<divclass="button-row">
<buttonstyle="min-width: 50%">Foo</button>
<buttonstyle="min-width: 50%">Bar</button>
</div>
<divclass="button-row" style="writing-mode: vertical-rl; height: 100px;flex-direction:column">
<buttonstyle="min-width: 200px">Foo</button>
<buttonstyle="min-width: 200px">Bar</button>
</div>
<divclass="button-row" style="zoom:2">
<buttonstyle="min-width: 200px">Foo</button>
<buttonstyle="min-width: 200px">Bar</button>
</div>
<script>
test(()=>{
letbuttons=document.querySelectorAll("button");
for(letbuttonofdocument.querySelectorAll("button"))
assert_equals(button.offsetWidth,200);
},'min-width should force all buttons to be 200px wide');
</script>