Update web-platform-tests to revision c2b30ef30749b6a8f2cc832761dfe011e63d5e94

This commit is contained in:
WPT Sync Bot 2018-10-05 21:34:34 -04:00
parent 987e376ca7
commit eda9b9b73a
142 changed files with 3513 additions and 851 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,2 @@
[multiple-position-color-stop-linear-2.html]
expected: FAIL

View file

@ -0,0 +1,4 @@
[elementsFromPoint-inline-htb-ltr.html]
[elementsFromPoint should return all elements under a point]
expected: FAIL

View file

@ -0,0 +1,4 @@
[elementsFromPoint-inline-htb-rtl.html]
[elementsFromPoint should return all elements under a point]
expected: FAIL

View file

@ -0,0 +1,4 @@
[elementsFromPoint-inline-vlr-ltr.html]
[elementsFromPoint should return all elements under a point]
expected: FAIL

View file

@ -0,0 +1,4 @@
[elementsFromPoint-inline-vlr-rtl.html]
[elementsFromPoint should return all elements under a point]
expected: FAIL

View file

@ -0,0 +1,4 @@
[elementsFromPoint-inline-vrl-ltr.html]
[elementsFromPoint should return all elements under a point]
expected: FAIL

View file

@ -0,0 +1,4 @@
[elementsFromPoint-inline-vrl-rtl.html]
[elementsFromPoint should return all elements under a point]
expected: FAIL

View file

@ -0,0 +1,4 @@
[getClientRects-br-htb-rtl.html]
[Position of the BR element]
expected: FAIL

View file

@ -0,0 +1,4 @@
[getClientRects-br-vlr-ltr.html]
[Position of the BR element]
expected: FAIL

View file

@ -0,0 +1,4 @@
[getClientRects-br-vlr-rtl.html]
[Position of the BR element]
expected: FAIL

View file

@ -0,0 +1,4 @@
[getClientRects-br-vrl-ltr.html]
[Position of the BR element]
expected: FAIL

View file

@ -0,0 +1,4 @@
[getClientRects-br-vrl-rtl.html]
[Position of the BR element]
expected: FAIL

View file

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

View file

@ -1,5 +1,4 @@
[fetch-in-iframe.html]
expected: CRASH
[Untitled]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

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

View file

@ -30,6 +30,3 @@
[Set HTTP URL frame location.protocol to data]
expected: FAIL
[Set HTTP URL frame location.protocol to x]
expected: FAIL

View file

@ -245,3 +245,18 @@
[<canvas><div id='target'> contents ok for element not being rendered ("<canvas><div id='target'>abc")]
expected: FAIL
[text-transform handles Turkish casing ("<div><div lang='tr' style='text-transform:uppercase'>i ı")]
expected: FAIL
[Leading whitespace after hard line break removed ("<div>abc<br> def")]
expected: FAIL
[Whitespace around <input> should not be collapsed ("<div>abc <input> def")]
expected: FAIL
[Trailing space at end of inline-block should be collapsed ("<div>abc <span style='display:inline-block'> def </span> ghi")]
expected: FAIL
[Whitespace around inline-block should not be collapsed ("<div>abc <span style='display:inline-block'></span> def")]
expected: FAIL

View file

@ -0,0 +1,7 @@
[toggleEvent.html]
[Calling open twice on 'details' fires only one toggle event]
expected: FAIL
[Setting open=true to opened 'details' element should not fire a toggle event at the 'details' element]
expected: FAIL

View file

