3 html { font-size:
16px; }
5 <script src=
"../../resources/js-test.js"></script>
7 if (!window
.eventSender
) {
8 document
.write("This test does not work in manual mode.");
10 if (window
.testRunner
)
11 testRunner
.dumpAsText();
13 // These media queries should be equivalent, since the documentElement
14 // has font-size:16px, so 300px should equal 18.75em. They should both
15 // initially be false (as the layout test runner is 800px wide).
17 'matchMedia("(max-width: 300px)").matches');
19 'matchMedia("(max-width: 18.75em)").matches');
22 // While zooming in, the two media queries should either
23 // both match or both not match.
24 var maxZoomLevel
= 20;
26 while (zoomLevel
< maxZoomLevel
) {
27 debug("eventSender.zoomPageIn()");
28 eventSender
.zoomPageIn();
31 if (matchMedia("(max-width: 300px)").matches
)
35 'matchMedia("(max-width: 300px)").matches',
36 'matchMedia("(max-width: 18.75em)").matches');
40 // Once sufficiently zoomed in, both should match.
42 'matchMedia("(max-width: 300px)").matches');
44 'matchMedia("(max-width: 18.75em)").matches');
47 // As soon as we zoom back out, both should stop matching
48 // and continue to not match.
49 while (zoomLevel
> 0) {
50 debug("eventSender.zoomPageOut()");
51 eventSender
.zoomPageOut();
55 'matchMedia("(max-width: 300px)").matches');
57 'matchMedia("(max-width: 18.75em)").matches');