Auto merge of #20263 - servo-wpt-sync:wpt_update_09-03-2018, r=jdm

Sync WPT with upstream (09-03-2018)

Automated downstream sync of changes from upstream as of 09-03-2018.
[no-wpt-sync]

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20263)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-03-09 23:39:19 -05:00 committed by GitHub
commit 53d9ca1bcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
193 changed files with 1605 additions and 458 deletions

File diff suppressed because it is too large Load diff

View file

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

View file

@ -2,3 +2,6 @@
[elementsFromPoint on the root document for points in iframe elements]
expected: FAIL
[elementsFromPoint on inner documents]
expected: FAIL

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<title>Animated PNG MIME type (image/apng) is recognized by &lt;source type></title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
function resolveUrl(relativeUrl) {
var a = document.createElement('a');
a.href = relativeUrl;
return a.href;
}
async_test(t => {
window.onload = t.step_func_done(() => {
let image = document.querySelector('img');
let apngSrc = document.querySelector('source');
assert_equals(image.currentSrc, resolveUrl(apngSrc.srcset));
});
});
</script>
<picture>
<source srcset="/images/anim-gr.png" type="image/apng">
<img src="/images/anim-gr.gif" style="visibility: hidden">
</picture>

View file

@ -0,0 +1,59 @@
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title>Tests basic cookie setting functionality</title>
<meta name=help href="https://tools.ietf.org/html/rfc6265#page-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/cookie-http-state-template.js"></script>
</head>
<body>
<div id="log"></div>
<script>
setup({ explicit_timeout: true });
const TEST_CASES = [
{file: "0001", name: "Set cookie."},
{file: "0002", name: "Set cookie with future expiration."},
{file: "0003", name: "Set expired cookie along with valid cookie."},
{file: "0004", name: "Ignore cookie without key."},
{file: "0005", name: "Set cookie with age."},
{file: "0006", name: "Set no cookie with max-age=0."},
{file: "0007", name: "Set cookie with version=1."},
{file: "0008", name: "Set cookie with version=1000."},
{file: "0009", name: "Set cookie with custom value."},
// TODO(fhorschig): Could 0010 break when run on a HTTPS try server?
{file: "0010", name: "Dont accept 'secure' cookies over http."},
{file: "0011", name: "Ignore separators in cookie values."},
{file: "0012", name: "Ignore values with separators and without ';'."},
{file: "0013", name: "Use last value for cookies with identical keys."},
{file: "0014", name: "Keep alphabetic key order."},
{file: "0015", name: "Keep alphabetic single-char key order."},
{file: "0016", name: "Keep non-alphabetic key order."},
{file: "0017", name: "Keep order if comma-separated."},
{file: "0018", name: "Ignore keys after semicolon."},
{file: "0019", name: "Ignore attributes after semicolon."},
{file: "0020", name: "Ignore cookies without key and value."},
{file: "0021", name: "Ignore cookie without key in all 'Set-Cookie'."},
{file: "0022", name: "Set cookie without value in all 'Set-Cookie'."},
{file: "0023", name: "Ignore cookies without '=' in all 'Set-Cookie'."},
{file: "0024", name: "Ignore malformed cookies in all 'Set-Cookie'."},
{file: "0025", name: "Ignore cookies with ';' in all 'Set-Cookie'."},
{file: "0026", name: "Ignore malformed cookies in all 'Set-Cookie' v2."},
{file: "0027", name: "Ignore malformed cookies in all 'Set-Cookie' v3."},
// TODO(fhorschig): Ask about 0028's expectations ... should be empty?
{file: "0028", name: "[INVALID EXPECTATION] Ignore malformed cookies in all 'Set-Cookie' v4."},
];
for (const i in TEST_CASES) {
const t = TEST_CASES[i];
promise_test(createCookieTest(t.file),
t.file + " - " + t.name,
{ timeout: 3000 });
}
</script>
</body>
</html>

View file

