mirror of
https://github.com/servo/servo
synced 2026-04-28 18:37:39 +02:00
69 lines
2.9 KiB
HTML
69 lines
2.9 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<title>CSSOM MediaQueryList Test: Properties and Functions</title>
|
|
<link rel="author" title="Joe Balancio" href="mailto:jlbalancio@gmail.com">
|
|
<link rel="help" href="http://www.w3.org/TR/cssom-view/#extensions-to-the-window-interface">
|
|
<link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface">
|
|
<meta name="flags" content="dom">
|
|
<meta name="assert" content="All properties exist and are readonly. All functions exist and are instances of Function">
|
|
<script src="/resources/testharness.js" type="text/javascript"></script>
|
|
<script src="/resources/testharnessreport.js" type="text/javascript"></script>
|
|
</head>
|
|
<body>
|
|
<noscript>Test not run - javascript required.</noscript>
|
|
<div id="log"></div>
|
|
<script type="text/javascript">
|
|
var mediaQueryList;
|
|
test(
|
|
function(){
|
|
assert_inherits(window, "matchMedia");
|
|
mediaQueryList = window.matchMedia('foo');
|
|
}, 'window_inherits_matchmedia', {
|
|
assert: ['window.matchMedia is inherited. If this fails, the rest of the test fails.']
|
|
}
|
|
);
|
|
/*
|
|
MediaQueryList Functions
|
|
*/
|
|
test(
|
|
function(){
|
|
assert_inherits(mediaQueryList, "addListener");
|
|
assert_inherits(mediaQueryList, "removeListener");
|
|
}, 'mediaquerylist_inherited_functions', {
|
|
assert: ['MediaQueryList functions are inherited']
|
|
}
|
|
);
|
|
|
|
test(
|
|
function(){
|
|
assert_true(mediaQueryList.addListener instanceof Function);
|
|
assert_true(mediaQueryList.removeListener instanceof Function);
|
|
}, 'mediaquerylist_functions', {
|
|
assert: ['MediaQueryList functions are instances of Function']
|
|
}
|
|
);
|
|
|
|
/*
|
|
MediaQueryList Properties
|
|
*/
|
|
test(
|
|
function() {
|
|
assert_own_property(mediaQueryList, 'media');
|
|
assert_own_property(mediaQueryList, 'matches');
|
|
}, 'mediaquerylist_properties', {
|
|
assert: ['MediaQueryList properties are owned by window']
|
|
}
|
|
);
|
|
test(
|
|
function() {
|
|
assert_readonly(mediaQueryList, 'media');
|
|
assert_readonly(mediaQueryList, 'matches');
|
|
}, 'mediaquerylist_properties_readonly', {
|
|
assert: ['MediaQueryList properties are readonly']
|
|
}
|
|
);
|
|
|
|
</script>
|
|
</body>
|
|
</html> |