Update web-platform-tests to revision 53876e32d827db82f4b7af38053529302c243d40

This commit is contained in:
WPT Sync Bot 2020-03-07 08:19:40 +00:00
parent a0f14ceb7b
commit 02d2f1860a
87 changed files with 2931 additions and 515 deletions

View file

@ -143231,6 +143231,45 @@
], ],
{} {}
] ]
],
"grid-placement-using-named-grid-lines-004.html": [
"c33b1a9ee9ec7f972df72b8658bae53c8163fd5e",
[
null,
[
[
"/css/reference/ref-filled-green-100px-square.xht",
"=="
]
],
{}
]
],
"grid-placement-using-named-grid-lines-005.html": [
"20d9298955f692b2c42113a747ca52627f29788b",
[
null,
[
[
"/css/reference/ref-filled-green-100px-square.xht",
"=="
]
],
{}
]
],
"grid-placement-using-named-grid-lines-006.html": [
"405858f73c5ab17b0a82167fe6399130ac1ddeba",
[
null,
[
[
"/css/reference/ref-filled-green-100px-square.xht",
"=="
]
],
{}
]
] ]
}, },
"subgrid": { "subgrid": {
@ -186771,7 +186810,7 @@
] ]
], ],
"max-length-percent-001.html": [ "max-length-percent-001.html": [
"ffb6c27db278bc030923745d0e06c47d2af897c3", "6d1e9ed248aff08c2e3ea11c087f9fde7b912707",
[ [
null, null,
[ [
@ -186797,7 +186836,7 @@
] ]
], ],
"min-length-percent-001.html": [ "min-length-percent-001.html": [
"73069ecfe1e6d5b198f6e01df48facbe117d6828", "0ffceb827a9b249581a40966a3193cf297a41738",
[ [
null, null,
[ [
@ -186810,7 +186849,7 @@
] ]
], ],
"min-max-percentage-length-interpolation.html": [ "min-max-percentage-length-interpolation.html": [
"14af1352d1740d32cd52ab069ab1799f87803f5d", "089d6f0407339cf3f4d7714eddb1f56e3d44c562",
[ [
null, null,
[ [
@ -240107,7 +240146,7 @@
[] []
], ],
"sec-ch-ua.py": [ "sec-ch-ua.py": [
"a14a27dadf9e333784a5c636c821634b387e475f", "f77eee8c4e9b13a24b10eba34147d3b485e923bc",
[] []
], ],
"stale-echo-client-hints.py": [ "stale-echo-client-hints.py": [
@ -305239,7 +305278,7 @@
[] []
], ],
"numeric-testcommon.js": [ "numeric-testcommon.js": [
"996250d359dc676e001bb1aebfacae98c263e41a", "e0569fed2641b169416dc6b351e32770eb8fbd95",
[] []
], ],
"parsing-testcommon.js": [ "parsing-testcommon.js": [
@ -305286,6 +305325,10 @@
"84141028020b7e8cdf2412acbca3c799ba50a534", "84141028020b7e8cdf2412acbca3c799ba50a534",
[] []
], ],
"serialize-testcommon.js": [
"18cebf538ef065867f0d4a2438d1996d4f4345af",
[]
],
"shorthand-testcommon.js": [ "shorthand-testcommon.js": [
"ab1f3794c8dac2f1e067209fd766ec18858a5f45", "ab1f3794c8dac2f1e067209fd766ec18858a5f45",
[] []
@ -313451,7 +313494,7 @@
], ],
"math": { "math": {
"axisheight5000-verticalarrow14000.woff": [ "axisheight5000-verticalarrow14000.woff": [
"9f5d59ae6a7fbf221fd14126645f1cbc7c25d286", "70f366a3d0b7ec891fc4041584a1ddea55b0bc42",
[] []
], ],
"fraction-axisheight7000-rulethickness1000.woff": [ "fraction-axisheight7000-rulethickness1000.woff": [
@ -324461,7 +324504,7 @@
[] []
], ],
"allowed-to-play.html.ini": [ "allowed-to-play.html.ini": [
"87726f492394955e3835a6a6675cae490669d5de", "6891cbe24e3c124a983939f811e23f23b3b52ed7",
[] []
], ],
"document-fonts-ready.html.ini": [ "document-fonts-ready.html.ini": [
@ -326231,7 +326274,7 @@
}, },
"tools": { "tools": {
"axisheight.py": [ "axisheight.py": [
"43827e7031665bdd57ee54e208ea0f875a9a60ec", "d588560b650af0d2cb995083f8fff366a542ca44",
[] []
], ],
"fractions.py": [ "fractions.py": [
@ -328806,6 +328849,30 @@
"0fc1d163f2b61951813eae9ca84f2d4fe7f59703", "0fc1d163f2b61951813eae9ca84f2d4fe7f59703",
[] []
], ],
"op11 no-ids.json": [
"0f3907bb3e61b60750762db1167611184cfcf384",
[]
],
"op12 empty-ids.json": [
"e5c31d2561c1a52ecd728239c20a96c7052804ba",
[]
],
"op13 empty-ids-after-nonempty.json": [
"773772457448691e1c82003aabbe484a10903aa3",
[]
],
"op14 non-array-id.json": [
"bc7cf74fbaa766c7bc6d5af4603fd23aa6bec999",
[]
],
"op15 mix-of-ids.json": [
"b49637dbd5c6cecbbbebdad0535895809e87f8c0",
[]
],
"op16 two-ids.json": [
"7a7d8398aa1b8a10c3b4235da35b0094ef5a2214",
[]
],
"op2 cspfp-double-top-level.json": [ "op2 cspfp-double-top-level.json": [
"26d798b585d96fd29994dc39544a15bd2f6a639d", "26d798b585d96fd29994dc39544a15bd2f6a639d",
[] []
@ -328841,11 +328908,11 @@
}, },
"resources": { "resources": {
"origin-policy-test-runner.js": [ "origin-policy-test-runner.js": [
"a1c6453debd20d7abc3923a273a0c1890dcab7a6", "d3fd2e4ce11a7d18075c900a9087f47438d42c10",
[] []
], ],
"subframe-with-origin-policy.py": [ "subframe-with-origin-policy.py": [
"636a649a0e20bebe36ccd013b72b8e1f315d674e", "258f23754ef7ef0b5c68f351c7c330c7e288c0c8",
[] []
] ]
} }
@ -342378,7 +342445,7 @@
[] []
], ],
"safari-technology-preview.rb": [ "safari-technology-preview.rb": [
"bcd4d5a4f3e8ceedfb998fbe95945209d44e9151", "1bf9d5df0b3307665bf36c158fb963d2656d202d",
[] []
], ],
"system_info.yml": [ "system_info.yml": [
@ -347564,7 +347631,7 @@
[] []
], ],
"client.py": [ "client.py": [
"9885e99c4f7c8c339caad4fd2172e59688d9b2fe", "658ed0e00f8a344941673eed671ba9de317858a9",
[] []
], ],
"error.py": [ "error.py": [
@ -347576,7 +347643,7 @@
[] []
], ],
"transport.py": [ "transport.py": [
"edaf3186039d287dd5ef3ce6e4e616fd8bc0e302", "f817ec81a96fb93cc5c60154f057d72e98375694",
[] []
] ]
} }
@ -348077,7 +348144,7 @@
[] []
], ],
"executorwebdriver.py": [ "executorwebdriver.py": [
"96488f462e7c89b0526a0d58ddb8ddb2cdb03a44", "2a0e9c7136dc147fec9a690509d6c05813ead5f0",
[] []
], ],
"executorwebkit.py": [ "executorwebkit.py": [
@ -402926,7 +402993,7 @@
] ]
], ],
"minmax-angle-computed.html": [ "minmax-angle-computed.html": [
"84e598a8147e123285d54876f942a0df0a5bf57f", "c0218a0899e6f9ee991a3645293895b924a895ed",
[ [
null, null,
{} {}
@ -402940,21 +403007,21 @@
] ]
], ],
"minmax-angle-serialize.html": [ "minmax-angle-serialize.html": [
"07b7d3c2b232612334555603325560259cb41203", "106d6d24111d7ae49f76bbd2e50118308eaa6dbc",
[ [
null, null,
{} {}
] ]
], ],
"minmax-integer-computed.html": [ "minmax-integer-computed.html": [
"b3794acba9c8f5cfdf56b31292f971b4ccc0bb28", "49dbe198c993d0ace5542b9467f462c3c74c2ef7",
[ [
null, null,
{} {}
] ]
], ],
"minmax-length-computed.html": [ "minmax-length-computed.html": [
"2d6e24e51944beb0f7d030bd99eb14576f7dd3dc", "f2444306230fd8df56cf927e55bf556d094248af",
[ [
null, null,
{} {}
@ -402968,7 +403035,7 @@
] ]
], ],
"minmax-length-percent-computed.html": [ "minmax-length-percent-computed.html": [
"acd0f2b31bb7554d1e74dd43ad56bd5a68543f07", "9788fa26df6aa14f67e9c904e84b616ec7f90c45",
[ [
null, null,
{} {}
@ -402982,21 +403049,21 @@
] ]
], ],
"minmax-length-percent-serialize.html": [ "minmax-length-percent-serialize.html": [
"c353fa849076f4551827a10b9742a85b53d4fc18", "9e215fd68742f4c1fc960fd5374ed660e8537098",
[ [
null, null,
{} {}
] ]
], ],
"minmax-length-serialize.html": [ "minmax-length-serialize.html": [
"4b30864d2344ba297f077b7e9090d25984bdb631", "bd00ee058859b3b805e621474fa9221f2cd44d17",
[ [
null, null,
{} {}
] ]
], ],
"minmax-number-computed.html": [ "minmax-number-computed.html": [
"9a6e6142ea85ede12d742ca49f5bddf03b2e56b0", "3a1c609e161d165c9f173cba6ccdbf9fcf577ac6",
[ [
null, null,
{} {}
@ -403010,14 +403077,14 @@
] ]
], ],
"minmax-number-serialize.html": [ "minmax-number-serialize.html": [
"e05ccc339c90a1c8df22d6b9f46ff7c357dc36af", "fc34f199834fabfc7b755d473e4ff577ca6a4f2f",
[ [
null, null,
{} {}
] ]
], ],
"minmax-percentage-computed.html": [ "minmax-percentage-computed.html": [
"9f9d0a59d12c2642bfea8ca5a3e2f8528067c80e", "8775a280f1ad5459385b6ef8e5bed732de87e2be",
[ [
null, null,
{} {}
@ -403031,14 +403098,14 @@
] ]
], ],
"minmax-percentage-serialize.html": [ "minmax-percentage-serialize.html": [
"79624be529e5ec91b847a995d497e515736f66cc", "f1cb5081a6d341cbba638ca7f1ecdb302813bc8f",
[ [
null, null,
{} {}
] ]
], ],
"minmax-time-computed.html": [ "minmax-time-computed.html": [
"36bcf601eb808311732562a6c1c6a7c801f33e9d", "47f70ed01818d0d6e670980bd68b039066c55af8",
[ [
null, null,
{} {}
@ -403052,7 +403119,7 @@
] ]
], ],
"minmax-time-serialize.html": [ "minmax-time-serialize.html": [
"d7dd4edb5880e9162a702e3c1ce0a5540dc42679", "27d09cfa28b60c6b0e0e61e65d000345c5bb4a53",
[ [
null, null,
{} {}
@ -403940,6 +404007,13 @@
{} {}
] ]
], ],
"CSSStyleSheet-constructable-baseURL.tentative.html": [
"b43ed61c3eea71f4f59531b80adcbc33d22337c1",
[
null,
{}
]
],
"CSSStyleSheet-constructable-disabled-regular-sheet-insertion.html": [ "CSSStyleSheet-constructable-disabled-regular-sheet-insertion.html": [
"ef4ea1480658af9aee9ef3464650893481d8ed46", "ef4ea1480658af9aee9ef3464650893481d8ed46",
[ [
@ -403955,7 +404029,7 @@
] ]
], ],
"CSSStyleSheet-constructable.html": [ "CSSStyleSheet-constructable.html": [
"c7e215381048eddedcf3c33166790815fc685aea", "fbee4298c1411937f8c45a2f6001ee78dccadbb5",
[ [
null, null,
{} {}
@ -447785,15 +447859,15 @@
{} {}
] ]
], ],
"navigator_user_agent.tentative.html": [ "navigator_user_agent.https.html": [
"dd4c531070c8a21328a14709fd0357c6fba15001", "4c83c7e8a546dd8c4d37b56f5bdc70d80e23e910",
[ [
null, null,
{} {}
] ]
], ],
"navigator_user_agent.tentative.https.html": [ "navigator_user_agent.tentative.html": [
"5f0dba6bcf72cb94f7e53ee52bfaedf7ac4819bf", "dd4c531070c8a21328a14709fd0357c6fba15001",
[ [
null, null,
{} {}
@ -470881,6 +470955,143 @@
{} {}
] ]
] ]
},
"idlharness.any.js": [
"c8ee8a326d1325ab38cae686c4647a81ec12e517",
[
"origin-policy/idlharness.any.html",
{
"script_metadata": [
[
"global",
"window,worker"
],
[
"script",
"/resources/WebIDLParser.js"
],
[
"script",
"/resources/idlharness.js"
]
]
}
],
[
"origin-policy/idlharness.any.serviceworker.html",
{
"script_metadata": [
[
"global",
"window,worker"
],
[
"script",
"/resources/WebIDLParser.js"
],
[
"script",
"/resources/idlharness.js"
]
]
}
],
[
"origin-policy/idlharness.any.sharedworker.html",
{
"script_metadata": [
[
"global",
"window,worker"
],
[
"script",
"/resources/WebIDLParser.js"
],
[
"script",
"/resources/idlharness.js"
]
]
}
],
[
"origin-policy/idlharness.any.worker.html",
{
"script_metadata": [
[
"global",
"window,worker"
],
[
"script",
"/resources/WebIDLParser.js"
],
[
"script",
"/resources/idlharness.js"
]
]
}
]
],
"ids": {
"empty-ids-after-nonempty.https.html": [
"3bffa9cffa713d49a78ce5effdb736ca07022da2",
[
null,
{}
]
],
"empty-ids.https.html": [
"385aa7c66fe639b3f7d52c7d936a0ed09522e131",
[
null,
{}
]
],
"mix-of-ids.https.html": [
"7be2c9f48df9fd192b4855e984cad13466caaf7b",
[
null,
{}
]
],
"no-ids.https.html": [
"1fe3d480d0acebeb869b82cc7838575a6d915bbb",
[
null,
{}
]
],
"non-array-id.https.html": [
"223b78f929c1346774fca040e767d93bc7605e40",
[
null,
{}
]
],
"same-object-returned.https.html": [
"9286f9f7344808c4fa548f47c675a9e963421229",
[
null,
{}
]
],
"still-present-in-http.html": [
"01969450f92aca7657b69fd1c58888d4627d58f6",
[
null,
{}
]
],
"two-ids.https.html": [
"630f07280790e0631fe1c2e795194bd541ffee72",
[
null,
{}
]
]
} }
}, },
"page-visibility": { "page-visibility": {
@ -538142,7 +538353,7 @@
] ]
], ],
"TrustedTypePolicy-createXXX.tentative.html": [ "TrustedTypePolicy-createXXX.tentative.html": [
"7e39042e1cb86c042367b5fc08e4e4e72c934165", "81ad053f5cd549c0175788929f270f1a5fdaff3b",
[ [
null, null,
{} {}
@ -545042,6 +545253,24 @@
} }
] ]
], ],
"wakelock-onrelease.https.html": [
"3506c8ae82b91178468a7158b9fca6d099a498f6",
[
null,
{
"testdriver": true
}
]
],
"wakelock-request-denied.https.html": [
"8dbe523ed2c5653932a3f6f246d34ada1e4b113f",
[
null,
{
"testdriver": true
}
]
],
"wakelock-screen-type-on-worker.https.worker.js": [ "wakelock-screen-type-on-worker.https.worker.js": [
"0201294e2365abae3e13fcfe21debfd26628236a", "0201294e2365abae3e13fcfe21debfd26628236a",
[ [
@ -545089,10 +545318,12 @@
] ]
], ],
"wakelockpermissiondescriptor.https.html": [ "wakelockpermissiondescriptor.https.html": [
"b8c9ae9568b5c540c6745eea2686a519b66a3484", "fd7a08a34ba7dfe203c42f4d4f78ae626fbea235",
[ [
null, null,
{} {
"testdriver": true
}
] ]
] ]
}, },
@ -546900,7 +547131,7 @@
] ]
], ],
"contenttype.any.js": [ "contenttype.any.js": [
"713fd70854042e4bf4a3467e86328a5f3d6a1f28", "e9ca93a13fd4c21b21a93a6eb68bf61f094afc9a",
[ [
"wasm/webapi/contenttype.any.html", "wasm/webapi/contenttype.any.html",
{ {

View file

@ -2,3 +2,6 @@
[Hit test intersecting scaled box] [Hit test intersecting scaled box]
expected: FAIL expected: FAIL
[Hit test within unscaled box]
expected: FAIL

View file

@ -191,3 +191,99 @@
[Property transform value 'rotate(calc(max(90deg, 1.56rad) * 2)'] [Property transform value 'rotate(calc(max(90deg, 1.56rad) * 2)']
expected: FAIL expected: FAIL
[max(1turn) should be used-value-equivalent to 1turn]
expected: FAIL
[min(1deg, 2deg) should be used-value-equivalent to 1deg]
expected: FAIL
[min(1turn) should be used-value-equivalent to 1turn]
expected: FAIL
[max(1grad) should be used-value-equivalent to 1grad]
expected: FAIL
[calc(min(90deg, 1.58rad) / 2 should be used-value-equivalent to 45deg]
expected: FAIL
[min(1rad, 2rad) should be used-value-equivalent to 1rad]
expected: FAIL
[calc(min(90deg, 1.58rad) - 0.125turn) should be used-value-equivalent to 45deg]
expected: FAIL
[max(1deg) should be used-value-equivalent to 1deg]
expected: FAIL
[calc(min(90deg, 1.58rad) - max(0.25turn, 99grad)) should be used-value-equivalent to 0deg]
expected: FAIL
[calc(max(90deg, 1.56rad) / 2 should be used-value-equivalent to 45deg]
expected: FAIL
[calc(max(90deg, 1.56rad) - 0.125turn) should be used-value-equivalent to 45deg]
expected: FAIL
[max(1rad) should be used-value-equivalent to 1rad]
expected: FAIL
[min(270deg, max(0.25turn, 3.14rad)) should be used-value-equivalent to 3.14rad]
expected: FAIL
[min(1grad, 2grad) should be used-value-equivalent to 1grad]
expected: FAIL
[min(1deg) should be used-value-equivalent to 1deg]
expected: FAIL
[min(90deg, 0.26turn) should be used-value-equivalent to 90deg]
expected: FAIL
[calc(min(90deg, 1.58rad) + 0.25turn) should be used-value-equivalent to 180deg]
expected: FAIL
[calc(max(90deg, 1.56rad) * 2 should be used-value-equivalent to 180deg]
expected: FAIL
[calc(max(90deg, 1.56rad) + 0.25turn) should be used-value-equivalent to 180deg]
expected: FAIL
[max(1grad, 2grad) should be used-value-equivalent to 2grad]
expected: FAIL
[max(91deg, 0.25turn) should be used-value-equivalent to 91deg]
expected: FAIL
[calc(min(90deg, 1.58rad) * 2 should be used-value-equivalent to 180deg]
expected: FAIL
[min(1.57rad, 95deg) should be used-value-equivalent to 1.57rad]
expected: FAIL
[min(1turn, 2turn) should be used-value-equivalent to 1turn]
expected: FAIL
[max(1.58rad, 90deg) should be used-value-equivalent to 1.58rad]
expected: FAIL
[calc(min(90deg, 1.58rad) + max(0.25turn, 99grad)) should be used-value-equivalent to 180deg]
expected: FAIL
[max(1turn, 2turn) should be used-value-equivalent to 2turn]
expected: FAIL
[max(1rad, 2rad) should be used-value-equivalent to 2rad]
expected: FAIL
[max(1deg, 2deg) should be used-value-equivalent to 2deg]
expected: FAIL
[min(1rad) should be used-value-equivalent to 1rad]
expected: FAIL
[max(0.25turn, min(270deg, 3.14rad)) should be used-value-equivalent to 3.14rad]
expected: FAIL
[min(1grad) should be used-value-equivalent to 1grad]
expected: FAIL

View file

@ -65,3 +65,117 @@
[e.style['transform'\] = "rotate(calc(min(1deg) + min(2deg)))" should set the property value] [e.style['transform'\] = "rotate(calc(min(1deg) + min(2deg)))" should set the property value]
expected: FAIL expected: FAIL
['rotate(max(90deg))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(max(0.25turn, 1.57rad, 90deg))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(min(93deg, 92deg, 90deg))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(max(90deg, 1.57rad, 0.25turn))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(min(90deg))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(calc(50grad + min(45deg)))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(max(90deg, 1.57rad, 0.25turn))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(min(90deg))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(max(90deg))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(min(90deg, 1.58rad, 0.25turn))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(max(81deg, 82deg, 90deg))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(min(90deg, 92deg, 93deg))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(max(.25turn))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(calc(50grad + max(45deg)))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(min(.25turn))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(max(100grad))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(calc(min(30deg) + max(60deg)))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(calc(50grad + min(45deg)))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(min(100grad))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(max(100grad))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(min(0.25turn, 1.58rad, 90deg))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(calc(min(30deg) + max(60deg)))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(max(83deg, 82deg, 90deg))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(min(90deg, 92deg, 93deg))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(max(0.25turn, 1.57rad, 90deg))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(calc(min(45deg) + 50grad))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(max(83deg, 82deg, 90deg))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(max(.25turn))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(min(90deg, 1.58rad, 0.25turn))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(min(93deg, 92deg, 90deg))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(calc(max(45deg) + 50grad))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(calc(min(45deg) + 50grad))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(calc(max(45deg) + 50grad))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(min(0.25turn, 1.58rad, 90deg))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(calc(50grad + max(45deg)))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(min(100grad))' as a computed value should serialize as 'rotate(90deg)'.]
expected: FAIL
['rotate(min(.25turn))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL
['rotate(max(81deg, 82deg, 90deg))' as a specified value should serialize as 'rotate(calc(90deg))'.]
expected: FAIL

View file

@ -59,3 +59,33 @@
[Property z-index value 'min(0.6)'] [Property z-index value 'min(0.6)']
expected: FAIL expected: FAIL
[min(1.1, max(0.4, 0.6)) should be used-value-equivalent to 1]
expected: FAIL
[min(0.4) should be used-value-equivalent to 0]
expected: FAIL
[max(1) should be used-value-equivalent to 1]
expected: FAIL
[max(0.6) should be used-value-equivalent to 1]
expected: FAIL
[min(0.6) should be used-value-equivalent to 1]
expected: FAIL
[min(1) should be used-value-equivalent to 1]
expected: FAIL
[calc(max(0.3, 0.6) / 2) should be used-value-equivalent to 0]
expected: FAIL
[max(0.4) should be used-value-equivalent to 0]
expected: FAIL
[calc(min(0.3, 0.6) * 2) should be used-value-equivalent to 1]
expected: FAIL
[max(0.3, min(1.1, 0.4)) should be used-value-equivalent to 0]
expected: FAIL

View file

@ -479,3 +479,240 @@
[Property letter-spacing value 'calc(max(1em, 19px) - 10px)'] [Property letter-spacing value 'calc(max(1em, 19px) - 10px)']
expected: FAIL expected: FAIL
[max(1pc, 2pc) should be used-value-equivalent to 2pc]
expected: FAIL
[min(1Q) should be used-value-equivalent to 1Q]
expected: FAIL
[max(1vmax, 2vmax) should be used-value-equivalent to 2vmax]
expected: FAIL
[max(1px) should be used-value-equivalent to 1px]
expected: FAIL
[max(15px, min(25px, 1em)) should be used-value-equivalent to 20px]
expected: FAIL
[max(1vmax) should be used-value-equivalent to 1vmax]
expected: FAIL
[calc(min(1em, 21px) + max(0.9em, 20px)) should be used-value-equivalent to 40px]
expected: FAIL
[min(1pt) should be used-value-equivalent to 1pt]
expected: FAIL
[min(95px, 1in) should be used-value-equivalent to 95px]
expected: FAIL
[max(1px, 2px) should be used-value-equivalent to 2px]
expected: FAIL
[min(1em, 2em) should be used-value-equivalent to 1em]
expected: FAIL
[min(1mm) should be used-value-equivalent to 1mm]
expected: FAIL
[min(1Q, 2Q) should be used-value-equivalent to 1Q]
expected: FAIL
[min(1pc, 2pc) should be used-value-equivalent to 1pc]
expected: FAIL
[max(1em) should be used-value-equivalent to 1em]
expected: FAIL
[max(1cm, 2cm) should be used-value-equivalent to 2cm]
expected: FAIL
[max(25px, 1em) should be used-value-equivalent to 25px]
expected: FAIL
[min(1cm) should be used-value-equivalent to 1cm]
expected: FAIL
[max(1ch) should be used-value-equivalent to 1ch]
expected: FAIL
[min(1vh, 2vh) should be used-value-equivalent to 1vh]
expected: FAIL
[max(1rem, 2rem) should be used-value-equivalent to 2rem]
expected: FAIL
[calc(max(1em, 19px) / 2 should be used-value-equivalent to 10px]
expected: FAIL
[max(15px, 2em) should be used-value-equivalent to 20px; fontSize=10px]
expected: FAIL
[min(1ch) should be used-value-equivalent to 1ch]
expected: FAIL
[calc(min(1em, 21px) / 2 should be used-value-equivalent to 10px]
expected: FAIL
[min(25px, 1em) should be used-value-equivalent to 20px]
expected: FAIL
[max(1ex) should be used-value-equivalent to 1ex]
expected: FAIL
[max(1ch, 2ch) should be used-value-equivalent to 2ch]
expected: FAIL
[calc(min(1em, 21px) * 2 should be used-value-equivalent to 40px]
expected: FAIL
[max(1pt) should be used-value-equivalent to 1pt]
expected: FAIL
[max(1Q) should be used-value-equivalent to 1Q]
expected: FAIL
[min(1in) should be used-value-equivalent to 1in]
expected: FAIL
[min(1vw) should be used-value-equivalent to 1vw]
expected: FAIL
[max(1mm) should be used-value-equivalent to 1mm]
expected: FAIL
[min(1rem) should be used-value-equivalent to 1rem]
expected: FAIL
[min(1rem, 2rem) should be used-value-equivalent to 1rem]
expected: FAIL
[min(1vmin, 2vmin) should be used-value-equivalent to 1vmin]
expected: FAIL
[max(95px, 1in) should be used-value-equivalent to 1in]
expected: FAIL
[min(1ex, 2ex) should be used-value-equivalent to 1ex]
expected: FAIL
[max(1vh) should be used-value-equivalent to 1vh]
expected: FAIL
[min(1em) should be used-value-equivalent to 1em]
expected: FAIL
[max(1rem) should be used-value-equivalent to 1rem]
expected: FAIL
[calc(min(1em, 21px) + 10px) should be used-value-equivalent to 30px]
expected: FAIL
[max(1vh, 2vh) should be used-value-equivalent to 2vh]
expected: FAIL
[min(1vmin) should be used-value-equivalent to 1vmin]
expected: FAIL
[min(1px, 2px) should be used-value-equivalent to 1px]
expected: FAIL
[calc(max(1em, 19px) - 10px) should be used-value-equivalent to 10px]
expected: FAIL
[min(1ch, 2ch) should be used-value-equivalent to 1ch]
expected: FAIL
[max(1em, 2em) should be used-value-equivalent to 2em]
expected: FAIL
[calc(max(1em, 19px) * 2 should be used-value-equivalent to 40px]
expected: FAIL
[max(1pc) should be used-value-equivalent to 1pc]
expected: FAIL
[min(25px, max(15px, 1em)) should be used-value-equivalent to 20px]
expected: FAIL
[min(1vmax) should be used-value-equivalent to 1vmax]
expected: FAIL
[min(1cm, 2cm) should be used-value-equivalent to 1cm]
expected: FAIL
[max(15px, 1em) should be used-value-equivalent to 20px]
expected: FAIL
[min(1pc) should be used-value-equivalent to 1pc]
expected: FAIL
[max(1Q, 2Q) should be used-value-equivalent to 2Q]
expected: FAIL
[max(1vw) should be used-value-equivalent to 1vw]
expected: FAIL
[min(1vh) should be used-value-equivalent to 1vh]
expected: FAIL
[max(1mm, 2mm) should be used-value-equivalent to 2mm]
expected: FAIL
[max(1pt, 2pt) should be used-value-equivalent to 2pt]
expected: FAIL
[max(1ex, 2ex) should be used-value-equivalent to 2ex]
expected: FAIL
[min(1vw, 2vw) should be used-value-equivalent to 1vw]
expected: FAIL
[calc(min(1em, 21px) - 10px) should be used-value-equivalent to 10px]
expected: FAIL
[max(1in, 2in) should be used-value-equivalent to 2in]
expected: FAIL
[min(1in, 2in) should be used-value-equivalent to 1in]
expected: FAIL
[max(1vmin, 2vmin) should be used-value-equivalent to 2vmin]
expected: FAIL
[min(1vmax, 2vmax) should be used-value-equivalent to 1vmax]
expected: FAIL
[calc(max(1em, 19px) + 10px) should be used-value-equivalent to 30px]
expected: FAIL
[max(1vw, 2vw) should be used-value-equivalent to 2vw]
expected: FAIL
[min(1px) should be used-value-equivalent to 1px]
expected: FAIL
[min(15px, 1em) should be used-value-equivalent to 10px; fontSize=10px]
expected: FAIL
[max(1vmin) should be used-value-equivalent to 1vmin]
expected: FAIL
[min(1ex) should be used-value-equivalent to 1ex]
expected: FAIL
[min(1pt, 2pt) should be used-value-equivalent to 1pt]
expected: FAIL
[min(1mm, 2mm) should be used-value-equivalent to 1mm]
expected: FAIL
[min(15px, 1em) should be used-value-equivalent to 15px]
expected: FAIL
[max(1cm) should be used-value-equivalent to 1cm]
expected: FAIL
[max(1in) should be used-value-equivalent to 1in]
expected: FAIL

View file

@ -299,3 +299,153 @@
[Property margin-left value 'calc(max(1em, 15%) / 2)'] [Property margin-left value 'calc(max(1em, 15%) / 2)']
expected: FAIL expected: FAIL
[max(20px, 10%) should be used-value-equivalent to 20px; width=100px]
expected: FAIL
[max(1mm + 1%) should be used-value-equivalent to calc(1mm + 1%)]
expected: FAIL
[min(1pt + 1%) should be used-value-equivalent to calc(1pt + 1%)]
expected: FAIL
[max(1pt + 1%) should be used-value-equivalent to calc(1pt + 1%)]
expected: FAIL
[min(1mm + 1%) should be used-value-equivalent to calc(1mm + 1%)]
expected: FAIL
[max(1ch + 1%) should be used-value-equivalent to calc(1ch + 1%)]
expected: FAIL
[max(1ex + 1%) should be used-value-equivalent to calc(1ex + 1%)]
expected: FAIL
[calc(max(1em, 15%) * 2) should be used-value-equivalent to 120px]
expected: FAIL
[max(2em + 10%, 1em + 20%) should be used-value-equivalent to 100px]
expected: FAIL
[min(1em + 1%) should be used-value-equivalent to calc(1em + 1%)]
expected: FAIL
[max(1cm + 1%) should be used-value-equivalent to calc(1cm + 1%)]
expected: FAIL
[min(1em, 10%) should be used-value-equivalent to 20px]
expected: FAIL
[min(1px + 1%) should be used-value-equivalent to calc(1px + 1%)]
expected: FAIL
[max(1px + 1%) should be used-value-equivalent to calc(1px + 1%)]
expected: FAIL
[min(1Q + 1%) should be used-value-equivalent to calc(1Q + 1%)]
expected: FAIL
[calc(min(1.5em, 10%) * 2) should be used-value-equivalent to 60px]
expected: FAIL
[max(1vmax + 1%) should be used-value-equivalent to calc(1vmax + 1%)]
expected: FAIL
[calc(min(1.5em, 10%) - 10px) should be used-value-equivalent to 20px]
expected: FAIL
[max(1em, 10%) should be used-value-equivalent to 20px; width=100px]
expected: FAIL
[max(1rem + 1%) should be used-value-equivalent to calc(1rem + 1%)]
expected: FAIL
[min(30px + 10%, 60px + 5%) should be used-value-equivalent to 70px]
expected: FAIL
[min(1ex + 1%) should be used-value-equivalent to calc(1ex + 1%)]
expected: FAIL
[min(1rem + 1%) should be used-value-equivalent to calc(1rem + 1%)]
expected: FAIL
[calc(min(1.5em, 10%) / 2) should be used-value-equivalent to 15px]
expected: FAIL
[min(1vmin + 1%) should be used-value-equivalent to calc(1vmin + 1%)]
expected: FAIL
[max(1em, 10%) should be used-value-equivalent to 40px]
expected: FAIL
[min(1pc + 1%) should be used-value-equivalent to calc(1pc + 1%)]
expected: FAIL
[calc(max(1em, 15%) - 10px) should be used-value-equivalent to 50px]
expected: FAIL
[calc(max(1em, 15%) + 10px) should be used-value-equivalent to 70px]
expected: FAIL
[min(1cm + 1%) should be used-value-equivalent to calc(1cm + 1%)]
expected: FAIL
[max(20px, 10%) should be used-value-equivalent to 40px]
expected: FAIL
[min(20px, 10%) should be used-value-equivalent to 10px; width=100px]
expected: FAIL
[min(1vw + 1%) should be used-value-equivalent to calc(1vw + 1%)]
expected: FAIL
[max(1Q + 1%) should be used-value-equivalent to calc(1Q + 1%)]
expected: FAIL
[max(1vw + 1%) should be used-value-equivalent to calc(1vw + 1%)]
expected: FAIL
[min(1vmax + 1%) should be used-value-equivalent to calc(1vmax + 1%)]
expected: FAIL
[max(1pc + 1%) should be used-value-equivalent to calc(1pc + 1%)]
expected: FAIL
[min(1in + 1%) should be used-value-equivalent to calc(1in + 1%)]
expected: FAIL
[calc(min(1.5em, 10%) + 10px) should be used-value-equivalent to 40px]
expected: FAIL
[min(20px, 10%) should be used-value-equivalent to 20px]
expected: FAIL
[min(1vh + 1%) should be used-value-equivalent to calc(1vh + 1%)]
expected: FAIL
[max(1em + 1%) should be used-value-equivalent to calc(1em + 1%)]
expected: FAIL
[calc(min(1.5em, 10%) - max(1em, 15%)) should be used-value-equivalent to -30px]
expected: FAIL
[calc(max(1em, 15%) / 2) should be used-value-equivalent to 30px]
expected: FAIL
[max(1vmin + 1%) should be used-value-equivalent to calc(1vmin + 1%)]
expected: FAIL
[min(1ch + 1%) should be used-value-equivalent to calc(1ch + 1%)]
expected: FAIL
[max(1vh + 1%) should be used-value-equivalent to calc(1vh + 1%)]
expected: FAIL
[min(1em, 10%) should be used-value-equivalent to 10px; width=100px]
expected: FAIL
[calc(min(1.5em, 10%) + max(1em, 15%)) should be used-value-equivalent to 90px]
expected: FAIL
[max(1in + 1%) should be used-value-equivalent to calc(1in + 1%)]
expected: FAIL

View file

@ -179,3 +179,156 @@
[e.style['margin-left'\] = "calc(min(1em) + 10%)" should set the property value] [e.style['margin-left'\] = "calc(min(1em) + 10%)" should set the property value]
expected: FAIL expected: FAIL
['calc(1em + max(10% + 20px) + 5% + min(1em + 10%) + 10px)' as a used value should serialize as '87px'.]
expected: FAIL
['max(1px)' as a used value should serialize as '1px'.]
expected: FAIL
['max(10%, 1em)' as a computed value should serialize as 'max(10%, 16px)'.]
expected: FAIL
['min(10%, 20px)' as a specified value should serialize as 'min(10%, 20px)'.]
expected: FAIL
['min(10% + 30px, 5em + 5%)' as a specified value should serialize as 'min(10% + 30px, 5% + 5em)'.]
expected: FAIL
['min(1px)' as a computed value should serialize as '1px'.]
expected: FAIL
['min(10% + 30px, 5em + 5%)' as a used value should serialize as '40px'.]
expected: FAIL
['max(10% + 30px, 5em + 5%)' as a computed value should serialize as 'max(10% + 30px, 5% + 80px)'.]
expected: FAIL
['max(10%, 20px)' as a used value should serialize as '20px'.]
expected: FAIL
['min(10%, 1em)' as a computed value should serialize as 'min(10%, 16px)'.]
expected: FAIL
['min(1px + 1%)' as a used value should serialize as '2px'.]
expected: FAIL
['min(1% + 1px)' as a computed value should serialize as 'min(1% + 1px)'.]
expected: FAIL
['max(10% + 30px, 5em + 5%)' as a used value should serialize as '85px'.]
expected: FAIL
['max(10% + 30px, 5em + 5%)' as a specified value should serialize as 'max(10% + 30px, 5% + 5em)'.]
expected: FAIL
['min(10%, 1em)' as a used value should serialize as '10px'.]
expected: FAIL
['min(1em, 10%)' as a used value should serialize as '10px'.]
expected: FAIL
['max(20px, 10%)' as a used value should serialize as '20px'.]
expected: FAIL
['max(10%, 1em)' as a used value should serialize as '16px'.]
expected: FAIL
['min(20px, 10%)' as a specified value should serialize as 'min(20px, 10%)'.]
expected: FAIL
['max(1em, 10%)' as a specified value should serialize as 'max(1em, 10%)'.]
expected: FAIL
['min(10%, 1em)' as a specified value should serialize as 'min(10%, 1em)'.]
expected: FAIL
['min(1px)' as a used value should serialize as '1px'.]
expected: FAIL
['min(1px)' as a specified value should serialize as 'calc(1px)'.]
expected: FAIL
['min(20px, 10%)' as a used value should serialize as '10px'.]
expected: FAIL
['min(1% + 1px)' as a used value should serialize as '2px'.]
expected: FAIL
['calc(min(10% + 1px) + max(1em + 10%) + min(10% + 20px))' as a computed value should serialize as 'calc(min(10% + 1px) + max(10% + 16px) + min(10% + 20px))'.]
expected: FAIL
['max(1px)' as a computed value should serialize as '1px'.]
expected: FAIL
['min(20px, 10%)' as a computed value should serialize as 'min(20px, 10%)'.]
expected: FAIL
['max(1px)' as a specified value should serialize as 'calc(1px)'.]
expected: FAIL
['max(10%, 1em)' as a specified value should serialize as 'max(10%, 1em)'.]
expected: FAIL
['min(10%, 20px)' as a used value should serialize as '10px'.]
expected: FAIL
['max(20px, 10%)' as a specified value should serialize as 'max(20px, 10%)'.]
expected: FAIL
['max(10%, 20px)' as a computed value should serialize as 'max(10%, 20px)'.]
expected: FAIL
['min(10% + 30px, 5em + 5%)' as a computed value should serialize as 'min(10% + 30px, 5% + 80px)'.]
expected: FAIL
['min(10%, 20px)' as a computed value should serialize as 'min(10%, 20px)'.]
expected: FAIL
['max(1px + 1%)' as a specified value should serialize as 'max(1% + 1px)'.]
expected: FAIL
['calc(min(10% + 1px) + max(1em + 10%) + min(10% + 20px))' as a used value should serialize as '67px'.]
expected: FAIL
['calc(1em + max(10% + 20px) + 5% + min(1em + 10%) + 10px)' as a computed value should serialize as 'calc(5% + 26px + max(10% + 20px) + min(10% + 16px))'.]
expected: FAIL
['max(1px + 1%)' as a computed value should serialize as 'max(1% + 1px)'.]
expected: FAIL
['min(1em, 10%)' as a specified value should serialize as 'min(1em, 10%)'.]
expected: FAIL
['min(1% + 1px)' as a specified value should serialize as 'min(1% + 1px)'.]
expected: FAIL
['calc(min(10% + 1px) + max(1em + 10%) + min(10% + 20px))' as a specified value should serialize as 'calc(min(10% + 1px) + max(10% + 1em) + min(10% + 20px))'.]
expected: FAIL
['max(10%, 20px)' as a specified value should serialize as 'max(10%, 20px)'.]
expected: FAIL
['min(1px + 1%)' as a specified value should serialize as 'min(1% + 1px)'.]
expected: FAIL
['max(1em, 10%)' as a computed value should serialize as 'max(16px, 10%)'.]
expected: FAIL
['min(1px + 1%)' as a computed value should serialize as 'min(1% + 1px)'.]
expected: FAIL
['max(1em, 10%)' as a used value should serialize as '16px'.]
expected: FAIL
['max(20px, 10%)' as a computed value should serialize as 'max(20px, 10%)'.]
expected: FAIL
['min(1em, 10%)' as a computed value should serialize as 'min(16px, 10%)'.]
expected: FAIL
['calc(1em + max(10% + 20px) + 5% + min(1em + 10%) + 10px)' as a specified value should serialize as 'calc(5% + 1em + 10px + max(10% + 20px) + min(10% + 1em))'.]
expected: FAIL
['max(1px + 1%)' as a used value should serialize as '2px'.]
expected: FAIL

View file

@ -131,3 +131,69 @@
[e.style['letter-spacing'\] = "calc(10px + min(1em))" should set the property value] [e.style['letter-spacing'\] = "calc(10px + min(1em))" should set the property value]
expected: FAIL expected: FAIL
['min(50px, 1in + 1px)' as a specified value should serialize as 'calc(50px)'.]
expected: FAIL
['min(1px)' as a computed value should serialize as '1px'.]
expected: FAIL
['min(50px, 1in + 1px)' as a computed value should serialize as '50px'.]
expected: FAIL
['calc(1px + min(1in, 100px))' as a computed value should serialize as '97px'.]
expected: FAIL
['min(1in)' as a specified value should serialize as 'calc(96px)'.]
expected: FAIL
['calc(1px + max(1in, 100px))' as a computed value should serialize as '101px'.]
expected: FAIL
['calc(min(1px, 1in) + max(100px + 1em, 10px + 1in) + 1px)' as a computed value should serialize as '118px'.]
expected: FAIL
['min(1px, 1em)' as a computed value should serialize as '1px'.]
expected: FAIL
['max(50px, 1in + 1px)' as a computed value should serialize as '97px'.]
expected: FAIL
['min(1px)' as a specified value should serialize as 'calc(1px)'.]
expected: FAIL
['calc(1px + min(1in, 100px))' as a specified value should serialize as 'calc(97px)'.]
expected: FAIL
['max(1px)' as a computed value should serialize as '1px'.]
expected: FAIL
['max(1px)' as a specified value should serialize as 'calc(1px)'.]
expected: FAIL
['min(1PX)' as a computed value should serialize as '1px'.]
expected: FAIL
['max(1in)' as a specified value should serialize as 'calc(96px)'.]
expected: FAIL
['min(1in)' as a computed value should serialize as '96px'.]
expected: FAIL
['min(1PX)' as a specified value should serialize as 'calc(1px)'.]
expected: FAIL
['calc(min(1px, 1in) + max(100px + 1em, 10px + 1in) + 1px)' as a specified value should serialize as 'calc(2px + max(1em + 100px, 106px))'.]
expected: FAIL
['max(1in)' as a computed value should serialize as '96px'.]
expected: FAIL
['min(1px, 1em)' as a specified value should serialize as 'min(1px, 1em)'.]
expected: FAIL
['max(50px, 1in + 1px)' as a specified value should serialize as 'calc(97px)'.]
expected: FAIL
['calc(1px + max(1in, 100px))' as a specified value should serialize as 'calc(101px)'.]
expected: FAIL

View file

@ -89,3 +89,45 @@
[Property opacity value 'min(0, 0.5)'] [Property opacity value 'min(0, 0.5)']
expected: FAIL expected: FAIL
[calc(min(0.1, 0.2) + 0.05) should be used-value-equivalent to 0.15]
expected: FAIL
[min(0.2, max(0.1, 0.15)) should be used-value-equivalent to 0.15]
expected: FAIL
[calc(min(0.1, 0.2) + max(0.1, 0.05)) should be used-value-equivalent to 0.2]
expected: FAIL
[calc(max(0.1, 0.2) + 0.05) should be used-value-equivalent to 0.25]
expected: FAIL
[calc(max(0.1, 0.2) - 0.05) should be used-value-equivalent to 0.15]
expected: FAIL
[max(0.1, min(0.2, 0.15)) should be used-value-equivalent to 0.15]
expected: FAIL
[max(1) should be used-value-equivalent to 1]
expected: FAIL
[calc(max(0.1, 0.2) * 2) should be used-value-equivalent to 0.4]
expected: FAIL
[min(1) should be used-value-equivalent to 1]
expected: FAIL
[calc(min(0.1, 0.2) / 2) should be used-value-equivalent to 0.05]
expected: FAIL
[calc(min(0.1, 0.2) * 2) should be used-value-equivalent to 0.2]
expected: FAIL
[calc(max(0.1, 0.2) / 2) should be used-value-equivalent to 0.1]
expected: FAIL
[calc(min(0.1, 0.2) - max(0.1, 0.05)) should be used-value-equivalent to 0]
expected: FAIL
[calc(min(0.1, 0.2) - 0.05) should be used-value-equivalent to 0.05]
expected: FAIL

View file

@ -35,3 +35,123 @@
[e.style['opacity'\] = "calc(1 + min(1))" should set the property value] [e.style['opacity'\] = "calc(1 + min(1))" should set the property value]
expected: FAIL expected: FAIL
['min(.3, .2, .1)' as a computed value should serialize as '0.1'.]
expected: FAIL
['scale(min(.1))' as a computed value should serialize as 'matrix(0.1, 0, 0, 0.1, 0, 0)'.]
expected: FAIL
['scale(min(.3, .2, .1))' as a computed value should serialize as 'matrix(0.1, 0, 0, 0.1, 0, 0)'.]
expected: FAIL
['calc(.1 + min(.1))' as a specified value should serialize as 'calc(0.2)'.]
expected: FAIL
['scale(calc(max(.1) + max(.2)))' as a computed value should serialize as 'matrix(0.3, 0, 0, 0.3, 0, 0)'.]
expected: FAIL
['max(.1, .2, .3)' as a specified value should serialize as 'calc(0.3)'.]
expected: FAIL
['min(.1, .2, .3)' as a computed value should serialize as '0.1'.]
expected: FAIL
['min(.3, .2, .1)' as a specified value should serialize as 'calc(0.1)'.]
expected: FAIL
['calc(max(.1) + max(.2))' as a specified value should serialize as 'calc(0.3)'.]
expected: FAIL
['scale(min(.1, .2, .3))' as a specified value should serialize as 'scale(calc(0.1))'.]
expected: FAIL
['calc(max(.1) + max(.2))' as a computed value should serialize as '0.3'.]
expected: FAIL
['max(.3, .2, .1)' as a specified value should serialize as 'calc(0.3)'.]
expected: FAIL
['min(.1)' as a specified value should serialize as 'calc(0.1)'.]
expected: FAIL
['scale(max(.3, .2, .1))' as a computed value should serialize as 'matrix(0.3, 0, 0, 0.3, 0, 0)'.]
expected: FAIL
['min(.1, .2, .3)' as a specified value should serialize as 'calc(0.1)'.]
expected: FAIL
['min(.1)' as a computed value should serialize as '0.1'.]
expected: FAIL
['scale(calc(max(.1) + max(.2)))' as a specified value should serialize as 'scale(calc(0.3))'.]
expected: FAIL
['scale(max(.1))' as a computed value should serialize as 'matrix(0.1, 0, 0, 0.1, 0, 0)'.]
expected: FAIL
['scale(max(.1, .2, .3))' as a specified value should serialize as 'scale(calc(0.3))'.]
expected: FAIL
['scale(min(.3, .2, .1))' as a specified value should serialize as 'scale(calc(0.1))'.]
expected: FAIL
['scale(max(.1, .2, .3))' as a computed value should serialize as 'matrix(0.3, 0, 0, 0.3, 0, 0)'.]
expected: FAIL
['scale(calc(max(.1) + .1))' as a specified value should serialize as 'scale(calc(0.2))'.]
expected: FAIL
['scale(min(.1, .2, .3))' as a computed value should serialize as 'matrix(0.1, 0, 0, 0.1, 0, 0)'.]
expected: FAIL
['scale(calc(min(.1) + min(.2)))' as a specified value should serialize as 'scale(calc(0.3))'.]
expected: FAIL
['scale(max(.3, .2, .1))' as a specified value should serialize as 'scale(calc(0.3))'.]
expected: FAIL
['scale(min(.1))' as a specified value should serialize as 'scale(calc(0.1))'.]
expected: FAIL
['calc(max(.1) + .1)' as a specified value should serialize as 'calc(0.2)'.]
expected: FAIL
['max(.3, .2, .1)' as a computed value should serialize as '0.3'.]
expected: FAIL
['calc(min(.1) + min(.2))' as a specified value should serialize as 'calc(0.3)'.]
expected: FAIL
['max(.1)' as a specified value should serialize as 'calc(0.1)'.]
expected: FAIL
['scale(max(.1))' as a specified value should serialize as 'scale(calc(0.1))'.]
expected: FAIL
['calc(min(.1) + min(.2))' as a computed value should serialize as '0.3'.]
expected: FAIL
['max(.1)' as a computed value should serialize as '0.1'.]
expected: FAIL
['calc(.1 + min(.1))' as a computed value should serialize as '0.2'.]
expected: FAIL
['calc(max(.1) + .1)' as a computed value should serialize as '0.2'.]
expected: FAIL
['scale(calc(.1 + min(.1)))' as a computed value should serialize as 'matrix(0.2, 0, 0, 0.2, 0, 0)'.]
expected: FAIL
['scale(calc(max(.1) + .1))' as a computed value should serialize as 'matrix(0.2, 0, 0, 0.2, 0, 0)'.]
expected: FAIL
['max(.1, .2, .3)' as a computed value should serialize as '0.3'.]
expected: FAIL
['scale(calc(min(.1) + min(.2)))' as a computed value should serialize as 'matrix(0.3, 0, 0, 0.3, 0, 0)'.]
expected: FAIL
['scale(calc(.1 + min(.1)))' as a specified value should serialize as 'scale(calc(0.2))'.]
expected: FAIL

View file

@ -83,3 +83,42 @@
[Property margin-left value 'calc(min(10%, 20%) + max(10%, 5%))'] [Property margin-left value 'calc(min(10%, 20%) + max(10%, 5%))']
expected: FAIL expected: FAIL
[calc(min(10%, 20%) - 5%) should be used-value-equivalent to 5%]
expected: FAIL
[calc(max(10%, 20%) + 5%) should be used-value-equivalent to 25%]
expected: FAIL
[max(10%, min(20%, 15%)) should be used-value-equivalent to 15%]
expected: FAIL
[min(20%, max(10%, 15%)) should be used-value-equivalent to 15%]
expected: FAIL
[calc(min(10%, 20%) + 5%) should be used-value-equivalent to 15%]
expected: FAIL
[calc(min(10%, 20%) * 2) should be used-value-equivalent to 20%]
expected: FAIL
[calc(max(10%, 20%) / 2) should be used-value-equivalent to 10%]
expected: FAIL
[calc(max(10%, 20%) * 2) should be used-value-equivalent to 40%]
expected: FAIL
[min(1%) should be used-value-equivalent to 1%]
expected: FAIL
[calc(min(10%, 20%) + max(10%, 5%)) should be used-value-equivalent to 20%]
expected: FAIL
[calc(min(10%, 20%) / 2) should be used-value-equivalent to 5%]
expected: FAIL
[calc(max(10%, 20%) - 5%) should be used-value-equivalent to 15%]
expected: FAIL
[max(1%) should be used-value-equivalent to 1%]
expected: FAIL

View file

@ -35,3 +35,72 @@
[e.style['margin-left'\] = "min(3%, 2%, 1%)" should set the property value] [e.style['margin-left'\] = "min(3%, 2%, 1%)" should set the property value]
expected: FAIL expected: FAIL
['max(1%)' as a used value should serialize as '1px'.]
expected: FAIL
['max(1%, 2%, 3%)' as a computed value should serialize as 'max(1%, 2%, 3%)'.]
expected: FAIL
['min(1%)' as a used value should serialize as '1px'.]
expected: FAIL
['min(3%, 2%, 1%)' as a used value should serialize as '1px'.]
expected: FAIL
['min(3%, 2%, 1%)' as a specified value should serialize as 'min(3%, 2%, 1%)'.]
expected: FAIL
['max(3%, 2%, 1%)' as a used value should serialize as '3px'.]
expected: FAIL
['calc(min(1%, 2%) + max(3%, 4%) + 10%)' as a computed value should serialize as '15%'.]
expected: FAIL
['max(3%, 2%, 1%)' as a specified value should serialize as 'max(3%, 2%, 1%)'.]
expected: FAIL
['min(1%)' as a specified value should serialize as 'calc(1%)'.]
expected: FAIL
['min(1%, 2%, 3%)' as a computed value should serialize as 'min(1%, 2%, 3%)'.]
expected: FAIL
['min(1%, 2%, 3%)' as a specified value should serialize as 'min(1%, 2%, 3%)'.]
expected: FAIL
['min(1%)' as a computed value should serialize as '1%'.]
expected: FAIL
['max(1%, 2%, 3%)' as a used value should serialize as '3px'.]
expected: FAIL
['max(1%)' as a specified value should serialize as 'calc(1%)'.]
expected: FAIL
['calc(min(1%, 2%) + max(3%, 4%) + 10%)' as a specified value should serialize as 'calc(15%)'.]
expected: FAIL
['max(3%, 2%, 1%)' as a computed value should serialize as 'max(3%, 2%, 1%)'.]
expected: FAIL
['calc(min(1%, 2%) + max(3%, 4%) + 10%)' as a used value should serialize as '15px'.]
expected: FAIL
['min(3%, 2%, 1%)' as a computed value should serialize as 'min(3%, 2%, 1%)'.]
expected: FAIL
['max(1%, 2%, 3%)' as a specified value should serialize as 'max(1%, 2%, 3%)'.]
expected: FAIL
['min(1%, 2%, 3%) 0px' as a specified value should serialize as 'min(1%, 2%, 3%) 0px'.]
expected: FAIL
['min(1%, 2%, 3%) 0px' as a computed value should serialize as 'min(1%, 2%, 3%) 0px'.]
expected: FAIL
['min(1%, 2%, 3%)' as a used value should serialize as '1px'.]
expected: FAIL
['max(1%)' as a computed value should serialize as '1%'.]
expected: FAIL

View file

@ -131,3 +131,66 @@
[Property transition-delay value 'calc(min(0.5s, 600ms) / 2)'] [Property transition-delay value 'calc(min(0.5s, 600ms) / 2)']
expected: FAIL expected: FAIL
[min(1s + 100ms, 500ms * 3) should be used-value-equivalent to 1.1s]
expected: FAIL
[max(1s, 2s) should be used-value-equivalent to 2s]
expected: FAIL
[max(1000ms, min(2000ms, 1.5s)) should be used-value-equivalent to 1.5s]
expected: FAIL
[calc(min(0.5s, 600ms) + max(500ms, 0.4s)) should be used-value-equivalent to 1s]
expected: FAIL
[min(1s, 2s) should be used-value-equivalent to 1s]
expected: FAIL
[min(1s, 1100ms) should be used-value-equivalent to 1s]
expected: FAIL
[calc(min(0.5s, 600ms) + 500ms) should be used-value-equivalent to 1s]
expected: FAIL
[min(1ms) should be used-value-equivalent to 1ms]
expected: FAIL
[calc(min(0.5s, 600ms) / 2) should be used-value-equivalent to 0.25s]
expected: FAIL
[calc(max(0.5s, 400ms) + 500ms) should be used-value-equivalent to 1s]
expected: FAIL
[calc(min(0.5s, 600ms) * 2) should be used-value-equivalent to 1s]
expected: FAIL
[max(0.9s, 1000ms) should be used-value-equivalent to 1000ms]
expected: FAIL
[min(2s, max(1s, 1500ms)) should be used-value-equivalent to 1500ms]
expected: FAIL
[max(1ms, 2ms) should be used-value-equivalent to 2ms]
expected: FAIL
[calc(max(0.5s, 400ms) / 2) should be used-value-equivalent to 0.25s]
expected: FAIL
[max(1ms) should be used-value-equivalent to 1ms]
expected: FAIL
[min(1ms, 2ms) should be used-value-equivalent to 1ms]
expected: FAIL
[min(1s) should be used-value-equivalent to 1s]
expected: FAIL
[calc(max(0.5s, 400ms) * 2) should be used-value-equivalent to 1s]
expected: FAIL
[max(1s) should be used-value-equivalent to 1s]
expected: FAIL
[calc(min(1s, 2s) + max(3s, 4s) + 10s) should be used-value-equivalent to 15s]
expected: FAIL

View file

@ -59,3 +59,69 @@
[e.style['transition-delay'\] = "min(3ms, 2ms, 1ms)" should set the property value] [e.style['transition-delay'\] = "min(3ms, 2ms, 1ms)" should set the property value]
expected: FAIL expected: FAIL
['min(1ms)' as a specified value should serialize as 'calc(0.001s)'.]
expected: FAIL
['min(900ms, 1s)' as a specified value should serialize as 'calc(0.9s)'.]
expected: FAIL
['max(3s, 2s, 1s)' as a computed value should serialize as '3s'.]
expected: FAIL
['max(1s)' as a specified value should serialize as 'calc(1s)'.]
expected: FAIL
['min(1s, 2s, 3s)' as a computed value should serialize as '1s'.]
expected: FAIL
['max(1s, 2s, 3s)' as a specified value should serialize as 'calc(3s)'.]
expected: FAIL
['min(1ms)' as a computed value should serialize as '0.001s'.]
expected: FAIL
['max(1ms)' as a computed value should serialize as '0.001s'.]
expected: FAIL
['min(3s, 2s, 1s)' as a computed value should serialize as '1s'.]
expected: FAIL
['max(1s)' as a computed value should serialize as '1s'.]
expected: FAIL
['min(1s)' as a specified value should serialize as 'calc(1s)'.]
expected: FAIL
['min(3s, 2s, 1s)' as a specified value should serialize as 'calc(1s)'.]
expected: FAIL
['calc(min(1s, 2s) + max(3s, 4s) + 10s)' as a computed value should serialize as '15s'.]
expected: FAIL
['max(1s, 2s, 3s)' as a computed value should serialize as '3s'.]
expected: FAIL
['max(3s, 2s, 1s)' as a specified value should serialize as 'calc(3s)'.]
expected: FAIL
['max(1ms)' as a specified value should serialize as 'calc(0.001s)'.]
expected: FAIL
['min(1s, 2s, 3s)' as a specified value should serialize as 'calc(1s)'.]
expected: FAIL
['min(1s)' as a computed value should serialize as '1s'.]
expected: FAIL
['max(1100ms, 1s)' as a computed value should serialize as '1.1s'.]
expected: FAIL
['calc(min(1s, 2s) + max(3s, 4s) + 10s)' as a specified value should serialize as 'calc(15s)'.]
expected: FAIL
['max(1100ms, 1s)' as a specified value should serialize as 'calc(1.1s)'.]
expected: FAIL
['min(900ms, 1s)' as a computed value should serialize as '0.9s'.]
expected: FAIL

View file

@ -0,0 +1,4 @@
[CaretPosition-001.html]
[Element at (400, 100)]
expected: FAIL

View file

@ -2,6 +2,3 @@
[listeners are called when <iframe> is resized] [listeners are called when <iframe> is resized]
expected: FAIL expected: FAIL
[listeners are called correct number of times]
expected: FAIL

View file

@ -21,3 +21,6 @@
[test the top of layer] [test the top of layer]
expected: FAIL expected: FAIL
[test some point of the element: top left corner]
expected: FAIL

View file

@ -0,0 +1,10 @@
[CSSStyleSheet-constructable-baseURL.tentative.html]
[Constructing sheet with custom base URL ueses that URL for CSS rules]
expected: FAIL
[Constructing sheet with invalid base URL throws a NotAllowedError]
expected: FAIL
[Constructing sheet with relative URL adds to the constructor document's base URL]
expected: FAIL

View file

@ -315,21 +315,18 @@
[<iframe>: combined response Content-Type: */* text/html] [<iframe>: combined response Content-Type: */* text/html]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html */*]
expected: FAIL
[<iframe>: combined response Content-Type: text/html */*;charset=gbk] [<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: FAIL expected: FAIL
[<iframe>: combined response Content-Type: text/html;" \\" text/plain] [<iframe>: combined response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/html */*]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
expected: FAIL expected: FAIL

View file

@ -56,3 +56,12 @@
[separate text/javascript x/x] [separate text/javascript x/x]
expected: FAIL expected: FAIL
[separate text/javascript;charset=windows-1252 error text/javascript]
expected: FAIL
[separate text/javascript; charset=windows-1252 text/javascript]
expected: FAIL
[separate text/javascript;charset=windows-1252 text/javascript]
expected: FAIL

View file

@ -1,4 +1,4 @@
[traverse_the_history_5.html] [traverse_the_history_3.html]
[Multiple history traversals, last would be aborted] [Multiple history traversals, last would be aborted]
expected: FAIL expected: FAIL

View file

@ -1,16 +1,20 @@
[supported-elements.html] [supported-elements.html]
expected: TIMEOUT
[Contenteditable element should support autofocus] [Contenteditable element should support autofocus]
expected: FAIL expected: FAIL
[Element with tabindex should support autofocus] [Element with tabindex should support autofocus]
expected: FAIL expected: TIMEOUT
[Host element with delegatesFocus including no focusable descendants should be skipped] [Host element with delegatesFocus including no focusable descendants should be skipped]
expected: FAIL expected: NOTRUN
[Area element should support autofocus] [Area element should support autofocus]
expected: FAIL expected: NOTRUN
[Host element with delegatesFocus should support autofocus] [Host element with delegatesFocus should support autofocus]
expected: FAIL expected: NOTRUN
[Non-HTMLElement should not support autofocus]
expected: NOTRUN

View file

@ -1,6 +1,6 @@
[iframe_sandbox_popups_escaping-3.html] [iframe_sandbox_popups_escaping-3.html]
type: testharness type: testharness
expected: CRASH expected: TIMEOUT
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used] [Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: TIMEOUT expected: TIMEOUT

View file

@ -1,5 +1,6 @@
[iframe_sandbox_popups_nonescaping-3.html] [iframe_sandbox_popups_nonescaping-3.html]
type: testharness type: testharness
expected: TIMEOUT
[Check that popups from a sandboxed iframe do not escape the sandbox] [Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL expected: NOTRUN

View file

@ -1,13 +1,4 @@
[contenttype.any.worker.html] [contenttype.any.worker.html]
[Response with Content-Type "APPLICATION/wasm": instantiateStreaming]
expected: FAIL
[Response with Content-Type "APPLICATION/WASM": instantiateStreaming]
expected: FAIL
[Response with Content-Type "application/wasm": instantiateStreaming]
expected: FAIL
[contenttype.any.sharedworker.html] [contenttype.any.sharedworker.html]
expected: ERROR expected: ERROR
@ -16,15 +7,6 @@
[contenttype.any.html] [contenttype.any.html]
[Response with Content-Type "APPLICATION/wasm": instantiateStreaming]
expected: FAIL
[Response with Content-Type "APPLICATION/WASM": instantiateStreaming]
expected: FAIL
[Response with Content-Type "application/wasm": instantiateStreaming]
expected: FAIL
[contenttype.any.serviceworker.html] [contenttype.any.serviceworker.html]
expected: ERROR expected: ERROR

View file

@ -38,3 +38,6 @@
[X Rendered audio for channel 5 does not equal [0,0.0626220703125,0.125030517578125,0.18695068359375,0.24810791015625,0.308319091796875,0.3673095703125,0.42486572265625,0.480743408203125,0.53472900390625,0.58660888671875,0.636199951171875,0.68328857421875,0.727691650390625,0.76922607421875,0.8077392578125...\] with an element-wise tolerance of {"absoluteThreshold":0.000030517578125,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[1\]\t3.6732959747314453e-1\t6.2622070312500000e-2\t3.0470752716064453e-1\t4.8658168859649127e+0\t3.0517578125000000e-5\n\t[2\]\t6.8329977989196777e-1\t1.2503051757812500e-1\t5.5826926231384277e-1\t4.4650639949963384e+0\t3.0517578125000000e-5\n\t[3\]\t9.0373212099075317e-1\t1.8695068359375000e-1\t7.1678143739700317e-1\t3.8340669508039502e+0\t3.0517578125000000e-5\n\t[4\]\t9.9780619144439697e-1\t2.4810791015625000e-1\t7.4969828128814697e-1\t3.0216621502152523e+0\t3.0517578125000000e-5\n\t[5\]\t9.5236867666244507e-1\t3.0831909179687500e-1\t6.4404958486557007e-1\t2.0889059484187866e+0\t3.0517578125000000e-5\n\t...and 42288 more errors.\n\tMax AbsError of 1.9962286949157715e+0 at index of 29972.\n\t[29972\]\t9.9879217147827148e-1\t-9.9743652343750000e-1\t1.9962286949157715e+0\t2.0013591321441684e+0\t3.0517578125000000e-5\n\tMax RelError of Infinity at index of 12348.\n\t[12348\]\t9.5105654001235962e-1\t0.0000000000000000e+0\t9.5105654001235962e-1\tInfinity\t3.0517578125000000e-5\n] [X Rendered audio for channel 5 does not equal [0,0.0626220703125,0.125030517578125,0.18695068359375,0.24810791015625,0.308319091796875,0.3673095703125,0.42486572265625,0.480743408203125,0.53472900390625,0.58660888671875,0.636199951171875,0.68328857421875,0.727691650390625,0.76922607421875,0.8077392578125...\] with an element-wise tolerance of {"absoluteThreshold":0.000030517578125,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[1\]\t3.6732959747314453e-1\t6.2622070312500000e-2\t3.0470752716064453e-1\t4.8658168859649127e+0\t3.0517578125000000e-5\n\t[2\]\t6.8329977989196777e-1\t1.2503051757812500e-1\t5.5826926231384277e-1\t4.4650639949963384e+0\t3.0517578125000000e-5\n\t[3\]\t9.0373212099075317e-1\t1.8695068359375000e-1\t7.1678143739700317e-1\t3.8340669508039502e+0\t3.0517578125000000e-5\n\t[4\]\t9.9780619144439697e-1\t2.4810791015625000e-1\t7.4969828128814697e-1\t3.0216621502152523e+0\t3.0517578125000000e-5\n\t[5\]\t9.5236867666244507e-1\t3.0831909179687500e-1\t6.4404958486557007e-1\t2.0889059484187866e+0\t3.0517578125000000e-5\n\t...and 42288 more errors.\n\tMax AbsError of 1.9962286949157715e+0 at index of 29972.\n\t[29972\]\t9.9879217147827148e-1\t-9.9743652343750000e-1\t1.9962286949157715e+0\t2.0013591321441684e+0\t3.0517578125000000e-5\n\tMax RelError of Infinity at index of 12348.\n\t[12348\]\t9.5105654001235962e-1\t0.0000000000000000e+0\t9.5105654001235962e-1\tInfinity\t3.0517578125000000e-5\n]
expected: FAIL expected: FAIL
[X Rendered audio for channel 5 does not equal [0,0.0626220703125,0.125030517578125,0.18695068359375,0.24810791015625,0.308319091796875,0.3673095703125,0.42486572265625,0.480743408203125,0.53472900390625,0.58660888671875,0.636199951171875,0.68328857421875,0.727691650390625,0.76922607421875,0.8077392578125...\] with an element-wise tolerance of {"absoluteThreshold":0.000030517578125,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[1\]\t3.6732959747314453e-1\t6.2622070312500000e-2\t3.0470752716064453e-1\t4.8658168859649127e+0\t3.0517578125000000e-5\n\t[2\]\t6.8329977989196777e-1\t1.2503051757812500e-1\t5.5826926231384277e-1\t4.4650639949963384e+0\t3.0517578125000000e-5\n\t[3\]\t9.0373212099075317e-1\t1.8695068359375000e-1\t7.1678143739700317e-1\t3.8340669508039502e+0\t3.0517578125000000e-5\n\t[4\]\t9.9780619144439697e-1\t2.4810791015625000e-1\t7.4969828128814697e-1\t3.0216621502152523e+0\t3.0517578125000000e-5\n\t[5\]\t9.5236867666244507e-1\t3.0831909179687500e-1\t6.4404958486557007e-1\t2.0889059484187866e+0\t3.0517578125000000e-5\n\t...and 42285 more errors.\n\tMax AbsError of 1.9986916780471802e+0 at index of 31225.\n\t[31225\]\t9.9994289875030518e-1\t-9.9874877929687500e-1\t1.9986916780471802e+0\t2.0011956154322119e+0\t3.0517578125000000e-5\n\tMax RelError of Infinity at index of 12348.\n\t[12348\]\t9.5105654001235962e-1\t0.0000000000000000e+0\t9.5105654001235962e-1\tInfinity\t3.0517578125000000e-5\n]
expected: FAIL

View file

@ -182,3 +182,12 @@
[X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...\] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[19030\]\t8.3196109375000000e+4\t-7.3546999692916870e-1\t8.3196844844996929e+4\t1.1312065100190540e+5\t3.8985999999999999e-3\n\t[19031\]\t-3.6017334461212158e-1\t-6.9157749414443970e-1\t3.3140414953231812e-1\t4.7920030992665957e-1\t3.8985999999999999e-3\n\t[38059\]\t1.6516518750000000e+5\t-9.8956179618835449e-1\t1.6516617706179619e+5\t1.6690840096898633e+5\t3.8985999999999999e-3\n\t[38060\]\t-8.8409073650836945e-2\t-9.9664616584777832e-1\t9.0823709219694138e-1\t9.1129341918891205e-1\t3.8985999999999999e-3\n\tMax AbsError of 1.6516617706179619e+5 at index of 38059.\n\tMax RelError of 1.6690840096898633e+5 at index of 38059.\n] [X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...\] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[19030\]\t8.3196109375000000e+4\t-7.3546999692916870e-1\t8.3196844844996929e+4\t1.1312065100190540e+5\t3.8985999999999999e-3\n\t[19031\]\t-3.6017334461212158e-1\t-6.9157749414443970e-1\t3.3140414953231812e-1\t4.7920030992665957e-1\t3.8985999999999999e-3\n\t[38059\]\t1.6516518750000000e+5\t-9.8956179618835449e-1\t1.6516617706179619e+5\t1.6690840096898633e+5\t3.8985999999999999e-3\n\t[38060\]\t-8.8409073650836945e-2\t-9.9664616584777832e-1\t9.0823709219694138e-1\t9.1129341918891205e-1\t3.8985999999999999e-3\n\tMax AbsError of 1.6516617706179619e+5 at index of 38059.\n\tMax RelError of 1.6690840096898633e+5 at index of 38059.\n]
expected: FAIL expected: FAIL
[X SNR (45.01863889150833 dB) is not greater than or equal to 85.58. Got 45.01863889150833.]
expected: FAIL
[X Stitched sine-wave buffers at sample rate 44100 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...\] with an element-wise tolerance of {"absoluteThreshold":0.000090957,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[31080\]\t-5.6100901701938710e-10\t5.6332010030746460e-1\t5.6332010086847362e-1\t1.0000000009958974e+0\t9.0957000000000003e-5\n\t[31081\]\t4.5647297475380916e-41\t6.1397600173950195e-1\t6.1397600173950195e-1\t1.0000000000000000e+0\t9.0957000000000003e-5\n\tMax AbsError of 6.1397600173950195e-1 at index of 31081.\n\tMax RelError of 1.0000000009958974e+0 at index of 31080.\n]
expected: FAIL
[< [buffer-stitching-1\] 2 out of 3 assertions were failed.]
expected: FAIL

View file

@ -0,0 +1,5 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -1,5 +0,0 @@
[018.html]
expected: TIMEOUT
[origin of the script that invoked the method, javascript:]
expected: TIMEOUT

View file

@ -1,5 +1,4 @@
[005.html] [005.html]
expected: ERROR
[dedicated worker in shared worker in dedicated worker] [dedicated worker in shared worker in dedicated worker]
expected: FAIL expected: FAIL

View file

@ -1,6 +1,3 @@
[promise.html] [promise.html]
type: testharness type: testharness
prefs: [dom.testbinding.enabled:true] prefs: [dom.testbinding.enabled:true]
[Native promise from async callback can be resolved]
expected: FAIL

View file

@ -5,7 +5,7 @@ def main(request, response):
response.headers.set("Accept-CH-Lifetime", "10") response.headers.set("Accept-CH-Lifetime", "10")
response.content = ''' response.content = '''
<script> <script>
window.opener.postMessage({ header: "%s" }, "*"); window.opener.postMessage({ header: '%s' }, "*");
</script> </script>
Sec-CH-UA: %s Sec-CH-UA: %s
''' % (ua, ua) ''' % (ua, ua)

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: Grid item placement with '&lt;integer&gt; && &lt;custom-ident&gt;' and auto repeat()</title>
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
<link rel="help" href="http://www.w3.org/TR/css-grid-1/#line-placement">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
<meta name="assert" content="Grid placement algorithm is able to select the right line when using the '<integer> && <custom-ident>' syntax and there is an auto repeat().">
<style>
.grid {
display: grid;
width: 300px;
height: 300px;
grid-template-columns: [foo] repeat(auto-fill, 100px [foo]);
grid-template-rows: repeat(auto-fill, [foo] 100px);
}
.grid > div {
grid-area: 1 foo / 1 foo;
background: green;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div class="grid">
<div></div>
</div>

View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: Grid item placement with implicit named line and auto repeat()</title>
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
<link rel="help" href="http://www.w3.org/TR/css-grid-1/#line-placement">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
<meta name="assert" content="Grid placement algorithm is able to select the right line when defined implicitly with grid-template-areas.">
<style>
.grid {
display: grid;
width: 300px;
height: 300px;
grid-template-areas: "area";
grid-template-columns: repeat(auto-fill, 100px);
grid-template-rows: repeat(auto-fill, 100px) [area-end] 100px;
}
.grid > div {
grid-area: area;
background: green;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div class="grid">
<div></div>
</div>

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: Grid item placement with implicit named line, '&lt;integer&gt; && &lt;custom-ident&gt;', and auto repeat()</title>
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
<link rel="help" href="http://www.w3.org/TR/css-grid-1/#line-placement">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
<meta name="assert" content="Grid placement algorithm is able to select the right line when defined implicitly with grid-template-areas, referenced using the '<integer> && <custom-ident>' syntax, and with auto repeat().">
<style>
.grid {
display: grid;
width: 300px;
height: 300px;
margin-left: -100px;
margin-top: -100px;
grid-template-areas: ". ." ". foo";
grid-template-columns: repeat(auto-fill, 100px) [foo-start];
grid-template-rows: repeat(auto-fill, 100px) [foo-start];
}
.grid > div {
grid-area: 1 foo-start / 1 foo-start;
background: green;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div class="grid">
<div></div>
</div>

View file

@ -12,7 +12,15 @@ html, body { margin: 0px; padding: 0px; }
height: 200px; height: 200px;
background: green; background: green;
} }
#fail {
width: 200px;
height: 200px;
position: absolute;
z-index: -1;
background: red;
}
</style> </style>
<div id=parent> <div id=parent>
<div id=fail></div>
<div id=target></div> <div id=target></div>
</div> </div>

View file

@ -12,7 +12,15 @@ html, body { margin: 0px; padding: 0px; }
height: 200px; height: 200px;
background: green; background: green;
} }
#fail {
width: 200px;
height: 200px;
position: absolute;
z-index: -1;
background: red;
}
</style> </style>
<div id=parent> <div id=parent>
<div id=fail></div>
<div id=target></div> <div id=target></div>
</div> </div>

View file

@ -17,8 +17,17 @@
.test { .test {
background-color: green; background-color: green;
animation: anim 2000000s linear; animation: anim 1s linear;
animation-delay: -1000000s; animation-delay: -.5s;
animation-play-state: paused;
}
.fail {
background: red;
position: absolute;
z-index: -1;
width: 100px;
height: 100px;
} }
.container { .container {
@ -29,5 +38,6 @@
</style> </style>
<p>Test passes if there is a filled green square.</p> <p>Test passes if there is a filled green square.</p>
<div class="container"> <div class="container">
<div class="fail"></div>
<div class="test"></div> <div class="test"></div>
</div> </div>

View file

@ -5,16 +5,14 @@
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org"> <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../support/computed-testcommon.js"></script> <script src="../support/numeric-testcommon.js"></script>
<div id="target"></div> <div id="target"></div>
<div id="reference"></div> <div id="reference"></div>
<script> <script>
function test_angle_equals(value, expected) { function test_angle_equals(value, expected) {
const reference = document.getElementById('reference'); test_math_used(`rotate(${value})`, `rotate(${expected})`,
reference.style.transform = ''; {prop:'transform', base:'none',
reference.style.transform = `rotate(${expected})`; msg: `${value} should be used-value-equivalent to ${expected}`});
const computed = getComputedStyle(reference).transform;
test_computed_value('transform', `rotate(${value})`, computed);
} }
// Identity tests // Identity tests

View file

@ -3,37 +3,109 @@
<link rel="help" href="https://drafts.csswg.org/css-values-4/#angles"> <link rel="help" href="https://drafts.csswg.org/css-values-4/#angles">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-serialize"> <link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-serialize">
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org"> <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<link rel="author" title="Tab Atkins-Bittner" href="https://xanthir.com/contact">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../support/parsing-testcommon.js"></script> <script src="../support/serialize-testcommon.js"></script>
<div id=target></div>
<script> <script>
function test_valid_angle(value, expected) { function test_serialization(t,s,c,u, {prop="transform"}={}) {
test_valid_value('transform', `rotate(${value})`, `rotate(${expected})`); t = `rotate(${t})`;
test_specified_serialization(prop, t, `rotate(${s})`);
test_computed_serialization(prop, t, c);
if(u) test_used_serialization(prop, t, u);
} }
test_valid_angle('min(1deg)', 'min(1deg)'); // Browsers aren't perfectly interoperable about how a 90deg rotation is serialized,
test_valid_angle('min(1rad)', 'min(1rad)'); // but that's not the focus of this test,
test_valid_angle('min(1turn)', 'min(1turn)'); // so just capture *whatever* the browser does and expect that.
test_valid_angle('min(1grad)', 'min(1grad)'); const rotateMatrix = (()=>{
test_valid_angle('max(1deg)', 'max(1deg)'); const el = document.querySelector("#target");
test_valid_angle('max(1rad)', 'max(1rad)'); el.style.transform = "rotate(90deg)";
test_valid_angle('max(1turn)', 'max(1turn)'); const ret = getComputedStyle(el).transform;
test_valid_angle('max(1grad)', 'max(1grad)'); el.removeAttribute('style');
return ret;
})();
test_valid_angle('min(1deg, 2deg, 3deg)', 'min(1deg, 2deg, 3deg)'); test_serialization(
test_valid_angle('min(3deg, 2deg, 1deg)', 'min(3deg, 2deg, 1deg)'); 'min(90deg)',
test_valid_angle('min(90deg, 1.57rad, 0.25turn)', 'min(90deg, 1.57rad, 0.25turn)'); 'calc(90deg)',
test_valid_angle('min(0.25turn, 1.57rad, 90deg)', 'min(0.25turn, 1.57rad, 90deg)'); rotateMatrix);
test_valid_angle('max(1deg, 2deg, 3deg)', 'max(1deg, 2deg, 3deg)'); test_serialization(
test_valid_angle('max(3deg, 2deg, 1deg)', 'max(3deg, 2deg, 1deg)'); 'min(.25turn)',
test_valid_angle('max(90deg, 1.57rad, 0.25turn)', 'max(90deg, 1.57rad, 0.25turn)'); 'calc(90deg)',
test_valid_angle('max(0.25turn, 1.57rad, 90deg)', 'max(0.25turn, 1.57rad, 90deg)'); rotateMatrix);
test_serialization(
'min(100grad)',
'calc(90deg)',
rotateMatrix);
test_serialization(
'max(90deg)',
'calc(90deg)',
rotateMatrix);
test_serialization(
'max(.25turn)',
'calc(90deg)',
rotateMatrix);
test_serialization(
'max(100grad)',
'calc(90deg)',
rotateMatrix);
// No way to test 'rad' serialization without depending heavily on numeric serialization
// and the precision used for radians...
test_valid_angle('calc(min(1deg) + min(2deg))', 'calc(min(1deg) + min(2deg))'); test_serialization(
test_valid_angle('calc(max(1deg) + max(2deg))', 'calc(max(1deg) + max(2deg))'); 'min(90deg, 92deg, 93deg)',
test_valid_angle('calc(1rad + min(1deg))', 'calc(1rad + min(1deg))'); 'calc(90deg)',
test_valid_angle('calc(min(1deg) + 1rad)', 'calc(1rad + min(1deg))'); rotateMatrix);
test_valid_angle('calc(1rad + max(1deg))', 'calc(1rad + max(1deg))'); test_serialization(
test_valid_angle('calc(max(1deg) + 1rad)', 'calc(1rad + max(1deg))'); 'min(93deg, 92deg, 90deg)',
'calc(90deg)',
rotateMatrix);
test_serialization(
'min(90deg, 1.58rad, 0.25turn)',
'calc(90deg)',
rotateMatrix);
test_serialization(
'min(0.25turn, 1.58rad, 90deg)',
'calc(90deg)',
rotateMatrix);
test_serialization(
'max(81deg, 82deg, 90deg)',
'calc(90deg)',
rotateMatrix);
test_serialization(
'max(83deg, 82deg, 90deg)',
'calc(90deg)',
rotateMatrix);
test_serialization(
'max(90deg, 1.57rad, 0.25turn)',
'calc(90deg)',
rotateMatrix);
test_serialization(
'max(0.25turn, 1.57rad, 90deg)',
'calc(90deg)',
rotateMatrix);
test_serialization(
'calc(min(30deg) + max(60deg))',
'calc(90deg)',
rotateMatrix);
test_serialization(
'calc(50grad + min(45deg))',
'calc(90deg)',
rotateMatrix);
test_serialization(
'calc(min(45deg) + 50grad)',
'calc(90deg)',
rotateMatrix);
test_serialization(
'calc(50grad + max(45deg))',
'calc(90deg)',
rotateMatrix);
test_serialization(
'calc(max(45deg) + 50grad)',
'calc(90deg)',
rotateMatrix);
</script> </script>

View file

@ -5,18 +5,14 @@
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org"> <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../support/computed-testcommon.js"></script> <script src="../support/numeric-testcommon.js"></script>
<div id="target"></div> <div id="target"></div>
<div id="reference"></div>
<script> <script>
const property = 'z-index';
function test_integer_equals(value, expected) { function test_integer_equals(value, expected) {
const reference = document.getElementById('reference'); test_math_used(value, expected,
reference.style[property] = ''; {base: '123',
reference.style[property] = expected; prop: 'z-index'}
const computed = getComputedStyle(reference)[property]; );
test_computed_value(property, value, computed);
} }
// Identity tests // Identity tests

View file

@ -5,20 +5,15 @@
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org"> <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../support/computed-testcommon.js"></script> <script src="../support/numeric-testcommon.js"></script>
<div id="container" style="font-size: 20px"> <div id="container" style="font-size: 20px">
<div id="target"></div> <div id="target"></div>
<div id="reference"></div>
</div> </div>
<script> <script>
const property = 'letter-spacing'; const property = 'letter-spacing';
function test_length_equals(value, expected, titleExtra) { function test_length_equals(value, expected, msgExtra) {
const reference = document.getElementById('reference'); test_math_used(value, expected, {msgExtra});
reference.style[property] = '';
reference.style[property] = expected;
const computed = getComputedStyle(reference)[property];
test_computed_value(property, value, computed, titleExtra);
} }
// Identity tests // Identity tests

View file

@ -5,80 +5,70 @@
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org"> <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../support/computed-testcommon.js"></script> <script src="../support/numeric-testcommon.js"></script>
<div id="container" style="font-size: 20px; width: 400px"> <div id="container" style="font-size: 20px; width: 400px">
<div id="target"></div> <div id="target"></div>
<div id="reference"></div>
</div> </div>
<script> <script>
const property = 'margin-left';
function test_length_percent_equals(value, expected, titleExtra) {
const reference = document.getElementById('reference');
reference.style[property] = '';
reference.style[property] = expected;
const computed = getComputedStyle(reference)[property];
test_computed_value(property, value, computed, titleExtra);
}
// Identity tests // Identity tests
test_length_percent_equals('min(1px + 1%)', 'calc(1px + 1%)'); test_math_used('min(1px + 1%)', 'calc(1px + 1%)', {prop:'margin-left'});
test_length_percent_equals('min(1cm + 1%)', 'calc(1cm + 1%)'); test_math_used('min(1cm + 1%)', 'calc(1cm + 1%)');
test_length_percent_equals('min(1mm + 1%)', 'calc(1mm + 1%)'); test_math_used('min(1mm + 1%)', 'calc(1mm + 1%)');
test_length_percent_equals('min(1Q + 1%)', 'calc(1Q + 1%)'); test_math_used('min(1Q + 1%)', 'calc(1Q + 1%)');
test_length_percent_equals('min(1in + 1%)', 'calc(1in + 1%)'); test_math_used('min(1in + 1%)', 'calc(1in + 1%)');
test_length_percent_equals('min(1pc + 1%)', 'calc(1pc + 1%)'); test_math_used('min(1pc + 1%)', 'calc(1pc + 1%)');
test_length_percent_equals('min(1pt + 1%)', 'calc(1pt + 1%)'); test_math_used('min(1pt + 1%)', 'calc(1pt + 1%)');
test_length_percent_equals('min(1em + 1%)', 'calc(1em + 1%)'); test_math_used('min(1em + 1%)', 'calc(1em + 1%)');
test_length_percent_equals('min(1ex + 1%)', 'calc(1ex + 1%)'); test_math_used('min(1ex + 1%)', 'calc(1ex + 1%)');
test_length_percent_equals('min(1ch + 1%)', 'calc(1ch + 1%)'); test_math_used('min(1ch + 1%)', 'calc(1ch + 1%)');
test_length_percent_equals('min(1rem + 1%)', 'calc(1rem + 1%)'); test_math_used('min(1rem + 1%)', 'calc(1rem + 1%)');
test_length_percent_equals('min(1vh + 1%)', 'calc(1vh + 1%)'); test_math_used('min(1vh + 1%)', 'calc(1vh + 1%)');
test_length_percent_equals('min(1vw + 1%)', 'calc(1vw + 1%)'); test_math_used('min(1vw + 1%)', 'calc(1vw + 1%)');
test_length_percent_equals('min(1vmin + 1%)', 'calc(1vmin + 1%)'); test_math_used('min(1vmin + 1%)', 'calc(1vmin + 1%)');
test_length_percent_equals('min(1vmax + 1%)', 'calc(1vmax + 1%)'); test_math_used('min(1vmax + 1%)', 'calc(1vmax + 1%)');
test_length_percent_equals('max(1px + 1%)', 'calc(1px + 1%)'); test_math_used('max(1px + 1%)', 'calc(1px + 1%)');
test_length_percent_equals('max(1cm + 1%)', 'calc(1cm + 1%)'); test_math_used('max(1cm + 1%)', 'calc(1cm + 1%)');
test_length_percent_equals('max(1mm + 1%)', 'calc(1mm + 1%)'); test_math_used('max(1mm + 1%)', 'calc(1mm + 1%)');
test_length_percent_equals('max(1Q + 1%)', 'calc(1Q + 1%)'); test_math_used('max(1Q + 1%)', 'calc(1Q + 1%)');
test_length_percent_equals('max(1in + 1%)', 'calc(1in + 1%)'); test_math_used('max(1in + 1%)', 'calc(1in + 1%)');
test_length_percent_equals('max(1pc + 1%)', 'calc(1pc + 1%)'); test_math_used('max(1pc + 1%)', 'calc(1pc + 1%)');
test_length_percent_equals('max(1pt + 1%)', 'calc(1pt + 1%)'); test_math_used('max(1pt + 1%)', 'calc(1pt + 1%)');
test_length_percent_equals('max(1em + 1%)', 'calc(1em + 1%)'); test_math_used('max(1em + 1%)', 'calc(1em + 1%)');
test_length_percent_equals('max(1ex + 1%)', 'calc(1ex + 1%)'); test_math_used('max(1ex + 1%)', 'calc(1ex + 1%)');
test_length_percent_equals('max(1ch + 1%)', 'calc(1ch + 1%)'); test_math_used('max(1ch + 1%)', 'calc(1ch + 1%)');
test_length_percent_equals('max(1rem + 1%)', 'calc(1rem + 1%)'); test_math_used('max(1rem + 1%)', 'calc(1rem + 1%)');
test_length_percent_equals('max(1vh + 1%)', 'calc(1vh + 1%)'); test_math_used('max(1vh + 1%)', 'calc(1vh + 1%)');
test_length_percent_equals('max(1vw + 1%)', 'calc(1vw + 1%)'); test_math_used('max(1vw + 1%)', 'calc(1vw + 1%)');
test_length_percent_equals('max(1vmin + 1%)', 'calc(1vmin + 1%)'); test_math_used('max(1vmin + 1%)', 'calc(1vmin + 1%)');
test_length_percent_equals('max(1vmax + 1%)', 'calc(1vmax + 1%)'); test_math_used('max(1vmax + 1%)', 'calc(1vmax + 1%)');
// Comparisons between lengths and percentages // Comparisons between lengths and percentages
test_length_percent_equals('min(20px, 10%)', '20px'); test_math_used('min(20px, 10%)', '20px');
test_length_percent_equals('min(1em, 10%)', '20px'); test_math_used('min(1em, 10%)', '20px');
test_length_percent_equals('max(20px, 10%)', '40px'); test_math_used('max(20px, 10%)', '40px');
test_length_percent_equals('max(1em, 10%)', '40px'); test_math_used('max(1em, 10%)', '40px');
document.getElementById('container').style.width = '100px'; document.getElementById('container').style.width = '100px';
test_length_percent_equals('min(20px, 10%)', '10px', 'width=100px'); test_math_used('min(20px, 10%)', '10px', {msgExtra:'width=100px'});
test_length_percent_equals('min(1em, 10%)', '10px', 'width=100px'); test_math_used('min(1em, 10%)', '10px', {msgExtra:'width=100px'});
test_length_percent_equals('max(20px, 10%)', '20px', 'width=100px'); test_math_used('max(20px, 10%)', '20px', {msgExtra:'width=100px'});
test_length_percent_equals('max(1em, 10%)', '20px', 'width=100px'); test_math_used('max(1em, 10%)', '20px', {msgExtra:'width=100px'});
document.getElementById('container').style.width = '400px'; document.getElementById('container').style.width = '400px';
// Comparisons between different mixings // Comparisons between different mixings
test_length_percent_equals('min(30px + 10%, 60px + 5%)', '70px'); test_math_used('min(30px + 10%, 60px + 5%)', '70px');
test_length_percent_equals('max(2em + 10%, 1em + 20%)', '100px'); test_math_used('max(2em + 10%, 1em + 20%)', '100px');
// General calculations // General calculations
test_length_percent_equals('calc(min(1.5em, 10%) + 10px)', '40px'); test_math_used('calc(min(1.5em, 10%) + 10px)', '40px');
test_length_percent_equals('calc(min(1.5em, 10%) - 10px)', '20px'); test_math_used('calc(min(1.5em, 10%) - 10px)', '20px');
test_length_percent_equals('calc(min(1.5em, 10%) * 2)', '60px'); test_math_used('calc(min(1.5em, 10%) * 2)', '60px');
test_length_percent_equals('calc(min(1.5em, 10%) / 2)', '15px'); test_math_used('calc(min(1.5em, 10%) / 2)', '15px');
test_length_percent_equals('calc(max(1em, 15%) + 10px)', '70px'); test_math_used('calc(max(1em, 15%) + 10px)', '70px');
test_length_percent_equals('calc(max(1em, 15%) - 10px)', '50px'); test_math_used('calc(max(1em, 15%) - 10px)', '50px');
test_length_percent_equals('calc(max(1em, 15%) * 2)', '120px'); test_math_used('calc(max(1em, 15%) * 2)', '120px');
test_length_percent_equals('calc(max(1em, 15%) / 2)', '30px'); test_math_used('calc(max(1em, 15%) / 2)', '30px');
test_length_percent_equals('calc(min(1.5em, 10%) + max(1em, 15%))', '90px'); test_math_used('calc(min(1.5em, 10%) + max(1em, 15%))', '90px');
test_length_percent_equals('calc(min(1.5em, 10%) - max(1em, 15%))', '-30px'); test_math_used('calc(min(1.5em, 10%) - max(1em, 15%))', '-30px');
</script> </script>

View file

@ -3,79 +3,117 @@
<link rel="help" href="https://drafts.csswg.org/css-values-4/#mixed-percentages"> <link rel="help" href="https://drafts.csswg.org/css-values-4/#mixed-percentages">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-serialize"> <link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-serialize">
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org"> <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<link rel="author" title="Tab Atkins-Bittner" href="https://xanthir.com/contact">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../support/parsing-testcommon.js"></script> <script src="../support/serialize-testcommon.js"></script>
<div style="width: 100px;">
<div id=target></div>
</div>
<script> <script>
const property = 'margin-left'; function test_serialization(t,s,c,u, {prop}={}) {
test_specified_serialization(prop || 'text-indent', t, s);
function test_valid_length_percent(value, expected) { test_computed_serialization(prop || 'text-indent', t, c);
test_valid_value(property, value, expected); if(u) test_used_serialization(prop || 'margin-left', t, u);
} }
test_valid_length_percent('min(1px + 1%)', 'min(1% + 1px)'); // If fully resolvable to a number, serialize to a calc() or all the way to a number.
test_valid_length_percent('min(1cm + 1%)', 'min(1% + 1cm)'); test_serialization(
test_valid_length_percent('min(1mm + 1%)', 'min(1% + 1mm)'); 'min(1px)',
test_valid_length_percent('min(1Q + 1%)', 'min(1% + 1q)'); 'calc(1px)',
test_valid_length_percent('min(1in + 1%)', 'min(1% + 1in)'); '1px',
test_valid_length_percent('min(1pc + 1%)', 'min(1% + 1pc)'); '1px');
test_valid_length_percent('min(1pt + 1%)', 'min(1% + 1pt)'); test_serialization(
test_valid_length_percent('min(1em + 1%)', 'min(1% + 1em)'); 'max(1px)',
test_valid_length_percent('min(1ex + 1%)', 'min(1% + 1ex)'); 'calc(1px)',
test_valid_length_percent('min(1ch + 1%)', 'min(1% + 1ch)'); '1px',
test_valid_length_percent('min(1rem + 1%)', 'min(1% + 1rem)'); '1px');
test_valid_length_percent('min(1vh + 1%)', 'min(1% + 1vh)');
test_valid_length_percent('min(1vw + 1%)', 'min(1% + 1vw)');
test_valid_length_percent('min(1vmin + 1%)', 'min(1% + 1vmin)');
test_valid_length_percent('min(1vmax + 1%)', 'min(1% + 1vmax)');
test_valid_length_percent('max(1px + 1%)', 'max(1% + 1px)');
test_valid_length_percent('max(1cm + 1%)', 'max(1% + 1cm)');
test_valid_length_percent('max(1mm + 1%)', 'max(1% + 1mm)');
test_valid_length_percent('max(1Q + 1%)', 'max(1% + 1q)');
test_valid_length_percent('max(1in + 1%)', 'max(1% + 1in)');
test_valid_length_percent('max(1pc + 1%)', 'max(1% + 1pc)');
test_valid_length_percent('max(1pt + 1%)', 'max(1% + 1pt)');
test_valid_length_percent('max(1em + 1%)', 'max(1% + 1em)');
test_valid_length_percent('max(1ex + 1%)', 'max(1% + 1ex)');
test_valid_length_percent('max(1ch + 1%)', 'max(1% + 1ch)');
test_valid_length_percent('max(1rem + 1%)', 'max(1% + 1rem)');
test_valid_length_percent('max(1vh + 1%)', 'max(1% + 1vh)');
test_valid_length_percent('max(1vw + 1%)', 'max(1% + 1vw)');
test_valid_length_percent('max(1vmin + 1%)', 'max(1% + 1vmin)');
test_valid_length_percent('max(1vmax + 1%)', 'max(1% + 1vmax)');
test_valid_length_percent('min(20px, 10%)', 'min(20px, 10%)'); // If not, keep as the function.
test_valid_length_percent('min(1em, 10%)', 'min(1em, 10%)'); test_serialization(
test_valid_length_percent('max(20px, 10%)', 'max(20px, 10%)'); 'min(1% + 1px)',
test_valid_length_percent('max(1em, 10%)', 'max(1em, 10%)'); 'min(1% + 1px)',
test_valid_length_percent('min(10%, 20px)', 'min(10%, 20px)'); 'min(1% + 1px)',
test_valid_length_percent('min(10%, 1em)', 'min(10%, 1em)'); '2px');
test_valid_length_percent('max(10%, 20px)', 'max(10%, 20px)'); test_serialization(
test_valid_length_percent('max(10%, 1em)', 'max(10%, 1em)'); 'min(1px + 1%)',
'min(1% + 1px)',
'min(1% + 1px)',
'2px');
test_serialization(
'max(1px + 1%)',
'max(1% + 1px)',
'max(1% + 1px)',
'2px');
test_valid_length_percent('min(10% + 30px, 5% + 60px)', 'min(10% + 30px, 5% + 60px)') // Arguments are simplified, but not reordered.
test_valid_length_percent('max(10% + 2em, 5% + 1em)', 'max(10% + 2em, 5% + 1em)') test_serialization(
'min(20px, 10%)',
'min(20px, 10%)',
'min(20px, 10%)',
'10px');
test_serialization(
'min(1em, 10%)',
'min(1em, 10%)',
'min(16px, 10%)',
'10px');
test_serialization(
'min(10%, 20px)',
'min(10%, 20px)',
'min(10%, 20px)',
'10px');
test_serialization(
'min(10%, 1em)',
'min(10%, 1em)',
'min(10%, 16px)',
'10px');
test_serialization(
'max(20px, 10%)',
'max(20px, 10%)',
'max(20px, 10%)',
'20px');
test_serialization(
'max(1em, 10%)',
'max(1em, 10%)',
'max(16px, 10%)',
'16px');
test_serialization(
'max(10%, 20px)',
'max(10%, 20px)',
'max(10%, 20px)',
'20px');
test_serialization(
'max(10%, 1em)',
'max(10%, 1em)',
'max(10%, 16px)',
'16px');
test_valid_length_percent('calc(min(10%) + max(1em) + min(20px))', 'calc(min(10%) + max(1em) + min(20px))'); // Within an argument, normal sorting occurs
test_valid_length_percent('calc(max(20px) + min(1em) + max(10%))', 'calc(max(20px) + min(1em) + max(10%))'); test_serialization(
test_valid_length_percent('calc(max(10%) + min(1em) + max(20px))', 'calc(max(10%) + min(1em) + max(20px))'); 'min(10% + 30px, 5em + 5%)',
test_valid_length_percent('calc(min(20px) + max(1em) + min(10%))', 'calc(min(20px) + max(1em) + min(10%))'); 'min(10% + 30px, 5% + 5em)',
'min(10% + 30px, 5% + 80px)',
'40px');
test_serialization(
'max(10% + 30px, 5em + 5%)',
'max(10% + 30px, 5% + 5em)',
'max(10% + 30px, 5% + 80px)',
'85px');
test_valid_length_percent('calc(20px + min(10%))', 'calc(20px + min(10%))'); // min()/max() are valid inside a calc(),
test_valid_length_percent('calc(10% + min(20px))', 'calc(10% + min(20px))'); // and retain their relative order
test_valid_length_percent('calc(1em + min(10%))', 'calc(1em + min(10%))'); test_serialization(
test_valid_length_percent('calc(10% + min(1em))', 'calc(10% + min(1em))'); 'calc(min(10% + 1px) + max(1em + 10%) + min(10% + 20px))',
test_valid_length_percent('calc(min(10%) + 20px)', 'calc(20px + min(10%))'); 'calc(min(10% + 1px) + max(10% + 1em) + min(10% + 20px))',
test_valid_length_percent('calc(min(20px) + 10%)', 'calc(10% + min(20px))'); 'calc(min(10% + 1px) + max(10% + 16px) + min(10% + 20px))',
test_valid_length_percent('calc(min(10%) + 1em)', 'calc(1em + min(10%))'); '67px');
test_valid_length_percent('calc(min(1em) + 10%)', 'calc(10% + min(1em))');
test_valid_length_percent('calc(20px + max(10%))', 'calc(20px + max(10%))');
test_valid_length_percent('calc(10% + max(20px))', 'calc(10% + max(20px))');
test_valid_length_percent('calc(1em + max(10%))', 'calc(1em + max(10%))');
test_valid_length_percent('calc(10% + max(1em))', 'calc(10% + max(1em))');
test_valid_length_percent('calc(max(10%) + 20px)', 'calc(20px + max(10%))');
test_valid_length_percent('calc(max(20px) + 10%)', 'calc(10% + max(20px))');
test_valid_length_percent('calc(max(10%) + 1em)', 'calc(1em + max(10%))');
test_valid_length_percent('calc(max(1em) + 10%)', 'calc(10% + max(1em))');
// min()/max() can be combined with plain units as well.
// While min()/max() maintain their own ordering,
// ordinary units will re-sort around them.
test_serialization(
'calc(1em + max(10% + 20px) + 5% + min(1em + 10%) + 10px)',
'calc(5% + 1em + 10px + max(10% + 20px) + min(10% + 1em))',
'calc(5% + 26px + max(10% + 20px) + min(10% + 16px))',
'87px');
</script> </script>

View file

@ -5,61 +5,71 @@
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org"> <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../support/parsing-testcommon.js"></script> <script src="../support/serialize-testcommon.js"></script>
<div style="width: 100px;">
<div id=target></div>
</div>
<script> <script>
const property = 'letter-spacing'; function test_serialization(t,s,c,u, {prop}={}) {
test_specified_serialization(prop || 'text-indent', t, s);
function test_valid_length(value, expected) { test_computed_serialization(prop || 'text-indent', t, c);
test_valid_value(property, value, expected); if(u) test_used_serialization(prop || 'margin-left', t, u);
} }
test_valid_length('min(1px)', 'min(1px)'); test_serialization(
test_valid_length('min(1cm)', 'min(1cm)'); 'min(1px)',
test_valid_length('min(1mm)', 'min(1mm)'); 'calc(1px)',
'1px');
test_serialization(
'min(1in)',
'calc(96px)',
'96px');
test_serialization(
'max(1px)',
'calc(1px)',
'1px');
test_serialization(
'max(1in)',
'calc(96px)',
'96px');
// Values are case-insensitive and serialize as lower case, for example 1Q // Values are case-insensitive and serialize as lower case, for example 1Q
// serializes as 1q. // serializes as 1q.
test_valid_length('min(1Q)', 'min(1q)'); test_serialization(
test_valid_length('min(1in)', 'min(1in)'); 'min(1PX)',
test_valid_length('min(1pc)', 'min(1pc)'); 'calc(1px)',
test_valid_length('min(1pt)', 'min(1pt)'); '1px');
test_valid_length('min(1em)', 'min(1em)');
test_valid_length('min(1ex)', 'min(1ex)');
test_valid_length('min(1ch)', 'min(1ch)');
test_valid_length('min(1rem)', 'min(1rem)');
test_valid_length('min(1vh)', 'min(1vh)');
test_valid_length('min(1vw)', 'min(1vw)');
test_valid_length('min(1vmin)', 'min(1vmin)');
test_valid_length('min(1vmax)', 'min(1vmax)');
test_valid_length('max(1px)', 'max(1px)');
test_valid_length('max(1cm)', 'max(1cm)');
test_valid_length('max(1mm)', 'max(1mm)');
test_valid_length('max(1Q)', 'max(1q)');
test_valid_length('max(1in)', 'max(1in)');
test_valid_length('max(1pc)', 'max(1pc)');
test_valid_length('max(1pt)', 'max(1pt)');
test_valid_length('max(1em)', 'max(1em)');
test_valid_length('max(1ex)', 'max(1ex)');
test_valid_length('max(1ch)', 'max(1ch)');
test_valid_length('max(1rem)', 'max(1rem)');
test_valid_length('max(1vh)', 'max(1vh)');
test_valid_length('max(1vw)', 'max(1vw)');
test_valid_length('max(1vmin)', 'max(1vmin)');
test_valid_length('max(1vmax)', 'max(1vmax)');
test_valid_length('min(10px, 20px, 30px)', 'min(10px, 20px, 30px)'); // Arguments simplify down eagerly
test_valid_length('min(30px, 20px, 10px)', 'min(30px, 20px, 10px)'); test_serialization(
test_valid_length('min(20px, 1em, 10vw)', 'min(20px, 1em, 10vw)'); 'min(50px, 1in + 1px)',
test_valid_length('min(10vw, 1em, 20px)', 'min(10vw, 1em, 20px)'); 'calc(50px)',
test_valid_length('max(10px, 20px, 30px)', 'max(10px, 20px, 30px)'); '50px');
test_valid_length('max(30px, 20px, 10px)', 'max(30px, 20px, 10px)'); test_serialization(
test_valid_length('max(20px, 1em, 10vw)', 'max(20px, 1em, 10vw)'); 'max(50px, 1in + 1px)',
test_valid_length('max(10vw, 1em, 20px)', 'max(10vw, 1em, 20px)'); 'calc(97px)',
'97px');
test_valid_length('calc(min(10px) + max(1em) + min(10vw))', 'calc(min(10px) + max(1em) + min(10vw))'); // And the entire function simplifies eagerly if possible
test_valid_length('calc(max(1em) + min(10vw) + max(10px))', 'calc(max(1em) + min(10vw) + max(10px))'); test_serialization(
test_valid_length('calc(10px + min(1em))', 'calc(10px + min(1em))'); 'calc(1px + min(1in, 100px))',
test_valid_length('calc(min(1em) + 10px)', 'calc(10px + min(1em))'); 'calc(97px)',
test_valid_length('calc(10px + max(1em))', 'calc(10px + max(1em))'); '97px');
test_valid_length('calc(max(1em) + 10px)', 'calc(10px + max(1em))'); test_serialization(
'calc(1px + max(1in, 100px))',
'calc(101px)',
'101px');
// Computed-value units preserve min()/max() in specified values
test_serialization(
'min(1px, 1em)',
'min(1px, 1em)',
'1px');
test_serialization(
'calc(min(1px, 1in) + max(100px + 1em, 10px + 1in) + 1px)',
'calc(2px + max(1em + 100px, 106px))',
'118px');
// Can't test that min()/max() are preserved in computed values with just lengths;
// see minmax-length-percentage-serialize for tests of that.
</script> </script>

View file

@ -5,41 +5,26 @@
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org"> <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../support/computed-testcommon.js"></script> <script src="../support/numeric-testcommon.js"></script>
<div id="target"></div> <div id="target"></div>
<div id="reference"></div>
<script> <script>
const property = 'opacity';
function test_number_equals(value, expected) {
const reference = document.getElementById('reference');
reference.style[property] = '';
reference.style[property] = expected;
const computed = getComputedStyle(reference)[property];
test_computed_value(property, value, computed);
}
// Identity tests // Identity tests
test_number_equals('min(1)', '1'); test_math_used('min(1)', '1', {type:'number'});
test_number_equals('max(1)', '1'); test_math_used('max(1)', '1', {type:'number'});
// Nestings // Nestings
test_number_equals('min(0.2, max(0.1, 0.15))', '0.15'); test_math_used('min(0.2, max(0.1, 0.15))', '0.15', {type:'number'});
test_number_equals('max(0.1, min(0.2, 0.15))', '0.15'); test_math_used('max(0.1, min(0.2, 0.15))', '0.15', {type:'number'});
// General calculations // General calculations
test_number_equals('calc(min(0.1, 0.2) + 0.05)', '0.15'); test_math_used('calc(min(0.1, 0.2) + 0.05)', '0.15', {type:'number'});
test_number_equals('calc(min(0.1, 0.2) - 0.05)', '0.05'); test_math_used('calc(min(0.1, 0.2) - 0.05)', '0.05', {type:'number'});
test_number_equals('calc(min(0.1, 0.2) * 2)', '0.2'); test_math_used('calc(min(0.1, 0.2) * 2)', '0.2', {type:'number'});
test_number_equals('calc(min(0.1, 0.2) / 2)', '0.05'); test_math_used('calc(min(0.1, 0.2) / 2)', '0.05', {type:'number'});
test_number_equals('calc(max(0.1, 0.2) + 0.05)', '0.25'); test_math_used('calc(max(0.1, 0.2) + 0.05)', '0.25', {type:'number'});
test_number_equals('calc(max(0.1, 0.2) - 0.05)', '0.15'); test_math_used('calc(max(0.1, 0.2) - 0.05)', '0.15', {type:'number'});
test_number_equals('calc(max(0.1, 0.2) * 2)', '0.4'); test_math_used('calc(max(0.1, 0.2) * 2)', '0.4', {type:'number'});
test_number_equals('calc(max(0.1, 0.2) / 2)', '0.1'); test_math_used('calc(max(0.1, 0.2) / 2)', '0.1', {type:'number'});
test_number_equals('calc(min(0.1, 0.2) + max(0.1, 0.05))', '0.2'); test_math_used('calc(min(0.1, 0.2) + max(0.1, 0.05))', '0.2', {type:'number'});
test_number_equals('calc(min(0.1, 0.2) - max(0.1, 0.05))', '0'); test_math_used('calc(min(0.1, 0.2) - max(0.1, 0.05))', '0', {type:'number'});
// Mixing floats and integers
test_number_equals('min(0, 0.5)', '0');
test_number_equals('max(0, 0.5)', '0.5');
</script> </script>

View file

@ -3,27 +3,61 @@
<link rel="help" href="https://drafts.csswg.org/css-values-4/#numbers"> <link rel="help" href="https://drafts.csswg.org/css-values-4/#numbers">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-serialize"> <link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-serialize">
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org"> <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<link rel="author" title="Tab Atkins-Bittner" href="https://xanthir.com/contact">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../support/parsing-testcommon.js"></script> <script src="../support/serialize-testcommon.js"></script>
<div id=target></div>
<script> <script>
function test_valid_number(value, expected) { function test_serialization(t,s,c) {
test_valid_value('opacity', value, expected); test_specified_serialization('opacity', t, s);
test_specified_serialization('transform', `scale(${t})`, `scale(calc(${c}))`);
test_computed_serialization('opacity', t, c);
test_computed_serialization('transform', `scale(${t})`, `matrix(${c}, 0, 0, ${c}, 0, 0)`);
} }
test_valid_number('min(1)', 'min(1)'); test_serialization(
test_valid_number('max(1)', 'max(1)'); 'min(.1)',
'calc(0.1)',
'0.1');
test_serialization(
'max(.1)',
'calc(0.1)',
'0.1');
test_valid_number('min(1, 2, 3)', 'min(1, 2, 3)'); test_serialization(
test_valid_number('min(3, 2, 1)', 'min(3, 2, 1)'); 'min(.1, .2, .3)',
test_valid_number('max(1, 2, 3)', 'max(1, 2, 3)'); 'calc(0.1)',
test_valid_number('max(3, 2, 1)', 'max(3, 2, 1)'); '0.1');
test_serialization(
'max(.1, .2, .3)',
'calc(0.3)',
'0.3');
test_valid_number('calc(min(1) + min(2))', 'calc(min(1) + min(2))'); test_serialization(
test_valid_number('calc(max(1) + max(2))', 'calc(max(1) + max(2))'); 'min(.3, .2, .1)',
test_valid_number('calc(1 + min(1))', 'calc(1 + min(1))'); 'calc(0.1)',
test_valid_number('calc(min(1) + 1)', 'calc(1 + min(1))'); '0.1');
test_valid_number('calc(1 + max(1))', 'calc(1 + max(1))'); test_serialization(
test_valid_number('calc(max(1) + 1)', 'calc(1 + max(1))'); 'max(.3, .2, .1)',
'calc(0.3)',
'0.3');
test_serialization(
'calc(min(.1) + min(.2))',
'calc(0.3)',
'0.3');
test_serialization(
'calc(max(.1) + max(.2))',
'calc(0.3)',
'0.3');
test_serialization(
'calc(.1 + min(.1))',
'calc(0.2)',
'0.2');
test_serialization(
'calc(max(.1) + .1)',
'calc(0.2)',
'0.2');
</script> </script>

View file

@ -5,39 +5,29 @@
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org"> <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../support/computed-testcommon.js"></script> <script src="../support/numeric-testcommon.js"></script>
<div id="container" style="width: 400px"> <div id="container" style="width: 400px">
<div id="target"></div> <div id="target"></div>
<div id="reference"></div>
</div> </div>
<script> <script>
const property = 'margin-left';
function test_percentage_equals(value, expected) {
const reference = document.getElementById('reference');
reference.style[property] = '';
reference.style[property] = expected;
const computed = getComputedStyle(reference)[property];
test_computed_value(property, value, computed);
}
// Identity tests // Identity tests
test_percentage_equals('min(1%)', '1%'); test_math_used('min(1%)', '1%');
test_percentage_equals('max(1%)', '1%'); test_math_used('max(1%)', '1%');
// Nestings // Nestings
test_percentage_equals('min(20%, max(10%, 15%))', '15%'); test_math_used('min(20%, max(10%, 15%))', '15%');
test_percentage_equals('max(10%, min(20%, 15%))', '15%'); test_math_used('max(10%, min(20%, 15%))', '15%');
// General calculations // General calculations
test_percentage_equals('calc(min(10%, 20%) + 5%)', '15%'); test_math_used('calc(min(10%, 20%) + 5%)', '15%');
test_percentage_equals('calc(min(10%, 20%) - 5%)', '5%'); test_math_used('calc(min(10%, 20%) - 5%)', '5%');
test_percentage_equals('calc(min(10%, 20%) * 2)', '20%'); test_math_used('calc(min(10%, 20%) * 2)', '20%');
test_percentage_equals('calc(min(10%, 20%) / 2)', '5%'); test_math_used('calc(min(10%, 20%) / 2)', '5%');
test_percentage_equals('calc(max(10%, 20%) + 5%)', '25%'); test_math_used('calc(max(10%, 20%) + 5%)', '25%');
test_percentage_equals('calc(max(10%, 20%) - 5%)', '15%'); test_math_used('calc(max(10%, 20%) - 5%)', '15%');
test_percentage_equals('calc(max(10%, 20%) * 2)', '40%'); test_math_used('calc(max(10%, 20%) * 2)', '40%');
test_percentage_equals('calc(max(10%, 20%) / 2)', '10%'); test_math_used('calc(max(10%, 20%) / 2)', '10%');
test_percentage_equals('calc(min(10%, 20%) + max(10%, 5%))', '20%'); test_math_used('calc(min(10%, 20%) + max(10%, 5%))', '20%');
test_percentage_equals('calc(min(10%, 20%) - max(10%, 5%))', '0%'); test_math_used('calc(min(10%, 20%) - max(10%, 5%))', '0%');
</script> </script>

View file

@ -3,27 +3,70 @@
<link rel="help" href="https://drafts.csswg.org/css-values-4/#percentages"> <link rel="help" href="https://drafts.csswg.org/css-values-4/#percentages">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-serialize"> <link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-serialize">
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org"> <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<link rel="author" title="Tab Atkins-Bittner" href="https://xanthir.com/contact">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../support/parsing-testcommon.js"></script> <script src="../support/serialize-testcommon.js"></script>
<div style="width: 100px;">
<div id=target></div>
</div>
<script> <script>
function test_valid_percentage(value, expected) { function test_serialization(t,s,c,u, {prop}={}) {
test_valid_value('margin-left', value, expected); test_specified_serialization(prop || 'text-indent', t,s);
test_computed_serialization(prop || 'text-indent', t,c);
if(u) test_used_serialization(prop || 'margin-left', t,u);
} }
test_valid_percentage('min(1%)', 'min(1%)'); test_serialization(
test_valid_percentage('max(1%)', 'max(1%)'); 'min(1%)',
'calc(1%)',
'1%',
'1px');
test_serialization(
'max(1%)',
'calc(1%)',
'1%',
'1px');
test_valid_percentage('min(1%, 2%, 3%)', 'min(1%, 2%, 3%)');
test_valid_percentage('min(3%, 2%, 1%)', 'min(3%, 2%, 1%)');
test_valid_percentage('max(1%, 2%, 3%)', 'max(1%, 2%, 3%)');
test_valid_percentage('max(3%, 2%, 1%)', 'max(3%, 2%, 1%)');
test_valid_percentage('calc(min(1%) + min(2%))', 'calc(min(1%) + min(2%))'); // %s can't be simplified until we resolve them,
test_valid_percentage('calc(max(1%) + max(2%))', 'calc(max(1%) + max(2%))'); // since in some cases they can resolve against a negative value
test_valid_percentage('calc(1% + min(1%))', 'calc(1% + min(1%))'); // (so that 20% is less than 10%),
test_valid_percentage('calc(min(1%) + 1%)', 'calc(1% + min(1%))'); // and we don't want to try and distinguish between the properties
test_valid_percentage('calc(1% + max(1%))', 'calc(1% + max(1%))'); // where the resolving value is possibly-negative or always non-negative.
test_valid_percentage('calc(max(1%) + 1%)', 'calc(1% + max(1%))'); test_serialization(
'min(1%, 2%, 3%)',
'min(1%, 2%, 3%)',
'min(1%, 2%, 3%)',
'1px');
test_serialization(
'min(3%, 2%, 1%)',
'min(3%, 2%, 1%)',
'min(3%, 2%, 1%)',
'1px');
test_serialization(
'max(1%, 2%, 3%)',
'max(1%, 2%, 3%)',
'max(1%, 2%, 3%)',
'3px');
test_serialization(
'max(3%, 2%, 1%)',
'max(3%, 2%, 1%)',
'max(3%, 2%, 1%)',
'3px');
// Also ensure that this works against a possibly-negative resolving value...
test_serialization(
'min(1%, 2%, 3%) 0px',
'min(1%, 2%, 3%) 0px',
'min(1%, 2%, 3%) 0px',
'',
{prop:'background-position'});
test_serialization(
'calc(min(1%, 2%) + max(3%, 4%) + 10%)',
'calc(15%)',
'15%',
'15px');
</script> </script>

View file

@ -5,18 +5,11 @@
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org"> <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../support/computed-testcommon.js"></script> <script src="../support/numeric-testcommon.js"></script>
<div id="target"></div> <div id="target"></div>
<div id="reference"></div>
<script> <script>
const property = 'transition-delay'; function test_time_equals(t,e) {
test_math_used(t, e, {type:"time"});
function test_time_equals(value, expected) {
const reference = document.getElementById('reference');
reference.style[property] = '';
reference.style[property] = expected;
const computed = getComputedStyle(reference)[property];
test_computed_value(property, value, computed);
} }
// Identity tests // Identity tests
@ -50,4 +43,6 @@ test_time_equals('calc(max(0.5s, 400ms) * 2)', '1s');
test_time_equals('calc(max(0.5s, 400ms) / 2)', '0.25s'); test_time_equals('calc(max(0.5s, 400ms) / 2)', '0.25s');
test_time_equals('calc(min(0.5s, 600ms) + max(500ms, 0.4s))', '1s'); test_time_equals('calc(min(0.5s, 600ms) + max(500ms, 0.4s))', '1s');
test_time_equals('calc(min(0.5s, 600ms) - max(500ms, 0.4s))', '0s'); test_time_equals('calc(min(0.5s, 600ms) - max(500ms, 0.4s))', '0s');
test_time_equals('min(1s + 100ms, 500ms * 3)', '1.1s');
test_time_equals('calc(min(1s, 2s) + max(3s, 4s) + 10s)', '15s');
</script> </script>

View file

@ -3,36 +3,62 @@
<link rel="help" href="https://drafts.csswg.org/css-values-4/#time"> <link rel="help" href="https://drafts.csswg.org/css-values-4/#time">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-serialize"> <link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-serialize">
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org"> <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<link rel="author" title="Tab Atkins-Bittner" href="https://xanthir.com/contact">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="../support/parsing-testcommon.js"></script> <script src="../support/serialize-testcommon.js"></script>
<div id=target></div>
<script> <script>
function test_valid_time(value, expected) { function test_serialization(t,s,c,u, {prop="transition-delay"}={}) {
test_valid_value('transition-delay', value, expected); test_specified_serialization(prop, t, s);
test_computed_serialization(prop, t, c);
if(u) test_used_serialization(prop, t, u);
} }
test_valid_time('min(1ms)', 'min(1ms)'); test_serialization(
test_valid_time('min(1s)', 'min(1s)'); 'min(1ms)',
test_valid_time('max(1ms)', 'max(1ms)'); 'calc(0.001s)',
test_valid_time('max(1s)', 'max(1s)'); '0.001s');
test_serialization(
'min(1s)',
'calc(1s)',
'1s');
test_serialization(
'max(1ms)',
'calc(0.001s)',
'0.001s');
test_serialization(
'max(1s)',
'calc(1s)',
'1s');
test_valid_time('min(1ms, 2ms, 3ms)', 'min(1ms, 2ms, 3ms)'); test_serialization(
test_valid_time('min(3ms, 2ms, 1ms)', 'min(3ms, 2ms, 1ms)'); 'min(1s, 2s, 3s)',
test_valid_time('max(1ms, 2ms, 3ms)', 'max(1ms, 2ms, 3ms)'); 'calc(1s)',
test_valid_time('max(3ms, 2ms, 1ms)', 'max(3ms, 2ms, 1ms)'); '1s');
test_valid_time('min(1000ms, 1s)', 'min(1000ms, 1s)'); test_serialization(
test_valid_time('min(1s, 1000ms)', 'min(1s, 1000ms)'); 'min(3s, 2s, 1s)',
test_valid_time('max(1000ms, 1s)', 'max(1000ms, 1s)'); 'calc(1s)',
test_valid_time('max(1s, 1000ms)', 'max(1s, 1000ms)'); '1s');
test_serialization(
test_valid_time('calc(min(1s) + min(2s))', 'calc(min(1s) + min(2s))'); 'max(1s, 2s, 3s)',
test_valid_time('calc(min(2s) + min(1s))', 'calc(min(2s) + min(1s))'); 'calc(3s)',
test_valid_time('calc(max(1s) + max(2s))', 'calc(max(1s) + max(2s))'); '3s');
test_valid_time('calc(max(2s) + max(1s))', 'calc(max(2s) + max(1s))'); test_serialization(
'max(3s, 2s, 1s)',
test_valid_time('calc(1s + min(2s))', 'calc(1s + min(2s))'); 'calc(3s)',
test_valid_time('calc(min(2s) + 1s)', 'calc(1s + min(2s))'); '3s');
test_valid_time('calc(1s + max(2s))', 'calc(1s + max(2s))'); test_serialization(
test_valid_time('calc(max(2s) + 1s)', 'calc(1s + max(2s))'); 'min(900ms, 1s)',
'calc(0.9s)',
'0.9s');
test_serialization(
'max(1100ms, 1s)',
'calc(1.1s)',
'1.1s');
test_serialization(
'calc(min(1s, 2s) + max(3s, 4s) + 10s)',
'calc(15s)',
'15s');
</script> </script>

View file

@ -0,0 +1,66 @@
<!DOCTYPE html>
<title>CSSStyleSheet baseURL</title>
<link rel="author" title="Erik Nordin" href="mailto:enordin@mozilla.com">
<link rel="help" href="https://github.com/WICG/construct-stylesheets/issues/95#issuecomment-593545252">
<div id="target"></div>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
<script>
function currentLocation() {
const sections = location.href.split("/")
sections.pop();
return sections.join("/");
}
test(() => {
const span = document.createElement("span");
target.appendChild(span);
span.attachShadow({ mode: "open" })
const shadowDiv = document.createElement("div");
span.shadowRoot.appendChild(shadowDiv);
const fileName = "example.png"
const baseURL = `${location.origin}/custom/path/`;
const fullURL = `${baseURL}${fileName}`;
const sheet = new CSSStyleSheet({ baseURL });
span.shadowRoot.adoptedStyleSheets = [sheet];
sheet.replaceSync(`* { background-image: url("${fileName}"); }`);
const styleFromRelative = getComputedStyle(shadowDiv).backgroundImage;
sheet.replaceSync(`* { background-image: url("${fullURL}"); }`);
const styleFromFull = getComputedStyle(shadowDiv).backgroundImage;
assert_equals(styleFromRelative, styleFromFull);
}, "Constructing sheet with custom base URL ueses that URL for CSS rules");
test(() => {
const span = document.createElement("span");
target.appendChild(span);
span.attachShadow({ mode: "open" })
const shadowDiv = document.createElement("div");
span.shadowRoot.appendChild(shadowDiv);
const fileName = "example.png"
const baseURL = "custom/path/";
const fullURL = `${currentLocation()}/${baseURL}${fileName}`;
const sheet = new CSSStyleSheet({ baseURL });
span.shadowRoot.adoptedStyleSheets = [sheet];
sheet.replaceSync(`* { background-image: url("${fileName}"); }`);
const styleFromRelative = getComputedStyle(shadowDiv).backgroundImage;
sheet.replaceSync(`* { background-image: url("${fullURL}"); }`);
const styleFromFull = getComputedStyle(shadowDiv).backgroundImage;
assert_equals(styleFromRelative, styleFromFull);
}, "Constructing sheet with relative URL adds to the constructor document's base URL");
test(() => {
assert_throws_dom("NotAllowedError", () => { new CSSStyleSheet({ baseURL: "chrome://"}) });
}, "Constructing sheet with invalid base URL throws a NotAllowedError");
</script>

View file

@ -742,4 +742,30 @@ test(() => {
sheet.replaceSync(''); sheet.replaceSync('');
}, 'Modifying an adopted stylesheet on a disconnected shadow root should not crash.'); }, 'Modifying an adopted stylesheet on a disconnected shadow root should not crash.');
function currentLocation() {
const sections = location.href.split("/")
sections.pop();
return sections.join("/");
}
test(() => {
const span = document.createElement("span");
thirdSection.appendChild(span);
const shadowDiv = attachShadowDiv(span);
const fileName = "example.png"
const fullPath = `${currentLocation()}/${fileName}`
const sheet = new CSSStyleSheet();
span.shadowRoot.adoptedStyleSheets = [sheet];
sheet.replaceSync(`* { background-image: url("${fileName}"); }`);
const styleFromRelative = getComputedStyle(shadowDiv).backgroundImage;
sheet.replaceSync(`* { background-image: url("${fullPath}"); }`);
const styleFromFull = getComputedStyle(shadowDiv).backgroundImage;
assert_equals(styleFromRelative, styleFromFull);
}, "Constructing a sheet with the default base URL uses the constructor document's base URL for CSS rules");
</script> </script>

View file

@ -1,58 +1,189 @@
'use strict'; 'use strict';
/* /*
Tests to verify that numeric values Provides functions to help test that two numeric values are equivalent.
(math functions, generally), These *do not* rely on you predicting what one value will serialize to;
are handled correctly. instead, they set and serialize *both* values,
and just ensure that they serialize to the same thing.
Relies on a #target element existing in the document, They rely on a #target element existing in the document,
as this might rely on layout to resolve styles, as this might rely on layout to resolve styles,
and so it needs to be in the document. and so it needs to be in the document.
Three main functions are defined, with the same signatures:
test_math_used() (for testing used values),
test_math_computed() (for testing computed values),
and test_math_specified() (for testing specified values).
Signature for all is:
test_math_X(
testString, // A numeric value; required.
expectedString, // A hopefully-equivalent numeric value; required.
{ // all of these are optional
type, // "number", "length", etc. See impl for full list. Defaults to "length".
msg, // The message to display for the test; autogenned if not provided.
msgExtra, // Extra info to put after the auto-genned message.
prop, // If you want to override the automatic choice of tested property.
extraStyle, // Styles that need to be set at the same time to properly test the value.
}
);
Additionally, five specialized functions are provided
to test that a given value is ±, ±0, or NaN:
* test_plus_infinity(testString)
* test_minus_infinity(testString)
* test_plus_zero(testString)
* test_minus_zero(testString)
* test_nan(testString)
*/ */
/*
By default, assumes testString evaluates to a <length>. function test_math_used(testString, expectedString, {msg, msgExtra, type, prop, prefix, suffix, extraStyle={}}={}) {
If this isn't true, override {base, prop} accordingly. if(type === undefined) type = "length";
*/ if(!prop) {
function test_math_used(testString, expectedString, {base="123px", msg, prop="left"}={}) { switch(type) {
case "number": prop = "transform"; prefix="scale("; suffix=")"; break;
case "integer": prop = "z-index"; extraStyle.position="absolute"; break;
case "length": prop = "margin-left"; break;
case "angle": prop = "transform"; prefix="rotate("; suffix=")"; break;
case "time": prop = "transition-delay"; break;
case "resolution": prop = "image-resolution"; break;
case "flex": prop = "grid-template-rows"; break;
default: throw Exception(`Value type '${type}' isn't capable of math.`);
}
}
_test_math({stage:'used', testString, expectedString, type, msg, msgExtra, prop, prefix, suffix, extraStyle});
}
function test_math_computed(testString, expectedString, {msg, msgExtra, type, prop, prefix, suffix, extraStyle={}}={}) {
if(type === undefined) type = "length";
if(!prop) {
switch(type) {
case "number": prop = "transform"; prefix="scale("; suffix=")"; break;
case "integer": prop = "z-index"; extraStyle.position="absolute"; break;
case "length": prop = "flex-basis"; break;
case "angle": prop = "transform"; prefix="rotate("; suffix=")"; break;
case "time": prop = "transition-delay"; break;
case "resolution": prop = "image-resolution"; break;
case "flex": prop = "grid-template-rows"; break;
default: throw Exception(`Value type '${type}' isn't capable of math.`);
}
}
_test_math({stage:'computed', testString, expectedString, type, msg, msgExtra, prop, prefix, suffix, extraStyle});
}
function test_math_specified(testString, expectedString, {msg, msgExtra, type, prop, prefix, suffix, extraStyle={}}={}) {
if(type === undefined) type = "length";
const stage = "specified";
if(!prop) {
switch(type) {
case "number": prop = "transform"; prefix="scale("; suffix=")"; break;
case "integer": prop = "z-index"; extraStyle.position="absolute"; break;
case "length": prop = "flex-basis"; break;
case "angle": prop = "transform"; prefix="rotate("; suffix=")"; break;
case "time": prop = "transition-delay"; break;
case "resolution": prop = "image-resolution"; break;
case "flex": prop = "grid-template-rows"; break;
default: throw Exception(`Value type '${type}' isn't capable of math.`);
}
}
// Find the test element
const testEl = document.getElementById('target'); const testEl = document.getElementById('target');
if(testEl == null) throw "Couldn't find #target element to run tests on." if(testEl == null) throw "Couldn't find #target element to run tests on.";
// Then reset its styles
testEl.style = "";
for(const p in extraStyle) {
testEl.style[p] = extraStyle[p];
}
if(!msg) {
msg = `${testString} should be ${stage}-value-equivalent to ${expectedString}`;
if(msgExtra) msg += "; " + msgExtra;
}
let t = testString;
let e = expectedString;
if(prefix) {
t = prefix + t;
e = prefix + e;
}
if(suffix) {
t += suffix;
e += suffix;
}
test(()=>{ test(()=>{
testEl.style[prop] = base; testEl.style[prop] = '';
testEl.style[prop] = testString; testEl.style[prop] = t;
const usedValue = getComputedStyle(testEl)[prop]; const usedValue = testEl.style[prop];
assert_not_equals(usedValue, base, `${testString} isn't valid in '${prop}'; got the default value instead.`); assert_not_equals(usedValue, '', `${testString} isn't valid in '${prop}'; got the default value instead.`);
testEl.style[prop] = base; testEl.style[prop] = '';
testEl.style[prop] = expectedString; testEl.style[prop] = e;
const expectedValue = getComputedStyle(testEl)[prop]; const expectedValue = testEl.style[prop];
assert_not_equals(expectedValue, base, `${testString} isn't valid in '${prop}'; got the default value instead.`) assert_not_equals(expectedValue, '', `${expectedString} isn't valid in '${prop}'; got the default value instead.`)
assert_equals(usedValue, expectedValue, `${testString} and ${expectedString} serialize to the same thing in used values.`); assert_equals(usedValue, expectedValue, `${testString} and ${expectedString} serialize to the same thing in ${stage} values.`);
}, msg || `${testString} should be used-value-equivalent to ${expectedString}`); }, msg || `${testString} should be ${stage}-value-equivalent to ${expectedString}`);
} }
/* /*
All of these expect the testString to evaluate to a <number>. All of these expect the testString to evaluate to a <number>.
*/ */
function test_plus_infinity(testString) { function test_plus_infinity(testString) {
test_math_used(`calc(1px * ${testString})`, "calc(infinity * 1px)", test_math_used(testString, "calc(infinity)", {type:"number"});
{msg:`${testString} should equal +Infinity.`});
} }
function test_minus_infinity(testString) { function test_minus_infinity(testString) {
test_math_used(`calc(1px * ${testString})`, "calc(-infinity * 1px)", test_math_used(testString, "calc(-infinity)", {type:"number"});
{msg:`${testString} should equal -Infinity.`});
} }
function test_plus_zero(testString) { function test_plus_zero(testString) {
test_math_used(`calc(1px / ${testString})`, "calc(infinity * 1px)", test_math_used(`calc(1 / ${testString})`, "calc(infinity)", {type:"number"});
{msg:`${testString} should equal 0⁺.`});
} }
function test_minus_zero(testString) { function test_minus_zero(testString) {
test_math_used(`calc(1px / ${testString})`, "calc(-infinity * 1px)", test_math_used(`calc(1 / ${testString})`, "calc(-infinity)", {type:"number"});
{msg:`${testString} should equal 0⁻.`});
} }
function test_nan(testString) { function test_nan(testString) {
// Make sure that it's NaN, not an infinity, // Make sure that it's NaN, not an infinity,
// by making sure that it's the same value both pos and neg. // by making sure that it's the same value both pos and neg.
test_math_used(`calc(1px * ${testString})`, "calc(NaN * 1px)"); test_math_used(testString, "calc(NaN)", {type:"number"});
test_math_used(`calc(-1px * ${testString})`, "calc(NaN * 1px)"); test_math_used(`calc(-1 * ${testString})`, "calc(NaN)", {type:"number"});
}
function _test_math({stage, testEl, testString, expectedString, type, msg, msgExtra, prop, prefix, suffix, extraStyle}={}) {
// Find the test element
if(!testEl) testEl = document.getElementById('target');
if(testEl == null) throw "Couldn't find #target element to run tests on.";
// Then reset its styles
testEl.style = "";
for(const p in extraStyle) {
testEl.style[p] = extraStyle[p];
}
if(!msg) {
msg = `${testString} should be ${stage}-value-equivalent to ${expectedString}`;
if(msgExtra) msg += "; " + msgExtra;
}
let t = testString;
let e = expectedString;
if(prefix) {
t = prefix + t;
e = prefix + e;
}
if(suffix) {
t += suffix;
e += suffix;
}
test(()=>{
testEl.style[prop] = '';
testEl.style[prop] = t;
const usedValue = getComputedStyle(testEl)[prop];
assert_not_equals(usedValue, '', `${testString} isn't valid in '${prop}'; got the default value instead.`);
testEl.style[prop] = '';
testEl.style[prop] = e;
const expectedValue = getComputedStyle(testEl)[prop];
assert_not_equals(expectedValue, '', `${expectedString} isn't valid in '${prop}'; got the default value instead.`)
assert_equals(usedValue, expectedValue, `${testString} and ${expectedString} serialize to the same thing in ${stage} values.`);
}, msg || `${testString} should be ${stage}-value-equivalent to ${expectedString}`);
} }

View file

@ -0,0 +1,94 @@
"use strict";
/* Functions to test serialization of properties.
Each takes (property, testString, expectedSerialization) arguments.
These functions depend on a #target element existing in the page,
and will error if they don't find one.
Note that test_computed_serialization and test_used_serialization
are identical except for assertion messages;
you need to choose properties with the correct resolved values
to test the value stage that you want.
For ease of use, it's recommended that you define and use
the following function in your test page:
function test_serialization(t,s,c,u, {prop}={}) {
test_specified_serialization(prop || 'text-indent', t, s);
test_computed_serialization(prop || 'text-indent', t, c);
if(u) test_used_serialization(prop || 'margin-left', t, u);
}
(swapping the property names for what you're expecting to test)
Then you can write tests easily as:
test_serialization(
'calc(min(1%, 2%) + max(3%, 4%) + 10%)', // test string
'calc(15%)', // expected specified value
'15%', // expected computed value
'15px'); // expected used value
*/
function test_specified_serialization(prop, t, e) {
const el = document.querySelector("#target");
if(!el) throw new Exception("Couldn't find #target element to run tests on.");
test(()=>{
el.style[prop] = '';
el.style[prop] = t;
const tValue = el.style[prop];
assert_not_equals(tValue, '', `'${t}' should be valid in ${prop}.`);
el.style[prop] = '';
el.style[prop] = e;
const eValue = el.style[prop];
assert_not_equals(eValue, '', `'${e}' should be valid in ${prop}.`);
assert_equals(eValue, e, `'${e}' should round-trip exactly in specified values.`);
assert_equals(tValue, e, `'${t}' and '${e}' should serialize the same in specified values.`);
}, `'${t}' as a specified value should serialize as '${e}'.`);
}
function test_computed_serialization(prop, t, e) {
const el = document.querySelector("#target");
if(!el) throw new Exception("Couldn't find #target element to run tests on.");
test(()=>{
el.style[prop] = '';
el.style[prop] = t;
const tValue = getComputedStyle(el)[prop];
assert_not_equals(tValue, '', `'${t}' should be valid in ${prop}.`);
el.style[prop] = '';
el.style[prop] = e;
const eValue = getComputedStyle(el)[prop];
assert_not_equals(eValue, '', `'${e}' should be valid in ${prop}.`);
assert_equals(eValue, e, `'${e}' should round-trip exactly in computed values.`);
assert_equals(tValue, e, `'${t}' and '${e}' should serialize the same in computed values.`);
}, `'${t}' as a computed value should serialize as '${e}'.`);
}
function test_used_serialization(prop, t, e) {
const el = document.querySelector("#target");
if(!el) throw new Exception("Couldn't find #target element to run tests on.");
test(()=>{
el.style[prop] = '';
el.style[prop] = t;
const tValue = getComputedStyle(el)[prop];
assert_not_equals(tValue, '', `'${t}' should be valid in ${prop}.`);
el.style[prop] = '';
el.style[prop] = e;
const eValue = getComputedStyle(el)[prop];
assert_not_equals(eValue, '', `'${e}' should be valid in ${prop}.`);
assert_equals(eValue, e, `'${e}' should round-trip exactly in used values.`);
assert_equals(tValue, e, `'${t}' and '${e}' should serialize the same in used values.`);
}, `'${t}' as a used value should serialize as '${e}'.`);
}

View file

@ -0,0 +1,28 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/webrtc/dictionary-helper.js"></script>
<script>
test(t => {
assert_true("userAgentData" in navigator);
}, "navigator.getUserAgent() is exposed.");
promise_test(async t => {
const uaData = navigator.userAgentData;
for (ua of uaData.uaList) {
assert_equals(typeof ua.brand, "string", "brand should be a string");
assert_equals(typeof ua.version, "string", "version should be a string");
}
assert_equals(typeof uaData.mobile, "boolean", "mobile should be a boolean");
const highEntropyData = await uaData.getHighEntropyValues(["platform", "platformVersion", "architecture", "model"]);
assert_equals(typeof highEntropyData["platform"], "string", "Platform brand should be a string");
assert_equals(typeof highEntropyData["platformVersion"], "string", "Platform version should be a string");
assert_equals(typeof highEntropyData["architecture"], "string", "Architecture should be a string");
assert_equals(typeof highEntropyData["model"], "string", "Model should be a string");
const highEntropyData2 = await uaData.getHighEntropyValues([]);
assert_equals(highEntropyData2["platform"], "", "Platform brand should be an empty string");
assert_equals(highEntropyData2["platformVersion"], "", "Platform version should be an empty string");
assert_equals(highEntropyData2["architecture"], "", "Architecture should be an empty string");
assert_equals(highEntropyData2["model"], "", "Model should be an empty string");
}, "navigator.getUserAgent() returns a UserAgentMetadata object.");
</script>

View file

@ -1,21 +0,0 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/webrtc/dictionary-helper.js"></script>
<script>
test(t => {
assert_true("getUserAgent" in navigator);
}, "navigator.getUserAgent() is exposed.");
promise_test(t => {
return navigator.getUserAgent()
.then(ua => {
// TODO(web-platform-tests/wpt#9106): Use `idlharness.js` once it supports dictionaries.
assert_string_field(ua, "brand");
assert_string_field(ua, "version");
assert_string_field(ua, "platform");
assert_string_field(ua, "architecture");
assert_string_field(ua, "model");
});
}, "navigator.getUserAgent() returns a UserAgentMetadata object.");
</script>

View file

@ -7,7 +7,3 @@
[<audio> autoplay] [<audio> autoplay]
expected: expected:
if product == "safari": FAIL # https://bugs.webkit.org/show_bug.cgi?id=190775 if product == "safari": FAIL # https://bugs.webkit.org/show_bug.cgi?id=190775
[<video> autoplay]
expected:
if product == "safari": TIMEOUT # https://bugs.webkit.org/show_bug.cgi?id=190775

View file

@ -8,6 +8,7 @@ v1 = 5 * mathfont.em
v2 = 14 * mathfont.em v2 = 14 * mathfont.em
f = mathfont.create("axisheight%d-verticalarrow%d" % (v1, v2)) f = mathfont.create("axisheight%d-verticalarrow%d" % (v1, v2))
f.math.AxisHeight = v1 f.math.AxisHeight = v1
f.math.MinConnectorOverlap = 0
mathfont.createSquareGlyph(f, verticalArrowCodePoint) mathfont.createSquareGlyph(f, verticalArrowCodePoint)
g = f.createChar(-1, "size1") g = f.createChar(-1, "size1")
mathfont.drawRectangleGlyph(g, mathfont.em, v2 / 2, 0) mathfont.drawRectangleGlyph(g, mathfont.em, v2 / 2, 0)
@ -18,6 +19,7 @@ mathfont.drawRectangleGlyph(g, mathfont.em, v2 + v1, 0)
g = f.createChar(-1, "ext") g = f.createChar(-1, "ext")
mathfont.drawRectangleGlyph(g, mathfont.em, mathfont.em, 0) mathfont.drawRectangleGlyph(g, mathfont.em, mathfont.em, 0)
f[verticalArrowCodePoint].verticalVariants = "uni21A8 size1 size2" f[verticalArrowCodePoint].verticalVariants = "uni21A8 size1 size2"
# Part: (glyphName, isExtender, startConnector, endConnector, fullAdvance)
f[verticalArrowCodePoint].verticalComponents = \ f[verticalArrowCodePoint].verticalComponents = \
(("bot", False, 0, 0, mathfont.em), ("ext", True, 0, 0, mathfont.em)); (("bot", False, 0, mathfont.em, v2 + v1), ("ext", True, mathfont.em, mathfont.em, mathfont.em));
mathfont.save(f) mathfont.save(f)

View file

@ -0,0 +1,17 @@
// META: global=window,worker
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
'use strict';
idl_test(
['origin-policy'],
['html', 'dom'],
idl_array => {
if (self.Window) {
idl_array.add_objects({ Window: ['self'] });
} else {
idl_array.add_objects({ WorkerGlobalScope: ['self'] });
}
}
);

View file

@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>Origin policy with empty-array "ids" member that occurs after a non-empty "ids" member must be ignored</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/origin-policy-test-runner.js"></script>
<div id="log"></div>
<script>
"use strict";
runTestsInSubframe({
hostname: "op13",
testJS: "../content-security/resources/allow-unsafe-eval.mjs",
expectedIds: []
});
</script>

View file

@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>Origin policy with empty-array "ids" member must be ignored</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/origin-policy-test-runner.js"></script>
<div id="log"></div>
<script>
"use strict";
runTestsInSubframe({
hostname: "op12",
testJS: "../content-security/resources/allow-unsafe-eval.mjs",
expectedIds: []
});
</script>

View file

@ -0,0 +1,25 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>Origin policy must include valid IDs and exclude non-strings and invalid strings</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/origin-policy-test-runner.js"></script>
<div id="log"></div>
<script>
"use strict";
runTestsInSubframe({
hostname: "op15",
testJS: "../content-security/resources/disallow-unsafe-eval-disallow-images.mjs",
expectedIds: [
"my-policy-1",
"my-policy-2",
"~",
" ",
"!\"#$%&'()*+,-./:;<=>?@{|}~",
"azAZ",
"my~policy"
]
});
</script>

View file

@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>Origin policy with no "ids" member must be ignored</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/origin-policy-test-runner.js"></script>
<div id="log"></div>
<script>
"use strict";
runTestsInSubframe({
hostname: "op11",
testJS: "../content-security/resources/allow-unsafe-eval.mjs",
expectedIds: []
});
</script>

View file

@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>Origin policy a non-array "ids" member must be ignored</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/origin-policy-test-runner.js"></script>
<div id="log"></div>
<script>
"use strict";
runTestsInSubframe({
hostname: "op14",
testJS: "../content-security/resources/allow-unsafe-eval.mjs",
expectedIds: []
});
</script>

View file

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>originPolicyIds must return the same object each time</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
test(() => {
// Failing this test is a common failure mode for FrozenArray attributes,
// so let's be sure implementations get it right.
assert_equals(window.originPolicyIds, window.originPolicyIds);
});
</script>

View file

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>originPolicyIds must return an empty array in http: pages</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
test(() => {
assert_equals(location.protocol, "http:");
}, "Prerequisite check: running on HTTP, not HTTPS");
test(() => {
assert_array_equals(window.originPolicyIds, []);
}, "The attribute is still present and returns an empty frozen array");
</script>

View file

@ -0,0 +1,20 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>Origin policy second "ids" member must take precedence</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/origin-policy-test-runner.js"></script>
<div id="log"></div>
<script>
"use strict";
runTestsInSubframe({
hostname: "op16",
testJS: "../content-security/resources/disallow-unsafe-eval-disallow-images.mjs",
expectedIds: [
"3",
"4"
]
});
</script>

View file

@ -0,0 +1,7 @@
{
"content_security": {
"policies": [
"script-src 'self' 'unsafe-inline'"
]
}
}

View file

@ -0,0 +1,8 @@
{
"ids": [],
"content_security": {
"policies": [
"script-src 'self' 'unsafe-inline'"
]
}
}

View file

@ -0,0 +1,11 @@
{
"ids": [
"this should be overwritten by the subsequent one"
],
"ids": [],
"content_security": {
"policies": [
"script-src 'self' 'unsafe-inline'"
]
}
}

View file

@ -0,0 +1,8 @@
{
"ids": "this is not an array",
"content_security": {
"policies": [
"script-src 'self' 'unsafe-inline'"
]
}
}

View file

@ -0,0 +1,28 @@
{
"ids": [
"my-policy-1",
["my-policy-array"],
5,
null,
{ "id": "my-policy-object" },
"my-policy-2",
true,
"~",
" ",
"\u0000",
"\t",
"my\tpolicy",
"!\"#$%&'()*+,-./:;<=>?@{|}~",
"my\u007Fpolicy",
"azAZ",
"my\u0080policy",
"my~policy",
"my\u1234policy"
],
"content_security": {
"policies": [
"script-src 'self' 'unsafe-inline'",
"img-src 'none'"
]
}
}

View file

@ -0,0 +1,16 @@
{
"ids": [
"1",
"2"
],
"ids": [
"3",
"4"
],
"content_security": {
"policies": [
"script-src 'self' 'unsafe-inline'",
"img-src 'none'"
]
}
}

View file

@ -1,4 +1,4 @@
window.runTestsInSubframe = ({ hostname, testJS }) => { window.runTestsInSubframe = ({ hostname, testJS, expectedIds }) => {
test(() => { test(() => {
assert_equals(location.protocol, "https:"); assert_equals(location.protocol, "https:");
}, "Prerequisite check: running on HTTPS"); }, "Prerequisite check: running on HTTPS");
@ -12,6 +12,8 @@ window.runTestsInSubframe = ({ hostname, testJS }) => {
// to themselves. // to themselves.
url.searchParams.append("test", new URL(testJS, document.baseURI).pathname); url.searchParams.append("test", new URL(testJS, document.baseURI).pathname);
url.searchParams.append("expectedIds", JSON.stringify(expectedIds));
const iframe = document.createElement("iframe"); const iframe = document.createElement("iframe");
iframe.src = url.href; iframe.src = url.href;

View file

@ -9,10 +9,12 @@ def main(request, response):
""" """
test_file = request.GET.first("test") test_file = request.GET.first("test")
expected_ids = request.GET.first("expectedIds")
response.headers.set("Origin-Policy", "allowed=(latest)") response.headers.set("Origin-Policy", "allowed=(latest)")
response.headers.set("Content-Type", "text/html") response.headers.set("Content-Type", "text/html")
return """ ret_val = """
<!DOCTYPE html> <!DOCTYPE html>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Origin policy subframe</title> <title>Origin policy subframe</title>
@ -24,3 +26,14 @@ def main(request, response):
<script type="module" src="%s"></script> <script type="module" src="%s"></script>
""" % test_file """ % test_file
if expected_ids != "undefined":
ret_val += """
<script type="module">
test(() => {
assert_array_equals(originPolicyIds, %s);
}, "Expected originPolicyIDs check");
</script>
""" % expected_ids
return ret_val

View file

@ -1,10 +1,10 @@
cask 'safari-technology-preview' do cask 'safari-technology-preview' do
if MacOS.version <= :mojave if MacOS.version <= :mojave
version '101,061-79986-20200218-f3264d1d-fff0-4ff6-b518-719415265e1c' version '102,061-84687-20200304-286a8fe8-5a00-41ba-9dba-2c42e047ffb1'
sha256 '00e091a57289366ecdac4f47de8405561817730d79b040966903459ac90da20a' sha256 '2e048fec4a470f5b5d9cffc359ba967bee02cf3cf121e5ea16812077adc5ba60'
else else
version '101,061-79983-20200218-baf609a5-fdff-4f67-ade1-24d800440418' version '102,061-84666-20200304-c2d165f2-2aec-41b2-86ef-0a9407608e2c'
sha256 'a9ee1470dc7319e17b5a793530c21ff8a33d5458348096a95226b1da084a36b0' sha256 'ef9e9ea8990bb63936216fcdf93720b854366d158cad3daf5b812f841f7b5d99'
end end
url "https://secure-appldnld.apple.com/STP/#{version.after_comma}/SafariTechnologyPreview.dmg" url "https://secure-appldnld.apple.com/STP/#{version.after_comma}/SafariTechnologyPreview.dmg"

View file

@ -444,7 +444,7 @@ class Session(object):
finally: finally:
self.session_id = None self.session_id = None
def send_command(self, method, url, body=None): def send_command(self, method, url, body=None, timeout=None):
""" """
Send a command to the remote end and validate its success. Send a command to the remote end and validate its success.
@ -465,7 +465,7 @@ class Session(object):
response = self.transport.send( response = self.transport.send(
method, url, body, method, url, body,
encoder=protocol.Encoder, decoder=protocol.Decoder, encoder=protocol.Encoder, decoder=protocol.Decoder,
session=self) session=self, timeout=timeout)
if response.status != 200: if response.status != 200:
err = error.from_response(response) err = error.from_response(response)
@ -493,7 +493,7 @@ class Session(object):
return value return value
def send_session_command(self, method, uri, body=None): def send_session_command(self, method, uri, body=None, timeout=None):
""" """
Send a command to an established session and validate its success. Send a command to an established session and validate its success.
@ -510,7 +510,7 @@ class Session(object):
an error. an error.
""" """
url = urlparse.urljoin("session/%s/" % self.session_id, uri) url = urlparse.urljoin("session/%s/" % self.session_id, uri)
return self.send_command(method, url, body) return self.send_command(method, url, body, timeout)
@property @property
@command @command

View file

@ -103,9 +103,8 @@ class HTTPWireProtocol(object):
conn_kwargs = {} conn_kwargs = {}
if not PY3: if not PY3:
conn_kwargs["strict"] = True conn_kwargs["strict"] = True
# We are not setting an HTTP timeout other than the default # We are not setting an HTTP timeout other than the default when the
# because the timeouts are handled externally by the runner # connection its created. The send method has a timeout value if needed.
# and can be different for each type of test.
self._conn = HTTPConnection(self.host, self.port, **conn_kwargs) self._conn = HTTPConnection(self.host, self.port, **conn_kwargs)
return self._conn return self._conn
@ -124,6 +123,7 @@ class HTTPWireProtocol(object):
headers=None, headers=None,
encoder=json.JSONEncoder, encoder=json.JSONEncoder,
decoder=json.JSONDecoder, decoder=json.JSONDecoder,
timeout=None,
**codec_kwargs): **codec_kwargs):
""" """
Send a command to the remote. Send a command to the remote.
@ -179,11 +179,11 @@ class HTTPWireProtocol(object):
# runner thread. We use the boolean below to check for that and restart # runner thread. We use the boolean below to check for that and restart
# the connection in that case. # the connection in that case.
self._last_request_is_blocked = True self._last_request_is_blocked = True
response = self._request(method, uri, payload, headers) response = self._request(method, uri, payload, headers, timeout=None)
self._last_request_is_blocked = False self._last_request_is_blocked = False
return Response.from_http(response, decoder=decoder, **codec_kwargs) return Response.from_http(response, decoder=decoder, **codec_kwargs)
def _request(self, method, uri, payload, headers=None): def _request(self, method, uri, payload, headers=None, timeout=None):
if isinstance(payload, text_type): if isinstance(payload, text_type):
payload = payload.encode("utf-8") payload = payload.encode("utf-8")
@ -195,8 +195,21 @@ class HTTPWireProtocol(object):
if self._last_request_is_blocked or self._has_unread_data(): if self._last_request_is_blocked or self._has_unread_data():
self.close() self.close()
self.connection.request(method, url, payload, headers) self.connection.request(method, url, payload, headers)
return self.connection.getresponse()
# timeout for request has to be set just before calling httplib.getresponse()
# and the previous value restored just after that, even on exception raised
try:
if timeout:
previous_timeout = self._conn.gettimeout()
self._conn.settimeout(timeout)
response = self.connection.getresponse()
finally:
if timeout:
self._conn.settimeout(previous_timeout)
return response
def _has_unread_data(self): def _has_unread_data(self):
return self._conn and self._conn.sock and select.select([self._conn.sock], [], [], 0)[0] return self._conn and self._conn.sock and select.select([self._conn.sock], [], [], 0)[0]

View file

@ -301,19 +301,15 @@ class WebDriverProtocol(Protocol):
self.webdriver = None self.webdriver = None
def is_alive(self): def is_alive(self):
socket_previous_timeout = socket.getdefaulttimeout()
try: try:
# Get a simple property over the connection, with 2 seconds of timeout # Get a simple property over the connection, with 2 seconds of timeout
# that should be more than enough to check if the WebDriver its # that should be more than enough to check if the WebDriver its
# still alive, and allows to complete the check within the testrunner # still alive, and allows to complete the check within the testrunner
# 5 seconds of extra_timeout we have as maximum to end the test before # 5 seconds of extra_timeout we have as maximum to end the test before
# the external timeout from testrunner triggers. # the external timeout from testrunner triggers.
socket.setdefaulttimeout(2) self.webdriver.send_session_command("GET", "window", timeout=2)
self.webdriver.window_handle
except (socket.timeout, client.UnknownErrorException, client.InvalidSessionIdException): except (socket.timeout, client.UnknownErrorException, client.InvalidSessionIdException):
return False return False
finally:
socket.setdefaulttimeout(socket_previous_timeout)
return True return True
def after_connect(self): def after_connect(self):

View file

@ -99,7 +99,7 @@
for (let [index, [policy_fn, value]] of test_cases.entries()) { for (let [index, [policy_fn, value]] of test_cases.entries()) {
let subtest_name = "TestPolicy" + trusted_class.name + index; let subtest_name = "TestPolicy" + trusted_class.name + index;
test(t => { test(t => {
if (typeof value == "object") { if (typeof value == "object" || typeof value == "function") {
assert_throws_js(value, () => builder(subtest_name, policy_fn)); assert_throws_js(value, () => builder(subtest_name, policy_fn));
} else { } else {
assert_equals("" + builder(subtest_name, policy_fn), value); assert_equals("" + builder(subtest_name, policy_fn), value);

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<link rel="help" href="https://w3c.github.io/wake-lock/#the-onrelease-attribute">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script>
async_test(async t => {
await test_driver.set_permission({name: 'wake-lock', type: 'screen'}, 'granted', false);
const lock = await navigator.wakeLock.request("screen");
lock.onrelease = t.step_func_done((ev) => {
assert_class_string(ev, "Event", "release() must fire an Event object");
assert_equals(ev.target, lock, "The event's target must be the lock that was acquired");
assert_true(ev.isTrusted);
assert_false(ev.bubbles);
assert_false(ev.cancelable);
});
await lock.release();
}, "Test onreleased event's basic properties");
</script>

View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script>
'use strict';
promise_test(async t => {
await test_driver.set_permission({name: 'wake-lock', type: 'screen'}, 'denied', false);
return promise_rejects_dom(t, "NotAllowedError", navigator.wakeLock.request('screen'));
}, 'Denied requests should abort with NotAllowedError');
</script>
</body>
</html>

View file

@ -2,10 +2,9 @@
<link rel="help" href="https://w3c.github.io/wake-lock/#the-wakelockpermissiondescriptor-dictionary"> <link rel="help" href="https://w3c.github.io/wake-lock/#the-wakelockpermissiondescriptor-dictionary">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script> <script>
// Checking for the permission status requires testdriver.js support for permissions.
// See https://github.com/web-platform-tests/wpt/issues/5671.
promise_test(t => { promise_test(t => {
return promise_rejects_js(t, TypeError, navigator.permissions.query({ name:'wake-lock' })); return promise_rejects_js(t, TypeError, navigator.permissions.query({ name:'wake-lock' }));
}, "WakeLockPermissionDescriptor's type attribute is required"); }, "WakeLockPermissionDescriptor's type attribute is required");
@ -13,4 +12,22 @@ promise_test(t => {
promise_test(t => { promise_test(t => {
return promise_rejects_js(t, TypeError, navigator.permissions.query({ name: 'wake-lock', type: 'foo' })); return promise_rejects_js(t, TypeError, navigator.permissions.query({ name: 'wake-lock', type: 'foo' }));
}, "WakeLockPermissionDescriptor's type attribute must be a WakeLockType"); }, "WakeLockPermissionDescriptor's type attribute must be a WakeLockType");
promise_test(async t => {
await test_driver.set_permission({name: 'wake-lock', type: 'screen'}, 'denied', false);
return navigator.permissions.query({name:'wake-lock', type: 'screen'}).then(status => {
assert_class_string(status, "PermissionStatus");
assert_equals(status.state, "denied");
});
}, "WakeLockPermissionDescriptor with type=screen works");
promise_test(async t => {
await test_driver.set_permission({name: 'wake-lock', type: 'system'}, 'denied', false);
return navigator.permissions.query({ name: 'wake-lock', type: 'system' }).then(status => {
assert_class_string(status, "PermissionStatus");
assert_equals(status.state, "denied");
});
}, "WakeLockPermissionDescriptor with type=system works");
</script> </script>

View file

@ -40,6 +40,15 @@ for (const contenttype of validContentTypes) {
promise_test(async t => { promise_test(async t => {
const response = fetch(`/wasm/incrementer.wasm?pipe=header(Content-Type,${encodeURIComponent(contenttype)})`); const response = fetch(`/wasm/incrementer.wasm?pipe=header(Content-Type,${encodeURIComponent(contenttype)})`);
const result = await WebAssembly.instantiateStreaming(response); const result = await WebAssembly.instantiateStreaming(response);
assert_WebAssemblyInstantiatedSource(result); assert_WebAssemblyInstantiatedSource(
result,
{
"increment": {
"kind": "function",
"name": "0",
"length": 1
}
}
);
}, `Response with Content-Type ${format_value(contenttype)}: instantiateStreaming`); }, `Response with Content-Type ${format_value(contenttype)}: instantiateStreaming`);
} }