@ -0,0 +1,80 @@
const SERVER_LOCATION = "resources";
const SERVER_SCRIPT = SERVER_LOCATION + "/cookie-setter.py";
function stripPrefixAndWhitespace(cookie_text) {
return cookie_text.replace(/^Cookie: /, '').replace(/^\s+|\s+$/g, '');
}
function getLocalResourcesPath() {
return location.pathname.replace(/[^\/]*$/, "") + SERVER_LOCATION;
}
function getAbsoluteServerLocation() {
return getLocalResourcesPath().replace(/resources.*$/,'')+ SERVER_SCRIPT;
}
function expireCookie(name, expiry_date, path) {
name = name || "";
expiry_date = expiry_date || "Thu, 01 Jan 1970 00:00:00 UTC";
path = path || getLocalResourcesPath();
document.cookie = name + "=; expires=" + expiry_date + "; path=" + path + ";";
}
function CookieManager() {
this.initial_cookies = [];
}
CookieManager.prototype.parse = document_cookies => {
this.initial_cookies = [];
document_cookies = document_cookies.replace(/^Cookie: /, '');
if (document_cookies != "") {
this.initial_cookies = document_cookies.split(/\s*;\s*/);
}
}
CookieManager.prototype.diffWith = document_cookies => {
this.actual_cookies = document_cookies;
for (let i in initial_cookies) {
let no_spaces_cookie_regex =
new RegExp(/\s*[\;]*\s/.source + initial_cookies[i]);
this.actual_cookies = actual_cookies.replace(no_spaces_cookie_regex, '');
}
return this.actual_cookies;
}
CookieManager.prototype.resetCookies = () => {
expireCookie(/*name=*/""); // If a cookie without keys was accepted, drop it.
if (this.actual_cookies == "") {
return; // There is nothing to reset here.
}
let cookies_to_delete = this.actual_cookies.split(/\s*;\s*/)
for (let i in cookies_to_delete){
expireCookie(cookies_to_delete[i].replace(/=.*$/, ""));
// Drop cookies with same name that were set to the root path which happens
// for example due to "0010" still failing.
expireCookie(cookies_to_delete[i].replace(/=.*$/, ""),
/*expiry_date=*/null,
/*path=*/'/');
}
}
function createCookieTest(file) {
return t => {
const iframe = document.createElement('iframe');
document.body.appendChild(iframe);
let diff_tool = new CookieManager();
t.add_cleanup(diff_tool.resetCookies);
return new Promise((resolve, reject) => {
diff_tool.parse(document.cookie);
window.addEventListener("message", t.step_func(e => {
assert_true(!!e.data, "Message contains data")
resolve(e.data);
}));
iframe.src = getAbsoluteServerLocation() + "?file=" + file;
}).then((response) => {
let actual_cookies = diff_tool.diffWith(response.cookies);
let expected_cookies = stripPrefixAndWhitespace(response.expectation);
assert_equals(actual_cookies, expected_cookies);
});
}
};

View file

@ -0,0 +1,54 @@
from os import path;
SETUP_FILE_TEMPLATE = "{}-test"
EXPECTATION_FILE_TEMPLATE = "{}-expected"
EXPECTATION_HTML_SCAFFOLD = "iframe-expectation-doc.html.py-str"
DEBUGGING_HTML_SCAFFOLD = "debugging-single-test.html.py-str"
DEFAULT_RESOURCE_DIR = path.join("cookies", "http-state", "resources")
DEFAULT_TEST_DIR = "test-files"
def dump_file(directory, filename):
return open(path.join(directory, filename), "r").read()
class CookieTestResponse(object):
def __init__(self, file, root):
super(CookieTestResponse, self).__init__()
self.__test_file = SETUP_FILE_TEMPLATE.format(file)
self.__expectation_file = EXPECTATION_FILE_TEMPLATE.format(file)
self.__resources_dir = path.join(root, DEFAULT_RESOURCE_DIR)
self.__test_files_dir = path.join(self.__resources_dir, DEFAULT_TEST_DIR)
def cookie_setting_header(self):
return dump_file(self.__test_files_dir, self.__test_file)
def body_with_expectation(self):
html_frame = dump_file(self.__resources_dir, EXPECTATION_HTML_SCAFFOLD)
expected_data = dump_file(self.__test_files_dir, self.__expectation_file);
return html_frame.format(**{'data' : expected_data})
def main(request, response):
if "debug" in request.GET:
response.writer.write_status(200)
response.writer.end_headers()
html_frame = dump_file(path.join(request.doc_root, DEFAULT_RESOURCE_DIR),
DEBUGGING_HTML_SCAFFOLD)
test_file = html_frame % (request.GET['debug'])
response.writer.write_content(test_file)
return;
if not "file" in request.GET:
response.writer.write_status(404)
response.writer.end_headers()
response.writer.write_content("The 'file' parameter is missing!")
return;
cookie_response = CookieTestResponse(request.GET['file'], request.doc_root)
response.writer.write_status(200)
response.writer.write(cookie_response.cookie_setting_header())
response.writer.end_headers()
response.writer.write_content(cookie_response.body_with_expectation())

