Update web-platform-tests to revision d5be80a86d4f938250c075ac12414ad47516969c

This commit is contained in:
WPT Sync Bot 2018-11-08 21:03:14 -05:00
parent bb2c5e387f
commit 463b6d3b60
32 changed files with 454 additions and 43 deletions

View file

@ -0,0 +1,28 @@
<!doctype html>
<link rel="help" href="https://drafts.csswg.org/css2/visuren.html" />
<title>The computed value of float with absolute positioning when there is no box should be "none"</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
div[id] {
position: absolute;
float: left;
}
</style>
<div id="test1" style="display: none"></div>
<div id="test2" style="display: contents"></div>
<div style="display: none"><div id="test3"></div></div>
<script>
promise_test(
t => {
return new Promise(test => addEventListener('load', e=>test()))
.then(test => assert_equals(getComputedStyle(test1)['float'], "none", "[display:none] Invalid gCS(test1)['float'];"))
.then(test => assert_equals(getComputedStyle(test2)['float'], "none", "[display:contents] Invalid gCS(test2)['float'];"))
.then(test => assert_equals(getComputedStyle(test3)['float'], "none", "[in a display:none] Invalid gCS(test3)['float'];"))
}
);
</script>

View file

@ -49,6 +49,8 @@
// Allow tree-abiding pseudo elements after ::slotted
test_valid_selector("::slotted(*)::before");
test_valid_selector("::slotted(*)::after");
test_valid_selector("::slotted(*)::placeholder");
test_valid_selector("::slotted(*)::marker");
// Other pseudo elements not valid after ::slotted
test_invalid_selector("::slotted(*)::first-line");

View file

@ -0,0 +1,6 @@
<!doctype html>
<style>
::placeholder { color: green }
</style>
<input placeholder="I should be green">
<textarea placeholder="I should be green"></textarea>

View file

@ -0,0 +1,19 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Scoping Test: ::slotted() allows ::placeholder</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="author" title="Mozilla" href="https://mozilla.org">
<link rel="help" href="https://drafts.csswg.org/css-scoping/#slotted-pseudo">
<link rel="match" href="slotted-placeholder-ref.html">
<div id="host">
<input placeholder="I should be green">
<textarea placeholder="I should be green"></textarea>
</div>
<script>
host.attachShadow({ mode: "open" }).innerHTML = `
<style>
::slotted(*)::placeholder { color: green }
</style>
<slot></slot>
`;
</script>

View file

@ -16,8 +16,10 @@ test_valid_value("scale", "none");
test_valid_value("scale", "1");
test_valid_value("scale", "100 100", "100");
test_valid_value("scale", "100 200");
test_valid_value("scale", "100 200 1");
test_valid_value("scale", "100 200 300");
</script>
</body>

View file

@ -3,3 +3,4 @@ suggested_reviewers:
- svgeesus
- grorg
- dirkschulze
- chrishtr

View file

@ -36,6 +36,17 @@
const selectionEnd = 5;
const selectionDirection = "backward";
// Obtain selectionDirection after setting it to "none".
// Some platforms don't support "none" direction, and "forward" is returned
// in such platforms.
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#set-the-selection-direction
function testNoneDirection() {
const input = document.createElement("input");
input.selectionDirection = "none";
return input.selectionDirection;
}
const noneDirectionResult = testNoneDirection();
for (var i = 0; i < types.length; i++) {
for (var j = 0; j < types.length; j++) {
if (types[i] != types[j]) {
@ -92,7 +103,8 @@
} else {
assert_equals(input.selectionStart, 0, "selectionStart should be 0");
assert_equals(input.selectionEnd, 0, "selectionEnd should be 0");
assert_equals(input.selectionDirection, "none", "selectionDirection should be 'none'");
assert_equals(input.selectionDirection, noneDirectionResult,
`selectionDirection should be '{noneDirectionResult}'`);
}
}
}

View file

@ -7,3 +7,4 @@ suggested_reviewers:
- mnoorenberghe
- romandev
- edenchuang
- aestes

View file

