GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — wpt/css/cssom-view/MediaQueryListEvent.html at master · web-platform-tests/wpt

Expand file tree

/

MediaQueryListEvent.html

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
90 lines (73 loc) · 2.35 KB
/

MediaQueryListEvent.html

Copy path

File metadata and controls

90 lines (73 loc) · 2.35 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="flags" content="dom">
<title>CSS Test: CSSOM View MediaQueryListEvent</title>
<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#mediaquerylistevent">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/matchMedia.js"></script>
<div id="log"></div>
<script>
"use strict";
test(() => {
assert_equals(new MediaQueryListEvent("test").type, "test");
}, 'type can be different from "change"');
test(() => {
const event = new MediaQueryListEvent("change");
assert_equals(event.media, "");
assert_false(event.matches);
assert_false(event.bubbles);
assert_false(event.cancelable);
}, "init dictionary default values");
test(() => {
const event = new MediaQueryListEvent("change", {
media: "test",
matches: true,
bubbles: true,
cancelable: true,
});
assert_equals(event.media, "test");
assert_true(event.matches);
assert_true(event.bubbles);
assert_true(event.cancelable);
}, "init dictionary overrides");
promise_test(async t => {
const mql = await createMQL(t);
let _event;
mql.addListener(event => {
_event = event;
});
triggerMQLEvent(mql);
await waitForChangesReported();
assert_true(_event instanceof getWindow(mql).MediaQueryListEvent);
assert_equals(_event.type, "change");
assert_false(_event.bubbles);
assert_false(_event.cancelable);
}, "argument of addListener");
promise_test(async t => {
const mql = await createMQL(t);
let _event;
mql.onchange = event => {
_event = event;
};
triggerMQLEvent(mql);
await waitForChangesReported();
assert_true(_event instanceof getWindow(mql).MediaQueryListEvent);
assert_equals(_event.type, "change");
assert_false(_event.bubbles);
assert_false(_event.cancelable);
}, "argument of onchange");
promise_test(async t => {
const mql = await createMQL(t);
let _event;
mql.addEventListener("change", event => {
_event = event;
});
triggerMQLEvent(mql);
await waitForChangesReported();
assert_true(_event instanceof getWindow(mql).MediaQueryListEvent);
assert_equals(_event.type, "change");
assert_false(_event.bubbles);
assert_false(_event.cancelable);
}, 'constructor of "change" event');
</script>
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.