View file

@ -0,0 +1,21 @@
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title>Debug single test</title>
<meta name=help href="https://tools.ietf.org/html/rfc6265#page-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="cookie-http-state-template.js"></script>
</head>
<body>
<div id="log"></div>
<script>
setup({ explicit_timeout: true });
promise_test(createCookieTest("%s"), "DEBUG", { timeout: 3000 });
</script>
</body>
</html>

View file

@ -0,0 +1,4 @@
window.top.postMessage({
"cookies": document.cookie,
"expectation": document.querySelector('#data').innerText
}, "*");

View file

@ -0,0 +1,11 @@
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title>Cookie Test Expectation Document</title>
</head>
<body>
<div id="data">{data}</div>
<script src="iframe-content-pushing.js"></script>
</body>
</html>

View file

@ -0,0 +1 @@
Cookie: foo=bar

View file

@ -0,0 +1 @@
Set-Cookie: foo=bar

View file

@ -0,0 +1 @@
Cookie: foo=bar

View file

@ -0,0 +1 @@
Set-Cookie: foo=bar; Expires=Fri, 07 Aug 2019 08:04:19 GMT

View file

@ -0,0 +1 @@
Cookie: foo2=bar2

View file

@ -0,0 +1,2 @@
Set-Cookie: foo=bar; Expires=Fri, 07 Aug 2007 08:04:19 GMT
Set-Cookie: foo2=bar2; Expires=Fri, 07 Aug 2027 08:04:19 GMT

View file

@ -0,0 +1 @@
Set-Cookie: foo

View file

@ -0,0 +1 @@
Cookie: foo=bar

View file

@ -0,0 +1 @@
Set-Cookie: foo=bar; max-age=10000;

View file

@ -0,0 +1 @@
Set-Cookie: foo=bar; max-age=0;

View file

@ -0,0 +1 @@
Cookie: foo=bar

View file

@ -0,0 +1 @@
Set-Cookie: foo=bar; version=1;

View file

@ -0,0 +1 @@
Cookie: foo=bar

View file

@ -0,0 +1 @@
Set-Cookie: foo=bar; version=1000;

View file

@ -0,0 +1 @@
Cookie: foo=bar

View file

@ -0,0 +1 @@
Set-Cookie: foo=bar; customvalue=1000;

View file

@ -0,0 +1 @@
Set-Cookie: foo=bar; secure;

View file

@ -0,0 +1 @@
Cookie: foo=bar

View file

@ -0,0 +1 @@
Set-Cookie: foo=bar; customvalue="1000 or more";

View file

@ -0,0 +1 @@
Cookie: foo=bar

View file

@ -0,0 +1 @@
Set-Cookie: foo=bar; customvalue="no trailing semicolon"

View file

@ -0,0 +1 @@
Cookie: foo=qux

View file

@ -0,0 +1,2 @@
Set-Cookie: foo=bar
Set-Cookie: foo=qux

View file

@ -0,0 +1 @@
Cookie: foo1=bar; foo2=qux

View file

@ -0,0 +1,2 @@
Set-Cookie: foo1=bar
Set-Cookie: foo2=qux

View file

@ -0,0 +1 @@
Cookie: a=b; z=y

View file

@ -0,0 +1,2 @@
Set-Cookie: a=b
Set-Cookie: z=y

View file

@ -0,0 +1 @@
Cookie: z=y; a=b

View file

@ -0,0 +1,2 @@
Set-Cookie: z=y
Set-Cookie: a=b

View file

@ -0,0 +1,2 @@
Cookie: z=y, a=b

View file

@ -0,0 +1 @@
Set-Cookie: z=y, a=b

View file

@ -0,0 +1 @@
Set-Cookie: z=y; foo=bar, a=b

View file

@ -0,0 +1 @@
Set-Cookie: foo=b;max-age=3600, c=d;path=/

View file

@ -0,0 +1 @@
Cookie: a=b; c=d

View file