@ -146,6 +146,10 @@ class MockRuntime {
} else {
this.displayInfo_ = this.getNonImmersiveDisplayInfo();
}
if (fakeDeviceInit.supportsEnvironmentIntegration) {
this.displayInfo_.capabilities.canProvideEnvironmentIntegration = true;
}
}
// Test methods.
@ -323,6 +327,12 @@ class MockRuntime {
});
}
getEnvironmentIntegrationProvider(environmentProviderRequest) {
let environmentProviderBinding = new mojo.AssociatedBinding(
device.mojom.XREnvironmentIntegrationProvider, this,
environmentProviderRequest);
}
updateSessionGeometry(frame_size, display_rotation) {
// This function must exist to ensure that calls to it do not crash, but we
// do not have any use for this data at present.
@ -352,21 +362,12 @@ class MockRuntime {
let dataProviderBinding = new mojo.Binding(
device.mojom.XRFrameDataProvider, this, dataProviderRequest);
let environmentProviderPtr =
new device.mojom.XREnvironmentIntegrationProviderPtr();
let environmentProviderRequest =
mojo.makeRequest(environmentProviderPtr);
let environmentProviderBinding = new mojo.Binding(
device.mojom.XREnvironmentIntegrationProvider, this,
environmentProviderRequest);
let clientRequest = mojo.makeRequest(this.sessionClient_);
return Promise.resolve({
session: {
submitFrameSink: submit_frame_sink,
dataProvider: dataProviderPtr,
environmentProvider: environmentProviderPtr,
clientRequest: clientRequest,
displayInfo: this.displayInfo_
}

View file

@ -1 +1 @@
requests==2.20.0
requests==2.20.1

View file

@ -1,3 +1,3 @@
mozprocess == 0.26
selenium==3.141.0
requests==2.20.0
requests==2.20.1

View file

@ -1976,7 +1976,7 @@ const scaleListType = {
1000);
testAnimationSamples(animation, idlName,
[{ time: 500, expected: '4 4' }]);
[{ time: 500, expected: '4' }]);
}, `${property} with one unspecified value`);
test(t => {
@ -2012,8 +2012,8 @@ const scaleListType = {
composite: 'add' });
testAnimationSamples(animation, idlName,
[{ time: 0, expected: '-6 -6' },
{ time: 1000, expected: '10 10' }]);
[{ time: 0, expected: '-6' },
{ time: 1000, expected: '10' }]);
}, `${property} with one unspecified value`);
test(t => {
@ -2052,8 +2052,8 @@ const scaleListType = {
composite: 'accumulate' });
testAnimationSamples(animation, idlName,
[{ time: 0, expected: '-2 -2' },
{ time: 1000, expected: '6 6' }]);
[{ time: 0, expected: '-2' },
{ time: 1000, expected: '6' }]);
}, `${property} with one unspecified value`);
test(t => {

View file

@ -0,0 +1,54 @@
/**
* @class RecorderProcessor
* @extends AudioWorkletProcessor
*
* A simple recorder AudioWorkletProcessor. Returns the recorded buffer to the
* node when recording is finished.
*/
class RecorderProcessor extends AudioWorkletProcessor {
/**
* @param {*} options
* @param {number} options.duration A duration to record in seconds.
* @param {number} options.channelCount A channel count to record.
*/
constructor(options) {
super();
this._createdAt = currentTime;
this._elapsed = 0;
this._recordDuration = options.duration || 1;
this._recordChannelCount = options.channelCount || 1;
this._recordBufferLength = sampleRate * this._recordDuration;
this._recordBuffer = [];
for (let i = 0; i < this._recordChannelCount; ++i) {
this._recordBuffer[i] = new Float32Array(this._recordBufferLength);
}
}
process(inputs, outputs) {
if (this._recordBufferLength <= currentFrame) {
this.port.postMessage({
type: 'recordfinished',
recordBuffer: this._recordBuffer
});
return false;
}
// Records the incoming data from |inputs| and also bypasses the data to
// |outputs|.
const input = inputs[0];
const output = outputs[0];
for (let channel = 0; channel < input.length; ++channel) {
const inputChannel = input[channel];
const outputChannel = output[channel];
outputChannel.set(inputChannel);
const buffer = this._recordBuffer[channel];
const capacity = buffer.length - currentFrame;
buffer.set(inputChannel.slice(0, capacity), currentFrame);
}
return true;
}
}
registerProcessor('recorder-processor', RecorderProcessor);

View file

@ -61,6 +61,13 @@
extraArgs: RENDER_QUANTUM_FRAMES / context.sampleRate,
outputTestFrame: 4 * RENDER_QUANTUM_FRAMES,
expectedOutputValue: 4
},
{
event: 'setValueAtTime',
frame: 5 * RENDER_QUANTUM_FRAMES - 1,
values: [99, 1, 5],
outputTestFrame: 5 * RENDER_QUANTUM_FRAMES,
expectedOutputValue: 5
}
];

View file

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html>
<head>
<title>
Test if MediaElementAudioSourceNode works for cross-origin redirects with
"cors" request mode.
</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/webaudio/resources/audit.js"></script>
<script src="/common/get-host-info.sub.js"></script>
</head>
<body>
<script id="layout-test-code">
const audit = Audit.createTaskRunner();
const context = new AudioContext();
context.suspend();
const host_info = get_host_info();
const audioElement = document.createElement('audio');
audioElement.loop = true;
audioElement.crossOrigin = 'anonymous';
const wav =
host_info.HTTPS_ORIGIN + '/webaudio/resources/4ch-440.wav?' +
'pipe=header(access-control-allow-origin,*)';
audioElement.src =
host_info.HTTPS_REMOTE_ORIGIN +
'/fetch/api/resources/redirect.py?location=' +
encodeURIComponent(wav);
let source;
let workletRecorder;
audit.define(
{label: 'setting-up-graph'},
(task, should) => {
source = new MediaElementAudioSourceNode(context, {
mediaElement: audioElement
});
workletRecorder = new AudioWorkletNode(
context, 'recorder-processor', {channelCount: 4});
source.connect(workletRecorder).connect(context.destination);
task.done();
});
// The recorded data from MESN must be non-zero. The source file contains
// 4 channels of sine wave.
audit.define(
{label: 'start-playback-and-capture'},
(task, should) => {
workletRecorder.port.onmessage = (event) => {
if (event.data.type === 'recordfinished') {
for (let i = 0; i < event.data.recordBuffer.length; ++i) {
const channelData = event.data.recordBuffer[i];
should(channelData, `Recorded channel #${i}`)
.notBeConstantValueOf(0);
}
}
task.done();
};
context.resume();
audioElement.play();
});
Promise.all([
context.audioWorklet.addModule('/webaudio/js/worklet-recorder.js')
]).then(() => {
audit.run();
});
</script>
</body>
</html>

