Update web-platform-tests to revision 5ca972e15cfa80277964645d9ee5ccd87a661337

This commit is contained in:
WPT Sync Bot 2018-02-25 20:08:45 -05:00
parent 072badabac
commit 908e01b499
30 changed files with 811 additions and 289 deletions

View file

@ -271288,6 +271288,41 @@
{}
]
],
"feature-policy/feature-policy-header-policy-allowed-for-all.https.sub.html.sub.headers": [
[
{}
]
],
"feature-policy/feature-policy-header-policy-allowed-for-self.https.sub.html.sub.headers": [
[
{}
]
],
"feature-policy/feature-policy-header-policy-allowed-for-some.https.sub.html.sub.headers": [
[
{}
]
],
"feature-policy/feature-policy-header-policy-disallowed-for-all.https.sub.html.sub.headers": [
[
{}
]
],
"feature-policy/feature-policy-nested-header-policy-allowed-for-all.https.sub.html.sub.headers": [
[
{}
]
],
"feature-policy/feature-policy-nested-header-policy-allowed-for-self.https.sub.html.sub.headers": [
[
{}
]
],
"feature-policy/feature-policy-nested-header-policy-disallowed-for-all.https.sub.html.sub.headers": [
[
{}
]
],
"feature-policy/payment-allowed-by-feature-policy.https.sub.html.headers": [
[
{}
@ -271313,6 +271348,11 @@
{}
]
],
"feature-policy/resources/feature-policy-allowedfeatures.html": [
[
{}
]
],
"feature-policy/resources/feature-policy-autoplay.html": [
[
{}
@ -271323,6 +271363,11 @@
{}
]
],
"feature-policy/resources/feature-policy-nested-subframe-policy.https.sub.html": [
[
{}
]
],
"feature-policy/resources/feature-policy-payment.html": [
[
{}
@ -315455,15 +315500,15 @@
{}
]
],
"css/css-typed-om/stylevalue-normalization/normalize-numeric.tentative.html": [
"css/css-typed-om/stylevalue-normalization/normalize-image.html": [
[
"/css/css-typed-om/stylevalue-normalization/normalize-numeric.tentative.html",
"/css/css-typed-om/stylevalue-normalization/normalize-image.html",
{}
]
],
"css/css-typed-om/stylevalue-normalization/normalize-resource.tentative.html": [
"css/css-typed-om/stylevalue-normalization/normalize-numeric.tentative.html": [
[
"/css/css-typed-om/stylevalue-normalization/normalize-resource.tentative.html",
"/css/css-typed-om/stylevalue-normalization/normalize-numeric.tentative.html",
{}
]
],
@ -315509,6 +315554,12 @@
{}
]
],
"css/css-typed-om/stylevalue-serialization/cssImageValue.html": [
[
"/css/css-typed-om/stylevalue-serialization/cssImageValue.html",
{}
]
],
"css/css-typed-om/stylevalue-serialization/cssKeywordValue.tentative.html": [
[
"/css/css-typed-om/stylevalue-serialization/cssKeywordValue.tentative.html",
@ -315545,12 +315596,6 @@
{}
]
],
"css/css-typed-om/stylevalue-serialization/cssUrlImageValue.tentative.html": [
[
"/css/css-typed-om/stylevalue-serialization/cssUrlImageValue.tentative.html",
{}
]
],
"css/css-typed-om/stylevalue-subclasses/cssKeywordValue-invalid.html": [
[
"/css/css-typed-om/stylevalue-subclasses/cssKeywordValue-invalid.html",
@ -315653,24 +315698,6 @@
{}
]
],
"css/css-typed-om/stylevalue-subclasses/cssUrlImageValue-interface.html": [
[
"/css/css-typed-om/stylevalue-subclasses/cssUrlImageValue-interface.html",
{}
]
],
"css/css-typed-om/stylevalue-subclasses/cssUrlImageValue-invalid.html": [
[
"/css/css-typed-om/stylevalue-subclasses/cssUrlImageValue-invalid.html",
{}
]
],
"css/css-typed-om/stylevalue-subclasses/cssUrlImageValue.html": [
[
"/css/css-typed-om/stylevalue-subclasses/cssUrlImageValue.html",
{}
]
],
"css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html": [
[
"/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html",
@ -322809,6 +322836,48 @@
{}
]
],
"feature-policy/feature-policy-header-policy-allowed-for-all.https.sub.html": [
[
"/feature-policy/feature-policy-header-policy-allowed-for-all.https.sub.html",
{}
]
],
"feature-policy/feature-policy-header-policy-allowed-for-self.https.sub.html": [
[
"/feature-policy/feature-policy-header-policy-allowed-for-self.https.sub.html",
{}
]
],
"feature-policy/feature-policy-header-policy-allowed-for-some.https.sub.html": [
[
"/feature-policy/feature-policy-header-policy-allowed-for-some.https.sub.html",
{}
]
],
"feature-policy/feature-policy-header-policy-disallowed-for-all.https.sub.html": [
[
"/feature-policy/feature-policy-header-policy-disallowed-for-all.https.sub.html",
{}
]
],
"feature-policy/feature-policy-nested-header-policy-allowed-for-all.https.sub.html": [
[
"/feature-policy/feature-policy-nested-header-policy-allowed-for-all.https.sub.html",
{}
]
],
"feature-policy/feature-policy-nested-header-policy-allowed-for-self.https.sub.html": [
[
"/feature-policy/feature-policy-nested-header-policy-allowed-for-self.https.sub.html",
{}
]
],
"feature-policy/feature-policy-nested-header-policy-disallowed-for-all.https.sub.html": [
[
"/feature-policy/feature-policy-nested-header-policy-disallowed-for-all.https.sub.html",
{}
]
],
"feature-policy/payment-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html": [
[
"/feature-policy/payment-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html",
@ -519455,19 +519524,19 @@
"testharness"
],
"css/css-typed-om/resources/testhelper.js": [
"4465d71eb78c55793d0fb9929cb50b658effde4e",
"8721d62337a2183c1911a9818f65a32f13c50275",
"support"
],
"css/css-typed-om/stylevalue-normalization/normalize-ident.tentative.html": [
"162ce70613e78bb007ea24ea525ec78ef17cd3bd",
"testharness"
],
"css/css-typed-om/stylevalue-normalization/normalize-numeric.tentative.html": [
"65c2418988148bf9662f5f502bb4650cc6105a85",
"css/css-typed-om/stylevalue-normalization/normalize-image.html": [
"8b1e6ee80ae4f8c15e93ec373302983237e259cf",
"testharness"
],
"css/css-typed-om/stylevalue-normalization/normalize-resource.tentative.html": [
"fb966359dae9203a6ef503af8c5dc2c5c20652b2",
"css/css-typed-om/stylevalue-normalization/normalize-numeric.tentative.html": [
"65c2418988148bf9662f5f502bb4650cc6105a85",
"testharness"
],
"css/css-typed-om/stylevalue-normalization/normalize-tokens.tentative.html": [
@ -519502,6 +519571,10 @@
"2b6761e72a7867218d2f9d9f780569b342c1d89c",
"testharness"
],
"css/css-typed-om/stylevalue-serialization/cssImageValue.html": [
"22842f8738aab99af0c5c76977976c8e2de788a6",
"testharness"
],
"css/css-typed-om/stylevalue-serialization/cssKeywordValue.tentative.html": [
"004752ad2e9682845697d668af158679031f65dc",
"testharness"
@ -519526,10 +519599,6 @@
"d2881899fa46277dc15828dca1354d7adfe422c0",
"testharness"
],
"css/css-typed-om/stylevalue-serialization/cssUrlImageValue.tentative.html": [
"7b7fa7d06c5dcf614864bab0adef083359278ab6",
"testharness"
],
"css/css-typed-om/stylevalue-subclasses/cssKeywordValue-invalid.html": [
"63600cc74e62ecbaf98bf786de17362764ec947e",
"testharness"
@ -519598,18 +519667,6 @@
"46d36ae2dc68f3f3f1cee5d85cb5f496b7c3fa67",
"testharness"
],
"css/css-typed-om/stylevalue-subclasses/cssUrlImageValue-interface.html": [
"5565653081f6615d8d88323b98ed670a653bef9b",
"testharness"
],
"css/css-typed-om/stylevalue-subclasses/cssUrlImageValue-invalid.html": [
"2d776d5a92feebe4803434878c3f76973313063b",
"testharness"
],
"css/css-typed-om/stylevalue-subclasses/cssUrlImageValue.html": [
"800e58619dc18c65ae0cae405f44d71c93080f01",
"testharness"
],
"css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html": [
"ba012ace40e63718694a8cd91ba74039787ff666",
"testharness"
@ -519859,7 +519916,7 @@
"testharness"
],
"css/css-typed-om/the-stylepropertymap/properties/resources/testsuite.js": [
"a3df35f32209493e429282b89f4fdcc6581abe07",
"f09e5026ade5e844fdb5241fa5fea082379ef420",
"support"
],
"css/css-typed-om/the-stylepropertymap/properties/right.html": [
@ -547286,6 +547343,62 @@
"2ae1da8e026e63625a6168b842303cc156963ced",
"support"
],
"feature-policy/feature-policy-header-policy-allowed-for-all.https.sub.html": [
"4d27ea669ef4362242db87a5abda1589b985bf20",
"testharness"
],
"feature-policy/feature-policy-header-policy-allowed-for-all.https.sub.html.sub.headers": [
"bfcf350d87faae8e6cf4b2beb9fee84957cac449",
"support"
],
"feature-policy/feature-policy-header-policy-allowed-for-self.https.sub.html": [
"0d4facd79afb3a504aea2945937abdc12687eb12",
"testharness"
],
"feature-policy/feature-policy-header-policy-allowed-for-self.https.sub.html.sub.headers": [
"ea3519ed0612b18268c0df22a1c9472e404c2573",
"support"
],
"feature-policy/feature-policy-header-policy-allowed-for-some.https.sub.html": [
"0874eda2163926eb3bac6578141ea7099d02658d",
"testharness"
],
"feature-policy/feature-policy-header-policy-allowed-for-some.https.sub.html.sub.headers": [
"035bf4abe912636d5bd070eb20d573cf9c464565",
"support"
],
"feature-policy/feature-policy-header-policy-disallowed-for-all.https.sub.html": [
"bd1232467941a7760f4df7432bfc80733604575d",
"testharness"
],
"feature-policy/feature-policy-header-policy-disallowed-for-all.https.sub.html.sub.headers": [
"256d942867a563b1053629884cdeb52f6d5096ca",
"support"
],
"feature-policy/feature-policy-nested-header-policy-allowed-for-all.https.sub.html": [
"593523f11a7209097771a713f28e5c497f05faa1",
"testharness"
],
"feature-policy/feature-policy-nested-header-policy-allowed-for-all.https.sub.html.sub.headers": [
"bfcf350d87faae8e6cf4b2beb9fee84957cac449",
"support"
],
"feature-policy/feature-policy-nested-header-policy-allowed-for-self.https.sub.html": [
"56d721c8f2640eee31bf1148db07e91bbf812f46",
"testharness"
],
"feature-policy/feature-policy-nested-header-policy-allowed-for-self.https.sub.html.sub.headers": [
"ea3519ed0612b18268c0df22a1c9472e404c2573",
"support"
],
"feature-policy/feature-policy-nested-header-policy-disallowed-for-all.https.sub.html": [
"69b7667d23f4a49ef8d8ed5a8c5fece2b987d718",
"testharness"
],
"feature-policy/feature-policy-nested-header-policy-disallowed-for-all.https.sub.html.sub.headers": [
"f20475f628a5f4a3067b8682019054e3f31c703a",
"support"
],
"feature-policy/payment-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html": [
"22d155755cd7aaff8a1c40c597468066f01eb13b",
"testharness"
@ -547346,6 +547459,10 @@
"6b1dd45e19dff4759b4d165cdfd59970e4212058",
"support"
],
"feature-policy/resources/feature-policy-allowedfeatures.html": [
"0a1d2012f5ceb69ac0e3f358f594bb71141fd805",
"support"
],
"feature-policy/resources/feature-policy-autoplay.html": [
"34eb416a1b8981460d2055108b255bec7f639f04",
"support"
@ -547354,6 +547471,10 @@
"5d4a1f3eaf253211128f35990a94e1e0c91c1391",
"support"
],
"feature-policy/resources/feature-policy-nested-subframe-policy.https.sub.html": [
"c259c3a175099778b66b980876b74a112276855b",
"support"
],
"feature-policy/resources/feature-policy-payment.html": [
"958b32f77b02f2ff80cf174aadac62237d79056b",
"support"
@ -547375,7 +547496,7 @@
"support"
],
"feature-policy/resources/featurepolicy.js": [
"d2d5194fab261d7aa0b8d1b31077a42316f5f351",
"f6bb46c7ababec6a7902b1ed2b00a7803e0a7e1d",
"support"
],
"feature-policy/resources/picture-in-picture.js": [
@ -568847,7 +568968,7 @@
"support"
],
"interfaces/css-typed-om.idl": [
"81635661dbf769b0099d04ae7820784348f58e30",
"3c918afebfb20266dd4003e71a008ed19c448fbc",
"support"
],
"interfaces/cssom-view.idl": [

View file

@ -1,2 +0,0 @@
[vh_not_refreshing_on_chrome.html]
expected: FAIL

View file

@ -1,4 +0,0 @@
[010.html]
[Salvagability of document.opened document]
expected: FAIL

View file

@ -66,12 +66,6 @@ function assert_style_value_equals(a, b) {
case 'CSSMatrixComponent':
assert_matrix_approx_equals(a.matrix, b.matrix, 1e-6);
break;
case 'CSSURLImageValue':
assert_equals(a.instrinsicWidth, b.instrinsicWidth);
assert_equals(a.instrinsicHeight, b.instrinsicHeight);
assert_equals(a.instrinsicRatio, b.instrinsicRatio);
assert_equals(a.url, b.url);
break;
default:
assert_equals(a, b);
break;

View file

@ -0,0 +1,30 @@
<!doctype html>
<meta charset="utf-8">
<title>CSSImageValue normalization tests</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#resourcevalue-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<body>
<script>
'use strict';
const gTestUrl = '/media/1x1-green.png';
const gBadTestUrl = document.location.href;
test(t => {
const result = CSSStyleValue.parse('background-image', 'url("' + gTestUrl + '")');
assert_class_string(result, 'CSSImageValue');
}, 'Normalizing a valid <url> returns a CSSImageValue');
test(t => {
const result = CSSStyleValue.parse('background-image', 'url("' + gBadTestUrl + '")');
assert_class_string(result, 'CSSImageValue');
}, 'Normalizing a bad <url> returns a CSSImageValue');
test(t => {
const result = CSSStyleValue.parse('background-image', 'linear-gradient(red, orange)');
assert_equals(result.constructor.name, 'CSSImageValue');
}, 'Normalizing a <gradient> returns a CSSImageValue');
</script>

View file

@ -1,56 +0,0 @@
<!doctype html>
<meta charset="utf-8">
<title>CSSResourceValue normalization tests</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#resourcevalue-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<body>
<script>
'use strict';
const gTestUrl = '/media/1x1-green.png';
const gBadTestUrl = document.location.href;
async_test(t => {
const result = CSSStyleValue.parse('background-image', 'url("' + gTestUrl + '")');
assert_equals(result.constructor.name, 'CSSURLImageValue');
assert_equals(result.intrinsicWidth, null);
assert_equals(result.intrinsicHeight, null);
assert_equals(result.intrinsicRatio, null);
assert_equals(result.state, 'unloaded');
let image = loadImageResource(t, result);
image.addEventListener('load', t.step_func_done(() => {
assert_equals(result.url, gTestUrl);
assert_equals(result.state, 'loaded');
assert_equals(result.intrinsicWidth, 1);
assert_equals(result.intrinsicHeight, 1);
assert_equals(result.intrinsicRatio, 1);
}));
}, 'Normalizing a valid <url> returns a CSSURLImageValue that eventually loads');
async_test(t => {
const result = CSSStyleValue.parse('background-image', 'url("' + gBadTestUrl + '")');
assert_equals(result.constructor.name, 'CSSURLImageValue');
let image = loadImageResource(t, result);
image.addEventListener('error', t.step_func_done(() => {
assert_equals(result.url, gBadTestUrl);
assert_equals(result.state, 'error');
assert_equals(result.intrinsicWidth, null);
assert_equals(result.intrinsicHeight, null);
assert_equals(result.intrinsicRatio, null);
}));
}, 'Normalizing a bad <url> returns a CSSURLImageValue in error state');
test(t => {
const result = CSSStyleValue.parse('background-image', 'linear-gradient(red, orange)');
assert_equals(result.constructor.name, 'CSSImageValue');
assert_equals(result.state, 'loaded');
assert_equals(result.intrinsicWidth, null);
assert_equals(result.intrinsicHeight, null);
assert_equals(result.intrinsicRatio, null);
}, 'Normalizing a <gradient> returns a CSSImageValue');
</script>

View file

@ -0,0 +1,19 @@
<!doctype html>
<meta charset="utf-8">
<title>CSSURLImageValue serialization tests</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#urlimagevalue-serialization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<body>
<div id="log"></div>
<div id="testUrl" style="background-image: url('/media/1x1-green.png')"></div>
<script>
'use strict';
test(() => {
const result = document.getElementById('testUrl').attributeStyleMap.get('background-image');
assert_equals(result.toString(), 'url("/media/1x1-green.png")');
}, 'CSSUrlImageValue serializes correctly');
</script>

View file

@ -1,15 +0,0 @@
<!doctype html>
<meta charset="utf-8">
<title>IDL-constructed CSSURLImageValue serialization tests</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#urlimagevalue-serialization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<script>
'use strict';
test(() => {
assert_equals(new CSSURLImageValue('http://foo.bar').toString(), 'url("http://foo.bar")');
}, 'CSSUrlImageValue constructed from IDL serializes correctly');
</script>

View file

@ -1,22 +0,0 @@
<!doctype html>
<meta charset=utf-8>
<title>CSSURLImageValue IDL</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssurlimagevalue">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>
<script type="text/plain" id="idl">
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet),
Constructor(USVString url)]
interface CSSURLImageValue : CSSImageValue {
readonly attribute USVString url;
};
</script>
<script>
'use strict';
const idlArray = new IdlArray();
idlArray.add_untested_idls('interface CSSImageValue { stringifier; };');
idlArray.add_idls(document.getElementById('idl').textContent);
idlArray.test();
</script>

View file

@ -1,17 +0,0 @@
<!doctype html>
<meta charset="utf-8">
<title>CSSURLImageValue Error Handling</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#imagevalue-objects">
<meta name="assert" content="Test CSSURLImageValue constructor error handling" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<div id="log">
<script>
'use strict';
test(() => {
assert_throws(new TypeError(), () => new CSSURLImageValue("file://:invalid url"));
}, 'Constructing a CSSURLImageValue with an invalid URL throws a TypeError');
</script>

View file

@ -1,81 +0,0 @@
<!doctype html>
<meta charset="utf-8">
<title>CSSURLImageValue</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#imagevalue-objects">
<meta name="assert" content="Test CSSURLImageValue constructor and attributes" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<body>
<div id="log">
<script>
'use strict';
const gTestUrl = '/media/1x1-green.png';
const gBase64TestUrl = 'data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=';
const gBadTestUrl = document.location.href;
test(() => {
const result = new CSSURLImageValue(gTestUrl);
assert_not_equals(result, null,
'A CSSURLImageValue should be created');
assert_equals(result.url, gTestUrl,
'url member should be same as passed in the constructor');
assert_equals(result.intrinsicWidth, null, 'intrinsicWidth');
assert_equals(result.intrinsicHeight, null, 'intrinsicHeight');
assert_equals(result.intrinsicRatio, null, 'intrinsicRatio');
assert_equals(result.state, 'unloaded', 'state');
}, 'Constructing a CSSURLImageValue with a valid URL puts it in an ' +
'unloaded state');
async_test(t => {
const result = new CSSURLImageValue(gTestUrl);
let image = loadImageResource(t, result);
image.addEventListener('load', t.step_func_done(() => {
assert_equals(result.url, gTestUrl,
'url member should be same as passed in the constructor');
assert_equals(result.state, 'loaded', 'state');
assert_equals(result.intrinsicWidth, 1,
'intrinsicWidth member should be width of loaded image');
assert_equals(result.intrinsicHeight, 1,
'intrinsicHeight member should be height of loaded image');
assert_equals(result.intrinsicRatio, 1,
'intrinsicRatio member should be ratio of loaded image');
}));
}, 'Constructing a CSSURLImageValue from a URL sets its state to loaded');
async_test(t => {
const result = new CSSURLImageValue(gBase64TestUrl);
let image = loadImageResource(t, result);
image.addEventListener('load', t.step_func_done(() => {
assert_equals(result.url, gBase64TestUrl,
'url member should be same as passed in the constructor');
assert_equals(result.state, 'loaded', 'state');
assert_equals(result.intrinsicWidth, 1,
'intrinsicWidth member should be width of loaded image');
assert_equals(result.intrinsicHeight, 1,
'intrinsicHeight member should be height of loaded image');
assert_equals(result.intrinsicRatio, 1,
'intrinsicRatio member should be ratio of loaded image');
}));
}, 'Constructing a CSSURLImageValue from a base64 URL sets its state to loaded');
async_test(t => {
const result = new CSSURLImageValue(gBadTestUrl);
let image = loadImageResource(t, result);
image.addEventListener('error', t.step_func_done(() => {
assert_equals(result.url, gBadTestUrl,
'url member should be same as passed in the constructor');
assert_equals(result.state, 'error', 'state');
assert_equals(result.intrinsicWidth, null, 'intrinsicWidth');
assert_equals(result.intrinsicHeight, null, 'intrinsicHeight');
assert_equals(result.intrinsicRatio, null, 'intrinsicRatio');
}));
}, 'Constructing a CSSURLImageValue from a URL to an invalid image sets ' +
'its state to error');
</script>

View file

@ -145,22 +145,6 @@ const gTestSyntaxExamples = {
}
],
},
'<image>': {
description: 'an image',
examples: [
{
description: "a PNG image",
input: new CSSURLImageValue('/media/1x1.png'),
defaultComputed: (_, result) => {
// URLs compute to absolute URLs
assert_true(result instanceof CSSURLImageValue,
'Computed value should be a CSSURLImageValue');
assert_true(result.url.endsWith('/media/1x1.png'),
'Computed value should be an absolute URL');
}
}
],
},
'<transform>': {
description: 'a transform',
examples: [
@ -218,6 +202,24 @@ function testPropertyValid(propertyName, examples, specified, computed, descript
}, `Can set '${propertyName}' to ${description}`);
}
// We have to special case CSSImageValue as they cannot be created with a
// constructor and are completely opaque.
function testIsImageValidForProperty(propertyName) {
test(t => {
let element1 = createDivWithStyle(t, `${propertyName}: url("/media/1x1-green.png")`);
let element2 = createDivWithStyle(t);
const result = element1.attributeStyleMap.get(propertyName);
assert_not_equals(result, null, 'Image value must not be null');
assert_class_string(result, 'CSSImageValue',
'Image value must be a CSSImageValue');
element2.attributeStyleMap.set(propertyName, result);
assert_equals(element2.style[propertyName], element1.style[propertyName],
'Image value can be set on different element');
}, `Can set '${propertyName}' to an image`);
}
// Test that styleMap.set throws for invalid values
function testPropertyInvalid(propertyName, examples, description) {
test(t => {
@ -289,6 +291,12 @@ function runPropertyTests(propertyName, testCases) {
'CSS-wide keywords');
for (const testCase of testCases) {
// <image> is a special case
if (testCase.syntax === '<image>') {
testIsImageValidForProperty(propertyName);
continue;
}
// Retrieve test examples for this test case's syntax. If the syntax
// looks like a keyword, then create an example on the fly.
const syntaxExamples = testCase.syntax.match(/^[a-z\-]+$/) ?

View file

@ -0,0 +1,46 @@
<!DOCTYPE html>
<body>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/feature-policy/resources/featurepolicy.js></script>
<!-- Feature-Policy: fullscreen *; -->
<script>
'use strict';
var same_origin = 'https://{{domains[]}}:{{ports[https][0]}}';
var cross_origin = 'https://{{domains[www]}}:{{ports[https][0]}}';
var same_origin_src = '/feature-policy/resources/feature-policy-allowedfeatures.html';
var cross_origin_src = cross_origin + same_origin_src;
var header_policy = 'Feature-Policy: fullscreen *';
// Test that fullscreen's allowlist is ['*']
test(function() {
assert_array_equals(
document.policy.getAllowlistForFeature('fullscreen'),
['*']);
}, header_policy + ' -- test allowlist is ['*']');
// Test that fullscreen is allowed on all subframes.
test_allowed_feature_for_subframe(
header_policy + ' -- test fullscreen is allowed on same-origin subframe',
'fullscreen',
same_origin_src);
test_allowed_feature_for_subframe(
header_policy + ' -- test fullscreen is allowed on cross-origin subframe',
'fullscreen',
cross_origin_src);
// Dynamically update sub frame's container policy
var allow = "fullscreen 'self';"
test_allowed_feature_for_subframe(
header_policy + ', iframe.allow = ' + allow + ' -- test fullscreen is allowed on same-origin subframe',
'fullscreen',
same_origin_src,
allow);
test_disallowed_feature_for_subframe(
header_policy + ', iframe.allow = ' + allow + ' -- test fullscreen is disallowed on cross-origin subframe',
'fullscreen',
cross_origin_src,
allow);
</script>
</body>

View file

@ -0,0 +1,46 @@
<!DOCTYPE html>
<body>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/feature-policy/resources/featurepolicy.js></script>
<!-- Feature-Policy: fullscreen 'self'; -->
<script>
'use strict';
var same_origin = 'https://{{domains[]}}:{{ports[https][0]}}';
var cross_origin = 'https://{{domains[www]}}:{{ports[https][0]}}';
var same_origin_src = '/feature-policy/resources/feature-policy-allowedfeatures.html';
var cross_origin_src = cross_origin + same_origin_src;
var header_policy = 'Feature-Policy: fullscreen \'self\'';
// Test that fullscreen's allowlist is ['same_origin']
test(function() {
assert_array_equals(
document.policy.getAllowlistForFeature('fullscreen'),
[same_origin]);
}, header_policy + ' -- test allowlist is [same_origin]');
// Test that fullscreen is only allowed on same-origin subframe.
test_allowed_feature_for_subframe(
header_policy + ' -- test fullscreen is allowed on same-origin subframe',
'fullscreen',
same_origin_src);
test_disallowed_feature_for_subframe(
header_policy + ' -- test fullscreen is disallowed on cross-origin subframe',
'fullscreen',
cross_origin_src);
// Dynamically update sub frame's container policy
var allow = "fullscreen 'src';"
test_allowed_feature_for_subframe(
header_policy + ', iframe.allow = ' + allow + ' -- test fullscreen is allowed on same-origin subframe',
'fullscreen',
same_origin_src,
allow);
test_allowed_feature_for_subframe(
header_policy + ', iframe.allow = ' + allow + ' -- test fullscreen is allowed on cross-origin subframe',
'fullscreen',
same_origin_src,
allow);
</script>
</body>

View file

@ -0,0 +1,52 @@
<!DOCTYPE html>
<body>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/feature-policy/resources/featurepolicy.js></script>
<!-- Feature-Policy: fullscreen 'self' cross_origin https://www.example.com; -->
<script>
'use strict';
var same_origin = 'https://{{domains[]}}:{{ports[https][0]}}';
var cross_origin = 'https://{{domains[www]}}:{{ports[https][0]}}';
var same_origin_src = '/feature-policy/resources/feature-policy-allowedfeatures.html';
var cross_origin_src = cross_origin + same_origin_src;
var header_policy = 'Feature-Policy: fullscreen \'self\' ' + cross_origin +
' https://www.example.com;';
// Test that fullscreen's allowlist is [same_origin, cross_origin, 'https://www.example.com']
test(function() {
assert_array_equals(
document.policy.getAllowlistForFeature('fullscreen'),
[same_origin, cross_origin, 'https://www.example.com']);
}, header_policy + ' -- test allowlist is [same_origin, cross_origin, https://www.example.com]');
// Test that fullscreen is allowed on same_origin, some cross_origin subframes.
test_allowed_feature_for_subframe(
header_policy + ' -- test fullscreen is allowed on same-origin subframe',
'fullscreen',
same_origin_src);
test_allowed_feature_for_subframe(
header_policy + ' -- test fullscreen is allowed on cross-origin ' + cross_origin_src + ' subframe',
'fullscreen',
cross_origin_src);
var cross_origin_src1 = 'https://{{domains[www1]}}:{{ports[https][0]}}' + same_origin_src;
test_disallowed_feature_for_subframe(
header_policy + ' -- test fullscreen is disallowed on cross-origin ' + cross_origin_src1 + ' subframe',
'fullscreen',
cross_origin_src1);
// dynamically update sub frame's container policy
var allow = "fullscreen 'none';"
test_disallowed_feature_for_subframe(
header_policy + ', iframe.allow = ' + allow + ' -- test fullscreen is disallowed on same-origin subframe',
'fullscreen',
same_origin_src,
allow);
test_disallowed_feature_for_subframe(
header_policy + 'iframe.allow = ' + allow + ' -- test fullscreen is disallowed on cross-origin subframe',
'fullscreen',
cross_origin_src,
allow);
</script>
</body>

View file

@ -0,0 +1 @@
Feature-Policy: fullscreen 'self' https://{{domains[www]}}:{{ports[https][0]}} https://www.example.com;

View file

@ -0,0 +1,46 @@
<!DOCTYPE html>
<body>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/feature-policy/resources/featurepolicy.js></script>
<!-- Feature-Policy: fullscreen 'none'; -->
<script>
'use strict';
var same_origin = 'https://{{domains[]}}:{{ports[https][0]}}';
var cross_origin = 'https://{{domains[www]}}:{{ports[https][0]}}';
var same_origin_src = '/feature-policy/resources/feature-policy-allowedfeatures.html';
var cross_origin_src = cross_origin + same_origin_src;
var header_policy = 'Feature-Policy: fullscreen \'none\'';
// Test that fullscreen's allowlist is []
test(function() {
assert_array_equals(
document.policy.getAllowlistForFeature('fullscreen'),
[]);
}, header_policy + ' -- test allowlist is []');
// Test that fullscreen is disallowed on all subframes.
test_disallowed_feature_for_subframe(
header_policy + ' -- test fullscreen is disallowed on same-origin subframe',
'fullscreen',
same_origin_src);
test_disallowed_feature_for_subframe(
header_policy + ' -- test fullscreen is disallowed on cross-origin subframe',
'fullscreen',
cross_origin_src);
// Dynamically update sub frame's container policy
var allow = "fullscreen 'src';"
test_disallowed_feature_for_subframe(
header_policy + ', iframe.allow = ' + allow + ' -- test fullscreen is disallowed on same-origin subframe',
'fullscreen',
same_origin_src,
allow);
test_disallowed_feature_for_subframe(
header_policy + ', iframe.allow = ' + allow + ' -- test fullscreen is disallowed on cross-origin subframe',
'fullscreen',
cross_origin_src,
allow);
</script>
</body>

View file

@ -0,0 +1,61 @@
<!DOCTYPE html>
<body>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/feature-policy/resources/featurepolicy.js></script>
<script>
/*
fullscreen is allowed for all at the top-level document. It can be disabled by
subframes.
*/
'use strict';
const same_origin = 'https://{{domains[]}}:{{ports[https][0]}}';
const cross_origin = 'https://{{domains[www]}}:{{ports[https][0]}}';
const same_origin_src = '/feature-policy/resources/feature-policy-nested-subframe-policy.https.sub.html';
const cross_origin_src = cross_origin + same_origin_src;
/* ------------------------------------------
| top-level document |
| ------------------------------------ |
| | same-origin iframe | |
| | ------------------------------ | |
| | | local and remote iframes | | |
| | ------------------------------ | |
| ------------------------------------ |
------------------------------------------ */
test_subframe_header_policy('fullscreen', '*', same_origin_src,
{local_all: true, local_self: true, local_none: false,
remote_all: true, remote_self: true, remote_none: false},
'Test nested header policy with local iframe on policy "fullscreen *"');
test_subframe_header_policy('fullscreen', '\'self\'', same_origin_src,
{local_all: true, local_self: true, local_none: false,
remote_all: false, remote_self: false, remote_none: false},
'Test nested header policy with local iframe on policy "fullscreen \'self\'"');
test_subframe_header_policy('fullscreen', '\'none\'', same_origin_src,
{local_all: false, local_self: false, local_none: false,
remote_all: false, remote_self: false, remote_none: false},
'Test nested header policy with local iframe on policy "fullscreen \'none\'"');
/* -------------------------------------------
| top-level document |
| ------------------------------------- |
| | cross-origin iframe | |
| | ------------------------------- | |
| | | local and remote iframes | | |
| | ------------------------------- | |
| ------------------------------------- |
------------------------------------------- */
test_subframe_header_policy('fullscreen', '*', cross_origin_src,
{local_all: true, local_self: true, local_none: false,
remote_all: true, remote_self: true, remote_none: false},
'Test nested header policy with remote iframe on policy "fullscreen *"');
test_subframe_header_policy('fullscreen', '\'self\'', cross_origin_src,
{local_all: true, local_self: true, local_none: false,
remote_all: false, remote_self: false, remote_none: false},
'Test nested header policy with remote iframe on policy "fullscreen \'self\'"');
test_subframe_header_policy('fullscreen', '\'none\'', cross_origin_src,
{local_all: false, local_self: false, local_none: false,
remote_all: false, remote_self: false, remote_none: false},
'Test nested header policy with remote iframe on policy "fullscreen \'none\'"');
</script>
</body>

View file

@ -0,0 +1,62 @@
<!DOCTYPE html>
<body>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/feature-policy/resources/featurepolicy.js></script>
<script>
/*
fullscreen is allowed for 'self' at the top-level document and through the
chain of same-origin iframes. It can be enabled by subframes, but otherwise
is disallowed everywhere else.
*/
'use strict';
const same_origin = 'https://{{domains[]}}:{{ports[https][0]}}';
const cross_origin = 'https://{{domains[www]}}:{{ports[https][0]}}';
const same_origin_src = '/feature-policy/resources/feature-policy-nested-subframe-policy.https.sub.html';
const cross_origin_src = cross_origin + same_origin_src;
/* ------------------------------------------
| top-level document |
| ------------------------------------ |
| | same-origin iframe | |
| | ------------------------------ | |
| | | local and remote iframes | | |
| | ------------------------------ | |
| ------------------------------------ |
------------------------------------------ */
test_subframe_header_policy('fullscreen', '*', same_origin_src,
{local_all: true, local_self: true, local_none: false,
remote_all: true, remote_self: true, remote_none: false},
'Test nested header policy with local iframe on policy "fullscreen *"');
test_subframe_header_policy('fullscreen', '\'self\'', same_origin_src,
{local_all: true, local_self: true, local_none: false,
remote_all: false, remote_self: false, remote_none: false},
'Test nested header policy with local iframe on policy "fullscreen \'self\'"');
test_subframe_header_policy('fullscreen', '\'none\'', same_origin_src,
{local_all: false, local_self: false, local_none: false,
remote_all: false, remote_self: false, remote_none: false},
'Test nested header policy with local iframe on policy "fullscreen \'none\'"');
/* -------------------------------------------
| top-level document |
| ------------------------------------- |
| | cross-origin iframe | |
| | ------------------------------- | |
| | | local and remote iframes | | |
| | ------------------------------- | |
| ------------------------------------- |
------------------------------------------- */
test_subframe_header_policy('fullscreen', '*', cross_origin_src,
{local_all: false, local_self: false, local_none: false,
remote_all: false, remote_self: false, remote_none: false},
'Test nested header policy with remote iframe on policy "fullscreen *"');
test_subframe_header_policy('fullscreen', '\'self\'', cross_origin_src,
{local_all: false, local_self: false, local_none: false,
remote_all: false, remote_self: false, remote_none: false},
'Test nested header policy with remote iframe on policy "fullscreen \'self\'"');
test_subframe_header_policy('fullscreen', '\'none\'', cross_origin_src,
{local_all: false, local_self: false, local_none: false,
remote_all: false, remote_self: false, remote_none: false},
'Test nested header policy with remote iframe on policy "fullscreen \'none\'"');
</script>
</body>

View file

@ -0,0 +1,50 @@
<!DOCTYPE html>
<body>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/feature-policy/resources/featurepolicy.js></script>
<script>
/*
fullscreen is disabled at the top-level document, therefore disabled
everywhere throughout inheritance.
*/
'use strict';
const same_origin = 'https://{{domains[]}}:{{ports[https][0]}}';
const cross_origin = 'https://{{domains[www]}}:{{ports[https][0]}}';
const same_origin_src = '/feature-policy/resources/feature-policy-nested-subframe-policy.https.sub.html';
const cross_origin_src = cross_origin + same_origin_src;
const policies = ['*', '\'self\'', '\'none\''];
for (var i = 0; i < policies.length; i++) {
/* ------------------------------------------
| top-level document |
| ------------------------------------ |
| | same-origin iframe | |
| | ------------------------------ | |
| | | local and remote iframes | | |
| | ------------------------------ | |
| ------------------------------------ |
------------------------------------------ */
test_subframe_header_policy('fullscreen', policies[i], same_origin_src,
{local_all: false, local_self: false, local_none: false,
remote_all: false, remote_self: false, remote_none: false},
'Test nested header policy with local iframe on policy "fullscreen '
+ policies[i] + '".');
/* -------------------------------------------
| top-level document |
| ------------------------------------- |
| | cross-origin iframe | |
| | ------------------------------- | |
| | | local and remote iframes | | |
| | ------------------------------- | |
| ------------------------------------- |
------------------------------------------- */
test_subframe_header_policy('fullscreen', policies[i], cross_origin_src,
{local_all: false, local_self: false, local_none: false,
remote_all: false, remote_self: false, remote_none: false},
'Test nested header policy with remote iframe on policy "fullscreen '
+ policies[i] + '".');
}
</script>
</body>

View file

@ -0,0 +1,7 @@
<script>
'use strict';
window.onload = function() {
parent.postMessage(document.policy.allowedFeatures(), '*');
}
</script>

View file

@ -0,0 +1,50 @@
<!DOCTYPE html>
<body>
<script>
'use strict';
var same_origin_src = '/feature-policy/resources/feature-policy-allowedfeatures.html';
var cross_origin_src = 'https://{{domains[www1]}}:{{ports[https][0]}}' + same_origin_src;
var subframe_header_policy = '?pipe=header(Feature-Policy, fullscreen ';
var policy_all = '*';
var policy_self = '\'self\'';
var policy_none = '\'none\'';
let local_frame_all = document.createElement('iframe');
let local_frame_self = document.createElement('iframe');
let local_frame_none = document.createElement('iframe');
local_frame_all.src = same_origin_src + subframe_header_policy + policy_all + ';)';
local_frame_self.src = same_origin_src + subframe_header_policy + policy_self + ';)';
local_frame_none.src = same_origin_src + subframe_header_policy + policy_none + ';)';
let remote_frame_all = document.createElement('iframe');
let remote_frame_self = document.createElement('iframe');
let remote_frame_none = document.createElement('iframe');
remote_frame_all.src = cross_origin_src + subframe_header_policy + policy_all + ';)';
remote_frame_self.src = cross_origin_src + subframe_header_policy + policy_self + ';)';
remote_frame_none.src = cross_origin_src + subframe_header_policy + policy_none + ';)';
window.addEventListener('message', function(evt) {
if (evt.source === local_frame_all.contentWindow) {
parent.postMessage({frame: 'local', policy: policy_all, allowedfeatures: evt.data}, '*');
} else if (evt.source === local_frame_self.contentWindow) {
parent.postMessage({frame: 'local', policy: policy_self, allowedfeatures: evt.data}, '*');
} else if (evt.source === local_frame_none.contentWindow) {
parent.postMessage({frame: 'local', policy: policy_none, allowedfeatures: evt.data}, '*');
} else if (evt.source === remote_frame_all.contentWindow) {
parent.postMessage({frame: 'remote', policy: policy_all, allowedfeatures: evt.data}, '*');
} else if (evt.source === remote_frame_self.contentWindow) {
parent.postMessage({frame: 'remote', policy: policy_self, allowedfeatures: evt.data}, '*');
} else if (evt.source === remote_frame_none.contentWindow) {
parent.postMessage({frame: 'remote', policy: policy_none, allowedfeatures: evt.data}, '*');
}
});
document.body.appendChild(local_frame_all);
document.body.appendChild(local_frame_self);
document.body.appendChild(local_frame_none);
document.body.appendChild(remote_frame_all);
document.body.appendChild(remote_frame_self);
document.body.appendChild(remote_frame_none);
</script>
</body>

View file

@ -247,3 +247,139 @@ function run_all_fp_tests_allow_all(
'Feature policy "' + feature_name +
'" can be disabled in cross-origin iframes using "allow" attribute.');
}
// This function tests that a given policy allows each feature for the correct
// list of origins specified by the |expected_policy|.
// Arguments:
// expected_policy: A list of {feature, allowlist} pairs where the feature is
// enabled for every origin in the allowlist, in the |policy|.
// policy: Either a document.policy or a iframe.policy to be tested.
// message: A short description of what policy is being tested.
function test_allowlists(expected_policy, policy, message) {
for (var allowlist of allowlists) {
test(function() {
assert_array_equals(
policy.getAllowlistForFeature(allowlist.feature),
allowlist.allowlist);
}, message + ' for feature ' + allowlist.feature);
}
}
// This function tests that a subframe's document policy allows a given feature.
// A feature is allowed in a frame either through inherited policy or specified
// by iframe allow attribute.
// Arguments:
// test: test created by testharness. Examples: async_test, promise_test.
// feature: feature name that should be allowed in the frame.
// src: the URL to load in the frame.
// allow: the allow attribute (container policy) of the iframe
function test_allowed_feature_for_subframe(message, feature, src, allow) {
let frame = document.createElement('iframe');
if (typeof allow !== 'undefined') {
frame.allow = allow;
}
promise_test(function() {
frame.src = src;
return new Promise(function(resolve, reject) {
window.addEventListener('message', function handler(evt) {
resolve(evt.data);
}, { once: true });
document.body.appendChild(frame);
}).then(function(data) {
assert_true(data.includes(feature), feature);
});
}, message);
}
// This function tests that a subframe's document policy disallows a given
// feature. A feature is allowed in a frame either through inherited policy or
// specified by iframe allow attribute.
// Arguments:
// test: test created by testharness. Examples: async_test, promise_test.
// feature: feature name that should not be allowed in the frame.
// src: the URL to load in the frame.
// allow: the allow attribute (container policy) of the iframe
function test_disallowed_feature_for_subframe(message, feature, src, allow) {
let frame = document.createElement('iframe');
if (typeof allow !== 'undefined') {
frame.allow = allow;
}
promise_test(function() {
frame.src = src;
return new Promise(function(resolve, reject) {
window.addEventListener('message', function handler(evt) {
resolve(evt.data);
}, { once: true });
document.body.appendChild(frame);
}).then(function(data) {
assert_false(data.includes(feature), feature);
});
}, message);
}
// This function tests that a subframe with header policy defined on a given
// feature allows and disallows the feature as expected.
// Arguments:
// feature: feature name.
// frame_header_policy: either *, 'self' or 'none', defines the frame
// document's header policy on |feature|.
// src: the URL to load in the frame.
// test_expects: contains 6 expected results of either |feature| is allowed
// or not inside of a local or remote iframe nested inside
// the subframe given the header policy to be either *,
// 'slef', or 'none'.
// test_name: name of the test.
function test_subframe_header_policy(
feature, frame_header_policy, src, test_expects, test_name) {
let frame = document.createElement('iframe');
promise_test(function() {
frame.src = src + '?pipe=sub|header(Feature-Policy,' + feature + ' '
+ frame_header_policy + ';)';
return new Promise(function(resolve, reject) {
let results = [];
window.addEventListener('message', function handler(evt) {
results.push(evt.data);
if (results.length >= 6) {
resolve(results);
}
});
document.body.appendChild(frame);
}).then(function(results) {
for (var j = 0; j < results.length; j++) {
var data = results[j];
function test_result(message, test_expect) {
if (test_expect) {
assert_true(data.allowedfeatures.includes(feature), message);
} else {
assert_false(data.allowedfeatures.includes(feature), message);
}
}
if (data.frame === 'local') {
if (data.policy === '*') {
test_result('local_all:', test_expects.local_all);
}
if (data.policy === '\'self\'') {
test_result('local_self:', test_expects.local_self);
}
if (data.policy === '\'none\'') {
test_result('local_none:', test_expects.local_none);
}
}
if (data.frame === 'remote') {
if (data.policy === '*') {
test_result('remote_all:', test_expects.remote_all);
}
if (data.policy === '\'self\'') {
test_result('remote_self:', test_expects.remote_self);
}
if (data.policy === '\'none\'') {
test_result('remote_none:', test_expects.remote_none);
}
}
}
});
}, test_name);
}

View file

@ -308,23 +308,6 @@ interface CSSPositionValue : CSSStyleValue {
attribute CSSNumericValue y;
};
enum CSSResourceState {"unloaded", "loading", "loaded", "error"};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSResourceValue : CSSStyleValue {
readonly attribute CSSResourceState state;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSImageValue : CSSResourceValue {
readonly attribute double? intrinsicWidth;
readonly attribute double? intrinsicHeight;
readonly attribute double? intrinsicRatio;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet),
Constructor(USVString url)]
interface CSSURLImageValue : CSSImageValue {
readonly attribute USVString url;
interface CSSImageValue : CSSStyleValue {
};