@ -0,0 +1,3 @@
Set-Cookie: a=b
Set-Cookie: =
Set-Cookie: c=d

View file

@ -0,0 +1 @@
Cookie: a=b; c=d

View file

@ -0,0 +1,3 @@
Set-Cookie: a=b
Set-Cookie: =x
Set-Cookie: c=d

View file

@ -0,0 +1 @@
Cookie: a=b; x=; c=d

View file

@ -0,0 +1,3 @@
Set-Cookie: a=b
Set-Cookie: x=
Set-Cookie: c=d

View file

@ -0,0 +1,2 @@
Set-Cookie: foo
Set-Cookie:

View file

@ -0,0 +1,2 @@
Set-Cookie: foo
Set-Cookie: =

View file

@ -0,0 +1,2 @@
Set-Cookie: foo
Set-Cookie: ; bar

View file

@ -0,0 +1,2 @@
Set-Cookie: foo
Set-Cookie:

View file

@ -0,0 +1,2 @@
Set-Cookie: foo
Set-Cookie: bar

View file

@ -0,0 +1,2 @@
Set-Cookie: foo
Set-Cookie:

View file

@ -0,0 +1,2 @@
Set-Cookie: foo
Set-Cookie:

View file

@ -0,0 +1,30 @@
<!DOCTYPE html>
<title>Container height calculation with fractional line height and fractional child height</title>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/CSS22/visudet.html#line-height" title="10.8 Line height calculations: the 'line-height' and 'vertical-align' properties">
<link rel="match" href="../../reference/nothing.html">
<style>
.container { float:left; overflow:auto; width:50px; }
.container > span { display:inline-block; width:10px; }
</style>
<p>There should be nothing below.</p>
<!-- None of these should not trigger a vertical scrollbar, because the height
of the overflow:auto container is auto, so it should make room for
whatever's inside. -->
<div class="container" style="line-height:19.75px;">
<span style="height:100.25px;"></span>
</div>
<div class="container" style="line-height:19.75px;">
<span style="height:100.75px;"></span>
</div>
<div class="container" style="line-height:19.25px;">
<span style="height:100.25px;"></span>
</div>
<div class="container" style="line-height:19.25px;">
<span style="height:100.75px;"></span>
</div>

View file

@ -0,0 +1,2 @@
@dholbert
@emilio

View file

@ -0,0 +1,53 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://drafts.csswg.org/css-tables/#width-distribution" />
<style>
div {
display: inline-block;
width: 20px;
height: 20px;
background: blue;
}
</style>
Passes if each row has two blue squares.
<table>
<tr>
<td class='target' style="padding: 0 0.8px"><div></div> <div></div></td>
<td style="padding: 0 0.8px; width: 30px"></td>
</tr>
</table>
<table>
<tr>
<td class='target' style="padding: 0 1px"><div></div> <div></div></td>
<td style="padding: 0 1px; width: 30px"></td>
</tr>
</table>
<table>
<tr>
<td class='target' style="padding: 0 1.3px"><div></div> <div></div></td>
<td style="padding: 0 1.3px; width: 30px"></td>
</tr>
</table>
<table>
<tr>
<td class='target' style="padding: 0 1.5px"><div></div> <div></div></td>
<td style="padding: 0 1.5px; width: 30px"></td>
</tr>
</table>
<table>
<tr>
<td class='target' style="padding: 0 1.7px"><div></div> <div></div></td>
<td style="padding: 0 1.7px; width: 30px"></td>
</tr>
</table>
<script>
test(() => {
var targets = document.getElementsByClassName('target');
for (var i = 0; i < targets.length; ++i) {
var divs = targets[i].getElementsByTagName('div');
assert_equals(divs.length, 2);
assert_equals(divs[0].offsetTop, divs[1].offsetTop, 'Contents of td.target[' + i + '] should not wrap');
}
});
</script>

View file