View file

@ -0,0 +1,73 @@
<!DOCTYPE html>
<html>
<head>
<title>
Test if MediaElementAudioSourceNode works for cross-origin redirects with
"no-cors" request mode.
</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/webaudio/resources/audit.js"></script>
<script src="/common/get-host-info.sub.js"></script>
</head>
<body>
<script id="layout-test-code">
const audit = Audit.createTaskRunner();
const context = new AudioContext();
context.suspend();
const host_info = get_host_info();
const audioElement = document.createElement('audio');
audioElement.loop = true;
const wav =
host_info.HTTPS_ORIGIN + '/webaudio/resources/4ch-440.wav?' +
'pipe=header(access-control-allow-origin,*)';
audioElement.src =
host_info.HTTPS_REMOTE_ORIGIN +
'/fetch/api/resources/redirect.py?location=' +
encodeURIComponent(wav);
let source;
let workletRecorder;
audit.define(
{label: 'setting-up-graph'},
(task, should) => {
source = new MediaElementAudioSourceNode(context, {
mediaElement: audioElement
});
workletRecorder = new AudioWorkletNode(
context, 'recorder-processor', {channelCount: 4});
source.connect(workletRecorder).connect(context.destination);
task.done();
});
// The recorded data from MESN must be non-zero. The source file contains
// 4 channels of sine wave.
audit.define(
{label: 'start-playback-and-capture'},
(task, should) => {
workletRecorder.port.onmessage = (event) => {
if (event.data.type === 'recordfinished') {
for (let i = 0; i < event.data.recordBuffer.length; ++i) {
const channelData = event.data.recordBuffer[i];
should(channelData, `Recorded channel #${i}`)
.beConstantValueOf(0);
}
}
task.done();
};
context.resume();
audioElement.play();
});
Promise.all([
context.audioWorklet.addModule('/webaudio/js/worklet-recorder.js')
]).then(() => {
audit.run();
});
</script>
</body>
</html>

View file

@ -57,10 +57,17 @@ def test_element_not_interactable_css_transform(session, transform):
def test_element_not_interactable_out_of_view(session):
session.url = inline("""
<div style="width: 500px; height: 100px;
position: absolute; left: 0px; top: -150px; background-color: blue;">
</div>""")
element = session.find.css("div", all=False)
<style>
input {
position: absolute;
margin-top: -100vh;
background: red;
}
</style>
<input>
""")
element = session.find.css("input", all=False)
response = element_click(session, element)
assert_error(response, "element not interactable")
@ -76,9 +83,20 @@ def test_zero_sized_element(session, tag_name):
def test_element_intercepted(session):
session.url = inline("""
<input type=button value=Roger style="position: absolute; left: 10px; top: 10px">
<div style="position: absolute; height: 100px; width: 100px; background: rgba(255,0,0,.5); left: 10px; top: 5px"></div>""")
<style>
div {
position: absolute;
height: 100vh;
width: 100vh;
background: blue;
top: 0;
left: 0;
}
</style>
<input type=button value=Roger>
<div></div>
""")
element = session.find.css("input", all=False)
response = element_click(session, element)
assert_error(response, "element click intercepted")
@ -86,7 +104,6 @@ def test_element_intercepted(session):
def test_element_intercepted_no_pointer_events(session):
session.url = inline("""<input type=button value=Roger style="pointer-events: none">""")
element = session.find.css("input", all=False)
response = element_click(session, element)
assert_error(response, "element click intercepted")
@ -94,11 +111,21 @@ def test_element_intercepted_no_pointer_events(session):
def test_element_not_visible_overflow_hidden(session):
session.url = inline("""
<div style="position: absolute; height: 50px; width: 100px; background: rgba(255,0,0,.5); left: 10px; top: 50px; overflow: hidden">
ABCDEFGHIJKLMNOPQRSTUVWXYZ
<input type=text value=Federer style="position: absolute; top: 50px; left: 10px;">
</div>""")
<style>
div {
overflow: hidden;
height: 50px;
background: green;
}
input {
margin-top: 100px;
background: red;
}
</style>
<div><input></div>
""")
element = session.find.css("input", all=False)
response = element_click(session, element)
assert_error(response, "element not interactable")