Auto merge of #20270 - servo-wpt-sync:wpt_update_10-03-2018, r=jdm

Sync WPT with upstream (10-03-2018)

Automated downstream sync of changes from upstream as of 10-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/20270)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-03-10 23:15:55 -05:00 committed by GitHub
commit e3c78808c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 265 additions and 38 deletions

View file

@ -318167,6 +318167,24 @@
{} {}
] ]
], ],
"css/cssom/computed-style-002.html": [
[
"/css/cssom/computed-style-002.html",
{}
]
],
"css/cssom/computed-style-003.html": [
[
"/css/cssom/computed-style-003.html",
{}
]
],
"css/cssom/computed-style-004.html": [
[
"/css/cssom/computed-style-004.html",
{}
]
],
"css/cssom/css-style-attr-decl-block.html": [ "css/cssom/css-style-attr-decl-block.html": [
[ [
"/css/cssom/css-style-attr-decl-block.html", "/css/cssom/css-style-attr-decl-block.html",
@ -390463,7 +390481,7 @@
"support" "support"
], ],
"./README.md": [ "./README.md": [
"60e060b31a4f9f43f09c1b2a360902e4817014e1", "23780fdf7eea63c82965c8d5d4d847c0b9752c7e",
"support" "support"
], ],
"./check_stability.ini": [ "./check_stability.ini": [
@ -531798,6 +531816,18 @@
"0331a648e6b0d56f0e7365f1ff7d991ea77ce3e4", "0331a648e6b0d56f0e7365f1ff7d991ea77ce3e4",
"testharness" "testharness"
], ],
"css/cssom/computed-style-002.html": [
"d6579788bcfaf1d4c09324ba877a26ff95d6965d",
"testharness"
],
"css/cssom/computed-style-003.html": [
"aece414b89e0fdea1030e4ca9011ab7d22f1b275",
"testharness"
],
"css/cssom/computed-style-004.html": [
"55010cf90dc7fc2ef8ec6cbd13d1ec947a823aed",
"testharness"
],
"css/cssom/css-style-attr-decl-block.html": [ "css/cssom/css-style-attr-decl-block.html": [
"1d68a3fd1560308c0d2f3478864d84f4361e4ab9", "1d68a3fd1560308c0d2f3478864d84f4361e4ab9",
"testharness" "testharness"
@ -544291,7 +544321,7 @@
"support" "support"
], ],
"docs/introduction.md": [ "docs/introduction.md": [
"e7d0165e5c6a8604d25f32032b2374bff6e59e02", "8b5def1fe676bd3c47a54933d08f8e43b634a31d",
"support" "support"
], ],
"dom/OWNERS": [ "dom/OWNERS": [
@ -570831,7 +570861,7 @@
"support" "support"
], ],
"interfaces/IndexedDB.idl": [ "interfaces/IndexedDB.idl": [
"f367517cad717e2066ad8179df9ba5aa3b402c97", "3df484f3207920891c278bd99ec22e4029aa039f",
"support" "support"
], ],
"interfaces/OWNERS": [ "interfaces/OWNERS": [
@ -570839,7 +570869,7 @@
"support" "support"
], ],
"interfaces/WebCryptoAPI.idl": [ "interfaces/WebCryptoAPI.idl": [
"87b02fc82a1b204ac59a51932e58f9369b4a77c6", "1fa169a6badb1c21608f1e1a68075939e913603f",
"support" "support"
], ],
"interfaces/accelerometer.idl": [ "interfaces/accelerometer.idl": [
@ -572407,7 +572437,7 @@
"testharness" "testharness"
], ],
"mediacapture-streams/MediaDevices-enumerateDevices.https.html": [ "mediacapture-streams/MediaDevices-enumerateDevices.https.html": [
"98de0987027ceccd4e6164ea6afbc08d5d70c35d", "1fb376d675c685d5de76fef0e840e440de3e3268",
"testharness" "testharness"
], ],
"mediacapture-streams/MediaDevices-getUserMedia.https.html": [ "mediacapture-streams/MediaDevices-getUserMedia.https.html": [
@ -601075,7 +601105,7 @@
"testharness" "testharness"
], ],
"webmessaging/event.origin.sub.htm": [ "webmessaging/event.origin.sub.htm": [
"ef14b99d3eac8c17623f3ba531605fa2abda99d7", "591a0bcef635d7158fe9c04fabfeea030dce9c62",
"testharness" "testharness"
], ],
"webmessaging/event.ports.sub.htm": [ "webmessaging/event.ports.sub.htm": [
@ -601151,7 +601181,7 @@
"testharness" "testharness"
], ],
"webmessaging/postMessage_asterisk_xorigin.sub.htm": [ "webmessaging/postMessage_asterisk_xorigin.sub.htm": [
"d322154c452e58241091b2e5fc995d0322dfc4dd", "0d77e50f5ccdec34f98694ddcc266a1834250266",
"testharness" "testharness"
], ],
"webmessaging/postMessage_dup_transfer_objects.htm": [ "webmessaging/postMessage_dup_transfer_objects.htm": [

View file

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

View file

@ -0,0 +1,4 @@
[computed-style-002.html]
[Check that a percent width in an iframe is resolved against iframe width for getComputedStyle.]
expected: FAIL

View file

@ -0,0 +1,4 @@
[computed-style-003.html]
[CSS Test: getComputedStyle - resolved width in iframe dynamic display]
expected: FAIL

View file

@ -0,0 +1,4 @@
[computed-style-004.html]
[CSS Test: getComputedStyle - resolved width in nested iframes dynamic width]
expected: FAIL

View file

@ -0,0 +1,2 @@
[hide_after_load.html]
expected: TIMEOUT

View file

@ -69,22 +69,31 @@ python wpt serve
``` ```
This will start HTTP servers on two ports and a websockets server on This will start HTTP servers on two ports and a websockets server on
one port. By default one web server starts on port 8000 and the other one port. By default the web servers start on ports 8000 and 8443 and the other
ports are randomly-chosen free ports. Tests must be loaded from the ports are randomly-chosen free ports. Tests must be loaded from the
*first* HTTP server in the output. To change the ports, copy the *first* HTTP server in the output. To change the ports, copy the
`config.default.json` file to `config.json` and edit the new file, `config.default.json` file to `config.json` and edit the new file,
replacing the part that reads: replacing the part that reads:
``` ```
"http": [8000, "auto"] "http": [8000, "auto"],
"https":[8443]
``` ```
to some port of your choice e.g. to some ports of your choice e.g.
``` ```
"http": [1234, "auto"] "http": [1234, "auto"],
"https":[5678]
``` ```
After your `hosts` file is configured, the servers will be locally accessible at:
http://web-platform.test:8000/<br>
https://web-platform.test:8443/ *
\**See [Trusting Root CA](#trusting-root-ca)*
Running Tests Automatically Running Tests Automatically
--------------------------- ---------------------------
@ -222,7 +231,7 @@ Certificates
============ ============
By default pregenerated certificates for the web-platform.test domain By default pregenerated certificates for the web-platform.test domain
are provided in the repository. If you wish to generate new are provided in [`tools/certs`](tools/certs). If you wish to generate new
certificates for any reason it's possible to use OpenSSL when starting certificates for any reason it's possible to use OpenSSL when starting
the server, or starting a test run, by providing the the server, or starting a test run, by providing the
`--ssl-type=openssl` argument to the `wpt serve` or `wpt run` `--ssl-type=openssl` argument to the `wpt serve` or `wpt run`
@ -259,6 +268,11 @@ Then edit the JSON so that the key `ssl/openssl/base_conf_path` has a
value that is the path to the OpenSSL config file (typically this value that is the path to the OpenSSL config file (typically this
will be `C:\\OpenSSL-Win32\\bin\\openssl.cfg`). will be `C:\\OpenSSL-Win32\\bin\\openssl.cfg`).
### Trusting Root CA
To prevent browser SSL warnings when running HTTPS tests locally, the
web-platform-tests Root CA file `rootca.pem` in [tools/certs](tools/certs)
must be added as a trusted certificate in your OS/browser.
Publication Publication
=========== ===========

View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<title>CSS Test: getComputedStyle - resolved width in iframe</title>
<link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org" />
<link rel="help" href="https://drafts.csswg.org/cssom/#resolved-values" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe id="frm" width="100"></iframe>
<script>
test(() => {
const frmDoc = frm.contentWindow.document;
frmDoc.open();
frmDoc.write('<body style="margin:0"><div style="width:100%"></div>');
frmDoc.close();
assert_equals(frm.contentWindow.getComputedStyle(frmDoc.querySelector("div")).width, "100px");
}, "Check that a percent width in an iframe is resolved against iframe width for getComputedStyle.");
</script>

View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<title>CSS Test: getComputedStyle - resolved width in iframe dynamic display</title>
<link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org" />
<link rel="help" href="https://drafts.csswg.org/cssom/#resolved-values" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe id="frm" width="100" style="display:none"></iframe>
<script>
const frmDoc = frm.contentWindow.document;
frmDoc.open();
frmDoc.write('<body style="margin:0"><div style="width:100%"></div>');
frmDoc.close();
document.body.offsetWidth; // Make sure we layout the top document.
test(() => {
frm.style.display = "inline";
assert_equals(frm.contentWindow.getComputedStyle(frmDoc.querySelector("div")).width, "100px");
}, "Check that a percent width in an iframe is the resolved width when the iframe is displayed.");
</script>

View file

@ -0,0 +1,29 @@
<!DOCTYPE html>
<title>CSS Test: getComputedStyle - resolved width in nested iframes dynamic width</title>
<link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org" />
<link rel="help" href="https://drafts.csswg.org/cssom/#resolved-values" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe id="outer" width="100" scrolling="no" frameborder="0"></iframe>
<script>
const outerDoc = outer.contentWindow.document;
outerDoc.open();
outerDoc.write('<body style="margin:0"><iframe id="inner" scrolling="no" frameborder="0" style="width:100%"></iframe>');
outerDoc.close();
const innerWindow = outerDoc.querySelector("#inner").contentWindow;
const innerDoc = innerWindow.document;
innerDoc.open();
innerDoc.write('<body style="margin:0"><div style="width:100%"></div>');
innerDoc.close();
innerDoc.body.offsetWidth; // Make sure we layout the top document.
test(() => {
assert_equals(innerWindow.getComputedStyle(innerDoc.querySelector("div")).width, "100px");
}, "Check that the initial width is 100px.");
test(() => {
outer.setAttribute("width", "200");
assert_equals(innerWindow.getComputedStyle(innerDoc.querySelector("div")).width, "200px");
}, "Check that the resolved width of the inner div is affected by changing the width of outer iframe.");
</script>

View file

@ -128,22 +128,31 @@ The test environment can then be started using
./wpt serve ./wpt serve
This will start HTTP servers on two ports and a websockets server on This will start HTTP servers on two ports and a websockets server on
one port. By default one web server starts on port 8000 and the other one port. By default the web servers start on ports 8000 and 8443 and the other
ports are randomly-chosen free ports. Tests must be loaded from the ports are randomly-chosen free ports. Tests must be loaded from the
*first* HTTP server in the output. To change the ports, copy the *first* HTTP server in the output. To change the ports, copy the
`config.default.json` file to `config.json` and edit the new file, `config.default.json` file to `config.json` and edit the new file,
replacing the part that reads: replacing the part that reads:
``` ```
"http": [8000, "auto"] "http": [8000, "auto"],
"https":[8443]
``` ```
to some port of your choice e.g. to some ports of your choice e.g.
``` ```
"http": [1234, "auto"] "http": [1234, "auto"],
"https":[5678]
``` ```
After your `hosts` file is configured, the servers will be locally accessible at:
http://web-platform.test:8000/<br>
https://web-platform.test:8443/ *
\**See [Trusting Root CA](README.md#trusting-root-ca)*
## Running tests automatically ## Running tests automatically
The `wpt run` command provides a frontend for running tests automatically The `wpt run` command provides a frontend for running tests automatically

View file

@ -42,7 +42,7 @@ partial interface WindowOrWorkerGlobalScope {
[Exposed=(Window,Worker)] [Exposed=(Window,Worker)]
interface IDBFactory { interface IDBFactory {
IDBOpenDBRequest open(DOMString name, IDBOpenDBRequest open(DOMString name,
[EnforceRange] optional unsigned long long version); optional [EnforceRange] unsigned long long version);
IDBOpenDBRequest deleteDatabase(DOMString name); IDBOpenDBRequest deleteDatabase(DOMString name);
short cmp(any first, any second); short cmp(any first, any second);

View file

@ -131,7 +131,7 @@ dictionary CryptoKeyPair {
dictionary RsaKeyGenParams : Algorithm { dictionary RsaKeyGenParams : Algorithm {
// The length, in bits, of the RSA modulus // The length, in bits, of the RSA modulus
[EnforceRange] required unsigned long modulusLength; required [EnforceRange] unsigned long modulusLength;
// The RSA public exponent // The RSA public exponent
required BigInteger publicExponent; required BigInteger publicExponent;
}; };

View file

@ -16,28 +16,30 @@
<script> <script>
"use strict"; "use strict";
//NOTE ALEX: for completion, a test for ondevicechange event is missing. //NOTE ALEX: for completion, a test for ondevicechange event is missing.
test(function () { promise_test(function() {
assert_true(undefined !== navigator.mediaDevices.enumerateDevices, "navigator.mediaDevices.enumerateDevices exists"); assert_true(undefined !== navigator.mediaDevices.enumerateDevices, "navigator.mediaDevices.enumerateDevices exists");
var p = navigator.mediaDevices.enumerateDevices() return navigator.mediaDevices.enumerateDevices().then(function(list) {
p.then(function(list){
for (let mediainfo of list) { for (let mediainfo of list) {
assert_true(undefined !== mediainfo.deviceId, "mediaInfo's deviceId should exist."); assert_true(undefined !== mediainfo.deviceId, "mediaInfo's deviceId should exist.");
assert_true(undefined !== mediainfo.kind, "mediaInfo's kind should exist."); assert_true(undefined !== mediainfo.kind, "mediaInfo's kind should exist.");
assert_true(undefined !== mediainfo.label, "mediaInfo's label should exist."); assert_true(undefined !== mediainfo.label, "mediaInfo's label should exist.");
assert_true(undefined !== mediainfo.groupId, "mediaInfo's groupId should exist."); assert_true(undefined !== mediainfo.groupId, "mediaInfo's groupId should exist.");
// TODO the values of some of those fields should be empty string by default if no permission has been requested. // TODO the values of some of those fields should be empty string by default if no permission has been requested.
if ( mediainfo.kind == "audioinput" || if ( mediainfo.kind == "audioinput" || mediainfo.kind == "videoinput") {
mediainfo.kind == "videoinput") {
assert_true(mediainfo instanceof InputDeviceInfo); assert_true(mediainfo instanceof InputDeviceInfo);
var capabilities = mediainfo.getCapabilities();
assert_equals(typeof capabilities, "object", "capabilities must be an object.");
assert_equals(typeof capabilities.deviceId, "string", "deviceId must be a string.");
assert_equals(typeof capabilities.groupId, "string", "groupId must be a string.");
if (mediainfo.kind == "audioinput") {
assert_equals(typeof capabilities.echoCancellation, "object", "echoCancellation must be an object.");
}
} else if ( mediainfo.kind == "audiooutput" ) { } else if ( mediainfo.kind == "audiooutput" ) {
assert_true(mediainfo instanceof MediaDeviceInfo); assert_true(mediainfo instanceof MediaDeviceInfo);
} else { } else {
assert_unreached("mediainfo.kind should be one of 'audioinput', 'videoinput', or 'audiooutput'.") assert_unreached("mediainfo.kind should be one of 'audioinput', 'videoinput', or 'audiooutput'.")
} }
} }
})
p.catch(function(err){
assert_unreached("A call to enumerateDevices() should never fail.");
}); });
}, "mediaDevices.enumerateDevices() is present and working on navigator"); }, "mediaDevices.enumerateDevices() is present and working on navigator");
</script> </script>

View file

@ -190,6 +190,61 @@
encoder.skip(1); encoder.skip(1);
encoder.skip(1); encoder.skip(1);
}; };
function ServiceDataMap(values) {
this.initDefaults_();
this.initFields_(values);
}
ServiceDataMap.prototype.initDefaults_ = function() {
this.serviceData = null;
};
ServiceDataMap.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
ServiceDataMap.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 16}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate ServiceDataMap.serviceData
err = messageValidator.validateMapPointer(offset + codec.kStructHeaderSize + 0, false, codec.String, new codec.ArrayOf(codec.Uint8), false);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
ServiceDataMap.encodedSize = codec.kStructHeaderSize + 8;
ServiceDataMap.decode = function(decoder) {
var packed;
var val = new ServiceDataMap();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.serviceData = decoder.decodeMapPointer(codec.String, new codec.ArrayOf(codec.Uint8));
return val;
};
ServiceDataMap.encode = function(encoder, val) {
var packed;
encoder.writeUint32(ServiceDataMap.encodedSize);
encoder.writeUint32(0);
encoder.encodeMapPointer(codec.String, new codec.ArrayOf(codec.Uint8), val.serviceData);
};
function ScanRecord(values) { function ScanRecord(values) {
this.initDefaults_(); this.initDefaults_();
this.initFields_(values); this.initFields_(values);
@ -202,6 +257,7 @@
this.appearance = null; this.appearance = null;
this.txPower = null; this.txPower = null;
this.manufacturerData = null; this.manufacturerData = null;
this.serviceData = null;
}; };
ScanRecord.prototype.initFields_ = function(fields) { ScanRecord.prototype.initFields_ = function(fields) {
for(var field in fields) { for(var field in fields) {
@ -217,7 +273,7 @@
return err; return err;
var kVersionSizes = [ var kVersionSizes = [
{version: 0, numBytes: 48} {version: 0, numBytes: 56}
]; ];
err = messageValidator.validateStructVersion(offset, kVersionSizes); err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE) if (err !== validator.validationError.NONE)
@ -253,10 +309,16 @@
if (err !== validator.validationError.NONE) if (err !== validator.validationError.NONE)
return err; return err;
// validate ScanRecord.serviceData
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 40, ServiceDataMap, true);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE; return validator.validationError.NONE;
}; };
ScanRecord.encodedSize = codec.kStructHeaderSize + 40; ScanRecord.encodedSize = codec.kStructHeaderSize + 48;
ScanRecord.decode = function(decoder) { ScanRecord.decode = function(decoder) {
var packed; var packed;
@ -268,6 +330,7 @@
val.appearance = decoder.decodeStructPointer(Appearance); val.appearance = decoder.decodeStructPointer(Appearance);
val.txPower = decoder.decodeStructPointer(Power); val.txPower = decoder.decodeStructPointer(Power);
val.manufacturerData = decoder.decodeMapPointer(codec.Uint8, new codec.ArrayOf(codec.Uint8)); val.manufacturerData = decoder.decodeMapPointer(codec.Uint8, new codec.ArrayOf(codec.Uint8));
val.serviceData = decoder.decodeStructPointer(ServiceDataMap);
return val; return val;
}; };
@ -280,6 +343,7 @@
encoder.encodeStructPointer(Appearance, val.appearance); encoder.encodeStructPointer(Appearance, val.appearance);
encoder.encodeStructPointer(Power, val.txPower); encoder.encodeStructPointer(Power, val.txPower);
encoder.encodeMapPointer(codec.Uint8, new codec.ArrayOf(codec.Uint8), val.manufacturerData); encoder.encodeMapPointer(codec.Uint8, new codec.ArrayOf(codec.Uint8), val.manufacturerData);
encoder.encodeStructPointer(ServiceDataMap, val.serviceData);
}; };
function ScanResult(values) { function ScanResult(values) {
this.initDefaults_(); this.initDefaults_();
@ -4192,6 +4256,7 @@
exports.CentralState = CentralState; exports.CentralState = CentralState;
exports.Appearance = Appearance; exports.Appearance = Appearance;
exports.Power = Power; exports.Power = Power;
exports.ServiceDataMap = ServiceDataMap;
exports.ScanRecord = ScanRecord; exports.ScanRecord = ScanRecord;
exports.ScanResult = ScanResult; exports.ScanResult = ScanResult;
exports.CharacteristicProperties = CharacteristicProperties; exports.CharacteristicProperties = CharacteristicProperties;

View file

@ -164,8 +164,12 @@ class FakeCentral {
scanResult.scanRecord.manufacturerData, Number); scanResult.scanRecord.manufacturerData, Number);
} }
// TODO(https://crbug.com/817603): Add a conversion process for serviceData // Convert serviceData from a record<DOMString, BufferSource> into a
// when the field is added in Mojo. // map<string, array<uint8>> for Mojo.
if ('serviceData' in scanResult.scanRecord) {
scanResult.scanRecord.serviceData.serviceData = convertToMojoMap(
scanResult.scanRecord.serviceData, BluetoothUUID.getService);
}
await this.fake_central_ptr_.simulateAdvertisementReceived( await this.fake_central_ptr_.simulateAdvertisementReceived(
new bluetooth.mojom.ScanResult(scanResult)); new bluetooth.mojom.ScanResult(scanResult));

View file

@ -42,13 +42,23 @@
window.onmessage = t.step_func(function(e) window.onmessage = t.step_func(function(e)
{ {
// testharness.js uses postMessage so we must check what data we want to receive // Messages from TARGET1 and TARGET2 can come in any order
if (e.data.toString() === "#1" || e.data.toString() === "#2") { // (since one of them is cross-origin and can run in parallel).
ActualResult.push(e.data, e.origin); // To make the tests immune to message reordering, always
if (ActualResult.length === ExpectedResult.length) { // put the response from TARGET1 at the start of the list.
assert_array_equals(ActualResult, ExpectedResult, "ActualResult"); if (e.data.toString() === "#1")
t.done(); {
} ActualResult = [e.data, e.origin].concat(ActualResult);
}
else if (e.data.toString() === "#2")
{
ActualResult = ActualResult.concat([e.data, e.origin]);
}
if (ActualResult.length >= ExpectedResult.length)
{
assert_array_equals(ActualResult, ExpectedResult, "ActualResult");
t.done();
} }
}); });
</script> </script>

View file

@ -42,7 +42,18 @@
window.onmessage = t.step_func(function(e) window.onmessage = t.step_func(function(e)
{ {
ActualResult.push(e.data, e.origin); // Messages from TARGET1 and TARGET2 can come in any order
// (since one of them is cross-origin and can run in parallel).
// To make the tests immune to message reordering, always
// put the response from TARGET1 at the start of the list.
if (e.data.toString() === "#1")
{
ActualResult = [e.data, e.origin].concat(ActualResult);
}
else if (e.data.toString() === "#2")
{
ActualResult = ActualResult.concat([e.data, e.origin]);
}
if (ActualResult.length >= ExpectedResult.length) if (ActualResult.length >= ExpectedResult.length)
{ {