@ -0,0 +1,54 @@
<!doctype html>
<meta charset="utf-8">
<title>CSSUnparsedValue Indexed Getter and Setter</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssunparsedvalue-__getter__-index-index">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssunparsedvalue-__setter__-index-val-val">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
test(() => {
const result = new CSSUnparsedValue(['foo', 'bar']);
assert_equals(result[3], undefined, 'result from out of range index');
assert_equals(result[-1], undefined, 'result from negative index');
}, 'Getting invalid index in CSSUnparsedValue returns undefined');
test(() => {
let result = new CSSUnparsedValue([new CSSVariableReferenceValue('--foo')]);
result[0] = 'A';
assert_equals(result[0], 'A', 'fragment reflects new value');
}, 'Can update fragment in CSSUnparsedValue to a String');
test(() => {
let result = new CSSUnparsedValue(['foo']);
result[0] = new CSSVariableReferenceValue('--A');
assert_style_value_equals(result[0], new CSSVariableReferenceValue('--A'),
'fragment reflects new value');
}, 'Can update fragment in CSSUnparsedValue to a CSSVariableReference');
test(() => {
let result = new CSSUnparsedValue([]);
result[0] = 'foo';
assert_equals(result[0], 'foo', 'new fragment is appended');
}, 'Setting one past the last fragment in a CSSUnparsedValue to a String ' +
'appends the new fragment');
test(() => {
let result = new CSSUnparsedValue([' ']);
result[1] = new CSSVariableReferenceValue('--A');
assert_style_value_equals(result[1], new CSSVariableReferenceValue('--A'),
'new fragment is appended');
}, 'Setting one past the last fragment in a CSSUnparsedValue to a ' +
'CSSVariableReferenceValue appends the new fragment');
test(() => {
let result = new CSSUnparsedValue(['foo', 'bar']);
assert_throws(new RangeError(), () => result[3] = 'foo');
assert_equals(result[3], undefined, 'fragment does not change');
}, 'Setting out of range index in CSSUnparsedValue throws RangeError');
</script>

View file

@ -0,0 +1,24 @@
<!doctype html>
<meta charset="utf-8">
<title>CSSUnparsedValue Iterable Declaration</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssunparsedvalue">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
test(() => {
const result = new CSSUnparsedValue([]);
assert_array_equals([...result], [], 'result of iterating');
}, 'Iterating over an empty CSSUnparsedValue produces nothing');
test(() => {
const args = [' ', new CSSVariableReferenceValue('--A')];
const result = new CSSUnparsedValue(args);
assert_style_value_array_equals([...result], args, 'result of iterating');
}, 'Iterating over a CSSUnparsedValue produces all fragments');
</script>

View file

@ -0,0 +1,47 @@
<!doctype html>
<meta charset="utf-8">
<title>CSSUnparsedValue.length</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssunparsedvalue-length">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
test(() => {
const result = new CSSUnparsedValue([]);
assert_equals(result.length, 0, 'length');
}, 'Length of CSSUnparsedValue with no fragments is zero');
test(() => {
const result = new CSSUnparsedValue([
' ', new CSSVariableReferenceValue('--A')
]);
assert_equals(result.length, 2, 'length');
}, 'Length of CSSUnparsedValue with multiple fragments is the number of ' +
'fragments');
test(() => {
let result = new CSSUnparsedValue([' ']);
assert_equals(result.length, 1, 'initial length');
result[1] = new CSSVariableReferenceValue('--A');
assert_equals(result.length, 2, 'length after appending once');
result[2] = 'lemon';
assert_equals(result.length, 3, 'length after appending twice');
}, 'Length of CSSUnparsedValue updates when fragments are appended');
test(() => {
let result = new CSSUnparsedValue([' ']);
assert_equals(result.length, 1, 'initial length');
result[0] = new CSSVariableReferenceValue('--A');
assert_equals(result.length, 1, 'length after modification');
result[0] = 'lemon';
assert_equals(result.length, 1, 'length after modification');
}, 'Length of CSSUnparsedValue does not change when fragments are modified');
</script>

View file