@ -0,0 +1,283 @@
[no-quirks.html]
[top: -\\31 .5]
expected: FAIL
[bottom: -1A]
expected: FAIL
[bottom: -1a]
expected: FAIL
[top: @1]
expected: FAIL
[top: "1a"]
expected: FAIL
[top: @a]
expected: FAIL
[bottom: "1"]
expected: FAIL
[bottom: -/**/1]
expected: FAIL
[top: +/**/1]
expected: FAIL
[bottom: @1a]
expected: FAIL
[top: 1\\31 ]
expected: FAIL
[top: url('1')]
expected: FAIL
[bottom: -\\31 ]
expected: FAIL
[top: calc(1)]
expected: FAIL
[top: \\31 ]
expected: FAIL
[bottom: +1\\31 ]
expected: FAIL
[bottom: 1\\31 .5]
expected: FAIL
[bottom: #0001]
expected: FAIL
[top: calc(2 * 2px)]
expected: FAIL
[bottom: 1a]
expected: FAIL
[bottom: A]
expected: FAIL
[bottom: #01]
expected: FAIL
[top: +\\31 .5]
expected: FAIL
[bottom: #1]
expected: FAIL
[top: -/**/1]
expected: FAIL
[bottom: +\\31 .5]
expected: FAIL
[bottom: \\31 ]
expected: FAIL
[bottom: calc(1)]
expected: FAIL
[top: #001]
expected: FAIL
[top: +\\31 ]
expected: FAIL
[bottom: +\\31 ]
expected: FAIL
[top: +1.5]
expected: FAIL
[top: +1\\31 ]
expected: FAIL
[bottom: @a]
expected: FAIL
[bottom: @1]
expected: FAIL
[top: #1]
expected: FAIL
[top: 1a]
expected: FAIL
[bottom: +1a]
expected: FAIL
[bottom: +1A]
expected: FAIL
[bottom: "a"]
expected: FAIL
[top: #00001]
expected: FAIL
[bottom: -1\\31 .5]
expected: FAIL
[top: "1"]
expected: FAIL
[bottom: 1.5]
expected: FAIL
[bottom: -\\31 .5]
expected: FAIL
[bottom: url('1')]
expected: FAIL
[bottom: -1.5]
expected: FAIL
[top: \\31 .5]
expected: FAIL
[bottom: "1a"]
expected: FAIL
[bottom: calc(2 * 2px)]
expected: FAIL
[bottom: +1\\31 .5]
expected: FAIL
[bottom: 1\\31 ]
expected: FAIL
[bottom: +/**/1]
expected: FAIL
[bottom: #00001]
expected: FAIL
[top: url(1)]
expected: FAIL
[bottom: #001]
expected: FAIL
[top: +1\\31 .5]
expected: FAIL
[top: -1a]
expected: FAIL
[top: -1A]
expected: FAIL
[bottom: url(1)]
expected: FAIL
[top: a]
expected: FAIL
[top: A]
expected: FAIL
[top: #000001]
expected: FAIL
[top: 1]
expected: FAIL
[top: 1\\31 .5]
expected: FAIL
[bottom: a]
expected: FAIL
[bottom: 1]
expected: FAIL
[bottom: +1]
expected: FAIL
[bottom: #000001]
expected: FAIL
[bottom: +a]
expected: FAIL
[bottom: +A]
expected: FAIL
[top: 1.5]
expected: FAIL
[top: +A]
expected: FAIL
[top: +a]
expected: FAIL
[top: +1]
expected: FAIL
[top: -1.5]
expected: FAIL
[top: -1\\31 .5]
expected: FAIL
[top: +1a]
expected: FAIL
[top: +1A]
expected: FAIL
[top: @1a]
expected: FAIL
[bottom: \\31 .5]
expected: FAIL
[top: "a"]
expected: FAIL
[top: #01]
expected: FAIL
[bottom: +1.5]
expected: FAIL
[bottom: -A]
expected: FAIL
[bottom: -a]
expected: FAIL
[bottom: -1\\31 ]
expected: FAIL
[top: #0001]
expected: FAIL
[bottom: -1]
expected: FAIL
[top: -\\31 ]
expected: FAIL
[top: -A]
expected: FAIL
[top: -a]
expected: FAIL
[top: -1]
expected: FAIL
[top: -1\\31 ]
expected: FAIL

View file

@ -11,10 +11,10 @@
[response.formData() with input: &&&a=b&&&&c=d&]
expected: FAIL
[request.formData() with input: a=b&c=d]
[request.formData() with input: &&&a=b&&&&c=d&]
expected: FAIL
[request.formData() with input: a=b&c=d&]
[request.formData() with input: _charset_=windows-1252&test=%C2x]
expected: FAIL
@ -22,18 +22,18 @@
[request.formData() with input: a&b&c]
expected: FAIL
[request.formData() with input: a=b&c=d&]
expected: FAIL
[response.formData() with input: _charset_=windows-1252&test=%C2x]
expected: FAIL
[response.formData() with input: a=b&c=d&]
[response.formData() with input: a&b&c]
expected: FAIL
[response.formData() with input: &&&a=b&&&&c=d&]
[request.formData() with input: &&&a=b&&&&c=d&]
expected: FAIL
[response.formData() with input: a=b&c=d]
[request.formData() with input: _charset_=windows-1252&test=%C2x]
expected: FAIL
[request.formData() with input: a=b&c=d]
expected: FAIL

View file

@ -0,0 +1,4 @@
[event_constructor.html]
[constructor with undefined type argument and members]
expected: FAIL

View file

@ -0,0 +1,16 @@
[event_initstorageevent.html]
[initStorageEvent with 8 undefined arguments]
expected: FAIL
[initStorageEvent with 8 sensible arguments]
expected: FAIL
[initStorageEvent with 8 null arguments]
expected: FAIL
[initStorageEvent with 1 argument]
expected: FAIL
[initStorageEvent with 0 arguments]
expected: FAIL

View file

@ -0,0 +1,50 @@
// META: script=/service-workers/service-worker/resources/test-helpers.sub.js
// META: script=resources/utils.js
'use strict';
// Covers basic functionality provided by BackgroundFetchManager.abort().
// https://wicg.github.io/background-fetch/#background-fetch-registration-abort
backgroundFetchTest(async (test, backgroundFetch) => {
const registration = await backgroundFetch.fetch(
uniqueId(),
['resources/feature-name.txt', '/serviceworker/resources/slow-response.php']);
assert_true(await registration.abort());
assert_false(await registration.abort());
}, 'Aborting the same registration twice fails');
backgroundFetchTest(async (test, backgroundFetch) => {
const registration = await backgroundFetch.fetch(
uniqueId(),
['resources/feature-name.txt', '/serviceworker/resources/slow-response.php']);
const resultPromise = getMessageFromServiceWorker();
await new Promise(resolve => {
registration.onprogress = async (e) => {
// The size of the first file.
if (e.target.downloaded < 16)
return;
// At this point the first file is downloaded.
assert_true(await registration.abort());
const {type, eventRegistration, results} = await resultPromise;
assert_equals(eventRegistration.result, 'failure');
assert_equals(eventRegistration.failureReason, 'aborted');
assert_equals(type, 'backgroundfetchabort');
assert_equals(results.length, 1);
assert_true(results[0].url.includes('resources/feature-name.txt'));
assert_equals(results[0].status, 200);
assert_equals(results[0].text, 'Background Fetch');
resolve();
};
});
}, 'Calling BackgroundFetchRegistration.abort sets the correct fields and responses are still available');

View file

@ -82,6 +82,41 @@ backgroundFetchTest(async (test, backgroundFetch) => {
}, 'Empty URL is OK.');
backgroundFetchTest(async (test, backgroundFetch) => {
const registrationId = uniqueId();
const registration =
await backgroundFetch.fetch(registrationId,
new Request('https://example/com', {
method: 'PUT',
}));
assert_equals(registration.id, registrationId);
const {type, eventRegistration, results} = await getMessageFromServiceWorker();
assert_equals(type, 'backgroundfetchsuccess');
assert_equals(eventRegistration.result, 'success');
assert_equals(eventRegistration.failureReason, '');
}, 'Requests with PUT method require CORS Preflight and succeed.');
backgroundFetchTest(async (test, backgroundFetch) => {
const registrationId = uniqueId();
const registration =
await backgroundFetch.fetch(registrationId,
new Request('https://example/com', {
method: 'POST',
headers: {'Content-Type': 'text/json'}
}));
assert_equals(registration.id, registrationId);
const {type, eventRegistration, results} = await getMessageFromServiceWorker();
assert_equals(type, 'backgroundfetchsuccess');
assert_equals(eventRegistration.result, 'success');
assert_equals(eventRegistration.failureReason, '');
}, 'Requests with text/json content type require CORS Preflight and succeed.');
backgroundFetchTest(async (test, backgroundFetch) => {
const registrationId = uniqueId();
const registration =

View file

@ -26,6 +26,7 @@ promise_test(async test => {
backgroundFetchTest(async (test, backgroundFetch) => {
// The |id| parameter to the BackgroundFetchManager.get() method is required.
await promise_rejects(test, new TypeError(), backgroundFetch.get());
await promise_rejects(test, new TypeError(), backgroundFetch.get(''));
const registration = await backgroundFetch.get('my-id');
assert_equals(registration, undefined);

View file

@ -27,3 +27,4 @@ function handleBackgroundFetchUpdateEvent(event) {
self.addEventListener('backgroundfetchsuccess', handleBackgroundFetchUpdateEvent);
self.addEventListener('backgroundfetchfail', handleBackgroundFetchUpdateEvent);
self.addEventListener('backgroundfetchabort', handleBackgroundFetchUpdateEvent);

View file

@ -1,45 +0,0 @@
def main(request, response):
"""Code for generating large responses where the actual response data
isn't very important.
Two request parameters:
size (required): An integer number of bytes (no suffix) or kilobytes
("kb" suffix) or megabytes ("Mb" suffix).
string (optional): The string to repeat in the response. Defaults to "a".
Example:
/resources/large.py?size=32Mb&string=ab
"""
if not "size" in request.GET:
400, "Need an integer bytes parameter"
bytes_value = request.GET.first("size")
chunk_size = 1024
multipliers = {"kb": 1024,
"Mb": 1024*1024}
suffix = bytes_value[-2:]
if suffix in multipliers:
multiplier = multipliers[suffix]
bytes_value = bytes_value[:-2] * multiplier
try:
num_bytes = int(bytes_value)
except ValueError:
return 400, "Bytes must be an integer possibly with a kb or Mb suffix"
string = str(request.GET.first("string", "a"))
chunk = string * chunk_size
def content():
bytes_sent = 0
while bytes_sent < num_bytes:
if num_bytes - bytes_sent < len(chunk):
yield chunk[num_bytes - bytes_sent]
else:
yield chunk
bytes_sent += len(chunk)
return [("Content-Type", "text/plain")], content()

View file

@ -7,7 +7,7 @@ EXPAND=expand
EXPANDFLAGS=
GIT=git
GITFLAGS=
PYTHON=python3
PYTHON=python
PYTHONFLAGS=
VNU_TEST_REPO=git@github.com:validator/tests.git
ITS_REPO=git@github.com:w3c/its-2.0-testsuite-inputdata.git
@ -24,7 +24,7 @@ README.md: index.html
| $(EXPAND) $(EXPANDFLAGS) > $@
messages.json: .FORCE
$(PYTHON) $(PYTHONFLAGS) -mjson.tool --sort-keys $@ > $@.tmp
$(PYTHON) $(PYTHONFLAGS) -mjson.tool $@ > $@.tmp
mv $@.tmp $@
push:

View file

@ -1,4 +0,0 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>invalid aside-in-dt</title>
<dl><dt><aside><h2>text</h2></aside><dd>text</dl>

View file

@ -1,4 +0,0 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>invalid pattern</title>
<p><input pattern='*'></p>

View file

@ -1,4 +0,0 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>invalid pattern</title>
<p><input pattern='('></p>

View file

@ -650,7 +650,6 @@
"html/elements/dialog/model-novalid.html": "Element \u201cdt\u201d not allowed as child of element \u201cdialog\u201d in this context. (Suppressing further errors from this subtree.)",
"html/elements/div/model-novalid.html": "End tag \u201cp\u201d implied, but there were open elements.",
"html/elements/dl/article-in-dt-novalid.html": "The element \u201carticle\u201d must not appear as a descendant of the \u201cdt\u201d element.",
"html/elements/dl/aside-in-dt-novalid.html": "The element \u201caside\u201d must not appear as a descendant of the \u201cdt\u201d element.",
"html/elements/dl/dd-in-template-novalid.html": "Element \u201cdl\u201d is missing one or more of the following child elements: [dd].",
"html/elements/dl/div-contains-dl-novalid.html": "Element \u201cdl\u201d not allowed as child of element \u201cdiv\u201d in this context. (Suppressing further errors from this subtree.)",
"html/elements/dl/div-contains-text-novalid.html": "Text not allowed in element \u201cdiv\u201d in this context.",
@ -968,8 +967,6 @@
"html/elements/img/usemap-bad-value-novalid.html": "Bad value \u201c#\u201d for attribute \u201cusemap\u201d on element \u201cimg\u201d: Bad hash-name reference: A hash-name reference must have at least one character after \u201c#\u201d.",
"html/elements/img/width-height-negative-novalid.html": "Bad value \u201c-1\u201d for attribute \u201cwidth\u201d on element \u201cimg\u201d: Bad non-negative integer: Expected a digit but saw \u201c-\u201d instead.",
"html/elements/input/list-novalid.html": "The \u201clist\u201d attribute of the \u201cinput\u201d element must refer to a \u201cdatalist\u201d element.",
"html/elements/input/pattern-asterisk-novalid.html": "Bad value \u201c*\u201d for attribute \u201cpattern\u201d on element \u201cinput\u201d: Bad pattern: Dangling meta character '*' near index 0",
"html/elements/input/pattern-paren-novalid.html": "Bad value \u201c(\u201d for attribute \u201cpattern\u201d on element \u201cinput\u201d: Bad pattern: Unclosed group near index 1",
"html/elements/input/type-image-formaction-empty-novalid.html": "Bad value \u201c\u201d for attribute \u201cformaction\u201d on element \u201cinput\u201d: Bad URL: Must be non-empty.",
"html/elements/input/type-image-formaction-whitespace-only-novalid.html": "Bad value \u201c\t \n\u201d for attribute \u201cformaction\u201d on element \u201cinput\u201d: Bad URL: Must be non-empty.",
"html/elements/input/type-image-formaction/fragment-backslash-novalid.html": "Bad value \u201c#\\\u201d for attribute \u201cformaction\u201d on element \u201cinput\u201d: Bad URL: Illegal character in fragment: \u201c\\\u201d is not allowed.",

View file

@ -1,66 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Objects loaded using data attribute of &lt;object&gt; tag are blocked unless their host is listed as an allowed source in the object-src directive</title>
<meta name=timeout content=long>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
</head>
<body onLoad="object_loaded()">
<h1>Objects loaded using data attribute of &lt;object&gt; tag are blocked unless their host is listed as an allowed source in the object-src directive</h1>
<div id="log"></div>
<script>
var relativeMediaURL = "/support/media/flash.swf";
var pageURL = window.location.toString();
var temp1 = pageURL.split("//");
var temp2 = temp1[1].substring(0, temp1[1].lastIndexOf("/object-src/"));
var mediaURL = "http://www2." + temp2 + relativeMediaURL;
var htmlStr = "<object id='flashObject' type='application/x-shockwave-flash' data='" + mediaURL + "' width='200' height='200'></object>";
document.write(htmlStr);
</script>
<script>
var len = navigator.mimeTypes.length;
var allTypes = "";
var flashMimeType = "application/x-shockwave-flash";
for (var i = 0; i < len; i++) {
allTypes += navigator.mimeTypes[i].type;
}
var hasMimeType = allTypes.indexOf(flashMimeType) != -1;
<!-- The actual test. -->
var test1 = async_test("Async SWF load test")
function object_loaded() {
var elem = document.getElementById("flashObject");
var is_loaded = false;
try {
<!-- The Flash Player exposes values to JavaScript if a SWF has successfully been loaded. -->
var pct_loaded = elem.PercentLoaded();
is_loaded = true;
} catch (e) {}
if (hasMimeType) {
test1.step(function () {
assert_false(is_loaded, "External object loaded.")
});
var s = document.createElement('script');
s.async = true;
s.defer = true;
s.src = "../support/checkReport.sub.js?reportField=violated-directive&reportValue=object-src%20%27self%27"
document.lastChild.appendChild(s);
} else {
test1.set_status(test1.NOTRUN, "No Flash Player, cannot run test.");
test1.phase = test1.phases.HAS_RESULT;
}
test1.done();
}
</script>
</body>
</html>

View file

@ -1,6 +0,0 @@
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0, false
Pragma: no-cache
Set-Cookie: object-src-2_1={{$id:uuid()}}; Path=/content-security-policy/object-src/
Content-Security-Policy: script-src * 'unsafe-inline'; object-src 'self'; report-uri ../support/report.py?op=put&reportID={{$id}}

View file

@ -1,61 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Objects loaded using src attribute of &lt;embed&gt; tag are blocked unless their host is listed as an allowed source in the object-src directive</title>
<meta name=timeout content=long>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
</head>
<body onLoad="object_loaded()">
<h1>Objects loaded using src attribute of &lt;embed&gt; tag are blocked unless their host is listed as an allowed source in the object-src directive</h1>
<div id="log"></div>
<script>
var relativeMediaURL = "/support/media/flash.swf";
var pageURL = window.location.toString();
var temp1 = pageURL.split("//");
var temp2 = temp1[1].substring (0, temp1[1].lastIndexOf("/object-src/"));
var mediaURL = "http://www2." + temp2 + relativeMediaURL;
var htmlStr = "<embed id='flashObject' type='application/x-shockwave-flash' src='" + mediaURL + "' width='200' height='200'></object>";
document.write (htmlStr);
</script>
<script>
var len = navigator.mimeTypes.length;
var allTypes = "";
var flashMimeType = "application/x-shockwave-flash";
for ( var i=0;i<len;i++ ) {
allTypes+=navigator.mimeTypes[i].type;
}
var hasMimeType = allTypes.indexOf(flashMimeType) != -1;
<!-- The actual test. -->
var test1 = async_test("Async SWF load test")
function object_loaded() {
var elem = document.getElementById("flashObject");
var is_loaded = false;
try {
<!-- The Flash Player exposes values to JavaScript if a SWF has successfully been loaded. -->
var pct_loaded = elem.PercentLoaded();
is_loaded = true;
} catch (e) {}
if (hasMimeType) {
test1.step(function() {assert_false(is_loaded, "External object loaded.")});
var s = document.createElement('script');
s.async = true;
s.defer = true;
s.src = "../support/checkReport.sub.js?reportField=violated-directive&reportValue=object-src%20%27self%27"
document.lastChild.appendChild(s);
} else {
//test1.step(function() {});
test1.set_status(test1.NOTRUN, "No Flash Player, cannot run test.");
test1.phase = test1.phases.HAS_RESULT;
}
test1.done();
}
</script>
</body>
</html>

View file

@ -1,6 +0,0 @@
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0, false
Pragma: no-cache
Set-Cookie: object-src-2_2={{$id:uuid()}}; Path=/content-security-policy/object-src/
Content-Security-Policy: script-src * 'unsafe-inline'; object-src 'self'; report-uri ../support/report.py?op=put&reportID={{$id}}

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- Content-Security-Policy: object-src 'self'; script-src 'self' 'unsafe-inline'; report-uri ../support/report.py?op=put&reportID={{$id}} -->
</head>
<body>
<object type="application/x-webkit-test-netscape"></object>
<!-- we rely on the report because we can't rely on the onload event for
"allowed" tests as it is not fired for object and embed -->
<script async defer src='../support/checkReport.sub.js?reportExists=false'></script>
</body>
</html>

View file

@ -0,0 +1,2 @@
Set-Cookie: object-src-no-url-allowed={{$id:uuid()}}; Path=/content-security-policy/object-src/
Content-Security-Policy: object-src 'self'; script-src 'self' 'unsafe-inline'; report-uri ../support/report.py?op=put&reportID={{$id}}

View file

@ -1,31 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
<meta http-equiv="Content-Security-Policy" content="object-src 'self'; script-src 'self' 'unsafe-inline'; connect-src 'self';">
<title>object-src-no-url-allowed</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src='../support/logTest.sub.js?logs=["PASS"]'></script>
<script src="../support/alertAssert.sub.js?alerts=[]"></script>
</head>
<body>
<p>This test passes if there isn&apos;t a CSP violation saying the plugin was blocked.</p>
<script>
window.addEventListener('securitypolicyviolation', function(e) {
log("Fail");
});
</script>
<object type="application/x-webkit-test-netscape"></object>
<div id="log"></div>
<script>
log("PASS");
</script>
</body>
</html>

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-inline';">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Should block the object and fire a spv");
window.addEventListener('securitypolicyviolation', t.step_func_done(function(e) {
assert_equals(e.violatedDirective, "object-src");
}));
</script>
<object type="application/x-webkit-test-netscape"></object>
</body>
</html>

View file

@ -1,27 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-inline'; connect-src 'self';">
<title>object-src-no-url-blocked</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src='../support/logTest.sub.js?logs=["violated-directive=object-src"]'></script>
<script src="../support/alertAssert.sub.js?alerts=[]"></script>
</head>
<body>
<p>This test passes if there is a CSP violation saying the plugin was blocked.</p>
<script>
window.addEventListener('securitypolicyviolation', function(e) {
log("violated-directive=" + e.violatedDirective);
});
</script>
<object type="application/x-webkit-test-netscape"></object>
<div id="log"></div>
</body>
</html>

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- Content-Security-Policy: object-src 'self'; script-src 'self' 'unsafe-inline'; report-uri ../support/report.py?op=put&reportID={{$id}} -->
</head>
<body>
<object type="image/png" data="/content-security-policy/support/pass.png"></object>
<!-- we rely on the report because we can't rely on the onload event for
"allowed" tests as it is not fired for object and embed -->
<script async defer src='../support/checkReport.sub.js?reportExists=false'></script>
</body>
</html>

View file

@ -0,0 +1,2 @@
Set-Cookie: object-src-url-allowed={{$id:uuid()}}; Path=/content-security-policy/object-src/
Content-Security-Policy: object-src 'self'; script-src 'self' 'unsafe-inline'; report-uri ../support/report.py?op=put&reportID={{$id}}

View file

@ -1,30 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
<meta http-equiv="Content-Security-Policy" content="object-src 'self'; script-src 'self' 'unsafe-inline'; connect-src 'self';">
<title>object-src-url-allowed</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src='../support/logTest.sub.js?logs=["Pass"]'></script>
<script src="../support/alertAssert.sub.js?alerts=[]"></script>
</head>
<body>
<p>This test passes if there is no CSP violation saying the plugin was blocked.</p>
<script>
window.addEventListener('securitypolicyviolation', function(e) {
log("Fail");
});
</script>
<object data="/content-security-policy/support/pass.png"></object>
<div id="log"></div>
<script>
log("Pass");
</script>
</body>
</html>

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-inline';">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Should block the object and fire a spv");
window.addEventListener('securitypolicyviolation', t.step_func_done(function(e) {
assert_equals(e.violatedDirective, "object-src");
}));
</script>
<object type="image/png" data="/content-security-policy/support/pass.png"></object>
</body>
</html>

View file

@ -1,27 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-inline'; connect-src 'self';">
<title>object-src-url-blocked</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src='../support/logTest.sub.js?logs=["violated-directive=object-src"]'></script>
<script src="../support/alertAssert.sub.js?alerts=[]"></script>
</head>
<body>
<p>This test passes if there is a CSP violation saying the plugin was blocked.</p>
<script>
window.addEventListener('securitypolicyviolation', function(e) {
log("violated-directive=" + e.violatedDirective);
});
</script>
<object data="/plugins/resources/mock-plugin.pl"></object>
<div id="log"></div>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- Content-Security-Policy: object-src 'self'; script-src 'self' 'unsafe-inline'; report-uri ../support/report.py?op=put&reportID={{$id}} -->
</head>
<body>
<embed height="40" width="40" type="image/png"
src="/content-security-policy/support/pass.png"></embed>
<!-- we rely on the report because we can't rely on the onload event for
"allowed" tests as it is not fired for object and embed -->
<script async defer src='../support/checkReport.sub.js?reportExists=false'></script>
</body>
</html>

View file

@ -0,0 +1,2 @@
Set-Cookie: object-src-url-embed-allowed={{$id:uuid()}}; Path=/content-security-policy/object-src/
Content-Security-Policy: object-src 'self'; script-src 'self' 'unsafe-inline'; report-uri ../support/report.py?op=put&reportID={{$id}}

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-inline';">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Should block the object and fire a spv");
window.addEventListener('securitypolicyviolation', t.step_func_done(function(e) {
assert_equals(e.violatedDirective, "object-src");
}));
</script>
<embed height="40" width="40" type="image/png"
src="/content-security-policy/support/pass.png"></embed>
</body>
</html>

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- Content-Security-Policy: object-src 'self'; script-src 'self' 'unsafe-inline'; report-uri ../support/report.py?op=put&reportID={{$id}} -->
</head>
<body>
<object type="image/png" data="/common-redirect.py?location=/content-security-policy/support/pass.png"></object>
<!-- we rely on the report because we can't rely on the onload event for
"allowed" tests as it is not fired for object and embed -->
<script async defer src='../support/checkReport.sub.js?reportExists=false'></script>
</body>
</html>

View file

@ -0,0 +1,2 @@
Set-Cookie: object-src-url-redirect-allowed={{$id:uuid()}}; Path=/content-security-policy/object-src/
Content-Security-Policy: object-src 'self'; script-src 'self' 'unsafe-inline'; report-uri ../support/report.py?op=put&reportID={{$id}}

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="object-src 'self'; script-src 'self' 'unsafe-inline';">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Should block the object and fire a spv");
window.addEventListener('securitypolicyviolation', t.step_func_done(function(e) {
assert_equals(e.violatedDirective, "object-src");
}));
</script>
<object type="image/png" data="/common/redirect.py?location=http://{{domains[www1]}}/content-security-policy/support/pass.png"></object>
</body>
</html>

View file

@ -10,11 +10,16 @@
</head>
<body>
<script>
var test = async_test("Image should not load");
fetch(
"/cookies/resources/set-cookie.py?name=cspViolationReportCookie1&path=" + encodeURIComponent("{{domains[www1]}}:{{ports[http][0]}}/"),
promise_test(function(test) {
const path = encodeURIComponent("{{domains[www1]}}:{{ports[http][0]}}/");
return fetch(
"/cookies/resources/set-cookie.py?name=cspViolationReportCookie1&path=" + path,
{mode: 'no-cors', credentials: 'include'})
.then(() => {
test.add_cleanup(() => {
return fetch("/cookies/resources/set.py?cspViolationReportCookie1=; path=" + path + "; expires=Thu, 01 Jan 1970 00:00:01 GMT");
});
// This image will generate a CSP violation report.
const img = new Image();
img.onerror = test.step_func_done();
@ -23,6 +28,7 @@
img.src = "../support/fail.png";
document.body.appendChild(img);
});
}, "Image should not load");
</script>
<script async defer src='../support/checkReport.sub.js?reportField=violated-directive&reportValue=img-src%20%27none%27&noCookies=true'></script>

View file

@ -15,6 +15,10 @@
"/cookies/resources/set-cookie.py?name=cspViolationReportCookie2&path=" + encodeURIComponent("/"),
{mode: 'no-cors', credentials: 'include'})
.then(() => {
test.add_cleanup(() => {
document.cookie = "cspViolationReportCookie2=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT";
});
// This image will generate a CSP violation report.
const img = new Image();
img.onerror = test.step_func_done();

View file

@ -0,0 +1,5 @@
<!doctype html>
<meta charset=utf-8>
<body>
<div style="background: linear-gradient(to bottom, red 0%, red 25%, blue 25%, blue 75%, red 75%, red 100%); width: 100px; height: 100px;"><br></div>
</body>

View file

@ -0,0 +1,9 @@
<!doctype html>
<meta charset=utf-8>
<title>Linear gradient with a two position color stops</title>
<link rel="help" href="https://drafts.csswg.org/css-images-4/#color-stop-syntax">
<meta name="assert" content="Color stops with two positions are equivalent to two color stops with the same color">
<link rel=match href=/css/css-images/multiple-position-color-stop-linear-2-ref.html>
<body>
<div style="background: linear-gradient(to bottom, red 0% 25%, blue 25% 75%, red 75% 100%); width: 100px; height: 100px;"><br></div>
</body>

View file

@ -0,0 +1,5 @@
<!doctype html>
<meta charset=utf-8>
<body>
<div style="background: radial-gradient(center, red 0%, red 25%, blue 25%, blue 75%, red 75%, red 100%); width: 100px; height: 100px;"><br></div>
</body>

View file

@ -0,0 +1,9 @@
<!doctype html>
<meta charset=utf-8>
<title>Radial gradient with a two position color stops</title>
<link rel="help" href="https://drafts.csswg.org/css-images-4/#color-stop-syntax">
<meta name="assert" content="Color stops with two positions are equivalent to two color stops with the same color">
<link rel=match href=/css/css-images/multiple-position-color-stop-radial-2-ref.html>
<body>
<div style="background: radial-gradient(center, red 0% 25%, blue 25% 75%, red 75% 100%); width: 100px; height: 100px;"><br></div>
</body>

View file

@ -5,23 +5,27 @@
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
<meta content="ahem" name="flags">
<style>
body {
overflow: hidden;
}
.container {
writing-mode: horizontal-tb;
padding: 70px 30px;
margin: -170px -230px;
font: 100px/1 Ahem;
line-height: 100px;
color: red;
}
.container::first-letter {
color:green;
color: transparent;
}
.container > span {
clip-path: polygon(0% 0%, 50% 0%, 50% 100%, 0% 100%);
color: red;
}
.container > span > span {
color: green;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div class="container">
<span>
XX<br>
XXX
</span>
<br>
XX<span><span>X</span>X<br>XXXXX</span>
</div>

View file

@ -5,24 +5,27 @@
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
<meta content="ahem" name="flags">
<style>
body {
overflow: hidden;
}
.container {
writing-mode: vertical-rl;
margin-left: -100px;
padding: 70px 30px;
margin: -270px -130px;
font: 100px/1 Ahem;
line-height: 100px;
color: red;
}
.container::first-letter {
color:green;
color: transparent;
}
.container > span {
clip-path: polygon(0% 0%, 100% 0%, 100% 50%, 0% 50%);
color: red;
}
.container > span > span {
color: green;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div class="container">
<span>
XX<br>
XXX
</span>
<br>
XX<span><span>X</span>X<br>XXXXX</span>
</div>

View file

@ -5,23 +5,27 @@
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
<meta content="ahem" name="flags">
<style>
body {
overflow: hidden;
}
.container {
writing-mode: vertical-lr;
padding: 70px 30px;
margin: -270px -130px;
font: 100px/1 Ahem;
line-height: 100px;
color: red;
}
.container::first-letter {
color:green;
color: transparent;
}
.container > span {
clip-path: polygon(0% 0%, 100% 0%, 100% 50%, 0% 50%);
color: red;
}
.container > span > span {
color: green;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div class="container">
<span>
XX<br>
XXX
</span>
<br>
XX<span><span>X</span>X<br>XXXXX</span>
</div>

View file

@ -22,9 +22,9 @@
<img src="support/swatch-yellow.png" width="160" height="20" alt="Image download support must be enabled" />
<img src="support/black20x20.png" width="160" height="20" alt="Image download support must be enabled" />
<img src="support/swatch-yellow.png" width="160" height="20" alt="Image download support must be enabled" />
<img src="support/swatch-yellow.png" width="40" height="20" alt="Image download support must be enabled" /><img src="support/swatch-blue.png" width="80" height="20" alt="Image download support must be enabled" /><img src="support/swatch-pink.png" width="40" height="20" alt="Image download support must be enabled" />
<img src="support/swatch-orange.png" width="40" height="20" alt="Image download support must be enabled" /><img src="support/swatch-blue.png" width="40" height="20" alt="Image download support must be enabled" /><img src="support/swatch-pink.png" width="80" height="20" alt="Image download support must be enabled" />
<img src="support/swatch-yellow.png" width="40" height="20" alt="Image download support must be enabled" /><img src="support/swatch-blue.png" width="40" height="20" alt="Image download support must be enabled" /><img src="support/swatch-pink.png" width="40" height="20" alt="Image download support must be enabled" /><img src="support/swatch-yellow.png" width="40" height="20" alt="Image download support must be enabled" />
<img src="support/swatch-blue.png" width="80" height="20" alt="Image download support must be enabled" /><img src="support/swatch-pink.png" width="40" height="20" alt="Image download support must be enabled" /><img src="support/swatch-yellow.png" width="40" height="20" alt="Image download support must be enabled" />
</div>
</body>

View file

@ -50,10 +50,10 @@
color: orange;
/*
In this test, the glyphs "or" are painted into 1st column box.
"Content in the normal flow that extends into column
gaps (e.g., long words or images) is clipped in the
middle of the column gap."
Therefore, the glyphs "ang" are clipped and not painted.
Per spec, content in the normal flow that extends into column
gaps (e.g., long words or images) is not clipped to the column
box. However, the glyphs "ang" are overwritten by <span>s, so
they're not visible.
*/
}

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#extensions-to-the-document-interface">
<div id="container" style="width:200px; height:200px; writing-mode:horizontal-tb; direction:ltr;">
<span id="target">target</span>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> {
var elements = document.elementsFromPoint(15, 15);
assert_equals(elements.length, 4);
assert_equals(elements[0].id, "target");
assert_equals(elements[1].id, "container");
assert_equals(elements[2].nodeName, "BODY");
assert_equals(elements[3].nodeName, "HTML");
}, "elementsFromPoint should return all elements under a point");
</script>

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#extensions-to-the-document-interface">
<div id="container" style="width:200px; height:200px; writing-mode:horizontal-tb; direction:rtl;">
<span id="target">target</span>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> {
var elements = document.elementsFromPoint(200, 15);
assert_equals(elements.length, 4);
assert_equals(elements[0].id, "target");
assert_equals(elements[1].id, "container");
assert_equals(elements[2].nodeName, "BODY");
assert_equals(elements[3].nodeName, "HTML");
}, "elementsFromPoint should return all elements under a point");
</script>

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#extensions-to-the-document-interface">
<div id="container" style="width:200px; height:200px; writing-mode:vertical-lr; direction:ltr;">
<span id="target">target</span>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> {
var elements = document.elementsFromPoint(15, 15);
assert_equals(elements.length, 4);
assert_equals(elements[0].id, "target");
assert_equals(elements[1].id, "container");
assert_equals(elements[2].nodeName, "BODY");
assert_equals(elements[3].nodeName, "HTML");
}, "elementsFromPoint should return all elements under a point");
</script>

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#extensions-to-the-document-interface">
<div id="container" style="width:200px; height:200px; writing-mode:vertical-lr; direction:rtl;">
<span id="target">target</span>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> {
var elements = document.elementsFromPoint(15, 200);
assert_equals(elements.length, 4);
assert_equals(elements[0].id, "target");
assert_equals(elements[1].id, "container");
assert_equals(elements[2].nodeName, "BODY");
assert_equals(elements[3].nodeName, "HTML");
}, "elementsFromPoint should return all elements under a point");
</script>

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#extensions-to-the-document-interface">
<div id="container" style="width:200px; height:200px; writing-mode:vertical-rl; direction:ltr;">
<span id="target">target</span>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> {
var elements = document.elementsFromPoint(200, 15);
assert_equals(elements.length, 4);
assert_equals(elements[0].id, "target");
assert_equals(elements[1].id, "container");
assert_equals(elements[2].nodeName, "BODY");
assert_equals(elements[3].nodeName, "HTML");
}, "elementsFromPoint should return all elements under a point");
</script>

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#extensions-to-the-document-interface">
<div id="container" style="width:200px; height:200px; writing-mode:vertical-rl; direction:rtl;">
<span id="target">target</span>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> {
var elements = document.elementsFromPoint(200, 200);
assert_equals(elements.length, 4);
assert_equals(elements[0].id, "target");
assert_equals(elements[1].id, "container");
assert_equals(elements[2].nodeName, "BODY");
assert_equals(elements[3].nodeName, "HTML");
}, "elementsFromPoint should return all elements under a point");
</script>

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/cssom-view-1/#dom-element-getclientrects">
<div style="position:absolute; top:0; left:0; width:200px; height:100px; writing-mode:horizontal-tb; direction:ltr;">
<br id="child">
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=>{
let r = document.getElementById("child").getClientRects()[0];
assert_equals(r.left, 0);
assert_greater_than_equal(r.top, 0);
assert_less_than(r.top, 50);
}, "Position of the BR element");
</script>

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/cssom-view-1/#dom-element-getclientrects">
<div style="position:absolute; top:0; left:0; width:200px; height:100px; writing-mode:horizontal-tb; direction:rtl;">
<br id="child">
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=>{
let r = document.getElementById("child").getClientRects()[0];
assert_equals(r.left, 200);
assert_greater_than_equal(r.top, 0);
assert_less_than(r.top, 50);
}, "Position of the BR element");
</script>

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/cssom-view-1/#dom-element-getclientrects">
<div style="position:absolute; top:0; left:0; width:200px; height:100px; writing-mode:vertical-lr; direction:ltr;">
<br id="child">
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=>{
let r = document.getElementById("child").getClientRects()[0];
assert_greater_than_equal(r.left, 0);
assert_less_than(r.left, 50);
assert_equals(r.top, 0);
}, "Position of the BR element");
</script>

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/cssom-view-1/#dom-element-getclientrects">
<div style="position:absolute; top:0; left:0; width:200px; height:100px; writing-mode:vertical-lr; direction:rtl;">
<br id="child">
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=>{
let r = document.getElementById("child").getClientRects()[0];
assert_greater_than_equal(r.left, 0);
assert_less_than(r.left, 50);
assert_equals(r.top, 100);
}, "Position of the BR element");
</script>

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/cssom-view-1/#dom-element-getclientrects">
<div style="position:absolute; top:0; left:0; width:200px; height:100px; writing-mode:vertical-rl; direction:ltr;">
<br id="child">
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=>{
let r = document.getElementById("child").getClientRects()[0];
assert_greater_than(r.left, 150);
assert_less_than(r.left, 200);
assert_equals(r.top, 0);
}, "Position of the BR element");
</script>

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/cssom-view-1/#dom-element-getclientrects">
<div style="position:absolute; top:0; left:0; width:200px; height:100px; writing-mode:vertical-rl; direction:rtl;">
<br id="child">
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=>{
let r = document.getElementById("child").getClientRects()[0];
assert_greater_than(r.left, 150);
assert_less_than(r.left, 200);
assert_equals(r.top, 100);
}, "Position of the BR element");
</script>

View file

@ -0,0 +1,55 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/cssom-view-1/#dom-element-getclientrects">
<link rel="match" href="../reference/nothing.html">
<style>
.container {
float: left;
width: 8em;
height: 7em;
padding: 1em;
color: red;
}
.correctionFluid {
position: absolute;
background: white;
/* Add some fluff to cover text ink-overflow. */
outline:2px solid white;
}
</style>
<p>There should be nothing below.</p>
<div class="container" style="writing-mode:horizontal-tb;">
<br><span class="child">FAIL</span>
</div>
<div class="container" style="writing-mode:vertical-lr;">
<br><span class="child">FAIL</span>
</div>
<div class="container" style="writing-mode:vertical-rl;">
<br><span class="child">FAIL</span>
</div>
<div class="container" style="writing-mode:horizontal-tb; direction:rtl;">
<br><span class="child">FAIL</span>
</div>
<div class="container" style="writing-mode:vertical-lr; direction:rtl;">
<br><span class="child">FAIL</span>
</div>
<div class="container" style="writing-mode:vertical-rl; direction:rtl;">
<br><span class="child">FAIL</span>
</div>
<script>
// Create a white absolutely positioned box for each span.child
// element and cover it.
let elements = document.querySelectorAll("span.child");
elements.forEach((element)=> {
let correctionFluid = document.createElement("div");
correctionFluid.className = "correctionFluid";
var r = element.getClientRects()[0];
correctionFluid.style.left = r.left + "px";
correctionFluid.style.top = r.top + "px";
correctionFluid.style.width = r.width + "px";
correctionFluid.style.height = r.height + "px";
document.body.appendChild(correctionFluid);
});
</script>

View file

@ -0,0 +1,54 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/cssom-view-1/#extensions-to-the-htmlelement-interface">
<link rel="match" href="../reference/nothing.html">
<style>
.container {
float: left;
width: 8em;
height: 7em;
padding: 1em;
color: red;
}
.correctionFluid {
position: absolute;
background: white;
/* Add some fluff to cover text ink-overflow. */
outline:2px solid white;
}
</style>
<p>There should be nothing below.</p>
<div class="container" style="writing-mode:horizontal-tb;">
<br><span class="child">FAIL</span>
</div>
<div class="container" style="writing-mode:vertical-lr;">
<br><span class="child">FAIL</span>
</div>
<div class="container" style="writing-mode:vertical-rl;">
<br><span class="child">FAIL</span>
</div>
<div class="container" style="writing-mode:horizontal-tb; direction:rtl;">
<br><span class="child">FAIL</span>
</div>
<div class="container" style="writing-mode:vertical-lr; direction:rtl;">
<br><span class="child">FAIL</span>
</div>
<div class="container" style="writing-mode:vertical-rl; direction:rtl;">
<br><span class="child">FAIL</span>
</div>
<script>
// Create a white absolutely positioned box for each span.child
// element and cover it.
let elements = document.querySelectorAll("span.child");
elements.forEach((element)=> {
let correctionFluid = document.createElement("div");
correctionFluid.className = "correctionFluid";
correctionFluid.style.left = element.offsetLeft + "px";
correctionFluid.style.top = element.offsetTop + "px";
correctionFluid.style.width = element.offsetWidth + "px";
correctionFluid.style.height = element.offsetHeight + "px";
document.body.appendChild(correctionFluid);
});
</script>

View file

@ -109,7 +109,7 @@
}, "Scroll positions when aborting a smooth scrolling with another smooth scrolling");
promise_test(() => {
return new Promise(function(resolve) {
return new Promise(function(resolve, reject) {
resetScroll(overflowNode);
var initialScrollAborted = false;
var oldLeft = overflowNode.scrollLeft;

View file

@ -33,7 +33,7 @@
}));
// Handle the case where the button is focused before the test runs.
if (document.activeButtonement === button) {
if (document.activeElement === button) {
assert_equals(getComputedStyle(button).outlineColor, "rgb(0, 100, 0)");
t.done();
}

View file

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
</head>
<body>
<script>
var check_report_format = (reports, observer) => {
let report = reports[0];
assert_equals(report.type, "feature-policy");
assert_equals(report.url, document.location.href);
assert_equals(report.body.feature, "encrypted-media");
assert_equals(report.body.sourceFile, document.location.href);
assert_equals(typeof report.body.message, "string");
assert_equals(typeof report.body.lineNumber, "number");
assert_equals(typeof report.body.columnNumber, "number");
};
promise_test(async t => {
const report = new Promise(resolve => {
new ReportingObserver((reports, observer) => resolve([reports, observer]),
{types: ['feature-policy']}).observe();
});
await promise_rejects(t, "SecurityError",
navigator.requestMediaKeySystemAccess("org.w3.clearkey",
[{
initDataTypes: ["webm"],
videoCapabilities: [{contentType: 'video/webm;codecs="vp8"'}],
}]),
"requestMediaKeySystemAccess() should not be allowed in this document.");
const [reports, observer] = await report;
check_report_format(reports, observer);
}, "Encrypted Media report format");
</script>
</body>
</html>

View file

@ -0,0 +1 @@
Feature-Policy: encrypted-media 'none'

View file

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<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>
</head>
<body>
<script>
const check_report_format = (reports, observer) => {
const report = reports[0];
assert_equals(report.type, "feature-policy");
assert_equals(report.url, document.location.href);
assert_equals(report.body.feature, "picture-in-picture");
assert_equals(report.body.sourceFile, document.location.href);
assert_equals(typeof report.body.message, "string");
assert_equals(typeof report.body.lineNumber, "number");
assert_equals(typeof report.body.columnNumber, "number");
};
const loadVideo = () => new Promise(resolve => {
const video = document.createElement('video');
video.src = '/media/movie_5.ogv';
video.addEventListener('loadedmetadata', () => {
resolve(video);
}, { once: true });
});
promise_test(async (t) => {
const report = new Promise(resolve => {
new ReportingObserver((reports, observer) => resolve([reports, observer]),
{types: ['feature-policy']}).observe();
});
const videoElement = await loadVideo();
await test_driver.bless('picture-in-picture');
await promise_rejects(t, 'SecurityError', videoElement.requestPictureInPicture(),
"Picture-in-Picture should not be allowed in this document.");
const [reports, observer] = await report;
check_report_format(reports, observer);
}, "Picture-in-Picture Report Format");
</script>
</body>
</html>

View file

@ -0,0 +1 @@
Feature-Policy: picture-in-picture 'none'

View file

@ -9,6 +9,7 @@ testText("<div>abc\ndef", "abc def", "\\n converted to space");
testText("<div>abc\rdef", "abc def", "\\r converted to space");
testText("<div>abc\tdef", "abc def", "\\t converted to space");
testText("<div>abc <br>def", "abc\ndef", "Trailing whitespace before hard line break removed");
testText("<div>abc<br> def", "abc\ndef", "Leading whitespace after hard line break removed");
/**** <pre> ****/
@ -52,6 +53,9 @@ testText("<div style='white-space:pre-line'>abc\tdef", "abc def", "\\t converted
testText("<div><span>abc </span> def", "abc def", "Whitespace collapses across element boundaries");
testText("<div><span>abc </span><span></span> def", "abc def", "Whitespace collapses across element boundaries");
testText("<div><span>abc </span><span style='white-space:pre'></span> def", "abc def", "Whitespace collapses across element boundaries");
testText("<div>abc <input> def", "abc def", "Whitespace around <input> should not be collapsed");
testText("<div>abc <span style='display:inline-block'></span> def", "abc def", "Whitespace around inline-block should not be collapsed");
testText("<div>abc <span style='display:inline-block'> def </span> ghi", "abc def ghi", "Trailing space at end of inline-block should be collapsed");
/**** Soft line breaks ****/

View file

@ -95,5 +95,5 @@ function finish() {
<div></div>
<p>Save <a href="/common/large.py?size=32Mb">32MB.txt</a> to your desktop. Use your pointing device to drag the saved file from your desktop onto the orange box, and release it. If a confirmation dialog appears, accept it. Fail if this text is not replaced with a pass message. Fail if the UI locks up immediately after dropping the file.</p>
<p>Save <a href="../resources/32mb.py">32MB.txt</a> to your desktop. Use your pointing device to drag the saved file from your desktop onto the orange box, and release it. If a confirmation dialog appears, accept it. Fail if this text is not replaced with a pass message. Fail if the UI locks up immediately after dropping the file.</p>
<noscript><p>Enable JavaScript and reload</p></noscript>

View file

@ -0,0 +1,12 @@
thirty_two_megabytes = 32 * 1024 * 1024
chunk = 'ab' * 512 * 512
chunk_length = len(chunk)
def main(request, response):
def content():
bytes_sent = 0
while bytes_sent < thirty_two_megabytes:
yield chunk
bytes_sent += chunk_length
return [("Content-Type", "text/plain")], content()

View file

@ -3,6 +3,33 @@
// (https://github.com/tidoust/reffy-reports)
// Source: CSS Layout API Level 1 (https://drafts.css-houdini.org/css-layout-api-1/)
partial namespace CSS {
[SameObject] readonly attribute Worklet layoutWorklet;
};
[Global=(Worklet,LayoutWorklet),Exposed=LayoutWorklet]
interface LayoutWorkletGlobalScope : WorkletGlobalScope {
void registerLayout(DOMString name, VoidFunction layoutCtor);
};
[Exposed=LayoutWorklet]
dictionary LayoutOptions {
ChildDisplayType childDisplay = "block";
LayoutSizingMode sizing = "block-like";
};
[Exposed=LayoutWorklet]
enum ChildDisplayType {
"block",
"normal",
};
[Exposed=LayoutWorklet]
enum LayoutSizingMode {
"block-like",
"manual",
};
[Exposed=LayoutWorklet]
interface LayoutChild {
readonly attribute StylePropertyMapReadOnly styleMap;
@ -106,33 +133,6 @@ interface LayoutEdges {
readonly attribute LayoutEdgeSizes all;
};
partial namespace CSS {
[SameObject] readonly attribute Worklet layoutWorklet;
};
[Global=(Worklet,LayoutWorklet),Exposed=LayoutWorklet]
interface LayoutWorkletGlobalScope : WorkletGlobalScope {
void registerLayout(DOMString name, VoidFunction layoutCtor);
};
[Exposed=LayoutWorklet]
dictionary LayoutOptions {
ChildDisplayType childDisplay = "block";
LayoutSizingMode sizing = "block-like";
};
[Exposed=LayoutWorklet]
enum ChildDisplayType {
"block",
"normal",
};
[Exposed=LayoutWorklet]
enum LayoutSizingMode {
"block-like",
"manual",
};
[Exposed=LayoutWorklet]
interface IntrinsicSizesRequest {
};

View file

@ -1,7 +1,7 @@
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into reffy-reports
// (https://github.com/tidoust/reffy-reports)
// Source: DSCP Control API (https://w3c.github.io/webrtc-dscp-exp/)
// Source: WebRTC DSCP Control API (https://w3c.github.io/webrtc-dscp-exp/)
partial dictionary RTCRtpEncodingParameters {
RTCPriorityType networkPriority; // Note: No default

View file

@ -520,6 +520,7 @@ enum RTCSctpTransportState {
readonly attribute RTCPriorityType priority;
readonly attribute RTCDataChannelState readyState;
readonly attribute unsigned long bufferedAmount;
[EnforceRange]
attribute unsigned long bufferedAmountLowThreshold;
attribute EventHandler onopen;
attribute EventHandler onbufferedamountlow;
@ -536,7 +537,9 @@ enum RTCSctpTransportState {
dictionary RTCDataChannelInit {
boolean ordered = true;
[EnforceRange]
unsigned short maxPacketLifeTime;
[EnforceRange]
unsigned short maxRetransmits;
USVString protocol = "";
boolean negotiated = false;

View file

@ -794,3 +794,7 @@ MISSING-LINK: css/filter-effects/*.any.js
# Tests that use WebKit/Blink testing APIs
LAYOUTTESTS APIS: css/css-regions/interactivity/*
LAYOUTTESTS APIS: resources/chromium/generic_sensor_mocks.js
# Gecko additons to remove
CSS-COLLIDING-REF-NAME: css/css-contain/reference/contain-size-fieldset-001-ref.html
CSS-COLLIDING-REF-NAME: css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-size-fieldset-001-ref.html

View file

@ -18,26 +18,16 @@ via the <code>srcObject</code> attribute.</p>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
var vid = document.getElementById("vid");
var t = async_test("Tests that a MediaStream can be assigned to a video element with srcObject", {timeout: 10000});
t.step(function() {
navigator.mediaDevices.getUserMedia({video: true})
.then(t.step_func(function (stream) {
var testOncePlaying = function() {
assert_equals(vid.played.length, 1, "A MediaStream's timeline always consists of a single range");
assert_equals(vid.played.start(0), 0, "A MediaStream's timeline always consists of a single range");
assert_approx_equals(vid.played.end(0), vid.currentTime, 0.0001, "A MediaStream's timeline always consists of a single range");
assert_equals(vid.readyState, vid.HAVE_ENOUGH_DATA, "Upon selecting a media stream, the UA sets readyState to HAVE_ENOUGH_DATA");
assert_equals(vid.duration, Infinity, " A MediaStream does not have a pre-defined duration. ");
var time = vid.currentTime;
'use strict';
const vid = document.getElementById("vid");
assert_approx_equals(vid.currentTime, time, 0.0001, "The UA MUST ignore attempts to set the currentTime attribute");
// TODO add test that duration must be set to currentTime
// when mediastream is destroyed
vid.removeEventListener("timeupdate", testOncePlaying, false);
t.done();
}
vid.addEventListener("timeupdate", t.step_func(testOncePlaying), false);
promise_test(async t => {
const wait = ms => new Promise(r => t.step_timeout(r, ms));
const timeout = (promise, time, msg) =>
Promise.race([promise, wait(time).then(() => Promise.reject(new Error(msg)))]);
const stream = await timeout(navigator.mediaDevices.getUserMedia({video: true}), 10000, "getUserMedia timeout");
t.add_cleanup(() => stream.getTracks().forEach(track => track.stop()));
vid.srcObject = stream;
vid.play();
assert_true(!vid.seeking, "A MediaStream is not seekable");
@ -45,9 +35,28 @@ t.step(function() {
assert_equals(vid.defaultPlaybackRate, 1, "playback rate is always 1");
assert_equals(vid.playbackRate, 1, "playback rate is always 1");
assert_equals(vid.buffered.length, 0, "A MediaStream cannot be preloaded. Therefore, there is no buffered timeranges");
assert_equals(vid.duration, vid.readyState == vid.HAVE_NOTHING ? NaN : Infinity, " A MediaStream does not have a pre-defined duration. ");
}), function(error) {});
});
assert_equals(vid.readyState, vid.HAVE_NOTHING, "readyState is HAVE_NOTHING initially");
assert_equals(vid.duration, NaN, "A MediaStream does not have any duration initially.");
const haveLoadedData = new Promise(r => vid.addEventListener("loadeddata", r, {once: true}));
await new Promise(r => vid.addEventListener("timeupdate", r, {once: true}));
assert_equals(vid.played.length, 1, "A MediaStream's timeline always consists of a single range");
assert_equals(vid.played.start(0), 0, "A MediaStream's timeline always starts at zero");
assert_equals(vid.played.end(0), vid.currentTime, "A MediaStream's end MUST return the last known currentTime, says mediacapture-main");
assert_equals(vid.duration, Infinity, "A MediaStream does not have a pre-defined duration. ");
const time = vid.currentTime;
vid.currentTime = 0;
assert_equals(vid.currentTime, time, "The UA MUST ignore attempts to set the currentTime attribute");
await haveLoadedData;
assert_equals(vid.readyState, vid.HAVE_ENOUGH_DATA, "Upon having loaded a media stream, the UA sets readyState to HAVE_ENOUGH_DATA");
assert_equals(vid.duration, Infinity, "A MediaStream does not have a pre-defined duration.");
// TODO add test that duration must be set to currentTime
// when mediastream is destroyed
}, "Tests that a MediaStream can be assigned to a video element with srcObject");
</script>
</body>
</html>

View file

@ -22,6 +22,7 @@ promise_test(async () => {
try {
self.permissionStatus = await navigator.permissions.query({ name: "geolocation" });
self.permissionStatus = await navigator.permissions.query({ name: "background-fetch"});
} catch (e) {
// Will be surfaced in idlharness.js's test_object below.
}

View file

@ -0,0 +1,15 @@
<!doctype html>
<meta charset=utf-8>
<title>Test Background Fetch Permission.</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id="log"></div>
<script>
promise_test(function(test) {
internals.runtimeFlags.backgroundFetchEnabled = true;
return navigator.permissions.query({name:'background-fetch'}).then(function(result) {
assert_true(result instanceof PermissionStatus);
});
});
</script>

View file

@ -27,7 +27,7 @@ the correct arguments.
## Authoring Tests
Test cases are expressed as `.html` files located within the `tests/unit/` and
`tests/funtional/` sub-directories. Each test should include the
`tests/functional/` sub-directories. Each test should include the
`testharness.js` library with the following markup:
<script src="/resources/testharness.js"></script>

View file

@ -754,7 +754,7 @@ policies and contribution forms [3].
}
if (tests.file_is_test) {
// file is test files never have asynchronous cleanup logic,
// meaning the fully-sycnronous `done` funtion can be used here.
// meaning the fully-sycnronous `done` function can be used here.
tests.tests[0].done();
}
tests.end_wait();

View file

@ -2,7 +2,7 @@ marionette_driver==2.7.0
mozprofile==2.0.0
mozprocess == 0.26
mozcrash == 1.0
mozrunner==7.0.2
mozrunner==7.1.0
mozleak == 0.1
mozinstall==1.16.0
mozdownload==1.24

View file

@ -15,7 +15,7 @@ a dictionary with the fields
"executor_kwargs": String naming a function that takes http server url and
timeout multiplier and returns kwargs to use when creating
the executor class.
"env_options": String naming a funtion of no arguments that returns the
"env_options": String naming a function of no arguments that returns the
arguments passed to the TestEnvironment.
All classes and functions named in the above dict must be imported into the

View file

@ -88,19 +88,16 @@ class TestFileHandler(TestUsingServer):
self.request("/document.txt", headers={"Range":"bytes=%i-%i" % (len(expected), len(expected) + 10)})
self.assertEqual(cm.exception.code, 416)
@pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
def test_sub_config(self):
resp = self.request("/sub.sub.txt")
expected = b"localhost localhost %i" % self.server.port
assert resp.read().rstrip() == expected
@pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
def test_sub_headers(self):
resp = self.request("/sub_headers.sub.txt", headers={"X-Test": "PASS"})
expected = b"PASS"
assert resp.read().rstrip() == expected
@pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
def test_sub_params(self):
resp = self.request("/sub_params.sub.txt", query="test=PASS")
expected = b"PASS"

Some files were not shown because too many files have changed in this diff Show more