@ -1,32 +1,31 @@
<!doctype html>
<meta charset="utf-8">
<title>CSSUnparsedValue</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#unparsedvalue-objects">
<meta name="assert" content="Test CSSUnparsedValue constructor and members">
<title>CSSUnparsedValue Constructor</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssunparsedvalue-cssunparsedvalue">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<body>
<div id="log">
<div id="log"></div>
<script>
'use strict';
const gTestArguments = [
{
description: 'no arguments',
args: [],
fragments: [],
},
{
description: 'an empty string',
args: [''],
description: 'a single empty string',
fragments: [''],
},
{
description: 'a CSSVariableReferenceValue',
args: [new CSSVariableReferenceValue('--foo')],
description: 'a single CSSVariableReferenceValue',
fragments: [new CSSVariableReferenceValue('--foo')],
},
{
description: 'mix of strings and CSSVariableReferenceValues',
args: [
description: 'a mix of strings and CSSVariableReferenceValues',
fragments: [
'foo',
'bar',
new CSSVariableReferenceValue('--A'),
@ -36,56 +35,13 @@ const gTestArguments = [
},
];
for (const {args, description} of gTestArguments) {
for (const args of gTestArguments) {
test(() => {
const result = new CSSUnparsedValue(args);
assert_not_equals(result, null,
'A CSSUnparsedValue should be created');
assert_array_equals(result, args,
'Content of CSSUnparsedValue should be same as the arguments ' +
'passed in the constructor');
}, 'CSSUnparsedValue can be constructed from ' + description);
const result = new CSSUnparsedValue(args.fragments);
assert_not_equals(result, null, 'a CSSUnparsedValue is created');
assert_style_value_array_equals(result, args.fragments,
'fragments are same as given by constructor');
}, `CSSUnparsedValue can be constructed from ${args.description}`);
}
test(() => {
let result = new CSSUnparsedValue([new CSSVariableReferenceValue('--foo')]);
result[0] = 'A';
assert_equals(result[0], 'A', 'Item should be updated to new value');
}, 'Can update item in CSSUnparsedValue to a string');
test(() => {
let result = new CSSUnparsedValue(['foo']);
result[0] = new CSSVariableReferenceValue('--A');
assert_style_value_equals(result[0], new CSSVariableReferenceValue('--A'),
'Item should be updated to new value');
}, 'Can update item in CSSUnparsedValue to a variable reference');
test(() => {
let result = new CSSUnparsedValue([]);
result[0] = new CSSVariableReferenceValue('--A');
assert_equals(result.length, 1,
'Length of CSSUnparsedValue should have increased');
assert_style_value_equals(result[0], new CSSVariableReferenceValue('--A'),
'New item should be appended');
result[1] = 'foo';
assert_equals(result.length, 2,
'Length of CSSUnparsedValue should have increased');
assert_equals(result[1], 'foo', 'New item should be appended');
}, 'Can append items to CSSUnparsedValue');
test(() => {
const result = new CSSUnparsedValue(['foo', 'bar']);
assert_equals(result[3], undefined);
}, 'Getting invalid index in CSSUnparsedValue returns undefined');
test(() => {
let result = new CSSUnparsedValue(['foo', 'bar']);
assert_throws(new RangeError(), () => result[3] = 'foo');
}, 'Setting invalid index in CSSUnparsedValue throws RangeError');
</script>

View file

@ -20,22 +20,4 @@ test(() => {
}, 'Constructing a CSSVariableReferenceValue with an invalid variable name ' +
'throws SyntaxError');
test(() => {
let result = new CSSVariableReferenceValue('--foo');
assert_throws(new TypeError(), () => result.variable = '');
assert_equals(result.variable, '--foo',
'Variable member should not have changed');
}, 'Updating CSSVariableReferenceValue.variable to an empty variable name ' +
'throws TypeError');
test(() => {
let result = new CSSVariableReferenceValue('--foo');
assert_throws(new TypeError(), () => result.variable = 'bar');
assert_equals(result.variable, '--foo',
'Variable member should not have changed');
}, 'Updating CSSVariableReferenceValue.variable to an invalid variable name ' +
'throws TypeError');
</script>

View file

@ -0,0 +1,33 @@
<!doctype html>
<meta charset="utf-8">
<title>CSSVariableReferenceValue.variable</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssvariablereferencevalue-variable">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
test(() => {
let result = new CSSVariableReferenceValue('--foo');
result.variable = '--bar';
assert_equals(result.variable, '--bar', 'variable reflects new value');
}, 'CSSVariableReferenceValue.variable can updated to a valid custom ' +
'property name');
test(() => {
let result = new CSSVariableReferenceValue('--foo');
assert_throws(new TypeError(), () => result.variable = '');
assert_equals(result.variable, '--foo', 'variable does not change');
}, 'Updating CSSVariableReferenceValue.variable to the empty string ' +
'throws TypeError');
test(() => {
let result = new CSSVariableReferenceValue('--foo');
assert_throws(new TypeError(), () => result.variable = 'bar');
assert_equals(result.variable, '--foo', 'variable does not change');
}, 'Updating CSSVariableReferenceValue.variable to an invalid custom ' +
'property name throws TypeError');
</script>

View file

@ -1,55 +1,40 @@
<!doctype html>
<meta charset="utf-8">
<title>CSSVariableReferenceValue tests</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssvariablereferencevalue">
<meta name="assert" content="Test CSSVariableReferenceValue constructor and attributes" />
<title>CSSVariableReferenceValue Constructor</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssvariablereferencevalue-cssvariablereferencevalue">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
test(() => {
const result = new CSSVariableReferenceValue('--foo');
assert_not_equals(result, null,
'A CSSVariableReferenceValue should be created');
assert_not_equals(result, null, 'a CSSVariableReferenceValue is created');
assert_equals(result.variable, '--foo',
'Variable member should be same as passed in the constructor');
assert_equals(result.fallback, null,
'Fallback member should be null');
'variable is same as passed by constructor');
assert_equals(result.fallback, null, 'fallback');
}, 'CSSVariableReferenceValue can be constructed with no fallback');
test(() => {
const result = new CSSVariableReferenceValue('--foo', null);
assert_not_equals(result, null,
'A CSSVariableReferenceValue should be created');
assert_not_equals(result, null, 'a CSSVariableReferenceValue is created');
assert_equals(result.variable, '--foo',
'Variable member should be same as passed in the constructor');
assert_equals(result.fallback, null, 'Fallback member should be null');
'variable is same as passed by constructor');
assert_equals(result.fallback, null, 'fallback');
}, 'CSSVariableReferenceValue can be constructed with null fallback');
test(() => {
const result = new CSSVariableReferenceValue('--foo',
new CSSUnparsedValue(['lemon']));
assert_not_equals(result, null,
'A CSSVariableReferenceValue should be created');
assert_not_equals(result, null, 'a CSSVariableReferenceValue is created');
assert_equals(result.variable, '--foo',
'Variable member should be same as passed in the constructor');
assert_not_equals(result.fallback, null,
'Fallback member should not be null');
'variable is same as passed by constructor');
assert_not_equals(result.fallback, null, 'fallback');
assert_style_value_equals(result.fallback, new CSSUnparsedValue(['lemon']),
'Fallback member should be as same as passed in the constructor');
'fallback is same as passed by constructor');
}, 'CSSVariableReferenceValue can be constructed with valid fallback');
test(() => {
let result = new CSSVariableReferenceValue('--foo');
result.variable = '--bar';
assert_equals(result.variable, '--bar',
'Variable member should be updated to new value');
}, 'CSSVariableReferenceValue.variable can updated to a valid variable name');
</script>

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: sideways-lr - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-043-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: 'float: right' and 'sideways-lr' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-002-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: 'float: right' and 'sideways-lr' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-002-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: position absolute and 'sideways-lr' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: inline-block and 'sideways-lr' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: inline-block and 'sideways-lr' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: inline-block and 'sideways-lr' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: table-cell and 'sideways-lr' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: table-caption and 'sideways-lr' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: list and sideways-lr - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-043-ref.xht" />
<meta content="ahem image" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: sideways-lr - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-043-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: writing mode (sideways-lr) of document - horizontal position of first block</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#block-formatting" title="9.4.1 Block formatting contexts" />
<link rel="match" href="block-flow-direction-066-ref.xht" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: sideways-rl - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-002-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: 'float: left' and 'sideways-rl' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: 'float: left' and 'sideways-rl' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: position absolute and 'sideways-rl' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: inline-block and 'sideways-rl' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: inline-block and 'sideways-rl' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: inline-block and 'sideways-rl' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: table-cell and 'sideways-rl' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: table-caption and 'sideways-rl' - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-001-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: list and sideways-rl - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-002-ref.xht" />
<meta content="ahem image" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: sideways-rl - block flow direction of block-level boxes</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="match" href="block-flow-direction-002-ref.xht" />
<meta content="ahem" name="flags" />

View file

@ -7,7 +7,7 @@
<title>CSS Writing Modes Test: writing mode (sideways-rl) of document - horizontal position of first block</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" />
<link rel="help" href="http://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#block-formatting" title="9.4.1 Block formatting contexts" />
<link rel="match" href="block-flow-direction-025-ref.xht" />

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